NGN ( Bank Transfer )

Creates a BlockPay payment link configured for bank transfer as the payment channel.

The merchant provides the transaction and customer details, while payment_channel is set to BANK_TRANSFER. LedgerBlock returns a hosted payment link that the customer can use to complete the bank transfer.

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
Content-TypeSpecifies that the request body is JSONYes

Request Body

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
payment_channelSpecifies the payment channel. Use BANK_TRANSFER for bank transfer paymentsYes
redirect_urlURL to redirect the customer after paymentYes
notification_urlURL where transaction notifications should be sentYes

Request

curl --location -g '{{base_url}}/api/v1/collection/blockpay-link' \
--header 'Authorization: Bearer <token>' \
--header 'x-merchant-ref: {{vault:x-merchant-ref}}' \
--header 'Content-Type: application/json' \
--data '{
    "user_ref": "USR_TEST_002",
    "txn_merchant_ref": "TXN_TEST_BANK_001",
    "amount": 200,
    "currency": "NGN",
    "full_name": "Test Customer",
    "email": "[email protected]",
    "phone": "08000000001",
    "chain": "",
    "success_message": "Payment successful",
    "payment_method": "BLOCK_PAY_LINK",
    "payment_channel": "BANK_TRANSFER",
    "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-BANK-001",
    "pay_link": "https://blockpay.example.com/checkout?ref=BPAY-TEST-BANK-001&currency=NGN&amount=200&txn_ref=TXN_TEST_BANK_001",
    "txn_merchant_ref": "TXN_TEST_BANK_001",
    "amount": 200,
    "currency": "NGN",
    "redirect_url": "https://example.com/payment/success",
    "success_message": "Payment successful",
    "pay_data": null
  }
}

Response Fields

FieldDescription
statusIndicates whether the payment link was created successfully.
messageDescribes the result of the request.
data.payment_refUnique payment reference generated for the BlockPay transaction.
data.pay_linkHosted BlockPay checkout URL that can be shared with the customer.
data.txn_merchant_refMerchant's transaction reference supplied in the request.
data.amountAmount to be collected.
data.currencyCurrency of the payment.
data.redirect_urlURL where the customer is redirected after completing the payment.
data.success_messageMessage configured to be displayed after successful payment.
data.pay_dataAdditional payment data. Returns null when no additional data is available.

How It Works

  1. The merchant creates a BlockPay payment link.
  2. payment_channel is set to BANK_TRANSFER.
  3. LedgerBlock generates a unique payment reference and hosted payment link.
  4. The merchant shares the pay_link with the customer.
  5. The customer opens the link and completes the bank transfer.
  6. The customer is redirected to the configured redirect_url after payment.
  7. Transaction updates are sent to the configured notification_url.

Use Cases

The Bank Transfer payment link can be used to:

  • Collect NGN payments through bank transfer.
  • Generate a hosted payment page for customers.
  • Provide customers with the information required to complete a bank transfer.
  • 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.


Did this page help you?