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

HeaderDescriptionRequired
AuthorizationBearer token used to authenticate the requestYes
x-merchant-refUnique reference identifying the merchantYes
Content-TypeSpecifies that the request body is JSONYes

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

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 of cryptocurrency to be collected.
data.currencyCryptocurrency specified for 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 CRYPTO.
  3. The merchant specifies the cryptocurrency in currency.
  4. The merchant specifies the blockchain network in chain.
  5. LedgerBlock generates a unique payment reference and hosted payment link.
  6. The merchant shares the pay_link with the customer.
  7. The customer opens the link and completes the crypto payment on the specified network.
  8. The customer is redirected to the configured redirect_url after payment.
  9. 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: POL

This represents a USDT payment on the POL network.

The generated payment link reflects this combination:

USDT:POL

Use 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.


Did this page help you?