Contact Us

Chargeback Agent API

The Chargeback Agent API accepts dispute documents and returns a recommendation, recommended actions, and a formal response letter. Requests authenticate with a secret key.

Agent Lifecycle

The chargeback agent workflow consists of four main steps:

  1. Initialize agent with a chargeback case (POST)
  2. Attach documents to the case (POST, PUT)
  3. Agent recommendation (GET)
  4. Generate response letter (POST)
  5. Read response letter (GET)

Attaching documents and reviewing the recommendation is iterative: each recommendation reports its confidence and suggests further evidence to attach until the case is ready.

Once the recommendation is ready, downloading the PDF is a two-step process:

  1. Request download (GET)
  2. Download document (GET)

Initialize Agent with Chargeback Case

Initialize an agent session by posting the chargeback case details. The response provides the case id used by every subsequent call.

Request

POST /chargeback
Authorization: sk_findustryai_kkkkkkkkkkkk_nnnn
{
  data: {
    amountCents: Number,
    cardNetwork: String,
    cardholderName: String,
    currency: String,
    disputeDate: String,
    dueDate: String,
    maskedCardNumber: String,
    merchantIdentifier: String,
    reasonCode: String,
    reasonDescription: String,
    referenceNumber: String,
    transactionDate: String
  }
}
FieldTypeRequiredDescription
amountCents Number (integer) No Disputed amount in minor units (e.g., cents)
cardNetwork String No Card network for the disputed transaction (e.g., "visa")
cardholderName String No Name of the cardholder raising the dispute
currency String (ISO 4217) No Defaults to "USD"
disputeDate Date (ISO 8601) No Date the dispute was raised
dueDate Date (ISO 8601) No Deadline for the merchant response
maskedCardNumber String No Masked card number (e.g., "424242******4242")
merchantIdentifier String Yes Identifier of the merchant defending the case
reasonCode String No Card network reason code (e.g., "10.4")
reasonDescription String No Card network description of the reason code (e.g., "Other Fraud - Card-Absent Environment")
referenceNumber String Yes Dispute reference number from the processor or card network
transactionDate Date (ISO 8601) No Date of the disputed transaction

Response

The response returns the case with its id and status alongside the submitted details, plus the defenseRequirements the reason code calls for — available immediately, before any document is attached. evidenceSuggested and evidenceProvided are category-level projections of that checklist: a category counts provided as soon as one of its requirements is satisfied, and the rest stay suggested — the item-level detail lives in defenseRequirements and recommendedActions.

{
  data: {
    amountCents: Number,
    cardNetwork: String,
    cardholderName: String,
    currency: String,
    defenseRequirements: [{ requirement: String, satisfied: Boolean }],
    disputeDate: String,
    dueDate: String,
    evidenceProvided: [String],
    evidenceSuggested: [String],
    id: String,
    maskedCardNumber: String,
    merchantIdentifier: String,
    reasonCode: String,
    reasonDescription: String,
    referenceNumber: String,
    status: "pending",
    transactionDate: String
  }
}
FieldTypeDescription
defenseRequirements Array of Objects What the reason code requires the defense to show. Every item is satisfied: false until the agent assesses attached documents. Empty when the case has no reasonCode or the code is not recognized
evidenceProvided Array of Strings Evidence categories with at least one satisfied requirement — empty at initialization until evidence is assessed (or fetched by the agent up front)
evidenceSuggested Array of Strings Evidence categories still to collect, in presentation order — at initialization, every category the reason code calls for; with no recognized reason code, the full evidence category vocabulary
id String (uuid) Identifier for the agent session
status String (enum) pending until a document is attached

Evidence Categories

evidenceProvided and evidenceSuggested draw from a closed vocabulary. Every value is one of the strings below, lower-cased so it reads inside a sentence — "attach the delivery confirmation." Capitalize the first letter when presenting a value as a heading or list item. Both arrays are returned in presentation order, the order shown here, and a category appears in exactly one of them.

ValueWhat it asks for
refund receipt Refund and credit records, such as proof a credit was already issued
delivery confirmation Proof the order reached the cardholder, such as signed delivery confirmation or courier tracking
cardholder communication Correspondence with the cardholder, such as email conversations or post-payment agreements
transaction authorization The payment platform's record of the transaction and its authorization, such as the sales slip, AVS and CVV results, or device fingerprints
order confirmation Records of the order as placed, such as the confirmation email sent to the cardholder
proof of digital goods usage Proof digital content was delivered, such as purchase and download timestamps or access logs
proof of services provided Proof services were provided and used, such as an invoice or a service confirmation
proof of cardholder non-contact / non-return Proof the cardholder neither contacted the merchant nor returned the merchandise
refund and return policies The merchant's published policies and their acceptance, such as a checkout acceptance screenshot
recurring billing records Subscription billing and cancellation records, such as the billing notice sent to the cardholder
cardholder transaction history The cardholder's prior undisputed transactions with the merchant
evidence of product quality Evidence the goods were as described, such as condition photographs or a certificate of authenticity

Update Case Details

Update a case by posting the fields to change. Only fields present in data are updated; omitted fields are unchanged. Accepts the same fields as initialize.

Request

POST /chargeback/:id
Authorization: sk_findustryai_kkkkkkkkkkkk_nnnn
{
  data: {
    dueDate: String
  }
}

Response

The response returns the updated case, in the same shape as initialize.

Delete Case

Delete a case and its attached documents. Deleted cases and their documents cannot be retrieved.

Request

DELETE /chargeback/:id
Authorization: sk_findustryai_kkkkkkkkkkkk_nnnn

Response

{
  data: {
    id: String,
    status: "deleted"
  }
}

Attach Documents to Case

Attach documents by posting their uploadFilenames, then sending each file's contents to its returned signed putUrl, exactly as in document upload. Each attached document is assessed in the next recommendation.

Documents are attached to cases initialized with POST /chargeback. A session initialized with direct upload takes its documents at initialization and answers this endpoint with a 400.

Request

POST /chargeback/:id/upload
Authorization: sk_findustryai_kkkkkkkkkkkk_nnnn
{
  data: {
    uploadFilenames: [String]
  }
}

Response

{
  data: {
    id: String,
    putUrls: [
      {
        evidenceId: String,
        putUrl: String,
        uploadFilename: String
      }
    ]
  }
}

Each signed putUrl is valid for fifteen minutes. Each evidenceId identifies the attached document and is the identifier used to delete evidence.

Delete Evidence from Case

Delete a single attached document by its evidenceId. The case and its remaining documents are unchanged. Deleted documents cannot be retrieved.

Removing evidence triggers a fresh assessment automatically, about thirty seconds after the last deletion so a burst of deletions is assessed once. The recommendation shows status: "processing" while the agent reassesses and completes with the remaining evidence. Any response letter already written is retired at the same time, since it argued from the deleted document: GET /chargeback/:id/letter answers 404 until the response letter is requested again, which rewrites it from the remaining evidence.

Request

DELETE /chargeback/:id/evidence/:evidenceId
Authorization: sk_findustryai_kkkkkkkkkkkk_nnnn
ParameterTypeDescription
id String (uuid) Identifier for the agent session
evidenceId String (uuid) Identifier for the attached document, returned when the document is attached

Response

{
  data: {
    id: String,
    status: "deleted"
  }
}
FieldTypeDescription
id String (uuid) Identifier for the deleted evidence
status String (enum) String value deleted

Agent Recommendation

Once each document is uploaded the agent assesses the material presented to provide a recommendation and recommended actions. The API response shows status: "processing" while the Agent is working. This process takes several minutes.

The submitted case fields are returned at every status, so the case is readable at any time. While the agent works the response carries the case fields with the current status; once complete the recommendation fields join them.

Request

GET /chargeback/:id
Authorization: sk_findustryai_kkkkkkkkkkkk_nnnn

Response

Processing

{
  data: {
    amountCents: Number,
    cardNetwork: String,
    currency: String,
    // ...the case fields as submitted...
    defenseRequirements: [{ requirement: String, satisfied: Boolean }],
    evidenceProvided: [String],
    evidenceSuggested: [String],
    id: String,
    status: "processing"
  }
}

Complete

{
  data: {
    amountCents: Number,
    cardNetwork: String,
    currency: String,
    // ...the case fields as submitted...
    confidence: Number,
    defenseRequirements: [{ requirement: String, satisfied: Boolean }],
    evidenceProvided: [String],
    evidenceSuggested: [String],
    id: String,
    merchantAttachments: [{ evidenceId: String, uploadFilename: String }],
    merchantIdentifier: String,
    priority: String,
    recommendation: String,
    recommendedActions: [String],
    referenceNumber: String,
    status: String
  }
}
FieldTypeDescription
confidence Number Confidence in the recommendation, 0 to 100
defenseRequirements Array of Objects Each object contains two keys. The requirement key describes the defense requirement and the satisfied boolean indicates if it is satisfied by the attached documents. Served from initialization with every item unsatisfied; the assessment flips the flags, so the requirement set is stable over the life of the case. Evidence the agent found that matches no known requirement is appended
evidenceProvided Array of Strings Evidence categories the assessment found satisfied — a category counts provided once any of its defenseRequirements is satisfied
evidenceSuggested Array of Strings Evidence categories still unsatisfied — additional evidence that would strengthen the defense. Attach matching documents and check the recommendation again; the item-level ask is in defenseRequirements and recommendedActions
id String (uuid) Identifier for the agent session
merchantAttachments Array of Objects The case’s current documents. Each object carries the evidenceId (usable to delete the evidence) and its uploadFilename. Reflects deletions
merchantIdentifier String
priority String (enum) normal, high
recommendation String respond, hold
recommendedActions Array of Strings Each string describes a recommended action that may improve the merchant defense
referenceNumber String
status String (enum) pending, queued, processing, complete, error

If processing fails the response carries an error message instead of a recommendation.

{
  data: {
    id: String,
    message: String,
    status: "error"
  }
}

Generate Response Letter

Once the recommendation is satisfactory, request a formal response letter. The API response shows status: "processing" while the agent is working. This process takes several minutes. Read the letter until it is ready, or register a web hook.

A letter is written only when it is requested. Requesting it again rewrites it from the case as it then stands, so a case whose evidence has changed produces a new letter rather than the earlier one. While the new letter generates the response shows status: "processing" and the earlier letter is no longer returned.

Request

POST /chargeback/:id/letter
Authorization: sk_findustryai_kkkkkkkkkkkk_nnnn

Response

{
  data: {
    id: String,
    status: "processing"
  }
}

Read Response Letter

Poll the requested letter until it is ready. A letter that has never been requested, or one retired by deleting evidence, answers 404.

Request

GET /chargeback/:id/letter
Authorization: sk_findustryai_kkkkkkkkkkkk_nnnn

Response

Processing

{
  data: {
    id: String,
    status: "processing"
  }
}

Complete

{
  data: {
    id: String,
    responseLetter: String,
    status: "complete"
  }
}
FieldTypeDescription
id String (uuid) Identifier for the agent session
responseLetter String (markdown) Complete rebuttal letter in markdown, intended for acquirer and card networks

Not requested

HTTP 404
{
  errors: [
    {
      status: 404,
      title: String,
      detail: String
    }
  ]
}

Initialize Agent with Direct Upload

Direct upload allows already-generated files with chargeback details to be parsed as input. Chargeback Agent must be configured to recognize upload formats before use. Contact support@findustryai.com for assistance.

Details

Initialize an agent session by posting the uploadFilename of the document that will be uploaded. Filenames do not need to be unique across sessions. The response will provide the signed putUrl where the file contents are sent in the next step.

A direct-upload session carries one document. To have several documents assessed together, initialize a case with POST /chargeback and attach each document to it.

Request

POST /chargeback/upload
Authorization: sk_findustryai_kkkkkkkkkkkk_nnnn
{
  data: {
    uploadFilename: String
  }
}
FieldTypeRequiredDescription
uploadFilename String (filename) Yes Name of the file to be uploaded (e.g., "file.pdf"). A filename, never a path

Response

{
  data: {
    id: String,
    putUrls: [
      {
        evidenceId: String,
        putUrl: String,
        uploadFilename: String
      }
    ]
  }
}
FieldTypeDescription
id String (uuid) Identifier for the agent session
putUrls Array of one Object The entry pairs the uploadFilename with the signed putUrl endpoint for its document PUT operation. Connection to this endpoint is valid for five minutes. The evidenceId identifies the attached document for deletion

Document Upload

After initializing the agent, send the file's contents to its putUrl. This is a signed URL valid for five minutes.

PUT ${putUrl}
Content-Type: ${contentType}

Example using curl:

curl -X PUT -T file.pdf
"https://bucket.s3.amazonaws.com/file.pdf?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Expires=300&X-Amz-Signature=..."

Document Export

Document export assembles case files to custom formats (e.g., PDF, XLSX). Chargeback Agent must be configured with export formats before use. Contact support@findustryai.com for assistance.

Details

The agent produces a custom export based on a specified format. The API response shows status: "processing" while the agent is working. This process takes several minutes. Once the download is ready it will return a getUrl.

Request

GET /chargeback/:id/download
Authorization: sk_findustryai_kkkkkkkkkkkk_nnnn

Multiple Formats

If multiple formats are configured, the format query parameter specifies the format. If not specified, the default format will be returned.

Response

Processing

{
  data: {
    id: String,
    status: "processing"
  }
}

Complete

{
  data: {
    id: String,
    getUrl: String
  }
}
FieldTypeDescription
id String (uuid) Identifier for the agent session
getUrl String (url) Signed URL for the document

Document Download

The download request will return a getUrl. This is a signed URL valid for five minutes.

Example downloading using curl:

curl -L -o file.pdf
"https://bucket.s3.amazonaws.com/file.pdf?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Expires=300&X-Amz-Signature=..."

Web Hooks

Web hooks may be registered as an alternative to polling the agent status. The event body will contain the same data attribute as the HTTP response, along with metadata and security headers for authentication.

Event Metadata

Along with the data attribute, the event body will contain a metadata attribute describing the web hook event.

{
  metadata: {
    attempt: Number,
    event: "chargeback:copilot",
    id: String,
    timestamp: Number,
    type: "webhook",
    webhook: String
  },
  data: {
    // …
  }
}
FieldTypeDescription
attempt Number (integer) Numeric counter of web hook delivery attempts beginning at 1
event String String value chargeback:copilot
id String (uuid) Identifier for the web hook event. Does not change between retry attempts. Recommended as an idempotence token to prevent duplicate processing
timestamp Number (milliseconds) Timestamp for the web hook event attempt. Changes with each attempt
type String String value webhook
webhook String (uuid) Identifier of the web hook endpoint receiving this delivery

Acknowledgement

Web hooks interpret the HTTP response code as acknowledgement of receipt.

CodeResultDescription
2XX Success Mark delivered
401 Unauthorized Web hook failed authentication
429 Too many requests Delay next attempt. Retry with backoff
5XX Server error Retry with backoff. Unreachable hosts are treated as 504 Gateway Timeout
* Unknown error Client error, do not retry

Undeliverable Messages

Undeliverable messages will be reattempted for up to one hour. Messages that fail to deliver after one hour will be recorded for remediation. Findustry AI will reach out to discuss improving delivery rates.

Authentication

Web hook deliveries are signed with an HMAC signature in the X-Webhook-Signature header. See Web Hooks authentication.