Customer Vault
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
idreturned in the response — this is your permanent vault reference - Charge future transactions using
card.vaultIdset to that customerid
No /rate call is needed before vaulting: POST /customer and POST /customer/card/{id}
classify the card (brand, credit/debit, surcharge eligibility) internally.
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. cards is optional — a customer without a card is valid. The
first card in cards[] becomes the customer's default payment method.
cURL
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.
Take cards[].number and cards[].exp from the tokenization callback:
response.card.number is already masked (411111******1111) and response.card.exp is
normalized to MMYY. Field names are case-sensitive — unknown fields such as zipcode are
silently ignored.
Create a customer without a card
You can create a customer record first (omit cards or send an empty array) and add cards later:
cURL
Retrieve a customer
cURL
The response contains two different identifier fields. Understanding the difference between them is critical for charging correctly.
All /v1/public responses are wrapped in a data envelope.
Customer response
| Field | Description |
|---|---|
paymentMethods[] | Every stored card: customerVaultId, last4, exp, network, brand, number (masked), default |
paymentMethod | The default payment method (the entry with default: true) |
The first card sent on create becomes the default. Cards added later do not replace it — change the default explicitly:
cURL — set default payment method
The response returns the full customer in data.
Critical: id vs customerVaultId
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 ascard.vaultIdin charge requestspaymentMethod.customerVaultId(7581353772) — internal reference only, DO NOT use ascard.vaultId
Charge a stored card via vaultId
Use card.vaultId with the customer's id to charge without re-collecting card details. With
card.vaultId set, neither card.number nor card.paymentToken is required. The platform charges
the customer's default payment method.
To charge a specific non-default payment method, pass
"overrideDefaultPaymentMethod": "<paymentMethods[].customerVaultId>":
cURL
JavaScript
Surcharge on vault charges
The surcharge for a vault charge is computed server-side from the eligibility stored on the payment
method. Send the base amount (in cents) and expect the surcharge to be added to the captured
total — do not call /rate or add the surcharge yourself.
Vault charge errors
| Code | Message | Cause |
|---|---|---|
902 | VaultId or PaymentToken is required | card.vaultId and card.paymentToken both missing |
906 | Customer with id ... not found | The vault does not exist or belongs to another merchant |
Add a card to an existing customer
To add a new payment method to an existing customer, POST a card object to the customer's card
endpoint. Collect a fresh paymentToken first. The added card does not become the default — use
the PATCH .../default endpoint above to change it:
cURL
The route is /customer/card/{id} — /customer/{id}/card returns 404.
List customers
cURL
The default limit is 10. Use page and limit to paginate; limit=0 returns all records and
keyword filters by name or email. List responses carry a meta block alongside data:
List response
See Pagination & Filtering for details.
Next steps
- Tokenization — where
paymentToken, maskednumberandexpcome from - Surcharge Payments — how surcharge applies to token vs. vault charges
- Pagination & Filtering — query large customer lists efficiently
- API Reference → Customers — full endpoint documentation

