DuevanceAPI documentation

Capture, refund, void

Follow-up operations on a payment.

Follow-up operations on a payment. Each requires scope write and an Idempotency-Key, and only one runs at a time per payment: a second one while the first runs answers 409 payment_in_progress.

Capture

POST /v1/payments/{id}/capture

FieldRules
amountOptional. 1 up to the authorized amount; default the whole amount. One capture per payment

Only an authorized payment (created with capture: false) can be captured. The answer is the payment, 200, now succeeded with captured_amount set.

Void

POST /v1/payments/{id}/void with an empty body or {}.

Releases an authorized, uncaptured payment. The answer is the payment, 200, now canceled. A captured payment can't be voided: refund it.

Refund

POST /v1/payments/{id}/refunds

FieldRules
amountOptional. 1 up to the refundable amount; default everything still refundable
reasonOptional, at most 255 characters

The refundable amount is the captured amount minus succeeded refunds and refunds still pending, so two refunds can never return more than was captured. The answer is 201 with the refund:

{
  "id": "ref_0D4n…",
  "object": "refund",
  "payment": "pay_0D4m…",
  "status": "succeeded",
  "amount": 500,
  "currency": "EUR",
  "reason": "damaged",
  "decline_code": null,
  "failure_reason": null,
  "succeeded_at": "2026-12-03T10:05:00Z",
  "failed_at": null,
  "created_at": "2026-12-03T10:05:00Z"
}

A refund is pending until the acquirer confirms it, then succeeded or failed; the refund.succeeded and refund.failed webhooks tell you. A failed refund frees its amount. The payment becomes partially_refunded, then refunded.

GET /v1/payments/{id}/refunds lists a payment's refunds, newest first.

When an operation is refused

AnswerMeaning
422 invalid_payment_stateThe payment can't take this operation now, such as capturing a declined payment
422 validation_failed, param: "amount"The amount is out of range
422 operation_declinedThe acquirer declined it. The payment is unchanged; a declined refund is kept as failed
502 acquirer_unavailableIt never reached the acquirer. Nothing changed; retry later
502 acquirer_outcome_unknownThe acquirer didn't confirm a capture or void. Check the payment before retrying

Each carries error.payment_id.