For AI agents: a documentation index is available at the root level at /llms.txt and /llms-full.txt. Append /llms.txt to any URL for a page-level index, or .md for the markdown version of any page.
RegisterLoginSandbox Login
GuidesRecipesAPI Reference
GuidesRecipesAPI Reference
  • Recipes
    • Add 3DS Challenge (Angular)
    • Add Dynamic Height to Coinflow UI Component
    • Add Dynamic Height to Apple Pay Button
    • Add Dynamic Height to Coinflow iframe
    • Add Dynamic Loading to Coinflow iframe
    • Apple Pay Payouts API Implementation
    • Complete Checkout with 3DS Challenge (React)
    • Listen for Purchase Events
    • Listen for Successful Account Link Messages
    • Listen to Client-Side Messages on Swift iOS
    • Listen to Payment Success Messages
    • PCI Compliant Card Tokenization
    • Tokenize Card Data via API for Checkout
    • Tokenize Card Data via API for Debit Card Payouts
    • Tokenize Cards for Saved Card Checkout (Vue)
    • Tokenize Debit Cards for Withdraws
    • Upload files to Coinflow storage
LogoLogo
RegisterLoginSandbox Login
On this page
  • 1. Confirm you have provided Coinflow your PCI DSS certification
  • 2. Tokenize a credit card
  • 3. Call the card checkout endpoint
  • 4. Associate the CVV with Card Token
  • 5. Saved Card Checkout
  • 5b. Saved Card Checkout with Address (Optional)
Recipes

Tokenize Card Data via API for Checkout

Was this page helpful?
Previous

Tokenize Card Data via API for Debit Card Payouts

Next
Built with
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.