DuevanceAPI documentation

Card vault

Stored cards, mandates and card-on-file charges.

The vault stores cards so you can charge them again: when the buyer returns (cardholder-initiated) or on your own schedule (merchant-initiated, such as a subscription). Card numbers are encrypted at rest and never returned; you hold a pm_… id.

Two ways to store a card

  1. With a charge: send save_card: true (and a usage) on POST /v1/payments. The charge asks for 3-D Secure, and when it succeeds the card is stored active with its card-on-file mandate. The payment's payment_instrument names it.
  2. Without a charge: POST /v1/payment-instruments. The card is stored pending. Its first charge must be cardholder-initiated (initiator: "cardholder", with the buyer present): that charge asks for 3-D Secure, mints the mandate and makes the card active.

Only an active card can be charged merchant-initiated: networks require a mandate from a cardholder-present charge first.

Store a card

POST /v1/payment-instruments (scope write, Idempotency-Key required)

FieldRules
card.numberAs on Payments: Luhn, length and brand checked
card.expiryMM/YY or MM/YYYY, not in the past
card.holderAt most 64 characters
customer_refYour customer reference, at most 64 characters
usagerecurring, unscheduled (default) or installment
consentMust be true: the cardholder agreed to have the card stored

No cvc: security codes are never stored, and sending one is refused. Storing the same card again creates a new instrument. The answer is 201 with the instrument:

{
  "id": "pm_0D4p…",
  "object": "payment_instrument",
  "environment": "test",
  "status": "pending",
  "brand": "visa",
  "last4": "4242",
  "exp_month": 12,
  "exp_year": 2034,
  "holder": "Jane Doe",
  "customer_ref": "cust-1",
  "usage": "recurring",
  "has_mandate": false,
  "last_used_at": null,
  "created_at": "2026-12-03T10:00:00Z"
}

status is pending (no mandate yet) or active.

Charge a stored card

POST /v1/payment-instruments/{id}/charges (scope write, Idempotency-Key required, counted in the charges bucket)

The same fields as POST /v1/payments, without card, payment_instrument and save_card. initiator is merchant by default; send cardholder when the buyer is present. The answers are the same, with the same status table.

A merchant-initiated charge of a card without a mandate, an expired card or a card whose acquirer channel is gone is a 422 with param: "payment_instrument", and nothing is charged.

You may also charge a stored card through POST /v1/payments with payment_instrument.

Retrieve a stored card

GET /v1/payment-instruments/{id} (scope read). A deleted card is a 404.

Delete a stored card

DELETE /v1/payment-instruments/{id} (scope write)

{ "id": "pm_0D4p…", "object": "payment_instrument", "deleted": true }

The encrypted number, its fingerprint and the mandate are erased at once; only the brand and last four digits stay for your payment history. Deleting a deleted card answers the same.