# Void Authorization
For credit cards and some alternative payment methods, the payment is completed in two steps:
- Authorization – The payment details of the shopper are verified, and the funds are reserved.
- Capture – The reserved funds are transferred from the shopper to your account.
When the payment has been authorised but not yet captured, you can cancel the authorisation hold on the payment.
You can utilize the authorization ID to void or cancel an authorization. It's important to note that you cannot void a fully captured authorization.
TIP
Cancelling a payment can either be done in the Merchant Dashboard or using the folloing API request.
POST: https://api.openacquiring.com/v1/merchants/YOUR_MERCHANT_ID/payment/REFERENCE_ID/void
Request example
- Shell
- JavaScript
curl -X POST \
https://api.openacquiring.com/v1/merchants/w3z8dfhkzvfq0j9n/payment/W94Q5D31NWIRD90XYUI8/void \
-H 'authorization: Basic ODZidWQ0Y2JremlxOXZmYzoweHI1ZDkwOHo2bmo4a2h6' \
-H 'content-type: application/json' \
-d '{
"invoice_number":"123456",
"custom":{
"field1":"field1"
}
}'
Response example
{
"id": "95QU067XJ5N3VBH1D82C",
"reference_id": "U1Y04VFRJ2V0W7XKJ6D8",
"state": "voided",
"result": {
"code": "0000"
},
"transaction": {
"amount": {
"currency": "USD",
"total": "300"
},
"mode": "1",
"items": [
{
"sku": "100299S",
"name": "Ultrawatch",
"description": "Smart watch",
"quantity": "1",
"price": "500.0000",
"shipping": "",
"url": "",
"tangible": false
},
{
"sku": "100269S",
"name": "Drone",
"description": "drone x",
"quantity": "1",
"price": "500.0000",
"shipping": "",
"url": "",
"tangible": false
}
],
"invoice_number": "12345"
},
"custom": {
"field8": "::1",
"field9": "Test Capture",
"field10": "2"
},
"create_time": "2020-07-28T18:15:00Z"
}
# 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
TIP
Amount is not specified as a void will always void the full amount authorized
| Parameter | Type | Description |
|---|---|---|
| invoice_number | string | The invoice number to track this payment |
| custom | object | Free-form field for the use of clients |
# Response
{
"id": "95QU067XJ5N3VBH1D82C",
"reference_id": "U1Y04VFRJ2V0W7XKJ6D8",
"state": "voided",
"result": {
"code": "0000"
},
"transaction": {
"amount": {
"currency": "USD",
"total": "300"
},
"mode": "1",
"items": [
{
"sku": "100299S",
"name": "Ultrawatch",
"description": "Smart watch",
"quantity": "1",
"price": "500.0000",
"shipping": "",
"url": "",
"tangible": false
},
{
"sku": "100269S",
"name": "Drone",
"description": "drone x",
"quantity": "1",
"price": "500.0000",
"shipping": "",
"url": "",
"tangible": false
}
],
"invoice_number": "12345"
},
"custom": {
"field8": "::1",
"field9": "Test Capture",
"field10": "2"
},
"create_time": "2020-07-28T18:15:00Z"
}
# 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 |