Refund a collecting document
curl --request POST \
--url https://api.sandbox.trio.com.br/banking/cashin/documents/{id}/refund \
--header 'Authorization: Basic <encoded-value>' \
--header 'Content-Type: application/json' \
--data '
{
"amount": 10,
"description": "Refund description"
}
'import requests
url = "https://api.sandbox.trio.com.br/banking/cashin/documents/{id}/refund"
payload = {
"amount": 10,
"description": "Refund description"
}
headers = {
"Authorization": "Basic <encoded-value>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Basic <encoded-value>', 'Content-Type': 'application/json'},
body: JSON.stringify({amount: 10, description: 'Refund description'})
};
fetch('https://api.sandbox.trio.com.br/banking/cashin/documents/{id}/refund', 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.trio.com.br/banking/cashin/documents/{id}/refund",
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([
'amount' => 10,
'description' => 'Refund description'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Basic <encoded-value>",
"Content-Type: application/json"
],
]);
$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.trio.com.br/banking/cashin/documents/{id}/refund"
payload := strings.NewReader("{\n \"amount\": 10,\n \"description\": \"Refund description\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Basic <encoded-value>")
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.trio.com.br/banking/cashin/documents/{id}/refund")
.header("Authorization", "Basic <encoded-value>")
.header("Content-Type", "application/json")
.body("{\n \"amount\": 10,\n \"description\": \"Refund description\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.sandbox.trio.com.br/banking/cashin/documents/{id}/refund")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Basic <encoded-value>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"amount\": 10,\n \"description\": \"Refund description\"\n}"
response = http.request(request)
puts response.read_body{
"data": {
"amount": {
"amount": 10,
"currency": "BRL"
},
"description": "Refund description",
"end_to_end_id": "E44444444202405211946Dwg1pjxgehP",
"id": "018f9cb0-8d37-031e-8b99-bac2919a5033",
"receipt_url": "https://receipts.trio.com.br/document_receipts/018f9cb0-8d11-72dd-bb14-f82554e80999/refund/018f9cb0-8d37-031e-8b99-bac2919a5033",
"reconciliation_id": "018f9cb0-8d37-031e-8b99-bac2919a5033",
"status": "settled",
"timestamp": "2024-05-21T19:46:07.285344Z",
"transaction_date": "2024-05-21T19:46:07.285344Z"
}
}{
"errors": [
{
"detail": "null value where string expected",
"source": {
"pointer": "/data/attributes/petName"
},
"title": "Invalid value"
}
]
}{
"errors": [
{
"detail": "null value where string expected",
"source": {
"pointer": "/data/attributes/petName"
},
"title": "Invalid value"
}
]
}Refund (Pix)
Refund Pix
Refund a collecting document
POST
/
banking
/
cashin
/
documents
/
{id}
/
refund
Refund a collecting document
curl --request POST \
--url https://api.sandbox.trio.com.br/banking/cashin/documents/{id}/refund \
--header 'Authorization: Basic <encoded-value>' \
--header 'Content-Type: application/json' \
--data '
{
"amount": 10,
"description": "Refund description"
}
'import requests
url = "https://api.sandbox.trio.com.br/banking/cashin/documents/{id}/refund"
payload = {
"amount": 10,
"description": "Refund description"
}
headers = {
"Authorization": "Basic <encoded-value>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Basic <encoded-value>', 'Content-Type': 'application/json'},
body: JSON.stringify({amount: 10, description: 'Refund description'})
};
fetch('https://api.sandbox.trio.com.br/banking/cashin/documents/{id}/refund', 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.trio.com.br/banking/cashin/documents/{id}/refund",
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([
'amount' => 10,
'description' => 'Refund description'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Basic <encoded-value>",
"Content-Type: application/json"
],
]);
$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.trio.com.br/banking/cashin/documents/{id}/refund"
payload := strings.NewReader("{\n \"amount\": 10,\n \"description\": \"Refund description\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Basic <encoded-value>")
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.trio.com.br/banking/cashin/documents/{id}/refund")
.header("Authorization", "Basic <encoded-value>")
.header("Content-Type", "application/json")
.body("{\n \"amount\": 10,\n \"description\": \"Refund description\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.sandbox.trio.com.br/banking/cashin/documents/{id}/refund")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Basic <encoded-value>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"amount\": 10,\n \"description\": \"Refund description\"\n}"
response = http.request(request)
puts response.read_body{
"data": {
"amount": {
"amount": 10,
"currency": "BRL"
},
"description": "Refund description",
"end_to_end_id": "E44444444202405211946Dwg1pjxgehP",
"id": "018f9cb0-8d37-031e-8b99-bac2919a5033",
"receipt_url": "https://receipts.trio.com.br/document_receipts/018f9cb0-8d11-72dd-bb14-f82554e80999/refund/018f9cb0-8d37-031e-8b99-bac2919a5033",
"reconciliation_id": "018f9cb0-8d37-031e-8b99-bac2919a5033",
"status": "settled",
"timestamp": "2024-05-21T19:46:07.285344Z",
"transaction_date": "2024-05-21T19:46:07.285344Z"
}
}{
"errors": [
{
"detail": "null value where string expected",
"source": {
"pointer": "/data/attributes/petName"
},
"title": "Invalid value"
}
]
}{
"errors": [
{
"detail": "null value where string expected",
"source": {
"pointer": "/data/attributes/petName"
},
"title": "Invalid value"
}
]
}Authorizations
Basic authentication header of the form Basic <encoded-value>, where <encoded-value> is the base64-encoded string username:password.
Path Parameters
Collecting Document Unique identifier
Body
application/json
Refund creation attributes
Response
Document
Refund within a collecting document
⌘I

