Skip to content
SETSimple Easy Transactions
SET DocsSET Crypto API Suite and SET API referenceCurrent as of 2026-11-21 · wallet release 7d8a79fb
Browse: SET API

SET API · Card payments

Refund a card payment

POST/v1/card_payments/{id}/refunds

Key scope: write · Business accounts · Success: 201

Refunds all that is left, or amount, on the merchant's Stripe account. SET's fee on the payment comes back in proportion, and a refund the merchant makes in its own Stripe Dashboard is followed by the matching return of SET's fee. SET charges no fee of its own on a refund. A payment made from 2026-11-11 to 2026-11-12 carried no SET fee and has none to return.

Path parameters

id stringrequired
The payment (pi_…).

Headers

Idempotency-Key string
Optional. The same key and body run once; a replay answers with Idempotent-Replayed: true. Kept 24 hours.

Body

amount decimal string
Default: everything not yet refunded.
reason "duplicate" | "fraudulent" | "requested_by_customer"
Stripe's refund reason.

Errors

  • 409 set_connect_account_changed
  • 400 amount_invalid
  • 400 reason_invalid
  • 403 card_payments_merchant_only
  • 403 operator_cannot_refund
  • 404 card_payment_unknown
  • 409 card_payment_not_refundable
  • 409 card_payment_fully_refunded
  • 409 stripe_refused
  • 502 stripe_unavailable
  • 401 api_key_required
  • 401 api_key_invalid
  • 401 api_key_wrong_mode
  • 401 api_key_expired
  • 403 scope_missing
  • 403 platform_api_paused
  • 429 rate_limited
  • 503 api_disabled

All codes: Errors.