Request a manual refund (ops only)
POST/refunds
RequestRefund, the ops route. Automatic refunds come from the RefundOnLostPackage and RefundOnReturnToSender policies. The order must have an authorization (else 404). groupNo is optional: absent or 0 refunds at the order level. Refunds of an order (and of a group) never exceed the captured total (ErrOverRefund); FAILED refunds do not count. The provider is tried once in the same call: the answer is 201 with the refund SUCCEEDED, FAILED (provider decline, failureCode set) or still REQUESTED (provider unreachable; a policy retries it), never 503.
Request
Responses
- 201
- 400
- 404
- 409
- 422
- 500
- 503
The requested refund (REQUESTED, SUCCEEDED or FAILED after the one provider attempt).
Response Headers
"true" when the answer is the stored response of an earlier request with the same Idempotency-Key; absent on the first execution.
idempotency-key-required (no Idempotency-Key header), idempotency-key-invalid (not 1 to 128 printable ASCII characters) or malformed-request.
not-found (no such resource, or an identifier longer than 128 characters); not stored on a write; the order of a refund may be bound a moment later, so the key is released and the same Idempotency-Key runs again. resource-not-found for a path that carries a NUL character.
over-refund (ErrOverRefund) or concurrent-update; neither is stored, the key is released and the same Idempotency-Key runs again. Or idempotency-key-reused (the Idempotency-Key was already used with a different request).
validation-failed (on a write it is not stored; the key is released and the same Idempotency-Key runs again).
internal-error (an unexpected failure; the detail never carries the internal message).
payment-provider unreachable or timed out (payment-provider-unavailable), or manual refunds disabled by configuration (refunds-disabled, REFUNDS_ENABLED=false; no retry until an operator re-enables them).