Skip to content

Refunds

Full refund

To refund the full payment amount, POST to the refunds endpoint with no amount_cents field:

Terminal window
curl -X POST https://api.elasticpay.co/api/v1/payment_intents/pi_0abc123def456ghi789jkl012mn/refunds \
-H "Authorization: Bearer sk_live_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" \
-H "Content-Type: application/json" \
-d '{"reason": "customer_request"}'

Response

{
"success": true,
"status": "succeeded",
"transaction_id": "pi_0abc123def456ghi789jkl012mn",
"refund_id": "re_0abc123def456",
"message": "Full refund of 5000 AUD processed",
"amount_cents": 5000,
"currency": "AUD"
}

Partial refund

Specify amount_cents to refund a portion of the payment. Multiple partial refunds are allowed as long as the total does not exceed the original charged amount.

Terminal window
curl -X POST https://api.elasticpay.co/api/v1/payment_intents/pi_0abc123def456ghi789jkl012mn/refunds \
-H "Authorization: Bearer sk_live_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" \
-H "Content-Type: application/json" \
-d '{"amount_cents": 2000, "reason": "partial_return"}'

Response

{
"success": true,
"status": "succeeded",
"transaction_id": "pi_0abc123def456ghi789jkl012mn",
"refund_id": "re_0def456ghi789",
"message": "Partial refund of 2000 AUD processed",
"amount_cents": 2000,
"currency": "AUD"
}

List refunds

Retrieve all refunds for a payment intent:

Terminal window
curl https://api.elasticpay.co/api/v1/payment_intents/pi_0abc123def456ghi789jkl012mn/refunds \
-H "Authorization: Bearer sk_live_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"

Request fields

FieldTypeRequiredDescription
amount_centsintegerNoAmount to refund in the smallest currency unit. Omit for a full refund.
reasonstringNoOne of customer_request, duplicate, fraudulent. Passed to the PSP.

Refund statuses

StatusMeaning
succeededRefund confirmed by PSP
pendingSubmitted to PSP, awaiting confirmation
failedPSP rejected the refund

Constraints

  • The payment intent must be in succeeded status
  • Total refund amount across all refunds cannot exceed the original charged amount
  • A full refund transitions the payment intent status to refunded
  • A partial refund keeps the payment intent in succeeded
  • A failed refund does not affect the payment intent status — retry with a new request

Webhook events

EventWhen
payment_intent.refundedAll charged funds have been refunded
payment_intent.partially_refundedA partial refund succeeded (remaining balance > 0)
payment_intent.refund_failedRefund attempt failed

See Webhooks for how to handle these events.