Appearance
Payment Link Integration
Create hosted payment pages from your server, send customers to them, and let Rexel handle processing.
Lifecycle
- Create a payment link.
- Validate available channels.
- Initiate the payment.
- Authenticate the card (optional, 3DS/OTP).
- Finalize the payment.
- Verify status and listen for webhooks.
Step 1: Create a payment link
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 }
}'| Field | Values |
|---|---|
linkType | 0 one-time, 1 reusable |
amountType | 0 static, 1 dynamic |
json
{
"value": {
"id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"name": "Invoice 1001",
"alias": "0-k2tmbuy",
"link": "https://pay.rexel.ng/0-k2tmbuy",
"amountInfo": { "currencyCode": "NGN", "amount": 100 },
"linkType": "OneTime",
"status": "New",
"environment": "Test"
},
"isSuccess": true,
"message": "Request Successful"
}Step 2: Validate channels
bash
curl --request POST \
--url https://laas.rexel.ng/api/payment/pay/validate \
--header 'X-Api: sk_test_xxx' \
--header 'content-type: application/json' \
--data '{ "amount": { "amount": 100 } }'If no channels are passed, the response lists every channel enabled on your account.
Step 3: Initiate the payment
bash
curl --request POST \
--url https://laas.rexel.ng/api/payment/pay/initiate \
--header 'X-Api: sk_test_xxx' \
--header 'content-type: application/json' \
--data '{
"amount": 100,
"channel": "PayByTransfer",
"currency": "NGN",
"link": { "alias": "0-k2tmbuy" },
"userInformation": {
"firstName": "Dave", "lastName": "MC",
"emailAddress": "mcdave@test.com", "phone": "0901 010 1010"
}
}'See Pay by Bank Transfer and Pay by Card for responses.
Optional: authenticate a card payment
For cards, check whether 3D Secure / OTP is needed using the referenceId from Initiate. The response includes IsAuthenticationEnabled, Recommendation and authenticationhtml to present the challenge.
Step 4: Finalize
bash
curl --request POST \
--url https://laas.rexel.ng/api/payment/pay/finalize \
--header 'X-Api: sk_test_xxx' \
--header 'content-type: application/json' \
--data '{ "paymentReference": "THGUJYNHACLVSPG" }'A success returns responseCode: "00" and value.status: "completed".
Step 5: Verify status
Call Get Transaction Status with the reference from Initiate. Rely on webhooks for fulfilment.