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.


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.

Response includes:
  • object - The value "refund"
  • id - Refund identifier (rfnd_*)
  • livemode - Live or test mode
  • location - API path to the refund object
  • acquirer_reference_number - Reference number sent to card networks
  • amount - Refund amount in smallest currency unit
  • approval_code - Reference number for approved transactions
  • capture - Capture reference
  • charge - Associated charge ID (expandable)
  • currency - Three-letter ISO 4217 currency code
  • funding_amount - Amount in settlement currency
  • funding_currency - Settlement currency code
  • merchant_name - Sub-merchant name (Payfac only)
  • merchant_uid - Sub-merchant ID (Payfac only)
  • metadata - Custom metadata attached to refund
  • status - Current refund status (pending, successful, failed)
  • terminal - Original point of sale location
  • transaction - Associated transaction ID (expandable)
  • voided - Whether refund was processed as a void
  • created_at - Refund creation timestamp (ISO 8601)

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)

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 \
-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)

๐Ÿ”‘API Credentials

Try it outโ€‹

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