Opay
This page explains how to add Opay to your existing Direct API integration. The Direct API flow remains consistent across all payment methods, with differences in the payment_type_code and required fields.
Requirements
- API credentials - Ensure you have your EBANX integration key. If not, complete the Merchant Signup Form.
- Familiarity with EBANX Direct - This setup follows the same general structure as other payment methods, with a few unique parameters.
How it works
- Payment request - You initiate a payment request via the EBANX API, specifying Opay as the payment method. EBANX creates the payment and returns a redirect_url.
- Redirect to Opay - Opay payments require redirecting customers to Opay’s payment page, where they securely complete the transaction.
- Customer completes payment - Once the customer successfully completes the payment, EBANX will receive a confirmation from Opay and update the payment status.
- Order fulfillment - After receiving the payment confirmation, you can proceed with fulfilling the customer’s order.
Instructions
Follow the steps below.
- Select your environment- Select the appropriate environment for your integration. Use the sandbox environment for testing, or the production environment for live transactions. Use the URL for your HTTP requests based on your selection. https://sandbox.ebanx.com/ws/direct
- Define your parameters- Opay payments are completed at Opay environment, so you’ll need to redirect your customer to a their page or app. To obtain this redirection link, call the ws/direct endpoint with the following required fields. - Basic parameters:- Parameter - Description - operation- Set to - request- integration_key- Your EBANX integration key - payment_type_code- Set to - opay- country- Set to - ngfor Nigeria- Customer data:- Parameter - Description - name- Customer name - email- Customer email - phone_number- Customer phone number - Charge parameters:- Parameter - Description - merchant_payment_code- Unique merchant payment code - currency_code- Supported value: - NGN- amount_total- Total amount to be charged - redirect_url- URL where the customer will be redirected after completing the payment 
- Sample request- Use the following example to initiate a request. - curl -X POST \
 --location 'https://sandbox.ebanx.com/ws/direct' \
 --header 'Content-Type: application/json' \
 --data '{
 "integration_key": "your_ebanx_integration_key",
 "operation": "request",
 "payment": {
 "name": "John Doe",
 "email": "email@example.com",
 "phone_number": "9999999999",
 "country": "ng",
 "payment_type_code": "opay",
 "merchant_payment_code": "13a7460fe0b1d46a",
 "currency_code": "NGN",
 "amount_total": "500"
 "redirect_url": "https://your-callback-url.com",
 }
 }'
- Sample response- A successful request returns a response like the example below, with the Opay redirect link provided in the - redirect_urlparameter.- {
 "payment": {
 "hash": "63daaad563d447b3b4ab570fc519333b053447befdffcd67",
 "country": "ng",
 "merchant_payment_code": "rimi9m6blfagmqga2c1",
 "order_number": "1234567",
 "status": "PE",
 "open_date": "2024-12-02 20:35:12",
 "amount_br": "5000.00",
 "amount_ext": "5000.00",
 "amount_iof": "0.00",
 "currency_rate": "1.0000",
 "currency_ext": "NGN",
 "due_date": "2024-12-05",
 "instalments": "1",
 "payment_type_code": "opay",
 "redirect_url": "https://api.ebanx.com/ws/redirect/execute?hash=5ec27f3b86fa8e318dd345234523553626aec3989aa2ceccdb7",
 "pre_approved": false,
 "capture_available": null
 },
 "status": "SUCCESS",
 "redirect_url": "https://api.ebanx.com/ws/redirect/execute?hash=5ec27f3b86fa8e318dd345234523553626aec3989aa2ceccdb7"
 }At this stage, the payment will appear as pending (PE) in yourEBANX Dashboardchevron_right
- Redirect customer to the returned URL- Redirect your customer to the - redirect_url. This will take them to the Opay page, where they will securely complete the transaction.- After the customer successfully completes the payment at Opay, EBANX will receive a confirmation from Opay and update the payment status. - CO(Confirmed).
- Monitor payment for status changes- Notifications - EBANX will send a notification whenever a payment status changes. 
- Make sure your system is set up to receive notifications from EBANX for any changes in payment status. 
 - Status - When a payment is confirmed, the status will change from pending (PE) to confirmed (CO). If the customer does not complete the payment, the status will eventually change to cancelled (CA). 
- After receiving a notification, retrieve the payment status. 
 
- Congratulations!- You have succesfully integrated Opay. For more information, refer to theDirect API reference guidechevron_right
Resources
Use the following resources when testing in your sandbox environment.
Sample Cards
Click here to view mock card data to validate your payment integration.
API Reference
Click here to access detailed API documentation to integrate efficiently.
Mock Customer Data
Click here to view mock customer data for testing and validating user flows.
Error Codes
Click here to review common error codes to troubleshoot and resolve issues quickly.
Still need help?
We hope this article was helpful. If you still have questions, you can explore the following options:
- Merchant support: Contact our support team at sales.engineering@ebanx.com for assistance.
- Not a partner yet? Please complete the Merchant Signup Form, and our commercial team will reach out to you.