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

Retrieve a charge refund

Retrieve a specific refund for a charge. Returns complete information about the refund including its status, amount, and transaction details.


Request Parametersโ€‹

Required - 2 fieldsRequired Parameters
โ–ผ
`id`STRING(required)
The charge ID that the refund belongs to. Must be a valid charge ID from your account.
Example:"chrg_test_5xuy4w91xqz7d1w9u0t"
Constraints:Must start with chrg_, Test charges: chrg_test_, Live charges: chrg_live_
`refund_id`STRING(required)
The refund ID to retrieve. Must be a valid refund ID associated with the specified charge.
Example:"rfnd_test_5xuy4w91xqz7d1w9u0t"
Constraints:Must start with rfnd_, Test refunds: rfnd_test_, Live refunds: rfnd_live_

Responsesโ€‹

200

Successful retrieval

Returns complete refund object with all fields.

Response includes:
  • id - Refund ID
  • status - pending, closed, or failed
  • amount - Refund amount in smallest currency unit
  • currency - Currency code
  • charge - Associated charge ID
  • transaction - Associated transaction ID
  • created_at - Refund creation timestamp
  • metadata - Custom metadata (if set)

400

Bad request

Invalid parameters provided.

Common causes:
  • Invalid charge ID format
  • Invalid refund ID format

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 or refund ID does not exist.

Common causes:
  • Incorrect charge ID
  • Incorrect refund ID
  • Refund does not belong to the specified charge
  • Resource from different account
  • Using test key for live resource (or vice versa)

5xx

Server error

Server-side error occurred. These are rare but should be handled gracefully.

How to handle:

Code samplesโ€‹

curl https://api.omise.co/charges/chrg_test_5xuy4w91xqz7d1w9u0t/refunds/rfnd_test_5xuy4w91xqz7d1w9u0t \
-u skey_test_5xuy4w91xqz7d1w9u0t:

Error and result codesโ€‹

Refund Status Valuesโ€‹

StatusDescriptionNext Steps
pendingRefund is being processedWait for completion
closedRefund completed successfullyFunds returned to customer
failedRefund failedCheck failure reason

Refund Object Fieldsโ€‹

FieldTypeDescription
idstringUnique refund identifier
objectstringAlways "refund"
livemodebooleanWhether this is a live mode refund
locationstringAPI path to this refund
amountintegerRefund amount in smallest currency unit
currencystringThree-letter ISO currency code
chargestringID of the charge that was refunded
transactionstringID of the associated transaction
statusstringCurrent refund status
created_atstringISO 8601 timestamp of creation
metadataobjectCustom key-value pairs

๐Ÿ”‘API Credentials

Try it outโ€‹

Required - 2 fields
โ–ผ
Your IP: ...Loading...