Appearance
Create Payment Link
POST /api/payment/payment-link
Creates a Rexel-hosted checkout page for collecting NGN.
Body parameters
| Field | Type | Required | Description |
|---|---|---|---|
name | string | Yes | Unique name for the link |
description | string | Yes | What the payment is for |
linkType | integer | Yes | 0 one-time, 1 reusable |
amountType | integer | No | 0 static (fixed amount), 1 dynamic (amount varies) |
amountInfo.amount | number | Yes | Amount in NGN |
tax.isEnabled | boolean | Yes | Apply tax |
reference | string | No | Your idempotency reference |
metadata | object | No | Extra key/value data stored with the link |
Request
bash
curl --request POST \
--url https://laas.rexel.ng/api/payment/payment-link \
--header 'X-Api: sk_test_xxx' \
--header 'content-type: application/json' \
--data '{
"name": "Invoice 1001",
"description": "Payment for INV-1001",
"linkType": 0,
"amountType": 0,
"amountInfo": { "amount": 100 },
"tax": { "isEnabled": false },
"metadata": { "invoiceId": "INV-1001" }
}'Responses
json
{
"value": {
"id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"name": "Invoice 1001",
"description": "Payment for INV-1001",
"alias": "0-k2tmbuy",
"link": "https://pay.rexel.ng/0-k2tmbuy",
"amountInfo": { "currencyCode": "NGN", "amount": 100 },
"linkType": "OneTime",
"status": "New",
"createdDate": "2023-03-31T10:43:09.1931541+00:00",
"environment": "Test"
},
"isSuccess": true,
"message": "Request Successful"
}json
{
"value": {
"id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"alias": "0-k2tmbuy",
"link": "https://pay.rexel.ng/0-k2tmbuy",
"amountInfo": { "currencyCode": "NGN", "amount": 100 },
"linkType": "Reuseable",
"status": "New",
"environment": "Test"
},
"isSuccess": true,
"message": "Request Successful"
}json
{
"isSuccess": false,
"title": "Access Denied!",
"status": 401,
"detail": "Access Denied! You do not have the necessary permissions to perform this action. Please contact the Rexel team for assistance.",
"traceId": "00-b5aa368c66bff0279d7162dbc184a747-c971865180e32372-00"
}