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
Parameter | Description |
---|---|
X-Optimus-API-Key | Merchant authentication key |
Content-Type | Must 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
|
|
merchant_key
|
|
dispute_type
|
|
reason_code
|
|
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
| UUID of the file field |
value
| Base64 encoded file content. |
filename
| Original filename with extension. Notes:
|
content_type | 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
Parameter | Description |
---|---|
id | This parameter contains the chargeback ID. |
type | The parameter contains the chargeback-details as type. |
attributes | This parameter contains the chargeback details in a JSON format. For more information, refer to attributes JSON field descriptions. |
attributes JSON field descriptions
Field | Description | Example |
---|---|---|
id | This field contains the chargeback ID. | 1035881 |
payu-id | The field contains the PayU ID of the merchant. | 15420278029 |
status | This 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"
}
}
}