The customer vault lets you store a customer's payment information — cards and bank accounts —
so they don't have to re-enter their details on every transaction. Instead of collecting and
tokenizing a new card each time, you charge by referencing a stored vault entry.
How vault storage works
Collect a card using ZeroGateway.js to get a
single-use paymentToken
Create a customer (or add a card to an existing one), passing the paymentToken
Store the customer id returned in the response — this is your permanent vault reference
Charge future transactions using card.vaultId set to that customer id
Create a customer with a card
Pass the paymentToken from tokenization in the cards array. The card is vaulted and the token
is consumed in the same request.
The number field in the card object is for display only (masked). The actual card is stored via
the paymentToken. You must run the card through ZeroGateway.js first to obtain a real token —
never use the placeholder 00000000-000000-000000-000000000000 in production requests.
Create a customer without a card
You can create a customer record first and add cards later:
This is the most common vault integration mistake. The response contains two different ID values
and they are not interchangeable: Always use id (the top-level Customer identifier) as card.vaultId. Using customerVaultId will
fail or charge the wrong record.
id (670fbdf6fce1362341bcaf9f) — use as card.vaultId in charge requests
paymentMethod.customerVaultId (7581353772) — internal reference only, DO NOT use as card.vaultId
Charge a stored card via vaultId
Use card.vaultId with the customer's id to charge without re-collecting card details. The platform will use the 'default' payment method for that customer.
If you need to use a specific non-default payment method in that Customer, use the parameter "overrideDefaultPaymentMethod": "<paymentMethod.customerVaultId>":