Skip to main content
Version: 2019-05-29 (Current)

Reverse a charge

Reverse a pre-authorized charge to release the hold on customer funds without capturing payment. Only works for charges created with capture=false.


๐Ÿ”‘API Credentials

Request Parametersโ€‹

Required - 1 fieldRequired Parameters
โ–ผ
`id`STRING(required)
The charge ID to reverse. Must be an uncaptured pre-authorized charge (status: successful, capture: false, reversible: true).
Example:"chrg_test_5xuy4w91xqz7d1w9u0t"
Constraints:Must start with chrg_, Must be pre-authorized (capture: false), Must be reversible, Within 7-day authorization window

Responsesโ€‹

200

Successfully reversed

Pre-authorization cancelled. Funds released back to customer.

Key field changes after reversal:
  • status - Changes from successful to reversed
  • reversed - Changes from false to true
  • reversed_at - Set to current timestamp
  • reversible - Changes from true to false
  • capturable - Changes from true to false

400

Bad request

Invalid parameters or charge cannot be reversed.

Common causes:
  • Charge already captured (use refund instead)
  • Invalid charge ID format
  • Charge not a pre-authorization

401

Unauthorized

Authentication failed. Invalid or missing API key.

Common causes:
  • Missing Authorization header
  • Invalid secret key
  • Using public key instead of secret key

404

Not found

Charge ID does not exist.

Common causes:
  • Incorrect charge ID
  • Charge from different account
  • Using test key for live charge (or vice versa)

422

Unprocessable entity

Charge cannot be reversed.

Common causes:
  • Charge already reversed
  • Charge already captured (cannot reverse captured charges)
  • Charge not reversible (expired or wrong status)
  • Authorization expired (beyond 7-day window)

Code samplesโ€‹

curl https://api.omise.co/charges/chrg_test_5xuy4w91xqz7d1w9u0t/reverse \
-X POST \
-u skey_test_5xuy4w91xqz7d1w9u0t:

Error and result codesโ€‹

Common Error Codesโ€‹

CodeDescriptionResolution
not_foundCharge ID doesn't existVerify charge ID is correct
already_reversedCharge already reversedNo action needed
already_capturedCharge captured (use refund)Cannot reverse captured charges
not_reversibleCharge cannot be reversedCheck reversible field is true
authorization_expiredPre-auth expired (>7 days)Cannot reverse expired auth

Reversal Requirementsโ€‹

FieldRequired ValueDescription
statussuccessfulMust be authorized
capturefalseMust be pre-auth
reversibletrueMust be eligible for reversal
reversedfalseNot already reversed
Age< 7 daysWithin authorization window

Try it outโ€‹

Required - 1 fields
โ–ผ