reverseTransaction

Void or refund an Aeropay Transaction.

If a transaction needs to be reversed (return money to the customer) this method will void the payment, or create a payment to the customer from the merchant.

Transactions that are within the same business day can be voided on the spot, where no money is moved in either direction. If that window has closed and the transaction has begun to process, a transaction in the reverse direction will be created.

An amount can be included to handle partial refunds if there was a change in the amount, otherwise the full amount will be refunded.

Refunds will take 2-3 business days to process as usual.

Safe Retry for Refunds (Idempotency-Key): When a merchant retries a refund request (e.g. after a timeout or network error), Aeropay returns the same outcome as the first attempt instead of creating a second refund. Send an idempotency key with the request (e.g. a UUID in the Idempotency-Key header). The first request with that key is processed and its response is stored; later requests with the same key receive the stored response and do not trigger a new refund. The same key cannot be used with a different request body; if it is, the API rejects the request so one key always maps to one logical refund. Idempotency is optional; if no idempotency key is sent, the API does not apply this behavior and does not guarantee protection against duplicate refunds on retries.

NOTE: The id used is a Aeropay Transaction.id and is only for AeroTransactions. Use /v2/preauthTransaction DELETE to cancel a preauthorized transaction.

Error Glossary (click to expand)
CodeHTTP StatusMessage
AP009401Unauthorized
AP011401Unauthorized for this transaction
AP101401No authenticated user
AP310200Credit transaction declined
AP400200No bank account linked
AP700400Missing or invalid required parameter
AP701400Improperly formatted parameter
AP1001200Error committing to database
AP1200200Could not create merchant bill transaction
AP1300200Transaction already refunded
AP1301200Transaction already queued for refund
AP1302200Refund amount exceeds original transaction amount
AP1303200Refund amount must be positive
AP1304200Transaction type cannot be refunded
AP1305200RTP transaction cannot be voided - schedule a refund
Recent Requests
Log in to see full request history
TimeStatusUser Agent
Retrieving recent requests…
LoadingLoading…
Body Params

Payload to reverse (void or refund) a transaction.

string
required

id of transaction to refund or void. In UUID format.

amount
object

Dictionary with currency and amount in pennies. Only USD supported at this time

Headers
string
required
string
required

A merchant scoped token.

uuid

Optional idempotency key (e.g. a UUID) to ensure that reverseTransaction is idempotent.

Responses

Language
LoadingLoading…
Response
Click Try It! to start a request and see the response here! Or choose an example:
application/json