Implement Credit Card Checkout
Developers can use this documentation to tokenize credit cards when using our card checkout APIs.
How to Tokenize Credit Cards
To learn more about credit card tokenization, please refer to our detailed guide. Alternatively, you can follow the below step-by-step guide to learn how to tokenize a credit card when using Coinflow’s card checkout endpoints.
There are three primary endpoints you will use when tokenizing credit cards:
Tokenizing a Card for a Customer’s First Purchase
- Build a form for the New Card Checkout. This form will require the below fields as specified in the New Card Checkout endpoint:
- cardToken
- expYear
- expMonth
- firstName
- lastName
- address1
- city
- zip
- state
- country
- To obtain the
cardTokenparam, have the end-user fill out the<CoinflowCardNumberInput />and<CoinflowCvvInput />fields, then callcoinflowCardFormRef.current?.getToken(). Below is an example of how to implement this:
- The
getToken()function returns a token associated with the CVV, which can then be passed into thecard.cardTokenparam when making a request to the New Card Checkout Endpoint.
Refreshing a Tokenized Card on a Saved Card Purchase
- To allow a customer to purchase using a saved card, you’ll need to fetch the customer’s saved cards by calling the Get Customer endpoint.
- Access the end-user’s tokenized credit card from the response:
cards[0].token
- Create a CVV input field with the selected saved card’s token passed in. Below is an example of how to implement this:
- Calling
getToken()will return a new token that can be used to make a purchase with the saved card by calling the Saved Card Checkout endpoint.
Token Expiration
Tokens expire if not used within 7 days of creation. Once used, a token is valid for 5 minutes (in production; in the sandbox environment, the token remains valid). If a token expires, it will need to be regenerated.

