Initialize a transaction
This endpoint initializes the transaction that would be used for card payments and dynamic transfers.
Endpoint
POST Payments/Initialize
Headers
Authorization: Bearer
To authorize this API request, you need to include your apiKey
as a bearer token. This is done by setting the Authorization header in your request. The header should have the format:
Authorization: "Bearer your_api_key"
Note: Get your API key from Settings > API Keys in your dashboard.
Request Body
The following table describes the fields required in the request body:
Field | Type | Description |
---|---|---|
mode | string | The mode of the payment. |
amount | string | The amount of the payment. |
currency | string | The currency of the payment. Only NGN is supported. |
email | The email address associated with the payment. | |
transactionId | string | The unique identifier for the transaction. |
callbackUrl | string | The URL where the user will be redirected after payment completion. Transaction details are passed as query parameters. |
metadata | array | Additional metadata for the payment. Each item contains: name (string) and value (string). |
productId | string | The ID of the product for which the payment is being made. |
productDescription | string | The description of the product. |
applyConviniencyCharge | boolean | Indicates whether a convenience charge should be applied. |
Request Body
{
"amount": "5000",
"currency": "NGN",
"email": "customer@example.com",
"transactionId": "TXN123456789",
"callbackUrl": "https://example.com/payment/callback",
"metadata": [
{
"name": "CustomerName",
"value": "John Doe"
},
{
"name": "OrderId",
"value": "ORD987654321"
}
],
"productId": "PRD001",
"productDescription": "Premium Membership Registration",
"applyConviniencyCharge": false,
"mode": "Live"
}
Response (200)
{
"responseCode": "00",
"responseMessage": "Authorization URL created",
"data": {
"paymentUrl": "https://checkout.paybridge.africa/2a11mganDV4u",
"accessCode": "2a11mganDV4u"
}
}