Create link
Creates a BlockPay payment link that can be shared with a customer to complete a payment.
The merchant specifies the amount, currency, customer details, and payment configuration. LedgerBlock returns a unique payment reference and a hosted checkout link.
Make sure you create a wallet for the user before making a call for the blockpay link.
The wallet you create is where the money will be settled
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 |
Request Body
{
"user_ref": "USR_TEST_001",
"txn_merchant_ref": "TXN_TEST_BP_001",
"amount": 250,
"currency": "NGN",
"full_name": "Test Customer",
"email": "[email protected]",
"phone": "08000000000",
"chain": "",
"success_message": "Payment successful",
"payment_method": "BLOCK_PAY_LINK",
"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-001",
"pay_link": "https://blockpay.example.com/checkout?ref=BPAY-TEST-001¤cy=NGN&amount=250&txn_ref=TXN_TEST_BP_001",
"txn_merchant_ref": "TXN_TEST_BP_001",
"amount": 250,
"currency": "NGN",
"redirect_url": "https://example.com/payment/success",
"success_message": "Payment successful",
"pay_data": null
}
}
Example request
| Field | Description | Required |
|---|---|---|
user_ref | Reference of the user associated with the collection | Yes |
txn_merchant_ref | Unique transaction reference generated by the merchant | Yes |
amount | Amount to be collected | Yes |
currency | Currency of the payment | Yes |
full_name | Full name of the customer | Yes |
email | Customer's email address | Yes |
phone | Customer's phone number | Yes |
chain | Blockchain network, where applicable | No |
success_message | Message displayed after a successful payment | No |
payment_method | Payment method. For BlockPay links, use BLOCK_PAY_LINK | Yes |
redirect_url | URL to redirect the customer after payment | Yes |
notification_url | URL where transaction notifications should be sent | Yes |
Response :
| Field | Description |
|---|---|
payment_ref | Unique reference generated for the BlockPay payment |
pay_link | URL for the customer to complete the payment |
txn_merchant_ref | Unique transaction reference generated by the merchant |
amount | Amount to be collected |
currency | Currency of the payment |
redirect_url | URL to redirect the customer after payment |
success_message | Message displayed after a successful payment |
pay_data | Payment details returned when applicable; null when not available |
Updated 15 days ago
Did this page help you?
