Crypto
Creates a BlockPay payment link configured for crypto as the payment channel.
For crypto payments, the currency specifies the cryptocurrency being collected, while chain specifies the blockchain network on which the payment should be made.
Endpoint
POST /api/v1/collection/blockpay-link
Authorization
Bearer Token
A valid Bearer Token is required.
Headers
| Header | Description | Required |
|---|---|---|
Authorization | Bearer token used to authenticate the request | Yes |
x-merchant-ref | Unique reference identifying the merchant | Yes |
Content-Type | Specifies that the request body is JSON | Yes |
Request
{
"user_ref": "USR_TEST_003",
"txn_merchant_ref": "TXN_TEST_CRYPTO_001",
"amount": 2,
"currency": "USDT",
"full_name": "Test Customer",
"email": "[email protected]",
"phone": "08000000002",
"chain": "POL",
"success_message": "Payment successful",
"payment_method": "BLOCK_PAY_LINK",
"payment_channel": "CRYPTO",
"redirect_url": "https://example.com/payment/success",
"notification_url": "https://example.com/webhooks/payment"
}Response
{
"status": "success",
"message": "BlockPay link created successfully",
"data": {
"payment_ref": "BPAY-TEST-CRYPTO-001",
"pay_link": "https://blockpay.example.com/checkout?ref=BPAY-TEST-CRYPTO-001¤cy=USDT%3APOL&amount=2&txn_ref=TXN_TEST_CRYPTO_001",
"txn_merchant_ref": "TXN_TEST_CRYPTO_001",
"amount": 2,
"currency": "USDT",
"redirect_url": "https://example.com/payment/success",
"success_message": "Payment successful",
"pay_data": null
}
}Response Fields
| Field | Description |
|---|---|
status | Indicates whether the payment link was created successfully. |
message | Describes the result of the request. |
data.payment_ref | Unique payment reference generated for the BlockPay transaction. |
data.pay_link | Hosted BlockPay checkout URL that can be shared with the customer. |
data.txn_merchant_ref | Merchant's transaction reference supplied in the request. |
data.amount | Amount of cryptocurrency to be collected. |
data.currency | Cryptocurrency specified for the payment. |
data.redirect_url | URL where the customer is redirected after completing the payment. |
data.success_message | Message configured to be displayed after successful payment. |
data.pay_data | Additional payment data. Returns null when no additional data is available. |
How It Works
- The merchant creates a BlockPay payment link.
payment_channelis set toCRYPTO.- The merchant specifies the cryptocurrency in
currency. - The merchant specifies the blockchain network in
chain. - LedgerBlock generates a unique payment reference and hosted payment link.
- The merchant shares the
pay_linkwith the customer. - The customer opens the link and completes the crypto payment on the specified network.
- The customer is redirected to the configured
redirect_urlafter payment. - Transaction updates are sent to the configured
notification_url.
Currency and Chain
For crypto collections, the currency and chain work together to identify the asset and network.
Example:
currency: USDT
chain: POLThis represents a USDT payment on the POL network.
The generated payment link reflects this combination:
USDT:POLUse Cases
The Crypto payment link can be used to:
- Collect cryptocurrency payments from customers.
- Generate a hosted crypto checkout page.
- Specify the blockchain network for the payment.
- Accept supported crypto assets through BlockPay.
- Track payments using a merchant transaction reference.
- Receive transaction updates through a notification URL.
Note: All values in the request and response examples are dummy data for documentation purposes. Replace them with your actual values when making API requests.
Updated 20 days ago
Did this page help you?
