docs

Create a refund

Creates a full or partial refund for a successful charge. Target: provide EXACTLY ONE of `chargeId` or `paymentIntentId`. When `paymentIntentId` is supplied the server resolves it to the unique succeeded charge under that intent; the request is rejected if the intent has zero or multiple succeeded charges. Features: - Full or partial refunds - Ledger reversal (double-entry bookkeeping) - Balance updates (debits available funds) - Updates charge.amountRefunded - Updates paymentIntent.amountRefunded Refunds: - Hit available balance immediately (no hold period) - Create negative balance transactions - Reverse the original charge's ledger entries - Platform keeps fees (business decision)

POST
/refunds
  Creates a full or partial refund for a successful charge.

  Target: provide EXACTLY ONE of `chargeId` or `paymentIntentId`.
  When `paymentIntentId` is supplied the server resolves it to the unique
  succeeded charge under that intent; the request is rejected if the intent
  has zero or multiple succeeded charges.

  Features:
  - Full or partial refunds
  - Ledger reversal (double-entry bookkeeping)
  - Balance updates (debits available funds)
  - Updates charge.amountRefunded
  - Updates paymentIntent.amountRefunded

  Refunds:
  - Hit available balance immediately (no hold period)
  - Create negative balance transactions
  - Reverse the original charge's ledger entries
  - Platform keeps fees (business decision)
AuthorizationBearer <token>

API key for merchant integrations. Send as Authorization: Bearer <your key>.

In: header

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

curl -X POST "https://example.com/refunds" \  -H "Content-Type: application/json" \  -d '{}'
{
  "id": "re_abc123",
  "chargeId": "ch_xyz789",
  "amount": "50000",
  "currency": "EGP",
  "status": "succeeded",
  "reason": "requested_by_customer",
  "balanceTransactionId": "bt_def456",
  "createdAt": "2024-01-01T00:00:00.000Z"
}
Empty
Empty
Empty
Empty