Inyo

Refund

Refunding reverses a previously captured payment and returns funds to the cardholder. The time for the refund to appear on the cardholder's statement varies by issuing bank.

Key Rules

  • Only possible for captured payments (use Void for uncaptured authorizations)
  • You can refund the full amount or a partial amount
  • Multiple partial refunds are allowed until the full captured amount is refunded
  • Once fully refunded, further refund attempts return an error
  • If no amount is specified, the full captured amount is refunded

Endpoint

POST https://{FQDN}/payments/{externalPaymentId}/refund

Headers:

HeaderValue
AuthorizationBearer {accessToken}
Content-Typeapplication/json

Request Body (Optional)

Omit the body to refund the full captured amount. Include it for a partial refund:

{
  "amount": {
    "total": 25.00,
    "currency": "USD"
  }
}
FieldTypeRequiredDescription
amount.totalnumberAmount to refund (must be ≤ remaining captured amount)
amount.currencystringCurrency code (must match the original payment)

Example — Full Refund

curl -X POST https://{FQDN}/payments/order-12345/refund \
  -H 'Authorization: Bearer eyJhbGciOiJSUzI1NiIs...' \
  -H 'Content-Type: application/json'

Example — Partial Refund

curl -X POST https://{FQDN}/payments/order-12345/refund \
  -H 'Authorization: Bearer eyJhbGciOiJSUzI1NiIs...' \
  -H 'Content-Type: application/json' \
  -d '{
    "amount": {
      "total": 25.00,
      "currency": "USD"
    }
  }'

Response (200)

{
  "paymentId": "bfb9eacb-7c72-4cc8-9cae-afd9164ec792",
  "parentPaymentId": "bfb9eacb-7c72-4cc8-9cae-afd9164ec792",
  "externalPaymentId": "order-12345",
  "amount": 100.10,
  "created": "2024-04-22 16:22:06",
  "approved": true,
  "message": "Payment Approved",
  "automaticReversed": false,
  "status": "REFUNDED",
  "captured": true,
  "voided": false,
  "authCode": "bfb9eacb-7c72-4cc8-9cae-afd9164ec792",
  "issuerName": "BANK OF AMERICA",
  "issuerCountry": "US",
  "cvcResult": "APPROVED",
  "avsResult": "NOT_SENT"
}

For partial refunds, the status will be PARTIALLY_REFUNDED until the full amount is returned.