# Refund Payments
A sale is a completed payment. A captured payment is an authorized and captured payment. You can refund both sales and captured payments.
There are two types of refunds you might need to process:
Full refund A full refund returns the total amount of the transaction to the customer — it can only be performed once.
Partial refund A partial refund returns a sum less than the captured amount. A payment can be refunded multiple times, but cannot exceed the original payment amount.
TIP
- Refunds can be made in via the Dashboard or by using this API endpoint . Once processed, it is not possible to cancel a refund.
- Any refunds for less than the original captured amount will be considered partial refunds.
Live
Sandbox
POST: https://api.openacquiring.com/v1/merchants/YOUR_MERCHANT_ID/payment/REFERENCE_ID/refund
Request example
- Shell
- JavaScript
curl -X POST \
https://api.openacquiring.com/v1/merchants/w3z8dfhkzvfq0j9n/payment/W94Q5D31NWIRD90XYUI8/refund \
-H 'authorization: Basic ODZidWQ0Y2JremlxOXZmYzoweHI1ZDkwOHo2bmo4a2h6' \
-H 'content-type: application/json' \
-d '{
"amount": "110.00",
"invoice_number":"123456",
"custom":{
"field1":"this is a test"
}
}
Response example
{
"id": "8KRW59F4IK2JHFD1NVJZ",
"reference_id": "QNKJR6FYJ8U05FUX54D1",
"state": "refunded",
"result": {
"code": "0000"
},
"transaction": {
"amount": {
"currency": "USD",
"total": "100"
},
"mode": "1",
"invoice_number": "12345"
},
"custom": {
"field8": "::1",
"field9": "Test Refund",
"field10": "2"
},
"create_time": "2020-07-28T17:21:48Z",
"chargeback": "N"
}
# Request
# Header parameters
The request require a Basic authentication in the header. For more information about HTTP request headers, see HTTP request headers.
# Request parameters
| Parameter | Type | Description |
|---|---|---|
| merchant_id required | string | Encrypted Merchant account identifier for the Merchant |
| reference_id required | string | Id of the initial transaction, usually this correspond to the authorisation ID. |
# Request body
| Parameter | Type | Description |
|---|---|---|
| invoice_number | string | The invoice number to track this payment |
| custom | object | Free-form field for the use of clients |
| amount | string | The refund amount. (Should not exceed the captured amount) - Seven digits before the decimal point. - The decimal point. - Two digits after the decimal point. If not specified, the amount captured is refunded in full. If specified, the amount should be less or equal the originally captured amount. The currency used for this refund, is the same as the one used for authorization |
# Response
status 200
status 400
status 422
{
"id": "8KRW59F4IK2JHFD1NVJZ",
"reference_id": "QNKJR6FYJ8U05FUX54D1",
"state": "refunded",
"result": {
"code": "0000"
},
"transaction": {
"amount": {
"currency": "USD",
"total": "100"
},
"mode": "1",
"invoice_number": "12345"
},
"custom": {
"field8": "::1",
"field9": "Test Refund",
"field10": "2"
},
"create_time": "2020-07-28T17:21:48Z",
"chargeback": "N"
}
# Response Body
# Status 200 Success
| Parameter | Type | Description | Value |
|---|---|---|---|
| id | string | Identifier of the payment resource created | |
| reference_id | string | In case of referenced payment (e.g., Capture or Refund), this fields included to see which payment was referenced | |
| state | string | The state of the payment, authorization, or order transaction | - Authorised. The transaction was successfully authorised.- Pending. The transaction is currently pending.- Captured. The transaction has been captured.- Refunded. The transaction has been refunded.- Declined. The transaction has been declined.- Expired. The transaction has been expired.- Cancelled. The transaction has been cancelled.- Voided. The transaction has been voided.- Timeout. The transaction has been timeout.- Deferred Refund. The transaction refund has been deferred.- Flagged. The transaction has been flagged.- Deferred Capture. The transaction Capture has been deferred.- Card Verified. The card has been verified. |
| result | object | Contain result of the payment request | |
| transaction | object | Transactional details including the amount and item details | |
| custom | object | Free-form field for the use of clients | |
| create_time | datetime | Payment creation time as defined in RFC 3339 Section 5.6 | |
| chargeback | char | Indicate if the voided transaction has any chargeback associated. | - N - No chargeback associated -Y - Has chargeback associated |
# Error Response Body
# Status 400 Bad Request
| Parameter | Type | Description |
|---|---|---|
| code | string | Code indentifying the error on our system |
| name | string | Name indentifying the error on our system |
| message | string | Message related to the error |
| eventId | string | Unique Identifier for the request |
# Status 422 Unprocessable Entity
The request was well-formed but was unable to be follewed due to semantic errors.
| Parameter | Type | Description |
|---|---|---|
| eventId | string | Unique Identifier for the request |
| errors | arrayOf(error) | Array of errors |
# errors object
| Parameter | Type | Description |
|---|---|---|
| code | string | Code indentifying the error on our system |
| name | string | Name indentifying the error on our system |
| message | string | Message related to the error |