Create a payment request through the API
To create a payment request through the API, use the /payments/requests endpoint. In the response, you will get a payment link to share with your customer. You can redirect them to this URL in the same or a new tab, or you can also embed it as an iFrame for a quick on-page checkout.About currency codes
For currency ISOs and network names, refer to the list below:Currency codes and networks
Currency codes and networks
| Currency ISO | Network name |
|---|---|
| ADA | cardano |
| BCH | bitcoin_cash |
| BNB-BSC | binance |
| BTC | bitcoin |
| DOGE | dogecoin |
| ETH | ethereum |
| EURS | ethereum |
| LTC | litecoin |
| SNACK | binance |
| SOL | solana |
| TRX | tron |
| USDC | ethereum, solana, polygon, binance, |
| USDT | ethereum, binance, solana, tron, ton, polygon |
| BSV | bitcoin_sv |
| DAI | ethereum |
| CHZ | ethereum |
| TFS | ethereum |
| TON | ton |
| XED | ethereum |
| XRP | ripple |
| BXBT | ethereum |
| MNEE | ethereum |
| USDG | ethereum, solana |
| EURC | ethereum, solana |
| POL | polygon |
currency object. This is the currency you want to receive.
- Sample object (cryptocurrency)
- Sample object (fiat currency)
payment_currency object, which is the currency your customer will pay in. We recommend that you only use this if you prompt your customer for their preferred currency in your app’s interface before you share the payment request with them.
You can preselect both the currency and network or just the currency. If you only include the currency ISO, your customer will be prompted to choose their preferred network. For example, if you preselect USDT, your customer will be able to choose whether they want to pay in USDT based on the Ethereum, Solana, Tron or any other blockchains. CryptoProcessing will still bridge the deposit to your preferred network (that you set in the currency object).
- Preselecting the payment currency and network
- Preselecting the payment currency
Create a payment request
Step 1. Complete your onboarding
Complete your onboarding in your merchant dashboard and generate an API key. For more details on how to create an API key, see Get your API key.
Step 2. Create a payment request
Send a request to the /payments/v1/requests API endpoint. For details on all the required and optional parameters, see the endpoint page.
When you’re setting your payment request’s lifespan, make sure your customer will have enough time to place the payment and have their transaction confirmed. If it’s not confirmed in time, the payment request will be refunded automatically. We recommend setting a lifespan of at least 1 hour. For more details, see Payment requests with short and long lifespans.
We also recommend setting the
When you’re setting your payment request’s lifespan, make sure your customer will have enough time to place the payment and have their transaction confirmed. If it’s not confirmed in time, the payment request will be refunded automatically. We recommend setting a lifespan of at least 1 hour. For more details, see Payment requests with short and long lifespans.
We also recommend setting the
url_store, url_success and url_failed parameters to help your customer get back to your site at any stage.Step 4. Display the payment request link to your customer
Depending on your payment flow, you can:
- navigate the customer to the payment request link in a new tab,
- generate a QR code based on the payment request link and display it to your customer,
- embed the payment link as an iFrame for quick on-page checkout.
Step 5. Process callbacks
You’ll get callbacks with detailed metadata for most payment request events. For more details on payment request callbacks, see Payment request callbacks.
Integration tips
- For the currency object, the currency ticker is always required. If you chose a cryptocurrency, you need to also include the network name. Do not include the network name for fiat currencies. For more details on currency and network codes, see Currency codes.
- When you set the payment request lifespan (
life_time_date_timeorlife_time_duration), make sure your customer will have enough time to place the payment. We recommend setting the lifespan to at least 15 minutes. If your customers can pay in currencies on networks with higher confirmation times (such as BTC), consider setting the lifespan to at least an hour.
Create a payment request in your merchant dashboard
If you create a payment request through your merchant dashboard, you won’t be able to set a specific currency your customer will have to pay in (
payment_currency in the API). CryptoProcessing will still convert your customer’s payment to your preferred currency.Set a lifespan for your payment request. This can be either a duration (for example, 15 minutes or 10 hours) or a deadline. Optionally, include a short description and your customer’s email.