Skip to main content

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:

FieldTypeDescription
isLivestringtrue if its a live transaction and false if its a test transaction. See Environments & Base URL.
amountstringThe amount of the payment. See Fees & Amounts for how this relates to what the customer is charged at checkout.
currencystringThe currency of the payment. Only NGN is supported.
emailemailThe email address associated with the payment.
transactionIdstringThe unique identifier for the transaction.
callbackUrlstringThe URL where the user will be redirected after payment completion. Transaction details are passed as query parameters. See Callback URL vs Webhook URL.
metadataarrayAdditional metadata for the payment. Each item contains: name (string) and value (string). See Metadata.
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.echezona.com/2a11mganDV4u",
"accessCode": "2a11mganDV4u"
}
}