DuevanceAPI documentation

Payments

Create, retrieve and list payments; every field.

A payment is one charge of a card. Create it with a card typed by the buyer or a stored card; Duevance routes it to an acquirer, fails over to the next one when that is provably safe, and answers with the payment.

Create a payment

POST /v1/payments (scope write, Idempotency-Key required, counted in the charges bucket)

FieldTypeRules
amountintegerMinor units, 1 to 99 999 999. Required
currencystringISO 4217, such as EUR. Required
capturebooleanfalse only authorizes; capture later. Default true
cardobjectThe card typed by the buyer (below). Send card or payment_instrument
payment_instrumentstringA stored card's id, pm_… (see Card vault)
initiatorstringWith payment_instrument only: merchant (default) or cardholder
save_cardbooleanStore the card and mint a card-on-file mandate with this charge
usagestringrecurring, unscheduled or installment: why the card is stored or charged
require_3dsbooleanAsk for a 3-D Secure challenge
referencestringYour order reference, at most 64 characters, unique per project and environment
descriptionstringAt most 120 characters
statement_descriptorstring1–25 letters, digits, spaces or & . , - * / # '. Falls back to the project's, then the merchant's
return_urlstringWhere the buyer returns after 3-D Secure. https only (http://localhost is allowed in test mode). At most 2048 characters
transaction_typestringYour own classification, at most 24 characters, for reporting
parent_paymentstringA related earlier payment, pay_…, of this project and environment
metadataobjectUp to 50 string keys (≤ 40 characters) with string values (≤ 500 characters). Echoed back
customerobjectreference (≤ 64), email (≤ 255), country (ISO 3166 alpha-2, upper case), ip, user_agent (≤ 512)
browserobjectWhat the buyer's browser reports for 3-D Secure: at most 20 fields of strings (≤ 2048), integers or booleans

card:

FieldRules
number12–19 digits, spaces and dashes allowed; must pass the Luhn check and be Visa, Mastercard, Amex, Diners, Discover or JCB
expiryMM/YY or MM/YYYY, not in the past
cvc3 digits (4 for Amex). Never stored
holderAt most 64 characters

Saving a card (save_card: true) always asks for a 3-D Secure challenge: a mandate is only minted with the cardholder present.

The answer

StatusWhen
201succeeded, authorized, or requires_action with a next_action
402declined (see decline_code) or failed (nothing was charged). The body is the payment
202processing: the acquirer's answer is unknown. Don't charge again: wait for the webhook
409duplicate_reference: the reference is taken; error.payment_id names that payment
422A field is wrong (validation_failed), or no channel takes the charge (routing_unavailable). Nothing was created

The full status table is on Statuses.

3-D Secure

A payment in requires_action carries:

"next_action": { "type": "redirect_to_url", "url": "https://pay.duevance.com/3ds/att_0D4m…" }

Send the buyer's browser to url. Duevance runs the challenge with the buyer's bank, folds the answer into the payment, then sends the buyer to your return_url with payment_id added to its query (https://shop.example/back?payment_id=pay_0D4m…). Without a return_url, the buyer sees a result page and can close the window. The query proves nothing: confirm the payment server-side or wait for the webhook. See 3-D Secure.

The payment object

{
  "id": "pay_0D4mXqk2…",
  "object": "payment",
  "environment": "test",
  "status": "succeeded",
  "amount": 1999,
  "currency": "EUR",
  "capture": true,
  "captured_amount": 1999,
  "refunded_amount": 0,
  "reference": "order-1001",
  "description": null,
  "statement_descriptor": "DEMO SHOP",
  "decline_code": null,
  "decline_category": null,
  "card": { "brand": "visa", "last4": "4242" },
  "payment_instrument": null,
  "checkout_session": null,
  "parent_payment": null,
  "initiator": "cardholder",
  "usage": null,
  "transaction_type": null,
  "customer": { "email": "[email protected]", "country": "FR" },
  "metadata": { "cart": "17" },
  "next_action": null,
  "authorized_at": "2026-12-03T10:00:00.120Z",
  "captured_at": "2026-12-03T10:00:00.120Z",
  "canceled_at": null,
  "created_at": "2026-12-03T10:00:00.004Z"
}
FieldMeaning
statusSee Statuses
captured_amount, refunded_amountWhat was captured, and what succeeded refunds returned
decline_code, decline_categoryWhy it was declined. decline_category is soft (may succeed later or elsewhere), hard (don't retry this card), three_ds_required or unknown. A routing rule block reads blocked_by_rule:<name>
cardBrand and last four digits; the number is never returned
payment_instrumentThe stored card charged or saved, pm_…
initiatorcardholder or merchant, derived from how the card was charged
next_actionSet while requires_action

Retrieve a payment

GET /v1/payments/{id} (scope read) answers the payment object, or 404 when no payment of this project and environment has that id.

List payments

GET /v1/payments (scope read), newest first.

ParameterRules
statusOne status from Statuses
referenceYour reference, exactly
created_afterRFC 3339, inclusive, such as 2026-12-01T00:00:00Z
created_beforeRFC 3339, exclusive
limit1 to 100, default 25
cursornext_cursor from the previous page
{ "object": "list", "data": [ { "id": "pay_…", "object": "payment" } ], "has_more": true, "next_cursor": "eyJ…" }

Pass next_cursor as cursor to get the next page; it is null on the last one. Cursors are opaque and signed: an altered, truncated or foreign cursor is a 422 with param: "cursor", never a silent restart at page one. An unknown parameter, or one sent twice, is a 422 too.