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 Accept a card payment.
application/json- body
name?stringCardholder name as printed on the card, in printable ASCII or Latin-1 characters. Some projects don't allow sending it.
^[\x20-\x7E\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u00FF]+$1 <= length <= 120pan*stringCard number without spaces. It must pass the Luhn check.
^[0-9]{12,19}$expiry?stringExpiry date in MMYYYY format, such as 012030 for January 2030. Send it when you have it.
^(0[1-9]|1[0-2])[0-9]{4}$setup_token*stringThe setup_token from the payment_method_details of the transaction. It works once, within 300 seconds after the order was created.
uuidtransaction_id?stringThe id of the transaction the card is for. Optional, it's stored with the card.
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.prod.smartpay.gingerpayments.com/v1/cards/' \ --user "$API_KEY:" \ -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" ]}