Version: current

Retrieve a payment

About this guide

This guide quickly demonstrates how to retrieve any payment from your account in EBANX. We will walk you through the basic steps to achieve this goal using your already existing Direct API integration.

How it works

To Retrieve a payment through EBANX Direct API, please follow the steps below.

  1. Retrieve the payment using /ws/query end-point

    To retrieve a payment, you just need to call the end-point /ws/query (from your server) with the following required fields:

    info

    Please, note that to retrieve your payment, you can use either the hash or merchant_payment_code.

    FieldDescription
    integration_keyYour unique and secret integration key
    hashThe payment hash (EBANX unique identifier)

    Please, check the example below:

    curl -X POST -G 'https://sandbox.ebanxpay.com/ws/query' \
    -d 'integration_key=your_test_integration_key' \
    -d 'hash=5476099e890c06ca6f02cae9da1b1faaf3c5929439076cb9'

    A successful request will return a JSON response similar to the one below.

    {
    "payment": {
    "hash": "54737a76ffc1e5a520b0ed9062213a810ef41dae990184c7",
    "merchant_payment_code": "1416854121",
    "order_number": null,
    "status": "CO",
    "status_date": "2014-11-24 16:35:43",
    "open_date": "2014-11-24 16:35:34",
    "confirm_date": "2014-11-24 16:35:43",
    "transfer_date": null,
    "amount_br": "352.50",
    "amount_ext": "150.00",
    "amount_iof": "0.00",
    "currency_rate": "2.3500",
    "currency_ext": "USD",
    "due_date": "2014-12-01",
    "instalments": "1",
    "payment_type_code": "bradesco",
    "pre_approved": false,
    "capture_available": null,
    "refunds": [
    {
    "id": "9283",
    "merchant_refund_code": null,
    "status": "RE",
    "request_date": "2014-11-26 17:56:52",
    "pending_date": null,
    "confirm_date": null,
    "cancel_date": null,
    "paid_date": null,
    "amount_ext": "100.00",
    "description": "Order did not arrive",
    "settlement": {
    "transfer_date": "2014-12-01",
    "amount": 100.00
    },
    "refund_status_details": {
    "cancellation_reason": "Not Paid: refund payment period has been exceed",
    "cancellation_reason_code": "RSD-01",
    "can_have_settlement": true,
    "can_be_cancelled": false
    }
    }
    ]
    },
    "status": "SUCCESS"
    }
    Complete EBANX Direct API Reference

    The complete API reference for the end-point ws/query can be found here. We strongly recommend you to take a look in all the available options and examples.

Retrieving a payment via Dashboard

Alternativelly, you can also retrieve a payment using your EBANX Dashboard.

Getting help

We hope this article was enlightening, but in case we’ve failed to take out your doubts you have the following options to keep on seeking for answers:

  • If you’re not our partner yet and would like to know more about our prices and conditions please fill our this form and our commercial team will get in touch with you.
  • In case you’re already our partner please get in touch with our support team at integration@ebanx.com.
Last updated on by FlavioCostaeSilva