Tokenize Card Data via API for Checkout

2. Tokenize Card
$//Request to tokenize a credit card given the raw card number and CVV
>curl --location 'https://api-sandbox.coinflow.cash/api/tokenize' \
>--header 'Authorization: coinflow_sandbox_4183b4c3d236435db050daf2703a59aa_ac6f800a6f5642798809f4078e2061df' \
>--header 'accept: application/json' \
>--header 'content-type: application/json' \
>--header 'tx-apikey: jFQQ2yjKrLMcPeQVrBdixtle34nA6YTsYQXSy8Cv' \
>--header 'tx-token-scheme: sixANTOKENfour' \
>--header 'tx-tokenex-id: 4582952996979143' \
>--data '{
> "data":"4111111111111111",
> "cvv":"275"
>}
>'
3. Card Checkout
$//Request to card checkout endpoint w/ tokenized card number
>curl --location 'https://api-sandbox.coinflow.cash/api/checkout/card/testtest' \
>--header 'accept: application/json' \
>--header 'content-type: application/json' \
>--data-raw '
>{
> "subtotal": {
> "currency": "USD",
> "cents": 200
> },
> "card": {
> "cardToken": "411111YJM5TX1111",
> "expYear": "30",
> "expMonth": "10",
> "email": "test@gmail.com",
> "firstName": "Test",
> "lastName": "Test",
> "address1": "201 E Randolph St",
> "city": "Chicago",
> "zip": "60601",
> "state": "IL",
> "country": "US"
> }
>}
>'
4. Associate CVV
$//Request to re-associate a CVV with a previously tokenized card number
>curl --location 'https://api-sandbox.coinflow.cash/api/tokenize/associate-cvv' \
>--header 'Authorization: YOUR_API_KEY' \
>--header 'accept: application/json' \
>--header 'content-type: application/json' \
>--header 'tx-apikey: jFQQ2yjKrLMcPeQVrBdixtle34nA6YTsYQXSy8Cv' \
>--header 'tx-token-scheme: sixANTOKENfour' \
>--header 'tx-tokenex-id: 4582952996979143' \
>--data '{
> "Token": "411111YJM5TX1111",
> "CVV": "275"
>}'
5. Saved Card
$//Request to saved card checkout endpoint w/ tokenized card number
>curl --request POST \
> --url https://api-sandbox.coinflow.cash/api/checkout/token/YOUR_MERCHANT_ID \
> --header 'accept: application/json' \
> --header 'content-type: application/json' \
> --data '
>{
> "subtotal": {
> "currency": "USD",
> "cents": 100
> },
> "token": "411111YJM5TX1111"
>}
>'
Response Example
1//Response
2{
3 "token": "",
4 "firstSix": "",
5 "lastFour": "",
6 "referenceNumber": "2504291850028807806",
7 "success": true,
8 "error": "",
9 "message": "Associated successfully"
10}

1. Confirm you have provided Coinflow your PCI DSS certification

WARNING - If you have not provided Coinflow your PCI DSS certification you will not be eligible to access this endpoint

2. Tokenize a credit card

Pass the raw credit card number and CVV. You will receive a tokenized card number.

3. Call the card checkout endpoint

Pass the token received in the response to the “Card Checkout"" endpoint

4. Associate the CVV with Card Token

A returning payer needs to reassociate their CVV with their card token.

5. Saved Card Checkout

After reassociating a CVV with the card token, a payer may complete their payment using the refreshed token.

5b. Saved Card Checkout with Address (Optional)

If a card was saved without address information and your merchant account has AVS or Chargeback Protection enabled, you will receive a 422 Address Required error. In this case, include the address object in your request to provide the billing address.

The address values shown are example placeholder values. Replace them with the actual customer billing address information.

Address collection is only required when AVS or Chargeback Protection is enabled on your merchant account. If both are disabled, you can process saved card checkouts without providing address information. Contact the Coinflow integrations team to configure these settings.