Skip to main content

Echezona Standard

Echezona Standard provides a flexible server-side payment processing solution that integrates seamlessly into your application. This allows you to handle transactions securely while maintaining a smooth user experience.

Features

  • Server-side payment initiation.
  • Redirection to a secure Echezona checkout page.
  • Automatic redirection back to your website after successful or failed transactions.
  • Simplified post-payment processing.

How It Works

  1. Create Payment Endpoint

    Send a POST request to the Echezona create payment endpoint with the payment details.

  2. On success, you'll receive a payment link in the response. Redirect your customer to this link for payment.

  3. Transaction Completion

    After payment, the customer is redirected back to your website. Use the response to handle post-payment processes such as updating order statuses or providing confirmation.

API Reference

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

ParameterTypeDescription
amountstringThe transaction amount in the smallest currency unit.
currencystringThe currency for the transaction only NGN is supported.
emailemailThe customer's email address.
transactionIdstringA unique identifier for the transaction.
callbackUrlstringThe URL to which Echezona will return to and send transaction status updates.
metadataarrayA list of key-value pairs containing additional information about the transaction.
metadata[].namestringThe name of a metadata field.
metadata[].valuestringThe value of the corresponding metadata field.
productIdstringAn identifier for the product being purchased.
productDescriptionstringA description of the product being purchased.
applyConviniencyChargebooleanSet true if the customer incurs the transaction fee or false if it's you, the merchant.
modestringThe payment mode/environment (Test or Live).

Example Request Body

{
"amount": 5000,
"currency": "NGN",
"email": "customer@example.com",
"callbackUrl": "https://yourwebsite.com/thank-you",
"transactionId": "generated_trxn_id",
"mode": "Live"
}

Response

FieldTypeDescription
responseCodestringThe code indicating the status of the response (e.g., 00 for success).
responseMessagestringA message describing the result of the request (e.g., Authorization URL created).
dataobjectContains details related to the payment URL and access code.
data.paymentUrlstringThe URL for the payment page.
data.accessCodestringA unique code to identify the payment request.

This structure aligns the response body with the provided JSON example.

Example Response Body

{
"responseCode": "00",
"responseMessage": "Authorization URL created",
"data": {
"paymentUrl": "https://checkout.echezona.com/PMMGWFAFxVxHOpG",
"accessCode": "PMMGWFAFxVxHOpG"
}
}

Integration Steps

  1. Call the Initialize Payment API Use the above endpoint to generate a payment link.

  2. Redirect the Customer Redirect your customer to the payment_link provided in the response.

  3. Handle Post-Payment After the transaction, the customer will be redirected to the callbackUrl. Validate the transaction status on your server to confirm payment.

Example Code (Node.js)

const axios = require("axios");

const createPayment = async () => {
const paymentData = {
mode: "Live",
apiKey: "enter API key",
amount: "50",
currency: "NGN",
email: "john@doe.com",
phone: "08012345678",
firstName: "John",
lastName: "Doe",
callBackUrl: "https://your-website/thank-you", // replace with your desired callback URL
transactionId: Math.floor(Math.random() * 99999999) + "",
};

try {
const response = await axios.post(
"https://api.echezona.com/Payments/Initialize",
paymentData
);
console.log("Payment Link:", response.data.data.payment_link);
} catch (error) {
console.error("Error creating payment:", error.response.data);
}
};

createPayment();

Redirect URLs

After payment completion, customers are redirected to your specified callbackUrl. Use this opportunity to:

  • Confirm the transaction status by querying the Echezona API.
  • Display a payment success or failure message.

Security Tips

  • Always validate payment status on your server.
  • Use HTTPS to secure communications with the Echezona API.

Support

For questions or assistance, please contact our support team at hello@echezona.com.