Store a card
Stores card details in the vault and returns a vault_token that represents the card. Use it to authenticate a transaction, and store it for one-click and recurring payments.
Get the setup_token from the payment_method_details of the transaction when you create the order. It works once, within 300 seconds after the order was created.
You need to be PCI DSS compliant to send card data to this endpoint. See Server-to-server.
apiKeyAuthorizationBasic <token>Use your project's API key as the username and leave the password empty. Only use the API key from your server: it gives full access to your project.
application/json- body
name?stringCardholder name as printed on the card.
1 <= length <= 120pan*stringCard number without spaces.
^[0-9]{12,19}$expiry*stringExpiry date in MMYYYY format, such as 012030 for January 2030.
^(0[1-9]|1[0-2])[0-9]{4}$setup_token*stringThe setup_token from the payment_method_details of the transaction.
uuidThe card has been stored.
application/json- response
vault_token?stringToken that represents the card. Store it to use the card again.
uuidtruncated_pan?stringMasked card number.
brand?stringDetected card brand, such as visa.
brands?array<string>All brands detected for the card.
curl -X POST 'https://tokens.dev.gingerpayments.com/v1/cards/' \ -H 'Content-Type: application/json' \ -d '{ "name": "John Smith", "pan": "4111111111111111", "expiry": "012030", "setup_token": "87f05a5d-1755-48c7-8161-f8a9544e56bf"}'{ "vault_token": "d972dc43-6a3d-4dcf-b54e-6e9a0fe325e3", "truncated_pan": "4111********1111", "brand": "visa", "brands": [ "visa" ]}