curl --request GET \
--url https://api-global.fastpaybrasil.com/v1/charges/{id} \
--header 'Authorization: Basic <encoded-value>'import requests
url = "https://api-global.fastpaybrasil.com/v1/charges/{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-global.fastpaybrasil.com/v1/charges/{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-global.fastpaybrasil.com/v1/charges/{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-global.fastpaybrasil.com/v1/charges/{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-global.fastpaybrasil.com/v1/charges/{id}")
.header("Authorization", "Basic <encoded-value>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api-global.fastpaybrasil.com/v1/charges/{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{
"id": "2vorkDcXyvzifL63YX09S9VqcnI",
"status": "paid",
"chargebackAlertRefunded": true,
"chargebackAlertReason": "Chargeback - NSU 123456789",
"pspRefId": "ch_123456789",
"amount": 100.5,
"currency": "USD",
"spread": 2.5,
"net": 98,
"customer": {
"id": "2vorkDcXyvzifL63YX09S9VqcnI",
"name": "John Doe",
"email": "[email protected]",
"document": "123.456.789-00"
},
"paymentMethod": {
"type": "credit_card",
"firstSix": "123456",
"lastFour": "7890",
"expirationMonth": "08",
"expirationYear": "2024",
"holderName": "John Doe",
"installments": 3
},
"merchantId": "2vorkDcXyvzifL63YX09S9VqcnI",
"paymentDetails": {
"firstSix": "123456",
"lastFour": "7890",
"expirationMonth": "08",
"expirationYear": "2024",
"holderName": "John Doe",
"installments": 3
},
"metadata": {
"order_id": "123",
"user_id": "456"
},
"paidAt": "2023-01-15T14:30:00Z",
"createdAt": "2023-01-15T14:30:00Z",
"updatedAt": "2023-01-15T14:30:00Z"
}{
"statusCode": 401,
"message": "Unauthorized"
}{
"statusCode": 404,
"message": "Charge not found"
}Get charge by ID
Returns a single charge by its unique identifier. Useful for idempotency checks and for correlating webhook events with the charge’s current state.
curl --request GET \
--url https://api-global.fastpaybrasil.com/v1/charges/{id} \
--header 'Authorization: Basic <encoded-value>'import requests
url = "https://api-global.fastpaybrasil.com/v1/charges/{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-global.fastpaybrasil.com/v1/charges/{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-global.fastpaybrasil.com/v1/charges/{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-global.fastpaybrasil.com/v1/charges/{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-global.fastpaybrasil.com/v1/charges/{id}")
.header("Authorization", "Basic <encoded-value>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api-global.fastpaybrasil.com/v1/charges/{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{
"id": "2vorkDcXyvzifL63YX09S9VqcnI",
"status": "paid",
"chargebackAlertRefunded": true,
"chargebackAlertReason": "Chargeback - NSU 123456789",
"pspRefId": "ch_123456789",
"amount": 100.5,
"currency": "USD",
"spread": 2.5,
"net": 98,
"customer": {
"id": "2vorkDcXyvzifL63YX09S9VqcnI",
"name": "John Doe",
"email": "[email protected]",
"document": "123.456.789-00"
},
"paymentMethod": {
"type": "credit_card",
"firstSix": "123456",
"lastFour": "7890",
"expirationMonth": "08",
"expirationYear": "2024",
"holderName": "John Doe",
"installments": 3
},
"merchantId": "2vorkDcXyvzifL63YX09S9VqcnI",
"paymentDetails": {
"firstSix": "123456",
"lastFour": "7890",
"expirationMonth": "08",
"expirationYear": "2024",
"holderName": "John Doe",
"installments": 3
},
"metadata": {
"order_id": "123",
"user_id": "456"
},
"paidAt": "2023-01-15T14:30:00Z",
"createdAt": "2023-01-15T14:30:00Z",
"updatedAt": "2023-01-15T14:30:00Z"
}{
"statusCode": 401,
"message": "Unauthorized"
}{
"statusCode": 404,
"message": "Charge not found"
}Authorizations
HTTP Basic authentication. Use your secret key as the username and an empty string as password. The API key should be base64 encoded in the format 'username:' when sending the Authorization header.
Path Parameters
Unique charge identifier
Response
Successfully retrieved the charge
The unique identifier of the charge
"2vorkDcXyvzifL63YX09S9VqcnI"
The status of the charge
paid, pending, refused, failed, refunded, in_analysis, authentication_required, pre_chargeback, chargeback "paid"
Presente em cobranças com alerta de pré-chargeback (status: pre_chargeback). true = o valor já foi estornado ao portador como parte do tratamento do alerta; false = disputa aberta sem estorno. null quando não há alerta.
true
Motivo/referência informado no alerta de pré-chargeback.
"Chargeback - NSU 123456789"
The reference identifier in the PSP (Payment Service Provider) system
"ch_123456789"
The total amount of the charge
100.5
The currency of the charge in ISO 4217 format
"USD"
The spread applied to the charge
2.5
The net amount after applying the spread
98
Show child attributes
Show child attributes
- Credit Card
- Rapipago
- Khipu
- QRCode
Show child attributes
Show child attributes
The merchant identifier
"2vorkDcXyvzifL63YX09S9VqcnI"
Additional payment details. Its different based on the payment method.
- Credit Card
- Rapipago
- Khipu
- Pix
- QRCode
Show child attributes
Show child attributes
Custom metadata associated with the charge
{ "order_id": "123", "user_id": "456" }
The date and time when the charge was paid
"2023-01-15T14:30:00Z"
The date and time when the charge was created
"2023-01-15T14:30:00Z"
The date and time when the charge was last updated
"2023-01-15T14:30:00Z"