Payments
Charge a card at capture time, or charge a vaulted card by token.
POST /v1/payments/charge/token
The workhorse: charge a previously vaulted card using its charge token.
POST /v1/payments/charge/token Authorization: Bearer <session JWT> Content-Type: application/json { "token": "<charge token>", // required "amount": 25.00, // required, decimal > 0 "currency": "USD", // required "ref": "INV-2026-0042", // your reference, echoed in logs "processorId": "...", // optional; defaults to the token's gateway "storedCredentialType": 5 // optional; how this charge is initiated }
25.00 means twenty-five dollars.
Do not send minor units -- 2500 would charge $2,500.00.
Stored-credential behavior
For recurring cards, Card Vault manages the stored-credential chain with the card networks. If you flag a charge as merchant-initiated before the card has an established chain (an approved cardholder-present charge), the API refuses it:
422 Stored-Credential Chain Broken-- run a cardholder-present (CIT) charge first; see Card usage & lifecycle.422 Merchant-Initiated Charge Not Allowed-- the card is single-use, so it can only be charged cardholder-present with its CVV.storedCredentialType2-5 is refused.422 CVV Required-- no security code is on file and the card has no stored credential for a merchant-initiated charge. Collect the CVV (POST /v1/vault/cvvwith an amount charges with it).400 Invalid Stored-Credential Type--storedCredentialTypemust be 0 to 5.
Gateway routing
The charge runs on the gateway configured for the token's segment. Passing a
processorId that conflicts with it fails closed:
422 Processor Misaligned-- the specified processor does not match the gateway configured for this token's segment.503 Gateway Unavailable-- no active gateway profile, or merchant gateway credentials not configured.
Other errors
400-- missing token, non-positive amount, missing currency.404-- the token does not resolve for your account. If the card exists, you are probably sending the vault token instead of the charge token (Tokens).
POST /v1/payments/charge
At-capture charge ("card on hand"): charge the card in the same call that captures it, with optional vault-on-success. Card fields arrive through SDK secure-field encryption, like the vault call.
POST /v1/payments/charge Authorization: Bearer <session JWT> Content-Type: application/json { "encryptedPan": "<SDK secure field>", // required "encryptedCvv": "<SDK secure field>", // required "encryptedExpiry": "<SDK secure field>", // required, MM/YY "encryptedName": "<SDK secure field>", "amount": 25.00, // required, decimal > 0 "currency": "USD", // required "transactionType": 0, // 0 = charge, 1 = pre-authorization "vaultOnSuccess": true, // store the card if the charge approves "ref": "INV-2026-0042", "postal": "T8V 4E9", // optional, for AVS "processorId": "..." // optional }
Vault on success: when vaultOnSuccess is true and the
charge approves, the card is vaulted in the same operation and the response includes
its token -- the approved charge doubles as the cardholder-present transaction that
establishes the stored-credential chain for future token charges.
If your CardVault subscription is 30 or more days past due, the charge still runs and returns its normal outcome, but the card is not vaulted and the response carries no token (new cards are suspended until the subscription is paid; cards already in the vault keep working).
Errors
400-- missing/undecryptable fields, invalid PAN length, invalid expiry, non-positive amount, missing currency.422 Card Not Accepted(type: https://api.cardvault.dev/errors/card-not-accepted) -- only whenvaultOnSuccessis true: the tenant's Card Policy refuses this card's BIN, so it is refused before the charge is attempted (a card the tenant will not keep is never charged). Charges withoutvaultOnSuccessare not policy-checked.503 Gateway Unavailable-- no active gateway profile or missing gateway credentials.503 Service Configuration Error-- SDK encryption material not configured.
Charge outcome: 200 or 202
Every charge, pre-authorization and completion call waits for the processor's answer
(up to about 25 seconds) and returns it. The response carries txStatus
and txId:
200withtxStatusapproved,declinedorfailed-- the final outcome.declineReasonis set only fordeclinedandfailed.202withtxStatusprocessing-- the processor has not answered yet. This is not a decline: do not retry the payment. Read the outcome withGET /v1/payments/{txId}, or wait for the charge webhook.202withtxStatusunknown-- the processor's answer was lost in transit and Card Vault is reconciling it with the processor. Do not retry. Card Vault settles it with the processor; quote thetxIdto support.
When vaultOnSuccess is true, the card is vaulted only when the call itself
returns approved. A 202 answer does not vault the card.
GET /v1/payments/{txId}
Returns the outcome of a payment by its txId. Call it from your server with an
API key that has Virtual Terminal Log View. SDK session tokens are single-use,
so a device cannot poll with one.
{
"data": {
"txId": "3f2504e0-4f89-11d3-9a0c-0305e82c3301",
"txStatus": "approved", // approved | declined | failed | processing | unknown
"approved": true,
"txRef": "...",
"authCode": "...",
"declineReason": null,
"preAuthId": null, // set for an approved pre-authorization
"txType": 216, // 216 charge, 217 pre-auth, 218 completion, 220 cancel
"amount": 25.00,
"ref": "INV-2026-0042",
"correlationId": "..."
}
}
It answers 200 for a final outcome, 202 while the payment is
processing or unknown, and 404 when the id does not belong to your account.