Skip to main content

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.

  1. 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
  2. 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:

    ParameterDescription
    operationSet to request
    integration_keyYour EBANX integration key
    payment_type_codeSet to opay
    countrySet to ng for Nigeria

    Customer data:

    ParameterDescription
    nameCustomer name
    emailCustomer email
    phone_numberCustomer phone number

    Charge parameters:

    ParameterDescription
    merchant_payment_codeUnique merchant payment code
    currency_codeSupported value: NGN
    amount_totalTotal amount to be charged
    redirect_urlURL where the customer will be redirected after completing the payment
  3. 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",
    }
    }'
  4. Sample response

    A successful request returns a response like the example below, with the Opay redirect link provided in the redirect_url parameter.


    {
    "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.ebanxpay.com/ws/redirect/execute?hash=5ec27f3b86fa8e318dd345234523553626aec3989aa2ceccdb7",
    "pre_approved": false,
    "capture_available": null
    },
    "status": "SUCCESS",
    "redirect_url": "https://api.ebanxpay.com/ws/redirect/execute?hash=5ec27f3b86fa8e318dd345234523553626aec3989aa2ceccdb7"
    }

    At this stage, the payment will appear as pending (PE) in your
    EBANX Dashboardchevron_right
  5. 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).

  6. Monitor payment for status changes

    Notifications

    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.

  7. Congratulations!

    You have succesfully integrated Opay.

    For more information, refer to the
    Direct API reference guidechevron_right

Resources

Use the following resources when testing in your sandbox environment.


Still need help?

Help Image

We hope this article was helpful. If you still have questions, you can explore the following options: