> For the complete documentation index, see [llms.txt](https://docs.pandablue.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.pandablue.com/v1/cashouts-api/easy-cashout-api/endpoints/easy-cashout-creation-endpoint.md). Agents can also search and read this documentation through its [MCP server](https://docs.pandablue.com/~gitbook/mcp).

# Easy Cashout Creation Endpoint

Learn how to create cashout requests with our Easy Cashout API

### Easy Cashout Creation Endpoint

<mark style="color:green;">`POST`</mark> `https://payout-api-stg.directa24.com/v1/request`

This endpoint is used to create cashout links hosted by Easy Cashouts API

**Request Body**

| Name              | Type    | Description                                   |
| ----------------- | ------- | --------------------------------------------- |
| login             | string  | Your Easy Cashouts API Cashout login          |
| password          | string  | Your Easy Cashouts API Cashout Pass           |
| external\_id      | string  | ID on your end used to identify the cashout   |
| country           | string  | Country of the cashout                        |
| currency          | string  | Currency of the amount                        |
| amount            | number  | Amount of the cashout                         |
| document\_id      | string  | Personal document ID of the beneficiary       |
| first\_name       | string  | Beneficiary's first name                      |
| last\_name        | string  | Beneficiary's last name                       |
| on\_hold          | boolean | Used to mark the cashout on hold once created |
| notification\_url | string  | URL where the notifications will be sent to   |

{% tabs %}
{% tab title="200 Cashout created successfully" %}

```java
{
"data": {
"cashout_url": "https://payout.directa24.com/payout/64e5202599a843b0a73bcae43407a88a",
"external_id": "45343242333",
"status": "CREATED"
}
}
```

{% endtab %}

{% tab title="400 Missing parameter" %}

```java
{
"error": "missing_fields",
"message": "The following fields are missing or invalid: document_id"
}
```

{% endtab %}
{% endtabs %}

### Easy Cashout Request

#### Request Example

The request has to be made through a POST request to the above URL. The body of the request is sent in [JSON Format](https://www.json.org/json-en.html). Please remember to whitelist the IP of your servers under the "Cashout credentials" section of our Merchant Panel by going to Settings -> API Access.

{% tabs %}
{% tab title="JSON" %}

```javascript
// URL
POST: https://payout-api-stg.directa24.com/v1/request

// JSON Body
{
"login": "xxxxxx",
"password": "xxxxxxx",
"external_id": "45343242",
"country": "BR",
"currency": "USD",
"amount": 250,
"document_id": "8854521458",
"first_name": "Jonh",
"last_name": "Smith",
"on_hold": false,
"notification_url": "https://webhook.site/url"
}
```

{% endtab %}

{% tab title="cURL" %}

```java
curl --location --request POST 'https://payout-api-stg.directa24.com/v1/request' \
--header 'Content-Type: application/json' \
--data-raw '{
"login": "xxxxxxxx",
"password": "xxxxxxxxx",
"external_id": "45343242",
"country": "BR",
"currency": "USD",
"amount": 250,
"document_id": "8854521458",
"first_name": "Jonh",
"last_name": "Smith",
"on_hold": false,
"notification_url": "https://webhook.site/url"
}'
```

{% endtab %}

{% tab title="Java" %}

```java
import java.io.*;
import okhttp3.*;
public class main {
public static void main(String []args) throws IOException{
OkHttpClient client = new OkHttpClient().newBuilder()
.build();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n\t\"login\": \"xxxxxxxx\", \n\t\"password\": \"xxxxxxxxx\", \n\t\"external_id\": \"45343242\", \n\t\"country\": \"BR\", \n\t\"currency\": \"USD\", \n\t\"amount\": 250, \n\t\"document_id\": \"8854521458\", \n\t\"first_name\": \"Jonh\", \n\t\"last_name\": \"Smith\",\n\t\"on_hold\": false,\n\t\"notification_url\": \"https://webhook.site/url\"\n}");
Request request = new Request.Builder()
.url("https://payout-api-stg.directa24.com/v1/request")
.method("POST", body)
.addHeader("Content-Type", "application/json")
.build();
Response response = client.newCall(request).execute();
System.out.println(response.body().string());
}
}
```

{% endtab %}

{% tab title="PHP" %}

```php
<?php

$curl = curl_init();

curl_setopt_array($curl, array(
CURLOPT_URL => "https://payout-api-stg.directa24.com/v1/request",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 0,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS =>"{\n\t\"login\": \"xxxxxxxx\", \n\t\"password\": \"xxxxxxxxx\", \n\t\"external_id\": \"45343242\", \n\t\"country\": \"BR\", \n\t\"currency\": \"USD\", \n\t\"amount\": 250, \n\t\"document_id\": \"8854521458\", \n\t\"first_name\": \"Jonh\", \n\t\"last_name\": \"Smith\",\n\t\"on_hold\": false,\n\t\"notification_url\": \"https://webhook.site/url\"\n}",
CURLOPT_HTTPHEADER => array(
"Content-Type: application/json"
),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;
```

{% endtab %}

{% tab title="C#" %}

```csharp
using System;
using RestSharp;
namespace HelloWorldApplication {
class HelloWorld {
static void Main(string[] args) {
var client = new RestClient("https://payout-api-stg.directa24.com/v1/request");
client.Timeout = -1;
var request = new RestRequest(Method.POST);
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n\t\"login\": \"xxxxxxxx\", \n\t\"password\": \"xxxxxxxxx\", \n\t\"external_id\": \"45343242\", \n\t\"country\": \"BR\", \n\t\"currency\": \"USD\", \n\t\"amount\": 250, \n\t\"document_id\": \"8854521458\", \n\t\"first_name\": \"Jonh\", \n\t\"last_name\": \"Smith\",\n\t\"on_hold\": false,\n\t\"notification_url\": \"https://webhook.site/url\"\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
Console.WriteLine(response.Content);
}
}
}
```

{% endtab %}

{% tab title="Python" %}

```python
import http.client
import mimetypes
conn = http.client.HTTPSConnection("payout-api-stg.directa24.com")
payload = "{\n\t\"login\": \"xxxxxxxx\", \n\t\"password\": \"xxxxxxxxx\", \n\t\"external_id\": \"45343242\", \n\t\"country\": \"BR\", \n\t\"currency\": \"USD\", \n\t\"amount\": 250, \n\t\"document_id\": \"8854521458\", \n\t\"first_name\": \"Jonh\", \n\t\"last_name\": \"Smith\",\n\t\"on_hold\": false,\n\t\"notification_url\": \"https://webhook.site/url\"\n}"
headers = {
'Content-Type': 'application/json'
}
conn.request("POST", "/v1/request", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
```

{% endtab %}
{% endtabs %}

####

#### Response: Success

**Response Example**

```java
{
"data": {
"cashout_url": "https://payout.directa24.com/payout/2bafcb316edf488897f60d59d59c00d0",
"external_id": "45343242",
"status": "CREATED"
}
}
```

**Response Fields**

| Field name         | Format       | Description                                                                                      |
| ------------------ | ------------ | ------------------------------------------------------------------------------------------------ |
| `data`             | object\[]    | Object containing the elements of the response                                                   |
| `data.cashout_url` | String (URL) | Field containing the link of the cashout generated. Store this value to send it to your customer |
| `data.external_id` | String       | External ID of the transaction. It is the same you sent                                          |
| `data.status`      | String       | Status of the transaction: `CREATED`                                                             |

#### Response: Error

**Response Example**

```java
// Missing fields
{
"error": "missing_fields",
"message": "The following fields are missing or invalid: document_id"
}

// Invalid request
{
"error": "invalid_request",
"message": "One or more parameters provided are invalid"
}

// Invalid IP Address
{
"error": "invalid_ip_address",
"message": "Invalid IP address"
}

// Invalid credentials
{
"error": "invalid_credentials",
"message": "The provided credentials are invalid"
}
```

**Response Fields**

| Field name | Format | Description                                   |
| ---------- | ------ | --------------------------------------------- |
| `error`    | String | Field containing the error type               |
| `message`  | String | Field containing the description of the error |

### Request Fields Description

| Field              |       Format       | Mandatory | Description                                                                                                                                                                 |
| ------------------ | :----------------: | :-------: | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `login`            |       String       |    Yes    | Your Easy Cashouts API **CASHOUTS** API Key, found on the Merchant Panel: Settings -> API Access. Notice there're specific Cashout credentials                              |
| `password`         |       String       |    Yes    | Your Easy Cashouts API **CASHOUTS** API Passphrase, found on the Merchant Panel: Settings -> API Access. Notice there're specific Cashout credentials                       |
| `external_id`      |       String       |    Yes    | External ID generated by you used to identify the cashout                                                                                                                   |
| `country`          |       String       |    Yes    | Cashout country code in ISO format. [Click here to see country codes.](https://docs.directa24.com/knowledge-base/countries-specifications)                                  |
| `currency`         | String (length: 3) |    Yes    | Currency in which the amount was specified. [Click here to see the currencies available per country.](https://docs.directa24.com/knowledge-base/countries-specifications)   |
| `amount`           |       Number       |    Yes    | Cashout Amount in the currency specified in the `currency` field. Make sure the amount doesn't have quotes as it is of type `number`.                                       |
| `document_id`      |       String       |    Yes    | Customer's document number, it won't be possible to change it later. [Check document validations here.](https://docs.directa24.com/knowledge-base/countries-specifications) |
| `first_name`       |       String       |     No    | Customer's first name, it won't be possible to change it later                                                                                                              |
| `last_name`        |       String       |     No    | Users last name, it won't be possible to change it later                                                                                                                    |
| `on_hold`          |       boolean      |     No    | Indicates if the cashout will be put on old after the creation. Make sure the on\_hold value doesn't have quotes as it is of type `boolean`.                                |
| `notification_url` |       String       |     No    | Merchant URL to be notified about status changes                                                                                                                            |

### **Creation HTTP Codes**

| Code | Description                                                                        |
| ---- | ---------------------------------------------------------------------------------- |
| 200  | The external ID was already used, so the data for the previous cashout is returned |
| 201  | The cashout was successfully created and the URL is returned                       |
| 400  | Invalid request, usually due to missing parameters                                 |
| 401  | Invalid credentials were provided or the source                                    |
| 5XX  | Something went wrong on Easy Cashouts API's end. Contact <merchants@directa24.com> |


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

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

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.pandablue.com/v1/cashouts-api/easy-cashout-api/endpoints/easy-cashout-creation-endpoint.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
