Below shows how the Payment link flow Integration works:
From your server, call our create payment link endpoint with the payment details.
We'll return a link alias to a payment page. Redirect your customer to this link to make the payment.
When the transaction is completed, we'll redirect the customer back to you.
Step 1: Call Create Payment Endpoint
Title: Create Payment link
Description : This service may be used to generate payment link
URL: api /payment/payment-link/
HTTP Method : POST
First, you need to assemble the payment details. Here are the details you'll need:
amountInfo": { "currencyCode": "string", "amount": 0 }, "tax": { "isEnabled": true }, "name": "string", "description": "string", "linkType": 0, "metadata": { "additionalProp1": "string", "additionalProp2": "string", "additionalProp3": "string"
amount
: The amount to charge the customer.currency Code
: A three-letter ISO code for the currency in which you want to accept the payment. A unique code that represents a defined business currency. E.g NGN=Nigerian Naira, USD =United state Dollars etc (Required) If you don't specify a value, we'll assume"NGN"
Tax Enabled:
Specify if Tax/fees is applicable on the purchase value (true, false)name
: This is the name of the item to be purchased via the payment linkdescription: This is the description of the item to be purchased
link Type
: This specify how often the payment link can be used. (Reusable, One-time)meta
data (optional): An object containing any extra information you'd like to store alongside the transaction e.g{CVV
Sample Code
curl -X 'POST' \ 'https://laas-development.leatherback.co/api/payment/portal/payment-link' \ -H 'accept: application/json' \ -H 'Authorization: Bearer Bearer eyJhbGciOiJSUzI1NiIsImtpZCI6IjA0RjYyRERGNEY4RjYwMEEyMThFNDg4OTU1REU3MjNBIiwidHlwIjoiYXQrand0In0.eyJpc3MiOiJodHRwczovL2Rldi1pZGVudGl0eS5sZWF0aGVyYmFjay5jbyIsIm5iZiI6MTY3NzcwNjUwNCwiaWF0IjoxNjc3NzA2NTA0LCJleHAiOjE2Nzc3MDY4MDQsImF1ZCI6IldlYkFwaUdhdGV3YXkiLCJzY29wZSI6WyJvcGVuaWQiLCJwcm9maWxlIiwiV2ViQXBpR2F0ZXdheSIsIm9mZmxpbmVfYWNjZXNzIl0sImFtciI6WyJwd2QiXSwiY2xpZW50X2lkIjoic3NvY2xpZW50Iiwic3ViIjoiOWM4ZTdlYjMtMjI3MC00NmI3LWZhNjYtMDhkYjE4YWE4MjRhIiwiYXV0aF90aW1lIjoxNjc3NzA0OTg3LCJpZHAiOiJsb2NhbCIsIm5hbWUiOiJhb3RvdGdzd2NkaEBldXJva29vbC5jb20iLCJlbWFpbCI6ImFvdG90Z3N3Y2RoQGV1cm9rb29sLmNvbSIsInBob25lX251bWJlciI6Iis0NDc5NzU3Nzc2NDUiLCJnaXZlbl9uYW1lIjoiICIsInBob25lX251bWJlcl92ZXJpZmllZCI6IlVuVmVyaWZpZWQiLCJlbWFpbF92ZXJpZmllZCI6IlZlcmlmaWVkIiwicm9sZSI6IkN1c3RvbWVyIiwic2lkIjoiQzUxRTgyQjE4QjMyQTI5N0NDNkYwMzk5QTBFRDk4MEYiLCJqdGkiOiI1OUQ4NDk5NDhBMENGMUNDRjk5NjZGNzQ2RjhBREY2OCJ9.GlV1A28Ue-3yuFHmDtT3uNEmA4FUfMYx_atqq4u87f-O-xtgRMhwLvBPcGEv7lcjZygKzS1bXlS9KGQzvMbtLm9bSDKPZzQLA1dxP0p9BM9V2J673Q6Hp_jF2hXPrXEqp28VdZnMFM_D09pXPB3MzD5X7R6mo47Rx7NuwEuuuXoHU0L_ByhnHOP16OsH0BjqaT-LIgAokJctgd1K4s3-tXBFKMq4BCDHEr7vPkQu0jldAzybZh4QSMOjI7zy5q6iDwN6uU470c34joqiN1fQUlqCVaRvaouL6pg8EQTYej6ACYnRy_VmQqq2rIaS7G6Oeg0gSpP8PryknrHLQeyx0g' \ -H 'X-Api: pk_test_7e8201f9232bg86fh53c4f9d2bbc4ehafd4f0b9' \ -H 'Content-Type: application/json' \ -d '{ "amountInfo": { "currencyCode": "NGN", "amount": 500 }, "tax": { "isEnabled": true }, "name": "Redmi", "description": "Redmi 11pro", "linkType": 0, "metadata": { "additionalProp1": "string", "additionalProp2": "string", "additionalProp3": "string" } }'
Response Body
Response code : 200
{ "value": { "id": "d574c37c-cf55-46a5-9556-08db1c659f7d", "name": "REDMI", "description": "JJ", "alias": "0-mjlyfib", "link": "https://app-aaaspaymentlink-dev.azurewebsites.net/0-mjlyfib", "amountInfo": { "currencyCode": "NGN", "amount": 5000 }, "linkType": "Reuseable", "status": "New", "createdDate": "2023-03-04T04:04:59.6635547+00:00", "environment": "Test" }, "isSuccess": true, "error": "", "message": "Request Successful", "type": null, "title": null, "status": null, "detail": null, "instance": null }
Error Message
Error | Cause | Solution |
The {input field} is required | A mandatory field is empty | Ensure all mandatory fields and values are present. |
payment link with given reference_id: notes already exists. Please create a payment link with a different reference_id | An existing reference id has been passed | Ensure that a unique reference id is used for all payment links. |
Highlight important information in a panel like this one. To edit this panel's color or style, select one of the options in the menu.
Add Comment