Create payment link
This endpoint allows you to create a payment link page.
Endpoint
POST /PaymentPages/Add
Headers
Authorization: Bearer
To authorize this API request, you need to include your privateKey
as a bearer token. This is done by setting the Authorization header in your request. The header should have the format:
Authorization: "Bearer privateKey"
See how to find your private key on your dashboard here.
Request Body
businessName
(string) - The name of the business.merchantId
(long) - The ID of the merchant.pageName
(string) - The name of the payment page.description
(string) - A description of the payment page.amount
(double) - The amount for the payment.isFixedAmount
(boolean) - Indicates if the amount is fixed.isPhoneNumberRequired
(boolean) - Specifies if a phone number is required for payment.paymentPageLink
(string) - The link to the payment page.paymentPageLinkReference
(string) - Reference link to the payment page.callBackUrl
(string) - The callback URL for payment completion.successMessage
(string) - The message to display on successful payment.notificationEmail
(string) - The email for payment notifications.isTestMode
(boolean) - Indicates if the payment page is in test mode.pageType
(string) - The type of the payment page.additionalFields
(string) - Additional fields for the payment page.
Request Body
{
"businessName": "my.business@gmail.com",
"merchantId": 10,
"pageName": "My Payment Page",
"description": "This is a test payment page",
"amount": "100",
"isFixedAmount": true,
"isPhoneNumberRequired": true,
"paymentPageLink": "https://pay.paybridge.africa/pay/my-payment-page",
"paymentPageLinkReference": "my-payment-page",
"callBackUrl": "https://my-payment-page.com/callback",
"successMessage": "Payment successful",
"notificationEmail": "my.business@gmail.com",
"isTestMode": false,
"additionalFields": "[]",
}
- Success
- Error
- Validation error
Response (200) - Success
{
"responseCode": "00",
"responseMessage": "Fetched payment pages successfully",
"data": {
"id": 16,
"businessName": "my.business@gmail.com",
"merchantId": 10,
"pageName": "My Payment Page",
"description": "This is a test payment page",
"amount": 100,
"isFixedAmount": true,
"isPhoneNumberRequired": true,
"paymentPageLink": "https://pay.paybridge.africa/pay/my-payment-page",
"paymentPageLinkReference": "my-payment-page",
"callBackUrl": "https://my-payment-page.com/callback",
"successMessage": "Payment successful",
"notificationEmail": "my.business@gmail.com",
"isTestMode": false,
"additionalFields": "[]",
"isActive": true,
"dateCreated": "2024-11-20T10:04:37.67",
"isDeleted": false
}
}
Error - Page name already exists
{
"responseCode": "02",
"responseMessage": "Page name already exists"
}
Validation error --400
{
"title": "One or more validation errors occurred.",
"status": 400,
"errors": {
"PageName": [
"The PageName field is required."
]
},
}