Skip to content

Refunds

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"
}

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"
}

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"
Field Type Required Description
amount_cents integer No Amount to refund in the smallest currency unit. Omit for a full refund.
reason string No One of customer_request, duplicate, fraudulent. Passed to the PSP.
Status Meaning
succeeded Refund confirmed by PSP
pending Submitted to PSP, awaiting confirmation
failed PSP rejected the refund
  • 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
Event When
payment_intent.refunded All charged funds have been refunded
payment_intent.partially_refunded A partial refund succeeded (remaining balance > 0)
payment_intent.refund_failed Refund attempt failed

See Webhooks for how to handle these events.