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)

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.

{
  data: {
    amountCents: Number,
    cardNetwork: String,
    cardholderName: String,
    currency: String,
    disputeDate: String,
    dueDate: String,
    id: String,
    maskedCardNumber: String,
    merchantIdentifier: String,
    reasonCode: String,
    reasonDescription: String,
    referenceNumber: String,
    status: "pending",
    transactionDate: String
  }
}
FieldTypeDescription
id String (uuid) Identifier for the agent session
status String (enum) pending until a document is attached

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.

Request

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

Response

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

Each signed putUrl is valid for five minutes.

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.

Request

GET /chargeback/:id
Authorization: sk_findustryai_kkkkkkkkkkkk_nnnn

Response

{
  data: {
    confidence: Number,
    defenseRequirements: [{ requirement: String, satisfied: Boolean }],
    evidenceProvided: [String],
    evidenceSuggested: [String],
    id: String,
    merchantAttachments: [String],
    merchantIdentifier: String,
    priority: String,
    recommendation: String,
    recommendedActions: [String],
    referenceNumber: String,
    status: String
  }
}
FieldTypeDescription
confidence Number Confidence in the recommendation, from 0 (low) to 1 (high)
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
evidenceProvided Array of Strings Each string describes evidence found in the attached documents
evidenceSuggested Array of Strings Each string describes additional evidence that would strengthen the defense. Attach matching documents and check the recommendation again
id String (uuid) Identifier for the agent session
merchantAttachments Array of Strings Each string describes the attachment (e.g., “Order timeline showing payment processing and fulfillment events”)
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. Poll the same path with GET until the letter is ready, or register a web hook.

Request

POST /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

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 uploadFilenames of the documents that will be uploaded. These filenames do not need to be unique. The response will provide a signed putUrl per file where the file contents are sent in the next step.

Request

POST /chargeback/upload
Authorization: sk_findustryai_kkkkkkkkkkkk_nnnn
{
  data: {
    uploadFilenames: [String]
  }
}
FieldTypeRequiredDescription
uploadFilenames Array of Strings (filenames) Yes File names to be uploaded (e.g., ["file.pdf"])

Response

{
  data: {
    id: String,
    putUrls: [
      {
        putUrl: String,
        uploadFilename: String
      }
    ]
  }
}
FieldTypeDescription
id String (uuid) Identifier for the agent session
putUrls Array of Objects Each object pairs an uploadFilename with the signed putUrl endpoint for its document PUT operation. Connection to this endpoint is valid for five minutes

Document Upload

After initializing the agent, send each 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.