Show Card purchase document by id
curl --request GET \
--url https://api.sandbox.trio.com.br/banking/cards/purchases/{id} \
--header 'Authorization: Basic <encoded-value>'import requests
url = "https://api.sandbox.trio.com.br/banking/cards/purchases/{id}"
headers = {"Authorization": "Basic <encoded-value>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Basic <encoded-value>'}};
fetch('https://api.sandbox.trio.com.br/banking/cards/purchases/{id}', 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/cards/purchases/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Basic <encoded-value>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.sandbox.trio.com.br/banking/cards/purchases/{id}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Basic <encoded-value>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.sandbox.trio.com.br/banking/cards/purchases/{id}")
.header("Authorization", "Basic <encoded-value>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.sandbox.trio.com.br/banking/cards/purchases/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Basic <encoded-value>'
response = http.request(request)
puts response.read_body{
"data": {
"receipt_url": "https://app.trio.com.br/receipt/0182b3d0-0b3b-4b3b-8b3b-0b3b4b3b8b3b",
"is_partially_allowed": false,
"holder_id": "0182b3d0-0b3b-4b3b-8b3b-0b3b4b3b8b3b",
"stages": [
{
"is_partially_allowed": false,
"holder_id": "0182b3d0-0b3b-4b3b-8b3b-0b3b4b3b8b3b",
"inserted_at": "2021-01-01T00:00:00Z",
"wallet_id": "0182b3d0-0b3b-4b3b-8b3b-0b3b4b3b8b3b",
"entity_id": "0182b3d0-0b3b-4b3b-8b3b-0b3b4b3b8b3b",
"issuer_amount": {
"amount": 10000,
"currency": "BRL"
},
"category_type": "restaurants",
"tax": {
"amount": 10,
"currency": "BRL"
},
"merchant_country_code": "BR",
"card_id": "0182b3d0-0b3b-4b3b-8b3b-0b3b4b3b8b3b",
"category_code": "foodAndBeverages",
"method_code": "manual",
"company_id": "0182b3d0-0b3b-4b3b-8b3b-0b3b4b3b8b3b",
"status": "confirmed",
"updated_at": "2021-01-01T00:00:00Z",
"description": "description",
"id": "0182b3d0-0b3b-4b3b-8b3b-0b3b4b3b8b3b",
"purpose": "purchase",
"merchant_amount": {
"amount": 10000,
"currency": "BRL"
},
"purchase_document_id": "0182b3d0-0b3b-4b3b-8b3b-0b3b4b3b8b3b",
"merchant_currency_symbol": "R$",
"zip_code": "000000-000",
"merchant_name": "John Doe Store",
"category_id": "0182b3d0-0b3b-4b3b-8b3b-0b3b4b3b8b3b",
"callback_amount": {
"amount": 10000,
"currency": "BRL"
},
"error_code": "null",
"error_message": "null",
"end_to_end_id": "EE202506111406IVIN5pXVoyp",
"timestamp": "2021-01-01T00:00:00Z",
"callback_type": "approved",
"org_id": "0182b3d0-0b3b-4b3b-8b3b-0b3b4b3b8b3b",
"amount": {
"amount": 10000,
"currency": "BRL"
},
"score": "1.0",
"merchant_id": "0182b3d0-0b3b-4b3b-8b3b-0b3b4b3b8b3b"
}
],
"inserted_at": "2021-01-01T00:00:00Z",
"wallet_id": "0182b3d0-0b3b-4b3b-8b3b-0b3b4b3b8b3b",
"entity_id": "0182b3d0-0b3b-4b3b-8b3b-0b3b4b3b8b3b",
"issuer_amount": {
"amount": 10000,
"currency": "BRL"
},
"category_type": "restaurants",
"tax": {
"amount": 10,
"currency": "BRL"
},
"merchant_country_code": "BR",
"card_id": "0182b3d0-0b3b-4b3b-8b3b-0b3b4b3b8b3b",
"category_code": "foodAndBeverages",
"method_code": "manual",
"company_id": "0182b3d0-0b3b-4b3b-8b3b-0b3b4b3b8b3b",
"status": "confirmed",
"updated_at": "2021-01-01T00:00:00Z",
"description": "description",
"id": "0182b3d0-0b3b-4b3b-8b3b-0b3b4b3b8b3b",
"purpose": "purchase",
"merchant_amount": {
"amount": 10000,
"currency": "BRL"
},
"merchant_currency_symbol": "R$",
"zip_code": "000000-000",
"merchant_name": "John Doe Store",
"category_id": "0182b3d0-0b3b-4b3b-8b3b-0b3b4b3b8b3b",
"error_code": "null",
"error_message": "null",
"end_to_end_id": "EE202506111406IVIN5pXVoyp",
"timestamp": "2021-01-01T00:00:00Z",
"org_id": "0182b3d0-0b3b-4b3b-8b3b-0b3b4b3b8b3b",
"compress_timestamp": "2021-01-01T00:00:00Z",
"amount": {
"amount": 10000,
"currency": "BRL"
},
"score": "1.0",
"merchant_id": "0182b3d0-0b3b-4b3b-8b3b-0b3b4b3b8b3b"
}
}{
"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"
}
]
}Cards
Show Card Purchase Document by ID
Show Card purchase document by id
GET
/
banking
/
cards
/
purchases
/
{id}
Show Card purchase document by id
curl --request GET \
--url https://api.sandbox.trio.com.br/banking/cards/purchases/{id} \
--header 'Authorization: Basic <encoded-value>'import requests
url = "https://api.sandbox.trio.com.br/banking/cards/purchases/{id}"
headers = {"Authorization": "Basic <encoded-value>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Basic <encoded-value>'}};
fetch('https://api.sandbox.trio.com.br/banking/cards/purchases/{id}', 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/cards/purchases/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Basic <encoded-value>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.sandbox.trio.com.br/banking/cards/purchases/{id}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Basic <encoded-value>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.sandbox.trio.com.br/banking/cards/purchases/{id}")
.header("Authorization", "Basic <encoded-value>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.sandbox.trio.com.br/banking/cards/purchases/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Basic <encoded-value>'
response = http.request(request)
puts response.read_body{
"data": {
"receipt_url": "https://app.trio.com.br/receipt/0182b3d0-0b3b-4b3b-8b3b-0b3b4b3b8b3b",
"is_partially_allowed": false,
"holder_id": "0182b3d0-0b3b-4b3b-8b3b-0b3b4b3b8b3b",
"stages": [
{
"is_partially_allowed": false,
"holder_id": "0182b3d0-0b3b-4b3b-8b3b-0b3b4b3b8b3b",
"inserted_at": "2021-01-01T00:00:00Z",
"wallet_id": "0182b3d0-0b3b-4b3b-8b3b-0b3b4b3b8b3b",
"entity_id": "0182b3d0-0b3b-4b3b-8b3b-0b3b4b3b8b3b",
"issuer_amount": {
"amount": 10000,
"currency": "BRL"
},
"category_type": "restaurants",
"tax": {
"amount": 10,
"currency": "BRL"
},
"merchant_country_code": "BR",
"card_id": "0182b3d0-0b3b-4b3b-8b3b-0b3b4b3b8b3b",
"category_code": "foodAndBeverages",
"method_code": "manual",
"company_id": "0182b3d0-0b3b-4b3b-8b3b-0b3b4b3b8b3b",
"status": "confirmed",
"updated_at": "2021-01-01T00:00:00Z",
"description": "description",
"id": "0182b3d0-0b3b-4b3b-8b3b-0b3b4b3b8b3b",
"purpose": "purchase",
"merchant_amount": {
"amount": 10000,
"currency": "BRL"
},
"purchase_document_id": "0182b3d0-0b3b-4b3b-8b3b-0b3b4b3b8b3b",
"merchant_currency_symbol": "R$",
"zip_code": "000000-000",
"merchant_name": "John Doe Store",
"category_id": "0182b3d0-0b3b-4b3b-8b3b-0b3b4b3b8b3b",
"callback_amount": {
"amount": 10000,
"currency": "BRL"
},
"error_code": "null",
"error_message": "null",
"end_to_end_id": "EE202506111406IVIN5pXVoyp",
"timestamp": "2021-01-01T00:00:00Z",
"callback_type": "approved",
"org_id": "0182b3d0-0b3b-4b3b-8b3b-0b3b4b3b8b3b",
"amount": {
"amount": 10000,
"currency": "BRL"
},
"score": "1.0",
"merchant_id": "0182b3d0-0b3b-4b3b-8b3b-0b3b4b3b8b3b"
}
],
"inserted_at": "2021-01-01T00:00:00Z",
"wallet_id": "0182b3d0-0b3b-4b3b-8b3b-0b3b4b3b8b3b",
"entity_id": "0182b3d0-0b3b-4b3b-8b3b-0b3b4b3b8b3b",
"issuer_amount": {
"amount": 10000,
"currency": "BRL"
},
"category_type": "restaurants",
"tax": {
"amount": 10,
"currency": "BRL"
},
"merchant_country_code": "BR",
"card_id": "0182b3d0-0b3b-4b3b-8b3b-0b3b4b3b8b3b",
"category_code": "foodAndBeverages",
"method_code": "manual",
"company_id": "0182b3d0-0b3b-4b3b-8b3b-0b3b4b3b8b3b",
"status": "confirmed",
"updated_at": "2021-01-01T00:00:00Z",
"description": "description",
"id": "0182b3d0-0b3b-4b3b-8b3b-0b3b4b3b8b3b",
"purpose": "purchase",
"merchant_amount": {
"amount": 10000,
"currency": "BRL"
},
"merchant_currency_symbol": "R$",
"zip_code": "000000-000",
"merchant_name": "John Doe Store",
"category_id": "0182b3d0-0b3b-4b3b-8b3b-0b3b4b3b8b3b",
"error_code": "null",
"error_message": "null",
"end_to_end_id": "EE202506111406IVIN5pXVoyp",
"timestamp": "2021-01-01T00:00:00Z",
"org_id": "0182b3d0-0b3b-4b3b-8b3b-0b3b4b3b8b3b",
"compress_timestamp": "2021-01-01T00:00:00Z",
"amount": {
"amount": 10000,
"currency": "BRL"
},
"score": "1.0",
"merchant_id": "0182b3d0-0b3b-4b3b-8b3b-0b3b4b3b8b3b"
}
}{
"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
Document ID Unique identifier
Response
Document
Purchase Document response
A Card Purchase Document with Stages
Show child attributes
Show child attributes
Example:
{
"receipt_url": "https://app.trio.com.br/receipt/0182b3d0-0b3b-4b3b-8b3b-0b3b4b3b8b3b",
"is_partially_allowed": false,
"holder_id": "0182b3d0-0b3b-4b3b-8b3b-0b3b4b3b8b3b",
"inserted_at": "2021-01-01T00:00:00Z",
"wallet_id": "0182b3d0-0b3b-4b3b-8b3b-0b3b4b3b8b3b",
"entity_id": "0182b3d0-0b3b-4b3b-8b3b-0b3b4b3b8b3b",
"issuer_amount": { "amount": 10000, "currency": "BRL" },
"category_type": "restaurants",
"tax": { "amount": 10, "currency": "BRL" },
"merchant_country_code": "BR",
"card_id": "0182b3d0-0b3b-4b3b-8b3b-0b3b4b3b8b3b",
"category_code": "foodAndBeverages",
"method_code": "manual",
"company_id": "0182b3d0-0b3b-4b3b-8b3b-0b3b4b3b8b3b",
"status": "confirmed",
"updated_at": "2021-01-01T00:00:00Z",
"description": "description",
"id": "0182b3d0-0b3b-4b3b-8b3b-0b3b4b3b8b3b",
"purpose": "purchase",
"merchant_amount": { "amount": 10000, "currency": "BRL" },
"merchant_currency_symbol": "R$",
"zip_code": "000000-000",
"merchant_name": "John Doe Store",
"category_id": "0182b3d0-0b3b-4b3b-8b3b-0b3b4b3b8b3b",
"error_code": "null",
"error_message": "null",
"end_to_end_id": "EE202506111406IVIN5pXVoyp",
"timestamp": "2021-01-01T00:00:00Z",
"org_id": "0182b3d0-0b3b-4b3b-8b3b-0b3b4b3b8b3b",
"compress_timestamp": "2021-01-01T00:00:00Z",
"amount": { "amount": 10000, "currency": "BRL" },
"score": "1.0",
"merchant_id": "0182b3d0-0b3b-4b3b-8b3b-0b3b4b3b8b3b",
"stages": [
{
"is_partially_allowed": false,
"holder_id": "0182b3d0-0b3b-4b3b-8b3b-0b3b4b3b8b3b",
"inserted_at": "2021-01-01T00:00:00Z",
"wallet_id": "0182b3d0-0b3b-4b3b-8b3b-0b3b4b3b8b3b",
"entity_id": "0182b3d0-0b3b-4b3b-8b3b-0b3b4b3b8b3b",
"issuer_amount": { "amount": 10000, "currency": "BRL" },
"category_type": "restaurants",
"tax": { "amount": 10, "currency": "BRL" },
"merchant_country_code": "BR",
"card_id": "0182b3d0-0b3b-4b3b-8b3b-0b3b4b3b8b3b",
"category_code": "foodAndBeverages",
"method_code": "manual",
"company_id": "0182b3d0-0b3b-4b3b-8b3b-0b3b4b3b8b3b",
"status": "confirmed",
"updated_at": "2021-01-01T00:00:00Z",
"description": "description",
"id": "0182b3d0-0b3b-4b3b-8b3b-0b3b4b3b8b3b",
"purpose": "purchase",
"merchant_amount": { "amount": 10000, "currency": "BRL" },
"purchase_document_id": "0182b3d0-0b3b-4b3b-8b3b-0b3b4b3b8b3b",
"merchant_currency_symbol": "R$",
"zip_code": "000000-000",
"merchant_name": "John Doe Store",
"category_id": "0182b3d0-0b3b-4b3b-8b3b-0b3b4b3b8b3b",
"callback_amount": { "amount": 10000, "currency": "BRL" },
"error_code": "null",
"error_message": "null",
"end_to_end_id": "EE202506111406IVIN5pXVoyp",
"timestamp": "2021-01-01T00:00:00Z",
"callback_type": "approved",
"org_id": "0182b3d0-0b3b-4b3b-8b3b-0b3b4b3b8b3b",
"amount": { "amount": 10000, "currency": "BRL" },
"score": "1.0",
"merchant_id": "0182b3d0-0b3b-4b3b-8b3b-0b3b4b3b8b3b"
}
]
}
⌘I

