# API Integration

Our Cashouts API enable merchants to generate local withdrawals in every country that PandaBlue operates. In order to do so, **merchants need provide the in each transaction the local banking details required**.

Therefore, it is important to properly understand the  <a href="/pages/-MA9W0JDYr7ewGa7xDTk" class="button primary" data-icon="earth-americas">Countries validations</a> within each market that the merchant is willing to operate.

***

### Integration flow

{% stepper %}
{% step %}

### Cashout creation

{% tabs %}
{% tab title="Example request" %}
Merchants need to send **all the required local information** for creating the transaction.

In this example, in :flag\_mx: Mexico we need the document, the bank account, the beneficiary name and last name.

<pre class="language-sh"><code class="lang-sh">curl -L \
  --request POST \
<strong>  --url 'https://api-stg.pandablue.com/v3/cashout' \
</strong>  --header 'Content-Type: application/json' \
  --header 'Payload-Signature: text' \
  --data '{
    "login": "your_cashout_login",
    "pass": "your_cashout_pass",
    "external_id": "30000000001",
    "country": "MX",
    "currency": "MXN",
    "amount": 100,
    "document_id": "848392783",
    "bank_account": "021790064060296642",
    "beneficiary_name": "Luis",
    "beneficiary_lastname": "Miguel",
    "notification_url": "https://merchant.site/webhooks/pandablue",
    "type": "json"
}'
</code></pre>

{% endtab %}

{% tab title="Example response" %}
In response, merchants receive the transaction identifier (`cashout_id`).

```json
{
  "cashout_id": "8405147"
}
```

{% endtab %}
{% endtabs %}

> For technical details, please visit the API Reference <a href="/spaces/VNE8t2FopKfzgQzTjlBb/pages/BJVC40qCkbDFJpgxozD4" class="button primary" data-icon="pencil">Create a cashout</a>
> {% endstep %}

{% step %}

### Webhook notification

Each time that a cashout changes its status we will send a webhook notification.

<pre class="language-http" data-title="Example notification"><code class="lang-http">    date=2020-03-12%2020%3A26%3A11
    &#x26;bank_reference_id=
    &#x26;comments=
    &#x26;external_id=cashoutV35381
    &#x26;control=A4CFF64E78C4BD01F8BFCA4AFF04632EC4A33CC61BD6BBD156BA1289897892EB
<strong>    &#x26;cashout_id=8405147
</strong>    &#x26;status_reason=
</code></pre>

> Please visit <a href="/pages/IDRgrfdaoiwf4YdhGjLU" class="button primary" data-icon="message-medical">Notifications</a>
> {% endstep %}

{% step %}

### Retrieve the cashout status

By creating a request to the cashout status endpoint you will capable od retrieving the final status of the transaction.

{% tabs %}
{% tab title="Example request" %}

<pre class="language-sh"><code class="lang-sh">curl -L \
  --request POST \
  --url 'https://api-stg.pandablue.com/v3/cashout/status' \
  --header 'Content-Type: application/json' \
  --header 'Payload-Signature: text' \
  --data '{
    "login": "your_cashout_login",
    "pass": "your_cashout_pass",
<strong>    "cashout_id": 8405147
</strong>  }'
</code></pre>

{% endtab %}

{% tab title="Example response" %}

```json
{
  "cashout_status": 1,
  "cashout_status_description": "Completed"
}
```

For more information regarding the **`cashout_status`**, please visit <a href="/pages/M0hPMNs7uaCI6Dbi76RG#cashout-status-codes" class="button primary">Cashout status codes</a>
{% endtab %}
{% endtabs %}

> For technical details, please visit the API Reference <a href="/spaces/VNE8t2FopKfzgQzTjlBb/pages/kJcyiJ99exMkjrYoRSSS" class="button primary" data-icon="pencil">Get a cashout status</a>
> {% endstep %}
> {% endstepper %}

{% hint style="info" %}

### Additional flows

Note that the flow described above corresponds to a regular cashout completion flow.

Within the cashout lifecycle, cashouts can also be **CANCELLED** or put **ON\_HOLD** status.\
For more information visit the API References:&#x20;

* <a href="/spaces/VNE8t2FopKfzgQzTjlBb/pages/Qm5CcCRfLaVFFaSROT0p" class="button primary" data-icon="delete-left">Cashout cancellation</a>
* <a href="/spaces/VNE8t2FopKfzgQzTjlBb/pages/9ef5Y8mqB6qpEQMpa2gB" class="button primary" data-icon="arrows-rotate-reverse">Update to On Hold</a>
  {% endhint %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.pandablue.com/guides/cashouts/create-cashouts/api-integration.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
