List charges
curl --request GET \
--url https://api.fintoc.com/v1/charges \
--header 'Authorization: <api-key>'import requests
url = "https://api.fintoc.com/v1/charges"
headers = {"Authorization": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: '<api-key>'}};
fetch('https://api.fintoc.com/v1/charges', 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.fintoc.com/v1/charges",
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: <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"
"net/http"
"io"
)
func main() {
url := "https://api.fintoc.com/v1/charges"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "<api-key>")
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.fintoc.com/v1/charges")
.header("Authorization", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.fintoc.com/v1/charges")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = '<api-key>'
response = http.request(request)
puts response.read_body[
{
"id": "ch_o9YDuRzUez2GqV4x",
"object": "charge",
"amount": 5000,
"created_at": "2021-05-17T17:04:10.284Z",
"currency": "CLP",
"failure_code": null,
"metadata": {
"order_id": "0001"
},
"mode": "live",
"status": "pending",
"subscription_id": "sub_m7N9rAWJS9dWDKEe"
}
]{
"error": {
"type": "invalid_request_error",
"code": "invalid_enum",
"param": "status",
"message": "Invalid status: unknown_status. Must be one of 'pending', 'in_progress', 'succeeded', 'failed' or 'canceled'.",
"doc_url": "https://docs.fintoc.com/reference/errors"
}
}{
"error": {
"type": "authentication_error",
"code": "invalid_api_key",
"message": "Invalid API Key: invalid-*oken"
}
}{
"error": {
"type": "invalid_request_error",
"code": "missing_resource",
"param": "subscription_id",
"message": "Subscription not found: sub_LDcjBFqGpKuj8FPV",
"doc_url": "https://docs.fintoc.com/reference/errors"
}
}Cargos
List charges
Lists the charges of your organization for the live or test mode of the API key used, sorted by creation date with the most recent charges first.
GET
/
v1
/
charges
List charges
curl --request GET \
--url https://api.fintoc.com/v1/charges \
--header 'Authorization: <api-key>'import requests
url = "https://api.fintoc.com/v1/charges"
headers = {"Authorization": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: '<api-key>'}};
fetch('https://api.fintoc.com/v1/charges', 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.fintoc.com/v1/charges",
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: <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"
"net/http"
"io"
)
func main() {
url := "https://api.fintoc.com/v1/charges"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "<api-key>")
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.fintoc.com/v1/charges")
.header("Authorization", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.fintoc.com/v1/charges")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = '<api-key>'
response = http.request(request)
puts response.read_body[
{
"id": "ch_o9YDuRzUez2GqV4x",
"object": "charge",
"amount": 5000,
"created_at": "2021-05-17T17:04:10.284Z",
"currency": "CLP",
"failure_code": null,
"metadata": {
"order_id": "0001"
},
"mode": "live",
"status": "pending",
"subscription_id": "sub_m7N9rAWJS9dWDKEe"
}
]{
"error": {
"type": "invalid_request_error",
"code": "invalid_enum",
"param": "status",
"message": "Invalid status: unknown_status. Must be one of 'pending', 'in_progress', 'succeeded', 'failed' or 'canceled'.",
"doc_url": "https://docs.fintoc.com/reference/errors"
}
}{
"error": {
"type": "authentication_error",
"code": "invalid_api_key",
"message": "Invalid API Key: invalid-*oken"
}
}{
"error": {
"type": "invalid_request_error",
"code": "missing_resource",
"param": "subscription_id",
"message": "Subscription not found: sub_LDcjBFqGpKuj8FPV",
"doc_url": "https://docs.fintoc.com/reference/errors"
}
}Parámetros de consulta
Respuesta
List of charges for the current mode, sorted by creation date with the most recent charges first.
Reason why the charge failed. Always null unless status is failed. One of insufficient_funds (the bank account did not have enough funds), subscription_inactive (the subscription is no longer active at the bank), charge_amount_limit_exceeded (the amount exceeds the bank's per-charge limit), bank_account_unavailable (the bank account is closed, blocked, or could not be found), or other.
Opciones disponibles:
insufficient_funds, subscription_inactive, charge_amount_limit_exceeded, bank_account_unavailable, other, null Ejemplo:
"insufficient_funds"
¿Esta página le ayudó?