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

HeaderDescriptionRequired
AuthorizationBearer token used to authenticate the requestYes
x-merchant-refUnique reference identifying the merchantYes

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&currency=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

FieldDescriptionRequired
user_refReference of the user associated with the collectionYes
txn_merchant_refUnique transaction reference generated by the merchantYes
amountAmount to be collectedYes
currencyCurrency of the paymentYes
full_nameFull name of the customerYes
emailCustomer's email addressYes
phoneCustomer's phone numberYes
chainBlockchain network, where applicableNo
success_messageMessage displayed after a successful paymentNo
payment_methodPayment method. For BlockPay links, use BLOCK_PAY_LINKYes
redirect_urlURL to redirect the customer after paymentYes
notification_urlURL where transaction notifications should be sentYes


Response :

FieldDescription
payment_refUnique reference generated for the BlockPay payment
pay_linkURL for the customer to complete the payment
txn_merchant_refUnique transaction reference generated by the merchant
amountAmount to be collected
currencyCurrency of the payment
redirect_urlURL to redirect the customer after payment
success_messageMessage displayed after a successful payment
pay_dataPayment details returned when applicable; null when not available

Did this page help you?