Easy Cashout Creation Endpoint
Learn how to create cashout requests with our Easy Cashout API
Easy Cashout Creation Endpoint
POST
https://payout-api-stg.directa24.com/v1/request
This endpoint is used to create cashout links hosted by Directa24
Request Body
{
"data": {
"cashout_url": "https://payout.directa24.com/payout/64e5202599a843b0a73bcae43407a88a",
"external_id": "45343242333",
"status": "CREATED"
}
}
{
"error": "missing_fields",
"message": "The following fields are missing or invalid: document_id"
}
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. Please remember to whitelist the IP of your servers under the "Cashout credentials" section of our Merchant Panel by going to Settings -> API Access.
// 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"
}
curl --location --request POST 'https://payout-api-stg.directa24.com/v1/request' \
--header 'Content-Type: application/json' \
--header 'Cookie: GCLB=CP__tcP1vf2ZKQ' \
--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"
}'
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")
.addHeader("Cookie", "GCLB=CP__tcP1vf2ZKQ")
.build();
Response response = client.newCall(request).execute();
System.out.println(response.body().string());
}
}
<?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;
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);
}
}
}
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"))
Response: Success
Response Example
{
"data": {
"cashout_url": "https://payout.directa24.com/payout/2bafcb316edf488897f60d59d59c00d0",
"external_id": "45343242",
"status": "CREATED"
}
}
Response Fields
Response: Error
Response Example
// 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
Request Fields Description
Creation HTTP Codes
Last updated