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 |
---|---|---|
isLive | string | true if its a live transaction and false if its a test transaction. |
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). |
Request Body
{
"isLive": true,
"amount": "5000",
"currency": "NGN",
"email": "customer@example.com",
"phone": "08012345678",
"firstName": "John",
"lastName": "Doe",
"transactionId": "TXN123456789",
"callbackUrl": "https://example.com/payment/callback",
"metadata": [
{
"name": "CustomerName",
"value": "John Doe"
},
{
"name": "OrderId",
"value": "ORD987654321"
}
]
}
Response (200)
{
"responseCode": "00",
"responseMessage": "Authorization URL created",
"data": {
"paymentUrl": "https://checkout.paybridge.africa/2a11mganDV4u",
"accessCode": "2a11mganDV4u"
}
}