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

Create a Refund

Issue a full or partial refund for a successful charge. Funds are automatically returned to the customer's original payment method.


๐Ÿ”‘API Credentials

Request Parametersโ€‹

Required - 1 fieldRequired Parameters
โ–ผ
`id`STRING(required)
Charge ID to refund (path parameter). The charge must be successful, captured, and refundable.
Example:"chrg_test_5xuy4w91xqz7d1w9u0t"
Recommended - 1 fieldRecommended Parameters
Additional - 2 fieldsAdditional Parameters

Responsesโ€‹

200

Successful refund

Refund created successfully. Check the status field to determine processing state.

Possible refund statuses:
  • pending - Refund being processed. Customers typically see funds in 5-10 business days.
  • successful - Refund completed successfully.
  • failed - Refund failed (rare).

400

Bad request

Request validation failed. Check the error message for details.

Common causes:
  • Invalid charge ID format
  • Amount exceeds refundable balance
  • Invalid metadata format
  • Amount below minimum (1 unit)

401

Unauthorized

Authentication failed. Invalid or missing API key.

Common causes:
  • Missing Authorization header
  • Invalid secret key
  • Using public key instead of secret key
  • Incorrect HTTP Basic Auth format

404

Not found

Charge not found.

Common causes:
  • Incorrect charge ID
  • Charge belongs to different account
  • Charge ID typo or formatting error

422

Unprocessable entity

Charge cannot be refunded.

Common causes:
  • Charge not successful (still pending or failed)
  • Charge already fully refunded
  • Refund amount exceeds available balance
  • Charge has 15 or more partial refunds (maximum limit)
  • Charge older than 365 days (or shorter for some payment methods)

Code samplesโ€‹

curl https://api.omise.co/charges/chrg_test_5xuy4w91xqz7d1w9u0t/refunds \
-X POST \
-u skey_test_5xuy4w91xqz7d1w9u0t: \
-d "amount=50000"

Error and result codesโ€‹

Common Error Codesโ€‹

CodeDescriptionResolution
bad_requestMissing or invalid parametersCheck all required fields are provided
authentication_failureInvalid API keyVerify your secret key is correct
not_foundCharge ID does not existCheck charge ID is correct
charge_not_refundableCharge cannot be refundedVerify charge status is successful
insufficient_refundable_amountAmount exceeds available balanceCheck charge.amount - charge.refunded_amount
too_many_refunds15 refunds already createdMaximum 15 partial refunds per charge
refund_period_expiredCharge older than refund windowCharges must be under 365 days old

Refund Status Codesโ€‹

StatusDescription
pendingRefund being processed
successfulRefund completed successfully
failedRefund failed (rare)

Try it outโ€‹

Required - 1 fields
โ–ผ
Recommended - 1 fields
Additional - 2 fields