EazzPay Initiate Payment API Documentation
The `EazzPay Initiate Payment API allows businesses to create payment requests and redirect customers to complete transactions. This guide includes step-by-step instructions and examples in different programming languages.
Request URL
To initiate a payment, make a POST
request to the following API endpoint:
Ensure to replace {base_URL}
with the live API endpoint URL provided in your EazzPay Merchant Dashboard.
Request Headers
Include these headers in your request:
Header Name | Value |
---|---|
Content-Type | "application/json" |
Accept | "application/json" |
eazzpay-client-secret | Your API Key from the Merchant Dashboard |
Request Parameters
Request Payload
Upon successful initiation, the API returns the following response:
Parameter Details
Parameter | Required | Type | Description |
---|---|---|---|
cus_name | Yes | string | Customer's name (100 characters). |
amount | Yes | number | Payment amount (valid numeric value). |
metadata | No | string | JSON string for order details (max 1000 characters). |
success_url | Yes | string | Redirect URL for successful payment (100 characters). |
cancel_url | Yes | string | Redirect URL for canceled payment (100 characters). |
ipn_url | Yes | string | IPN callback URL (100 characters). |
ipn_method | No | string | HTTP method for IPN (GET , POST , PUT , DELETE , PATCH , OPTIONS , and HEAD ). Default: POST . |
Success Response Example
Upon successful initiation, the API returns the following response:
Response Fields
Root Level
Field | Type | Description |
---|---|---|
code | number | HTTP status code indicating success, e.g., 201 . |
message | string | Descriptive message confirming the operation. |
Data Object
Field | Type | Description |
---|---|---|
payment_id | string | Unique identifier for the payment transaction. |
reference | string | A reference for the payment, useful for tracking. |
transaction_status | string | Current status of the transaction, e.g., INITIATED . |
amount | number | Payment amount. |
payment_init_time | string | Timestamp of payment initiation. |
eazzpay_url | string | URL for customer redirection to complete the payment. |
success_url | string | Redirect URL for successful payment. |
cancel_url | string | Redirect URL for canceled payment. |
ipn_url | string | IPN callback URL. |
ipn_method | string | HTTP method for IPN requests. |
Error Response Example
In case of an error, the API returns the following response:
Error Response Fields
Field | Type | Description |
---|---|---|
message | string | Description of the error. |
error | string | Error type, e.g., Not Acceptable . |
code | number | HTTP status code indicating the error, e.g., 406 . |
Example Requests
Notes
- Sandbox Environment: Use this environment for testing your integration.
- Live Environment: Switch to live after successful testing.