Create card charge
curl --request POST \
--url https://api.fincle.com.br/card \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"amountInCents": 19900,
"description": "Invoice no. 2026/001042",
"postbackUrl": "https://api.example.com/webhooks/fincle",
"card": {
"cardToken": "tok_9f2c1a7b4d6e",
"installments": 3
},
"customer": {
"name": "Helena Martins Andrade",
"email": "helena.andrade@example.com",
"documentType": "cpf",
"document": "31845792041",
"phone": "11932104567"
}
}
'import requests
url = "https://api.fincle.com.br/card"
payload = {
"amountInCents": 19900,
"description": "Invoice no. 2026/001042",
"postbackUrl": "https://api.example.com/webhooks/fincle",
"card": {
"cardToken": "tok_9f2c1a7b4d6e",
"installments": 3
},
"customer": {
"name": "Helena Martins Andrade",
"email": "helena.andrade@example.com",
"documentType": "cpf",
"document": "31845792041",
"phone": "11932104567"
}
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
amountInCents: 19900,
description: 'Invoice no. 2026/001042',
postbackUrl: 'https://api.example.com/webhooks/fincle',
card: {cardToken: 'tok_9f2c1a7b4d6e', installments: 3},
customer: {
name: 'Helena Martins Andrade',
email: 'helena.andrade@example.com',
documentType: 'cpf',
document: '31845792041',
phone: '11932104567'
}
})
};
fetch('https://api.fincle.com.br/card', 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.fincle.com.br/card",
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([
'amountInCents' => 19900,
'description' => 'Invoice no. 2026/001042',
'postbackUrl' => 'https://api.example.com/webhooks/fincle',
'card' => [
'cardToken' => 'tok_9f2c1a7b4d6e',
'installments' => 3
],
'customer' => [
'name' => 'Helena Martins Andrade',
'email' => 'helena.andrade@example.com',
'documentType' => 'cpf',
'document' => '31845792041',
'phone' => '11932104567'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"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.fincle.com.br/card"
payload := strings.NewReader("{\n \"amountInCents\": 19900,\n \"description\": \"Invoice no. 2026/001042\",\n \"postbackUrl\": \"https://api.example.com/webhooks/fincle\",\n \"card\": {\n \"cardToken\": \"tok_9f2c1a7b4d6e\",\n \"installments\": 3\n },\n \"customer\": {\n \"name\": \"Helena Martins Andrade\",\n \"email\": \"helena.andrade@example.com\",\n \"documentType\": \"cpf\",\n \"document\": \"31845792041\",\n \"phone\": \"11932104567\"\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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.fincle.com.br/card")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"amountInCents\": 19900,\n \"description\": \"Invoice no. 2026/001042\",\n \"postbackUrl\": \"https://api.example.com/webhooks/fincle\",\n \"card\": {\n \"cardToken\": \"tok_9f2c1a7b4d6e\",\n \"installments\": 3\n },\n \"customer\": {\n \"name\": \"Helena Martins Andrade\",\n \"email\": \"helena.andrade@example.com\",\n \"documentType\": \"cpf\",\n \"document\": \"31845792041\",\n \"phone\": \"11932104567\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.fincle.com.br/card")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"amountInCents\": 19900,\n \"description\": \"Invoice no. 2026/001042\",\n \"postbackUrl\": \"https://api.example.com/webhooks/fincle\",\n \"card\": {\n \"cardToken\": \"tok_9f2c1a7b4d6e\",\n \"installments\": 3\n },\n \"customer\": {\n \"name\": \"Helena Martins Andrade\",\n \"email\": \"helena.andrade@example.com\",\n \"documentType\": \"cpf\",\n \"document\": \"31845792041\",\n \"phone\": \"11932104567\"\n }\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"message": "Transação aprovada",
"data": {
"id": "cmddiqpxo09zf1yju2kqkhgga",
"card": {
"token": "tok_9f2c1a7b4d6e",
"brand": "visa",
"last4": "1111"
},
"status": "paid",
"fees": 995
}
}{
"success": false,
"message": "Documento inválido para o tipo selecionado"
}{
"success": false,
"message": "Não autorizado"
}{
"success": false,
"message": "Você atingiu o número máximo de tentativas de pagamento com cartão. Aguarde o fim do bloqueio para tentar novamente com cartão ou pague com Pix.",
"code": "BUYER_ATTEMPTS_EXCEEDED",
"blockedUntil": "2026-11-12T18:30:00.000Z",
"retryAfterSeconds": 1800
}Charges
Create card charge
Creates a credit card charge. The response is 200 for both authorized and declined charges, and the outcome is given in data.status.
POST
/
card
Create card charge
curl --request POST \
--url https://api.fincle.com.br/card \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"amountInCents": 19900,
"description": "Invoice no. 2026/001042",
"postbackUrl": "https://api.example.com/webhooks/fincle",
"card": {
"cardToken": "tok_9f2c1a7b4d6e",
"installments": 3
},
"customer": {
"name": "Helena Martins Andrade",
"email": "helena.andrade@example.com",
"documentType": "cpf",
"document": "31845792041",
"phone": "11932104567"
}
}
'import requests
url = "https://api.fincle.com.br/card"
payload = {
"amountInCents": 19900,
"description": "Invoice no. 2026/001042",
"postbackUrl": "https://api.example.com/webhooks/fincle",
"card": {
"cardToken": "tok_9f2c1a7b4d6e",
"installments": 3
},
"customer": {
"name": "Helena Martins Andrade",
"email": "helena.andrade@example.com",
"documentType": "cpf",
"document": "31845792041",
"phone": "11932104567"
}
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
amountInCents: 19900,
description: 'Invoice no. 2026/001042',
postbackUrl: 'https://api.example.com/webhooks/fincle',
card: {cardToken: 'tok_9f2c1a7b4d6e', installments: 3},
customer: {
name: 'Helena Martins Andrade',
email: 'helena.andrade@example.com',
documentType: 'cpf',
document: '31845792041',
phone: '11932104567'
}
})
};
fetch('https://api.fincle.com.br/card', 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.fincle.com.br/card",
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([
'amountInCents' => 19900,
'description' => 'Invoice no. 2026/001042',
'postbackUrl' => 'https://api.example.com/webhooks/fincle',
'card' => [
'cardToken' => 'tok_9f2c1a7b4d6e',
'installments' => 3
],
'customer' => [
'name' => 'Helena Martins Andrade',
'email' => 'helena.andrade@example.com',
'documentType' => 'cpf',
'document' => '31845792041',
'phone' => '11932104567'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"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.fincle.com.br/card"
payload := strings.NewReader("{\n \"amountInCents\": 19900,\n \"description\": \"Invoice no. 2026/001042\",\n \"postbackUrl\": \"https://api.example.com/webhooks/fincle\",\n \"card\": {\n \"cardToken\": \"tok_9f2c1a7b4d6e\",\n \"installments\": 3\n },\n \"customer\": {\n \"name\": \"Helena Martins Andrade\",\n \"email\": \"helena.andrade@example.com\",\n \"documentType\": \"cpf\",\n \"document\": \"31845792041\",\n \"phone\": \"11932104567\"\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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.fincle.com.br/card")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"amountInCents\": 19900,\n \"description\": \"Invoice no. 2026/001042\",\n \"postbackUrl\": \"https://api.example.com/webhooks/fincle\",\n \"card\": {\n \"cardToken\": \"tok_9f2c1a7b4d6e\",\n \"installments\": 3\n },\n \"customer\": {\n \"name\": \"Helena Martins Andrade\",\n \"email\": \"helena.andrade@example.com\",\n \"documentType\": \"cpf\",\n \"document\": \"31845792041\",\n \"phone\": \"11932104567\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.fincle.com.br/card")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"amountInCents\": 19900,\n \"description\": \"Invoice no. 2026/001042\",\n \"postbackUrl\": \"https://api.example.com/webhooks/fincle\",\n \"card\": {\n \"cardToken\": \"tok_9f2c1a7b4d6e\",\n \"installments\": 3\n },\n \"customer\": {\n \"name\": \"Helena Martins Andrade\",\n \"email\": \"helena.andrade@example.com\",\n \"documentType\": \"cpf\",\n \"document\": \"31845792041\",\n \"phone\": \"11932104567\"\n }\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"message": "Transação aprovada",
"data": {
"id": "cmddiqpxo09zf1yju2kqkhgga",
"card": {
"token": "tok_9f2c1a7b4d6e",
"brand": "visa",
"last4": "1111"
},
"status": "paid",
"fees": 995
}
}{
"success": false,
"message": "Documento inválido para o tipo selecionado"
}{
"success": false,
"message": "Não autorizado"
}{
"success": false,
"message": "Você atingiu o número máximo de tentativas de pagamento com cartão. Aguarde o fim do bloqueio para tentar novamente com cartão ou pague com Pix.",
"code": "BUYER_ATTEMPTS_EXCEEDED",
"blockedUntil": "2026-11-12T18:30:00.000Z",
"retryAfterSeconds": 1800
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Headers
Idempotency key of the request. Repeating the request with the same key returns the transaction already recorded, without creating a new charge. A universally unique identifier (UUID) is recommended.
Body
application/json