Skip to main content
POST
/
v1
/
merchants
/
{merchantId}
/
cashouts
Create a cashout request for a specific merchant
curl --request POST \
  --url https://api-sandbox.rinne.com.br/core/v1/merchants/{merchantId}/cashouts \
  --header 'Content-Type: application/json' \
  --header 'x-api-key: <api-key>' \
  --data '
{
  "request_id": "req_123456789",
  "origin_bank_account_id": "123e4567-e89b-12d3-a456-426614174000",
  "amount": 10000,
  "method": "PIX",
  "destination_bank_account_id": "123e4567-e89b-12d3-a456-426614174001",
  "destination_pix_key_id": "223e4567-e89b-12d3-a456-426614174002",
  "currency": "BRL",
  "metadata": {
    "custom_field": "value",
    "order_id": "order_123"
  }
}
'
import requests

url = "https://api-sandbox.rinne.com.br/core/v1/merchants/{merchantId}/cashouts"

payload = {
"request_id": "req_123456789",
"origin_bank_account_id": "123e4567-e89b-12d3-a456-426614174000",
"amount": 10000,
"method": "PIX",
"destination_bank_account_id": "123e4567-e89b-12d3-a456-426614174001",
"destination_pix_key_id": "223e4567-e89b-12d3-a456-426614174002",
"currency": "BRL",
"metadata": {
"custom_field": "value",
"order_id": "order_123"
}
}
headers = {
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.text)
const options = {
method: 'POST',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
request_id: 'req_123456789',
origin_bank_account_id: '123e4567-e89b-12d3-a456-426614174000',
amount: 10000,
method: 'PIX',
destination_bank_account_id: '123e4567-e89b-12d3-a456-426614174001',
destination_pix_key_id: '223e4567-e89b-12d3-a456-426614174002',
currency: 'BRL',
metadata: {custom_field: 'value', order_id: 'order_123'}
})
};

fetch('https://api-sandbox.rinne.com.br/core/v1/merchants/{merchantId}/cashouts', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));
<?php

$curl = curl_init();

curl_setopt_array($curl, [
CURLOPT_URL => "https://api-sandbox.rinne.com.br/core/v1/merchants/{merchantId}/cashouts",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'request_id' => 'req_123456789',
'origin_bank_account_id' => '123e4567-e89b-12d3-a456-426614174000',
'amount' => 10000,
'method' => 'PIX',
'destination_bank_account_id' => '123e4567-e89b-12d3-a456-426614174001',
'destination_pix_key_id' => '223e4567-e89b-12d3-a456-426614174002',
'currency' => 'BRL',
'metadata' => [
'custom_field' => 'value',
'order_id' => 'order_123'
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-api-key: <api-key>"
],
]);

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
package main

import (
"fmt"
"strings"
"net/http"
"io"
)

func main() {

url := "https://api-sandbox.rinne.com.br/core/v1/merchants/{merchantId}/cashouts"

payload := strings.NewReader("{\n \"request_id\": \"req_123456789\",\n \"origin_bank_account_id\": \"123e4567-e89b-12d3-a456-426614174000\",\n \"amount\": 10000,\n \"method\": \"PIX\",\n \"destination_bank_account_id\": \"123e4567-e89b-12d3-a456-426614174001\",\n \"destination_pix_key_id\": \"223e4567-e89b-12d3-a456-426614174002\",\n \"currency\": \"BRL\",\n \"metadata\": {\n \"custom_field\": \"value\",\n \"order_id\": \"order_123\"\n }\n}")

req, _ := http.NewRequest("POST", url, payload)

req.Header.Add("x-api-key", "<api-key>")
req.Header.Add("Content-Type", "application/json")

res, _ := http.DefaultClient.Do(req)

defer res.Body.Close()
body, _ := io.ReadAll(res.Body)

fmt.Println(string(body))

}
HttpResponse<String> response = Unirest.post("https://api-sandbox.rinne.com.br/core/v1/merchants/{merchantId}/cashouts")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"request_id\": \"req_123456789\",\n \"origin_bank_account_id\": \"123e4567-e89b-12d3-a456-426614174000\",\n \"amount\": 10000,\n \"method\": \"PIX\",\n \"destination_bank_account_id\": \"123e4567-e89b-12d3-a456-426614174001\",\n \"destination_pix_key_id\": \"223e4567-e89b-12d3-a456-426614174002\",\n \"currency\": \"BRL\",\n \"metadata\": {\n \"custom_field\": \"value\",\n \"order_id\": \"order_123\"\n }\n}")
.asString();
require 'uri'
require 'net/http'

url = URI("https://api-sandbox.rinne.com.br/core/v1/merchants/{merchantId}/cashouts")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"request_id\": \"req_123456789\",\n \"origin_bank_account_id\": \"123e4567-e89b-12d3-a456-426614174000\",\n \"amount\": 10000,\n \"method\": \"PIX\",\n \"destination_bank_account_id\": \"123e4567-e89b-12d3-a456-426614174001\",\n \"destination_pix_key_id\": \"223e4567-e89b-12d3-a456-426614174002\",\n \"currency\": \"BRL\",\n \"metadata\": {\n \"custom_field\": \"value\",\n \"order_id\": \"order_123\"\n }\n}"

response = http.request(request)
puts response.read_body
{
  "id": "123e4567-e89b-12d3-a456-426614174000",
  "request_id": "req_123456789",
  "external_request_id": "123e4567-e89b-12d3-a456-426614174000",
  "company_id": "123e4567-e89b-12d3-a456-426614174000",
  "origin_bank_account_id": "123e4567-e89b-12d3-a456-426614174000",
  "amount": 10000,
  "currency": "BRL",
  "method": "PIX",
  "status": "PROCESSING",
  "created_at": "2025-01-01T10:00:00.000Z",
  "updated_at": "2025-01-01T10:05:00.000Z",
  "destination_bank_account_id": "123e4567-e89b-12d3-a456-426614174001",
  "destination_pix_key_id": "223e4567-e89b-12d3-a456-426614174002",
  "fee": 150,
  "cost": 100,
  "fee_policy_id": "123e4567-e89b-12d3-a456-426614174002",
  "cost_policy_id": "123e4567-e89b-12d3-a456-426614174003",
  "error_message": "Insufficient funds",
  "returned_amount": 5000,
  "latest_return_at": "2025-01-01T11:00:00.000Z",
  "returns": [
    {
      "id": "123e4567-e89b-12d3-a456-426614174004",
      "cashout_id": "123e4567-e89b-12d3-a456-426614174000",
      "provider_return_id": "b94150c9-7dad-4b21-8183-50c83f4c5dd8",
      "amount": 1000,
      "reason": "CUSTOMER_REQUEST",
      "return_identification": "return_123456789",
      "original_end_to_end_id": "E12345678202501011100000000001",
      "original_id": "tx_123456789",
      "created_at": "2025-01-01T11:00:00.000Z",
      "updated_at": "2025-01-01T11:00:00.000Z"
    }
  ],
  "metadata": {
    "custom_field": "value",
    "order_id": "order_123"
  },
  "end_to_end_id": "E12345678202501271234567890123456"
}
{
"error": {
"code": "VALIDATION_ERROR",
"message": "Validation error",
"status": 400,
"details": {
"issues": [
{
"field": "email",
"type": "REQUIRED",
"message": "Field 'email' is required",
"value": "invalid_value",
"constraints": {
"min": 18,
"max": 120
}
}
]
},
"path": "/companies",
"timestamp": "2023-12-01T10:00:00.000Z",
"requestId": "req_123456789"
}
}
{
"error": {
"code": "AUTHENTICATION_ERROR",
"message": "Authentication required to access this resource",
"status": 401,
"details": {
"reason": "Invalid API key"
},
"path": "/companies/me",
"timestamp": "2023-12-01T10:00:00.000Z",
"requestId": "req_123456789"
}
}
{
"error": {
"code": "RESOURCE_NOT_FOUND",
"message": "Company with ID '123' not found",
"status": 404,
"path": "/companies/me",
"timestamp": "2023-12-01T10:00:00.000Z",
"requestId": "req_123456789"
}
}
{
"error": {
"code": "INTERNAL_SERVER_ERROR",
"message": "An unexpected error occurred",
"status": 500,
"path": "/companies",
"timestamp": "2023-12-01T10:00:00.000Z",
"requestId": "req_123456789"
}
}

Authorizations

x-api-key
string
header
required

Company API key for authentication

Path Parameters

merchantId
string
required

The merchant ID

Body

application/json

Schema for creating a new cashout request.

Exactly one of destination_bank_account_id or destination_pix_key_id must be provided.

request_id
string
required

Client-generated request ID for tracking

Example:

"req_123456789"

origin_bank_account_id
string<uuid>
required

ID of the bank account to debit from

Example:

"123e4567-e89b-12d3-a456-426614174000"

amount
integer
required

Amount to transfer in cents

Required range: x >= 1
Example:

10000

method
enum<string>
required

Cashout method

Available options:
PIX
Example:

"PIX"

destination_bank_account_id
string<uuid>

ID of the bank account to credit to (omit when using destination_pix_key_id)

Example:

"123e4567-e89b-12d3-a456-426614174001"

destination_pix_key_id
string<uuid>

ID of the company PIX key to pay to (omit when using destination_bank_account_id)

Example:

"223e4567-e89b-12d3-a456-426614174002"

currency
enum<string>
default:BRL

Currency code (defaults to BRL if not provided)

Available options:
BRL
Example:

"BRL"

metadata
object

Optional metadata object for storing custom key-value pairs

Example:
{
"custom_field": "value",
"order_id": "order_123"
}

Response

Cashout created successfully

Cashout response

id
string<uuid>
required

Internal cashout ID

Example:

"123e4567-e89b-12d3-a456-426614174000"

request_id
string
required

Client-generated request ID

Example:

"req_123456789"

external_request_id
string<uuid>
required

External provider request ID

Example:

"123e4567-e89b-12d3-a456-426614174000"

company_id
string<uuid>
required

Company ID

Example:

"123e4567-e89b-12d3-a456-426614174000"

origin_bank_account_id
string<uuid>
required

ID of the bank account to debit from

Example:

"123e4567-e89b-12d3-a456-426614174000"

amount
integer
required

Amount to transfer in cents

Example:

10000

currency
enum<string>
required

Currency code

Available options:
BRL
Example:

"BRL"

method
enum<string>
required

Cashout method

Available options:
PIX
Example:

"PIX"

status
enum<string>
required

Cashout status

Available options:
PENDING,
PROCESSING,
COMPLETED,
PARTIALLY_RETURNED,
RETURNED,
FAILED
Example:

"PROCESSING"

created_at
string<date-time>
required

Creation timestamp

Example:

"2025-01-01T10:00:00.000Z"

updated_at
string<date-time>
required

Last update timestamp

Example:

"2025-01-01T10:05:00.000Z"

destination_bank_account_id
string<uuid> | null

ID of the bank account to credit to (null when destination is a PIX key)

Example:

"123e4567-e89b-12d3-a456-426614174001"

destination_pix_key_id
string<uuid> | null

ID of the company PIX key paid to (null when destination is a bank account)

Example:

"223e4567-e89b-12d3-a456-426614174002"

fee
integer

Total fee in cents charged on the cashout

Example:

150

cost
integer

Total cost in cents for this cashout

Example:

100

fee_policy_id
string<uuid> | null

ID of the fee policy used for pricing this cashout

Example:

"123e4567-e89b-12d3-a456-426614174002"

cost_policy_id
string<uuid> | null

ID of the cost policy used for pricing this cashout

Example:

"123e4567-e89b-12d3-a456-426614174003"

error_message
string | null

Error message if cashout failed

Example:

"Insufficient funds"

returned_amount
integer | null

Total amount returned in cents (sum of all returns)

Example:

5000

latest_return_at
string<date-time> | null

Timestamp of the latest return

Example:

"2025-01-01T11:00:00.000Z"

returns
object[]

List of returns

metadata
object | null

Metadata object for storing custom key-value pairs

Example:
{
"custom_field": "value",
"order_id": "order_123"
}
end_to_end_id
string | null

End to End ID from the payment provider (PIX transaction identifier)

Example:

"E12345678202501271234567890123456"