Orders

Refund order payment

Refund a paid order via Stripe. Supports full and partial refunds. Requires write access, and refunds must be enabled for your workspace and on the platform — the endpoint returns 404 while refunds are not enabled; contact support to enable them. The customer is refunded first; the platform fee is adjusted for the refunded amount. Idempotency: when `idempotencyKey` is omitted, a key is derived from the request (amount, reason, metadata) and the order's refund state at request time. That protects true retries of an identical request, but a keyless retry after a lost response can be treated as a new request (and refund twice) once the first refund has applied — always send a stable `idempotencyKey` for retries. Repeating a non-exhausting partial refund with the same `idempotencyKey` returns the original refund and makes no further changes (no duplicate refund, status change, or notification). A repeat that would now be rejected by a fresh eligibility check — a full refund, an exhausting partial, or one exceeding the currently refundable amount — returns 400 instead; retry with a smaller/different request, or contact support to confirm the original refund's status.

Authorization

Public key Secret key
x-fngs-public-key<token>

In: header

x-fngs-secret-key<token>

In: header

Path Parameters

orderIdOrNumber*|

PATCH /v0/orders/:orderIdOrNumber/refund Parameter

Request Body

application/json

PATCH /v0/orders/:orderIdOrNumber/refund Request body

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

application/json

PATCH
/v0/orders/{orderIdOrNumber}/refund
curl -X PATCH "https://example.com/v0/orders/497f6eca-6276-4993-bfeb-53cbbbba6f08/refund" \  -H "Content-Type: application/json" \  -d '{}'
{  "status": "success",  "data": {    "refundId": "string",    "orderId": "b3e1eced-f2bd-4d8c-9765-fbc9d1d222d5",    "amount": 1,    "currency": "AFN",    "status": "succeeded",    "createdAt": "string"  }}