Skip to content
Docs

Payments

POST/api/payments/{id}/voids

Void 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.

Server-side request · headers mid + terminal-idTry it in Sandbox

Path parameters

FieldTypeDescription
idRequiredstring

Payment request Id, Transaction Id and Order Id

Request body

FieldTypeDescription
referenceOptionalstring

A reference you can later use to identify this void request.

e.g. ORD-5023-4E89
metadataOptionalobject

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

FieldTypeDescription
midRequiredstring

Your MID, starts with ul-mid.

e.g. ul-mid-696f12de-46d0-48c4-a7c8-bb*********5
terminal-idRequiredstring

Your terminal id, starts with ul-tid.

e.g. ul-tid-6208df4ad7329e*********e

Responses

StatusDescription
200 OKSuccess
400 Bad requestBad Request
401 UnauthorizedUnauthorized
402 Payment requiredVoid Declined
403 ForbiddenForbidden request: the payment can't be voided, the 5-day void window has passed, or an amount was sent (partial void).
404 Not foundNot Found

Response fields 200

FieldTypeDescription
statusOptionalstring

The payment status after the void.

e.g. Voided
messageOptionalstring

Confirmation that the payment was voided.

e.g. Payment voided successfully
referenceOptionalstring

The reference you sent with the void request, or an empty string if none was sent.

e.g. ORD-10482
POSThttps://sandbox.geturbanledger.com/api/payments/ID/voids
curl -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"
  }
}'
Response
200 OK · Success
{
  "status": "Voided",
  "message": "Payment voided successfully",
  "reference": "ORD-10482"
}
Talk to ustalk-to-us