Accept/Reject Chargeback API

The Accept/Reject Chargeback API allows the merchant user to accept the chargeback by providing the appropriate reasons in the request body against the chargeback and merchant ID. The API supports file uploads through base64 encoding directly in the JSON payload.

HTTP Method: PATCH

Request parameters

Request header

ParameterDescription
X-Optimus-API-KeyMerchant authentication key
Content-TypeMust be set to application/json

This must contain the header with token you get using the Get Token API in the following format:

\--header 'X-Optimus-API-Key: <Bearer token>'

Request body

Parameter

Description

chargeback_id mandatory

String The ID of the chargeback to respond to

merchant_key mandatory

StringKey of merchant

dispute_type mandatory

StringTypes of response: accept, partially_accept, contest. For the dispute_type as partially_accept or contest, refer to the notes in the File upload fields table

reason_code mandatory

Array An array of reason codes with form data. For more information, refer to Reason code structure.

Reason code structure

The parameter must be an array of objects with the following structure:

[
  {
    "uuid": "reason-uuid",
    "form_data": [
      {
        "identifier": "form-field-uuid",
        "value": "field-value"
      }
      // Additional form fields...
    ]
  }
  // Additional reasons if applicable...
]

File upload fields

For file upload fields (identified by tag_type: "file_tag" in the system):

{
  "identifier": "file-field-uuid",
  "value": "BASE64_ENCODED_FILE_CONTENT",
  "filename": "evidence.pdf",
  "content_type": "application/pdf"
}

Field

Description

identifier mandatory

UUID of the file field

value mandatory

Base64 encoded file content.

filename mandatory

Original filename with extension. Notes:

  • The file size limit is 5MB per file.
  • File uploads are processed as base64 encoded strings directly in the JSON payload. Do not use multipart/form-data.
  • When using partially_accept as the dispute type, you must include a form field with the value (amount) that is less than the total chargeback amount and greater than 0.
  • Each form field has a specific UUID that must be used correctly for the system to process your response.
  • Do not upload file for when using accept as the dispute type.

content_type
mandatory

MIME type of the file

Sample request

Accept a Chargeback

curl --location --request PATCH 'https://bankportal.payu.in/api/v1/chargebacks/dispute' \
--header 'X-Optimus-API-Key: MERCHANT KEY' \
--header 'Content-Type: application/json' \
--data-raw '{
  "reason_code": [
    {
      "uuid": "bb10e1bb-f128-4ace-ab0f-59881f11fa4d",
      "form_data": [
        {
          "identifier": "bb10e1bb-f128-4ace-ab0f-59881f11fa4d",
          "value": "We accept this chargeback due to service issue."
        }
      ]
    }
  ],
  "chargeback_id": "1128897",
  "merchant_key": "2WEDS",
  "dispute_type": "accept"
}'

Contest a Chargeback with file evidence

curl --location --request PATCH 'https://bankportal.payu.in/api/v1/chargebacks/dispute' \
--header 'X-Optimus-API-Key: MERCHANT KEY' \
--header 'Content-Type: application/json' \
--data-raw '{
  "reason_code": [
    {
      "uuid": "cc20e2cc-f238-5bdf-ab0f-59881f11fa4e",
      "form_data": [
        {
          "identifier": "cc20e2cc-f238-5bdf-ab0f-59881f11fa4e",
          "value": "We are contesting this chargeback. Please see attached proof of delivery."
        },
        {
          "identifier": "200edfd3-84b6-4311-8486-23887f167772",
          "value": "BASE64_ENCODED_FILE_CONTENT_HERE",
          "filename": "delivery_proof.pdf",
          "content_type": "application/pdf"
        }
      ]
    }
  ],
  "chargeback_id": "1128897",
  "merchant_key": "2WEDS",
  "dispute_type": "contest"
}'

Partially accept a Chargeback

curl --location --request PATCH 'https://bankportal.payu.in/api/v1/chargebacks/dispute' \
--header 'X-Optimus-API-Key: MERCHANT KEY' \
--header 'Content-Type: application/json' \
--data-raw '{
  "reason_code": [
    {
      "uuid": "dd30e3dd-f348-6ceg-ab0f-59881f11fa4f",
      "form_data": [
        {
          "identifier": "6f92dad0-4446-4465-bfea-17f587e973d4",
          "value": "500.00"
        },
        {
          "identifier": "dd30e3dd-f348-6ceg-ab0f-59881f11fa4f-comments",
          "value": "We can partially refund as customer was charged for premium service but received standard service."
        }
      ]
    }
  ],
  "chargeback_id": "1128897",
  "merchant_key": "2WEDS",
  "dispute_type": "partially_accept"
}'

Response parameters

ParameterDescription
idThis parameter contains the chargeback ID.
typeThe parameter contains the chargeback-details as type.
attributesThis parameter contains the chargeback details in a JSON format. For more information, refer to attributes JSON field descriptions.

attributes JSON field descriptions

FieldDescriptionExample
idThis field contains the chargeback ID.1035881
payu-idThe field contains the PayU ID of the merchant.15420278029
statusThis field contains the status of the chargeback.Pending Doc Review

Sample response

Success scenario

{
    "data": {
        "id": "1035881",
        "type": "chargeback-details",
        "attributes": {
            "id": 1035881,
            "payu-id": "15420278029",
            "status": "Pending Doc Review"
        }
    }
}