๐Ÿง‘โ€๐Ÿ’ป SEPA / UK Faster Payments Integration

Developers can use the following guide to learn how to use our apis to implement SEPA & UK Faster Payments.

Overview

Developers can use the following guide to learn how to use our apis to implement SEPA & UK Faster Payments.

Implementation

UI Implementation (Option 1)

  1. Generate a Checkout Link
    This endpoint will generate a url which can be added to an iframe.
curl --request POST \
     --url https://api-sandbox.coinflow.cash/api/checkout/link \
     --header 'Authorization: YOUR_API_KEY' \
     --header 'accept: application/json' \
     --header 'content-type: application/json' \
     --header 'x-coinflow-auth-user-id: somecustomer' \
     --data '
{
  "subtotal": {
    "currency": "EUR",
    "cents": 100
  },
  "email": "[email protected]",
  "settlementType": "USDC",
  "supportEmail": "[email protected]"
}
'
{
  "link": "https://sandbox.coinflow.cash/solana/purchase-v2/testtest?sessionKey=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJjdXN0b21lcklkIjoic29tZWN1c3RvbWVyIiwibWVyY2hhbnRJZCI6InRlc3R0ZXN0IiwiaWF0IjoxNzM0NTU2ODg5LCJleHAiOjE3MzQ2NDMyODl9.g2394W9cshwwNqw1SgRYcg5FU0PJH4lu8mzKckkZTng&cents=100&currency=EUR&email=customer%40gmail.com&jwtToken=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJkYXRhIjoi456C4oKW26LXgtuA44yD44Cd6IKmxLHkhozpgKPhk7DGgcKY06Dhg4DkmLXriLLroLTstZLtnKXjoYDahOOQg-ubgOCngOKegNyA4rqYworlgpnkmLws54Sq6ZuJ5ICH4Yql6ZCT5YOO5KSS54ul5KeC5aGl5biA6rOk7YKm47qG75ib5Jet4YWP55ya5b-k7oqQ6o2S66Sg4oWr5o2T6YGj5Y-o6oW76Y-p64Oa6YCiXHVkOGEwXHVkODNh5q2S5YSr64SZ4YeB4Ymh5J2Q4aeEXHVkOTIwXHVkYTY54YGh4q2Q6oqQ5oSR4ZC04oih4Y-Q4oGg4oGV6ouR7Jmo5o2g6omp4oij6Yu17I2R4qOa5YSU4aeg5oSj5qSo75qS7YqN5JqS5YGg5oi36YOM6oqm6Yei6bSp4aSq2armo7XhhKPlh4LugqPrrZHhipDpg5nipKLutrRcdWQ4ZTLnpJ3hmYTilLbhrqDni4Ppg7DpkLrjjJfkkqLih6DtgoPhiLTihIrmmpnuh4jqvKPipIbshobkoKTtgIjktJzkmaTomIXpoKjlpIrqs5vKouqpkeKihOawguGHhuiJkualiOGQl-Ckg-C7lOuvguCip-K0vsSC7LOz5YGc4rKv6bCT5KWH4pqs5oi75oa37KOk54uB7oSi5KGz44ST6aGB64eh5IWI67Ge4LiD5KuD57KU6pqn67i66Kaj6IWj4qKY66yd4KyW4rK54YOlXHVkODMz4b-I5oGQ4oC54aaV45C54r2D442B66CQ5KKk4LuY6oqB6oqa6aCZ4baU5ZSt6JOQ46SW6Ju646Sb4LaC5oyU746V46qs7Kat6Y247qOQ6KGt5p-c6KC365Ot75Kz4r614a2v4rWm5qy85YeO4KqTXHVkZDcx5I-i4omZ5KGX5ZKK4ZeI66Cu6aK55JmH5ImT5Ieh45C25qiq0pbomajsnpLplJvGvu6eiVx1MDAwMeeygFx1MDAwMCIsIm1lcmNoYW50SWQiOiJ0ZXN0dGVzdCIsImlkZW1wb3RlbmN5S2V5IjoiSUtjNjJmZmFjNC0wZjgzLTQ3NGItODNhMi1mNzdlMmJlZTQ0OTQiLCJzdWJ0b3RhbCI6eyJjdXJyZW5jeSI6IkVVUiIsImNlbnRzIjoxMDB9LCJpYXQiOjE3MzQ1NTY4ODksImV4cCI6MTczNDY0MzI4OX0.dOQ0ucyMj8b9lyQklKtxILbRdnaSWqlpHK-ZH-2go5Q"
}
  1. Place the webpage in an iframe
    Below is an example of how you can put the returned checkout link in an iframe and display Coinflow's checkout modal to the end user. To quickly test a proof of concept, you may add the url here.
<iframe src="https://sandbox.coinflow.cash/solana/purchase-v2/testtest?sessionKey=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJjdXN0b21lcklkIjoic29tZWN1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Kz4r614a2v4rWm5qy85YeO4KqTXHVkZDcx5I-i4omZ5KGX5ZKK4ZeI66Cu6aK55JmH5ImT5Ieh45C25qiq0pbomajsnpLplJvGvu6eiVx1MDAwMeeygFx1MDAwMCIsIm1lcmNoYW50SWQiOiJ0ZXN0dGVzdCIsImlkZW1wb3RlbmN5S2V5IjoiSUtjNjJmZmFjNC0wZjgzLTQ3NGItODNhMi1mNzdlMmJlZTQ0OTQiLCJzdWJ0b3RhbCI6eyJjdXJyZW5jeSI6IkVVUiIsImNlbnRzIjoxMDB9LCJpYXQiOjE3MzQ1NTY4ODksImV4cCI6MTczNDY0MzI4OX0.dOQ0ucyMj8b9lyQklKtxILbRdnaSWqlpHK-ZH-2go5Q" width="100%" height="400" />


UI Implementation (Option 2)

Approvely provides SDKs for react, vue, angular, and react native. You can easily integrate our components into your application by following the steps below.


//Example implementation for React & React Native

<CoinflowPurchase
      sessionKey={'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJjdXN0b21lcklkIjoidXNlcjEyMyIsIm1lcmNoYW50SWQiOiJ0ZXN0dGVzdCIsImlhdCI6MTczNDU0NjU1OCwiZXhwIjoxNzM0NjMyOTU4fQ.DWFJgywBgzOUydudQAWp3L55aTjohfASRZ_0ZuRc04w'} // Get this from Create a session key endpoint
      merchantId={'YOUR_MERCHANT_ID'}
      env={'sandbox'}
      subtotal={{
        "currency": Currency.EUR, // Change to GBP for UK Faster Payment
        "cents": 200
       }}
      onSuccess={(...args) => {
        console.log('Purchase Success');
      }}
      email={'[email protected]'} // customers email address
      webhookInfo={{item: 'sword'}}
      settlementType={SettlementType.USDC}
    />

API Implementation

  1. Create a session key
    This endpoint returns a JWT that is unique to the customer. When calling this endpoint, the x-coinflow-auth-user-id can be any unique customer identifier string that you, the Merchant, uses to identify the buyer.

curl --request GET \
     --url https://api-sandbox.coinflow.cash/api/auth/session-key \
     --header 'Authorization: YOUR_API_KEY' \
     --header 'accept: application/json' \
     --header 'x-coinflow-auth-user-id: user123'
{
  "key": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJjdXN0b21lcklkIjoidXNlcjEyMyIsIm1lcmNoYW50SWQiOiJ0ZXN0dGVzdCIsImlhdCI6MTczNDU0NjU1OCwiZXhwIjoxNzM0NjMyOTU4fQ.DWFJgywBgzOUydudQAWp3L55aTjohfASRZ_0ZuRc04w"
}
  1. Get Totals
    This endpoint will allow you to show total purchase price after all fees.
// This is an example request for UK Faster Payments

curl --request POST \
  --url https://api-sandbox.coinflow.cash/api/checkout/totals/testtest \
  --header 'accept: application/json' \
  --header 'content-type: application/json' \
  --header 'x-coinflow-auth-session-key: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJjdXN0b21lcklkIjoidXNlcjEyMyIsIm1lcmNoYW50SWQiOiJ0ZXN0dGVzdCIsImlhdCI6MTczNDU0NjU1OCwiZXhwIjoxNzM0NjMyOTU4fQ.DWFJgywBgzOUydudQAWp3L55aTjohfASRZ_0ZuRc04w' \
  --data '
{
"subtotal": {
 "currency": "GBP",
 "cents": 200
},
"settlementType": "USDC"
}
'
// This is an example response for UK Faster Payments

{
"fasterPayments": {
 "subtotal": {
   "currency": "GBP",
   "cents": 200
 },
 "creditCardFees": {
   "cents": 200,
   "currency": "GBP"
 },
 "chargebackProtectionFees": {
   "cents": 0,
   "currency": "GBP"
 },
 "gasFees": {
   "cents": 0,
   "currency": "GBP"
 },
 "total": {
   "cents": 400,
   "currency": "GBP"
 },
 "settlement": {
   "subtotal": {
     "cents": 254,
     "currency": "USD"
   },
   "creditCardFees": {
     "cents": 255,
     "currency": "USD"
   },
   "chargebackProtectionFees": {
     "cents": 0,
     "currency": "USD"
   },
   "gasFees": {
     "cents": 0,
     "currency": "USD"
   },
   "total": {
     "cents": 509,
     "currency": "USD"
   }
 },
 "exchangeRate": 0.787071
}
}
// This is an example request for SEPA payment

curl --location 'https://api-sandbox.coinflow.cash/api/checkout/totals/testtest' \
--header 'accept: application/json' \
--header 'content-type: application/json' \
--header 'x-coinflow-auth-session-key: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJjdXN0b21lcklkIjoidXNlcjEyMyIsIm1lcmNoYW50SWQiOiJ0ZXN0dGVzdCIsImlhdCI6MTczNDU0NjU1OCwiZXhwIjoxNzM0NjMyOTU4fQ.DWFJgywBgzOUydudQAWp3L55aTjohfASRZ_0ZuRc04w' \
--data '
{
"subtotal": {
 "currency": "EUR",
 "cents": 200
},
"settlementType": "USDC"
}
'
// This is an example response for SEPA payment

{
    "sepa": {
        "subtotal": {
            "currency": "EUR",
            "cents": 200
        },
        "creditCardFees": {
            "cents": 200,
            "currency": "EUR"
        },
        "chargebackProtectionFees": {
            "cents": 0,
            "currency": "EUR"
        },
        "gasFees": {
            "cents": 0,
            "currency": "EUR"
        },
        "total": {
            "cents": 400,
            "currency": "EUR"
        },
        "settlement": {
            "subtotal": {
                "cents": 209,
                "currency": "USD"
            },
            "creditCardFees": {
                "cents": 210,
                "currency": "USD"
            },
            "chargebackProtectionFees": {
                "cents": 0,
                "currency": "USD"
            },
            "gasFees": {
                "cents": 0,
                "currency": "USD"
            },
            "total": {
                "cents": 419,
                "currency": "USD"
            }
        },
        "exchangeRate": 0.953588
    }
}
  1. Complete a new SEPA/UK Faster Payment
    This endpoint should be utilized by new customers who has never completed a payment or does not have a tokenized IBAN. This endpoint will tokenize their IBAN details, create the customer record, and return payment details which the customer will need to complete the purchase from their banking app.

๐Ÿ“˜

The presentment currency is specific to the chosen payment method.

For example, prices are displayed in GBP if the payment method is UK Faster Payments, and euros for SEPA transfers.

If you pass subtotals.currency = GBP for a SEPA transfer or , you will get an currency is not supported for payment method error.

// This is an example request for UK Faster Payments

curl --request POST \
  --url https://api-sandbox.coinflow.cash/api/checkout/iban \
  --header 'accept: application/json' \
  --header 'content-type: application/json' \
  --header 'x-coinflow-auth-session-key: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJjdXN0b21lcklkIjoidXNlcjEyMyIsIm1lcmNoYW50SWQiOiJ0ZXN0dGVzdCIsImlhdCI6MTczNDU0NjU1OCwiZXhwIjoxNzM0NjMyOTU4fQ.DWFJgywBgzOUydudQAWp3L55aTjohfASRZ_0ZuRc04w' \
  --data '
{
"webhookInfo": {
 "example": "{\"productId\": \"123abc\"}"
},
"subtotal": {
 "currency": "GBP", // Change to EUR for SEPA payment
 "cents": 200
},
"data": {
 "number": "26207729",
 "sortCode": "560029", // Optional: Sort code is only required for UK Faster Payment
 "firstName": "Dwayne",
 "lastName": "Johnson",
 "country": "GB",
 "email": "[email protected]"
},
"settlementType": "USDC",
"merchantId": "testtest"
}
'
// This is an example response for UK Faster Payments

{
"paymentId": "143e5f45-1d44-444f-9229-67224a840b5d",
"due": "2024-12-18T18:48:40.729Z",
"sortCode": "000000",
"account": "04188581",
"expires": "2024-12-18T18:48:40.729Z",
"amount": {
 "cents": 400,
 "currency": "GBP"
}
}
  
// This is an example request for SEPA

curl --location 'https://api-sandbox.coinflow.cash/api/checkout/iban' \
--header 'accept: application/json' \
--header 'content-type: application/json' \
--header 'x-coinflow-auth-session-key: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJjdXN0b21lcklkIjoidXNlcjEyMyIsIm1lcmNoYW50SWQiOiJ0ZXN0dGVzdCIsImlhdCI6MTczNDU0NjU1OCwiZXhwIjoxNzM0NjMyOTU4fQ.DWFJgywBgzOUydudQAWp3L55aTjohfASRZ_0ZuRc04w' \
--data-raw '
{
"webhookInfo": {
 "example": "{\"productId\": \"123abc\"}"
},
"subtotal": {
 "currency": "EUR", 
 "cents": 200
},
"data": {
 "number": "IT69T0300203280889389523223",
 "firstName": "Dwayne",
 "lastName": "Johnson",
 "country": "IT",
 "email": "[email protected]"
},
"settlementType": "USDC",
"merchantId": "testtest"
}
'
// This is an example response for SEPA

{
    "paymentId": "6f27d53e-e60a-4435-a333-2332937e62fc",
    "due": "2024-12-18T20:05:07.403Z",
    "account": "GB30MOCK00000004188615",
    "expires": "2024-12-18T20:05:07.403Z",
    "amount": {
        "cents": 400,
        "currency": "EUR"
    }
}

Display the response details to the customer and prompt them to complete the payment by going on their banking app and send the amount to the provided account (include the IBAN account number and/or the sort code).

When the customer has confirmed the payment from their banking app, Merchants will see the payment record status has been updated.

โ—๏ธ

The payment intent record is valid for 5 minutes.

If the customer has not completed the payment within 5 minutes, the payment status will be marked as expired.

  1. Get Customer to retrieve a tokenized IBAN
    This endpoint gets all details associated with the customer, including any of their previously used payment methods.
// This is an example request for UK Faster Payments

curl --request GET \
  --url https://api-sandbox.coinflow.cash/api/customer/v2 \
  --header 'accept: application/json' \
  --header 'x-coinflow-auth-session-key: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJjdXN0b21lcklkIjoidXNlcjEyMyIsIm1lcmNoYW50SWQiOiJ0ZXN0dGVzdCIsImlhdCI6MTczNDU0NjU1OCwiZXhwIjoxNzM0NjMyOTU4fQ.DWFJgywBgzOUydudQAWp3L55aTjohfASRZ_0ZuRc04w'
// This is an example response for UK Faster Payments

{
"customer": {
 "_id": "673cb1779f9ca25383093dfb",
 "customerId": "user123",
 "blockchain": "user",
 "email": "[email protected]",
 "isBlocked": "NotBlocked",
 "chargebackProtectionEnabled": true,
 "merchant": "66311727a26b3cb28faaf97d",
 "failedAttemptSetting": "Standard",
 "verificationSetting": "Enforced",
 "exempt3DS": false,
 "createdAt": "2024-12-18T15:40:39.935Z",
 "__v": 0,
 "bankAccounts": [],
 "cards": [],
 "sepas": [],
 "fasterPayments": [
   {
     "alias": "Test UK Acct 729",
     "last4": "7729",
     "accountHash": "2d9fabef7ac3fa893093c9b57db6d18812a73686",
     "token": "549ee4143bb5fe4be1183a4129221c961c5054d41d763ea3f980b7416a7f9204",
     "reference": "673cb1789f9ca25383093e09",
     "sortCode": "560029"
   }
 ]
}
}
// This is an example request for SEPA

curl --request GET \
  --url https://api-sandbox.coinflow.cash/api/customer/v2 \
  --header 'accept: application/json' \
  --header 'x-coinflow-auth-session-key: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJjdXN0b21lcklkIjoidXNlcjEyMyIsIm1lcmNoYW50SWQiOiJ0ZXN0dGVzdCIsImlhdCI6MTczNDU0NjU1OCwiZXhwIjoxNzM0NjMyOTU4fQ.DWFJgywBgzOUydudQAWp3L55aTjohfASRZ_0ZuRc04w'
// This is an example response for SEPA

{
    "customer": {
        "_id": "673cb1779f9ca25383093dfb",
        "customerId": "user123",
        "blockchain": "user",
        "email": "[email protected]",
        "isBlocked": "NotBlocked",
        "chargebackProtectionEnabled": true,
        "merchant": "66311727a26b3cb28faaf97d",
        "failedAttemptSetting": "Standard",
        "verificationSetting": "Enforced",
        "exempt3DS": false,
        "createdAt": "2024-12-18T15:40:39.935Z",
        "__v": 0,
        "bankAccounts": [],
        "cards": [],
        "sepas": [
            {
                "alias": "SEPA Account 3223",
                "last4": "3223",
                "accountHash": "234cd45c150a3977c98ba0755275396a4f957da4",
                "token": "296143c0d6fe6094e1dbdcd4c10ac98bb9bfce04dc0317614c9c125b0d35ced8",
                "reference": "673cb1789f9ca25383093e09"
            }
        ],
        "fasterPayments": []
    }
}

  1. Complete a SEPA/UK Faster Payment with a saved IBAN
    This endpoint should be utilized by existing customers who already have a tokenized IBAN. This endpoint will only return payment details which the customer will need to complete the purchase from their banking app.

๐Ÿ“˜

The presentment currency is specific to the chosen payment method.

For example, prices are displayed in GBP if the payment method is UK Faster Payments, and euros for SEPA transfers.

If you pass subtotals.currency = GBP for a SEPA transfer or , you will get an currency is not supported for payment method error.

// This is an example request for UK Faster Payment

{
  "paymentId": "16374354-83b6-4b2e-9133-7261913c1dbe",
  "due": "2024-12-18T19:22:37.460Z",
  "sortCode": "000000",
  "account": "04188581",
  "expires": "2024-12-18T19:22:37.460Z",
  "amount": {
    "cents": 400,
    "currency": "GBP"
  }
}
// This is an example request for SEPA

curl --location 'https://api-sandbox.coinflow.cash/api/checkout/iban/token' \
--header 'accept: application/json' \
--header 'content-type: application/json' \
--header 'x-coinflow-auth-session-key: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJjdXN0b21lcklkIjoidXNlcjEyMyIsIm1lcmNoYW50SWQiOiJ0ZXN0dGVzdCIsImlhdCI6MTczNDU0NjU1OCwiZXhwIjoxNzM0NjMyOTU4fQ.DWFJgywBgzOUydudQAWp3L55aTjohfASRZ_0ZuRc04w' \
--data '
{
  "webhookInfo": {
    "example": "{\"productId\": \"123abc\"}"
  },
  "subtotal": {
    "currency": "EUR", // Change to GBP for UK Faster Payment
    "cents": 200
  },
  "token": "296143c0d6fe6094e1dbdcd4c10ac98bb9bfce04dc0317614c9c125b0d35ced8", // Get this from calling Get Customer (sepas[0].token)
  "merchantId": "testtest",
  "settlementType": "USDC"
}
'
// This is an example response for SEPA

{
    "paymentId": "f7d62dda-71c4-44f5-85ee-e701fd0565ba",
    "due": "2024-12-18T20:12:12.300Z",
    "account": "GB30MOCK00000004188615",
    "expires": "2024-12-18T20:12:12.300Z",
    "amount": {
        "cents": 400,
        "currency": "EUR"
    }
}

Display the response details to the customer and prompt them to complete the payment by going on their banking app and send the amount to the provided account (include the IBAN account number and/or the sort code).

When the customer has confirmed the payment from their banking app, Merchants will see the payment record status has been updated.

โ—๏ธ

The payment intent record is valid for 5 minutes.

If the customer has not completed the payment within 5 minutes, the payment status will be marked as expired.