● Payment methods and vault · /v1 Payment methods and vault
Card data lives only in the vault; your systems hold nothing but a token. Reuse, set as default, delete.
POST /v1/vault/methods/{token}/store
Promote a single-use method into a reusable token bound to a customer. The card number reaches neither your database nor our business database.
Path parameters
Headers
Idempotency-Keyrequired | string | A unique string you generate (UUID/ULID recommended). Replaying the same key within 24 hours returns the original result and never creates a second payment. |
Body
customer_uidrequired | string | |
Response 200
token | string | Vault reference. This is the only value your systems should store. |
type | string | |
is_default | boolean | |
card_brand | string | |
card_last4 | string | |
card_exp_month | integer | |
card_exp_year | integer | |
network_token | boolean | Whether it has been upgraded to a network token (survives card replacement) |
customer_uid | string | |
created_at | string<date-time> | |
Request
curl -X POST https://api.baton.example/v1/vault/methods/{token}/store \
-H "Authorization: Bearer sk_live_xxx" \
-H "Idempotency-Key: 01J8ZQ4T7M2K9F3B" \
-H "X-Timestamp: 1763280000" -H "X-Nonce: 7f3a" -H "X-Signature: v1=..." \
-H "Content-Type: application/json" \
-d '{
"customer_uid": "CUS20261116000041"
}' POST /v1/vault/methods/{token}/default
Path parameters
Headers
Idempotency-Keyrequired | string | A unique string you generate (UUID/ULID recommended). Replaying the same key within 24 hours returns the original result and never creates a second payment. |
Response 200
token | string | Vault reference. This is the only value your systems should store. |
type | string | |
is_default | boolean | |
card_brand | string | |
card_last4 | string | |
card_exp_month | integer | |
card_exp_year | integer | |
network_token | boolean | Whether it has been upgraded to a network token (survives card replacement) |
customer_uid | string | |
created_at | string<date-time> | |
Request
curl -X POST https://api.baton.example/v1/vault/methods/{token}/default \
-H "Authorization: Bearer sk_live_xxx" \
-H "Idempotency-Key: 01J8ZQ4T7M2K9F3B" \
-H "X-Timestamp: 1763280000" -H "X-Nonce: 7f3a" -H "X-Signature: v1=..." POST /v1/vault/methods/{token}/delete
Takes effect immediately, though subscription charges already in flight are unaffected. The deletion is written to the audit log.
Path parameters
Response 200
uid | string | |
deleted | boolean | |
Request
curl -X POST https://api.baton.example/v1/vault/methods/{token}/delete \
-H "Authorization: Bearer sk_live_xxx" \
-H "X-Timestamp: 1763280000" -H "X-Nonce: 7f3a" -H "X-Signature: v1=..."