Payments
/ api/ payments/ {id}/ voidsVoid a payment
Voids an authorized payment that has not been captured yet, so the customer is not charged and the amount held on their card is released. Only the full amount can be voided (sending amount returns "Partial void not allowed"), and the void must be requested within 5 days of the authorization. To return money for a captured payment, use Refund a payment instead.
mid + terminal-idTry it in Sandbox Path parameters
| Field | Type | Description |
|---|---|---|
idRequired | string | Payment request Id, Transaction Id and Order Id |
Request body
| Field | Type | Description |
|---|---|---|
referenceOptional | string | A reference you can later use to identify this void request. |
metadataOptional | object | A set of key-value pairs that you can attach to the void request. This can be useful for storing additional information in a structured format. Note that this object only allows one level of depth, so cannot accept non-primitive data types such as objects or arrays. |
Headers
| Field | Type | Description |
|---|---|---|
midRequired | string | Your MID, starts with ul-mid. |
terminal-idRequired | string | Your terminal id, starts with ul-tid. |
Responses
| Status | Description |
|---|---|
| 200 OK | Success |
| 400 Bad request | Bad Request |
| 401 Unauthorized | Unauthorized |
| 402 Payment required | Void Declined |
| 403 Forbidden | Forbidden request: the payment can't be voided, the 5-day void window has passed, or an amount was sent (partial void). |
| 404 Not found | Not Found |
Response fields 200
| Field | Type | Description |
|---|---|---|
statusOptional | string | The payment status after the void. |
messageOptional | string | Confirmation that the payment was voided. |
referenceOptional | string | The reference you sent with the void request, or an empty string if none was sent. |
https://sandbox.geturbanledger.com/api/payments/ID/voidscurl -X POST "https://sandbox.geturbanledger.com/api/payments/ID/voids" \
-H "Content-Type: application/json" \
-H "mid: sb-ul-mid-xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" \
-H "terminal-id: ul-tid-xxxxxxxxxxxxxxxxxxxxxxxx" \
-d '{
"reference": "ORD-5023-4E89",
"metadata": {
"channel": "web",
"customer_ref": "CUST-10482"
}
}'{
"status": "Voided",
"message": "Payment voided successfully",
"reference": "ORD-10482"
}