Web3 merchants can learn how to pass the appropriate headers when sending API requests.
Server-to-Server Request Headers
Web3 merchants must include an Authorization header containing their API key when making API requests. This is required for accessing endpoints such as Merchant, Authentication, and Utilities.
To start sending API requests:
- Go to the Merchant Dashboard > API Keys > Create.
- Make a Request with Authorization Key.
Example Implementation
// Request for Getting Merchant Withdraws using API Key as Authorization Header
curl --request GET \
--url https://api-sandbox.coinflow.cash/api/merchant/withdraws \
--header 'Authorization: coinflow_sandbox_YOUR_API_KEY' \
--header 'accept: application/json'Client-to-Server Request Headers
Web3 merchants must include x-coinflow-auth-wallet and x-coinflow-auth-blockchain in the Authorization header when making client requests. These headers should contain the customer's wallet address and blockchain, respectively, and are required for accessing endpoints such as Checkout, Customers, Subscriptions, and Withdraw.
x-coinflow-auth-wallet references the end-user's wallet address and x-coinflow-auth-blockchain references the blockchain the Merchant is on.
To create a session key, Merchants must:
- Generate an API Key from
Merchant Dashboard>API Keys>Create. - Make a Client Request with
x-coinflow-auth-walletandx-coinflow-auth-blockchainheaders.
Example Implementation
// Example request with wallet and blockchain headers
curl --request GET \
--url https://api-sandbox.coinflow.cash/api/customer/v2 \
--header 'accept: application/json' \
--header 'x-coinflow-auth-blockchain: solana' \
--header 'x-coinflow-auth-wallet: 9rpv2W6qyShwcwTgZXpiFuC5kFGYpzhYugmpKK5Ls4Kt'
// Examples response with wallet and blockchain headers
{
"customer": {
"_id": "65e74467d7fd30773bdc531d",
"blockchain": "solana",
"email": "[email protected]",
"isBlocked": "NotBlocked",
"chargebackProtectionEnabled": false,
"createdAt": "2024-03-05T16:12:23.356Z",
"__v": 0,
"merchant": "63c73b64fe798b3fdb56e3af",
"failedAttemptSetting": "Standard",
"verificationSetting": "Enforced",
"exempt3DS": false,
"customerId": "9rpv2W6qyShwcwTgZXpiFuC5kFGYpzhYugmpKK5Ls4Kt",
"bankAccounts": [
{
"alias": "Plaid Saving 1111",
"token": "5e8c9682-41d4-4132-8360-088da66170e5",
"routingNumber": "011401533",
"last4": "1111",
"accountHash": "171e7a6868b9c2b1b3ae64ab39e2660252dc90b4",
"rtpEligible": true,
"reference": "666886ad30fd8f1205e77841",
"isDeleted": false
},
{
"alias": "Plaid Checking 0000",
"token": "e981d85b-21ec-45bf-9d23-fb80acca510a",
"routingNumber": "011401533",
"last4": "0000",
"accountHash": "a66621183ad216e4543f9004426a263ad58385f9",
"rtpEligible": true,
"reference": "666886ad30fd8f1205e77841",
"isDeleted": false
}
]
}
}