Fecha a fatura aberta de um cartão.
curl --request POST \
--url https://economy.synxbr.com/api/v1/card-invoices/{id}/close \
--header 'Authorization: Bearer <token>' \
--header 'Idempotency-Key: <idempotency-key>'const options = {
method: 'POST',
headers: {'Idempotency-Key': '<idempotency-key>', Authorization: 'Bearer <token>'}
};
fetch('https://economy.synxbr.com/api/v1/card-invoices/{id}/close', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://economy.synxbr.com/api/v1/card-invoices/{id}/close"
headers = {
"Idempotency-Key": "<idempotency-key>",
"Authorization": "Bearer <token>"
}
response = requests.post(url, headers=headers)
print(response.text)<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://economy.synxbr.com/api/v1/card-invoices/{id}/close",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Idempotency-Key: <idempotency-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}{
"data": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"card": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>"
},
"source": "registered",
"statement_month": "<string>",
"closing_date": "2023-12-25",
"due_date": "2023-12-25",
"due_date_estimated": true,
"status": "open",
"amount": "<string>",
"paid_amount": "<string>",
"open_amount": "<string>",
"closed_at": "2023-11-07T05:31:56Z",
"paid_at": "2023-11-07T05:31:56Z",
"payments": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"amount": "<string>",
"paid_at": "2023-11-07T05:31:56Z",
"origin": "manual",
"statement_line": "linked",
"bank_account": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>"
},
"status": "posted"
}
],
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z"
},
"meta": {
"request_id": "<string>",
"installments": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
],
"generated_titles": 123
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"request_id": "<string>",
"fields": {},
"required_permissions": [
"<string>"
]
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"request_id": "<string>",
"fields": {},
"required_permissions": [
"<string>"
]
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"request_id": "<string>",
"fields": {},
"required_permissions": [
"<string>"
]
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"request_id": "<string>",
"fields": {},
"required_permissions": [
"<string>"
]
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"request_id": "<string>",
"fields": {},
"required_permissions": [
"<string>"
]
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"request_id": "<string>",
"fields": {},
"required_permissions": [
"<string>"
]
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"request_id": "<string>",
"fields": {},
"required_permissions": [
"<string>"
]
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"request_id": "<string>",
"fields": {},
"required_permissions": [
"<string>"
]
}
}Fecha a fatura aberta de um cartão.
Depois de fechada, as próximas compras do cartão entram na fatura seguinte. Não tem volta, nem pela API nem pela tela. Vale a regra da tela: só a fatura aberta (status: open), e a de vencimento mais antigo do cartão; a fatura de cartão do banco fecha sozinha (409 invalid_state). A rota não recebe corpo.
Permissão exigida: Fechar e pagar faturas (cards.invoices.manage).
POST
/
card-invoices
/
{id}
/
close
Fecha a fatura aberta de um cartão.
curl --request POST \
--url https://economy.synxbr.com/api/v1/card-invoices/{id}/close \
--header 'Authorization: Bearer <token>' \
--header 'Idempotency-Key: <idempotency-key>'const options = {
method: 'POST',
headers: {'Idempotency-Key': '<idempotency-key>', Authorization: 'Bearer <token>'}
};
fetch('https://economy.synxbr.com/api/v1/card-invoices/{id}/close', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://economy.synxbr.com/api/v1/card-invoices/{id}/close"
headers = {
"Idempotency-Key": "<idempotency-key>",
"Authorization": "Bearer <token>"
}
response = requests.post(url, headers=headers)
print(response.text)<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://economy.synxbr.com/api/v1/card-invoices/{id}/close",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Idempotency-Key: <idempotency-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}{
"data": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"card": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>"
},
"source": "registered",
"statement_month": "<string>",
"closing_date": "2023-12-25",
"due_date": "2023-12-25",
"due_date_estimated": true,
"status": "open",
"amount": "<string>",
"paid_amount": "<string>",
"open_amount": "<string>",
"closed_at": "2023-11-07T05:31:56Z",
"paid_at": "2023-11-07T05:31:56Z",
"payments": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"amount": "<string>",
"paid_at": "2023-11-07T05:31:56Z",
"origin": "manual",
"statement_line": "linked",
"bank_account": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>"
},
"status": "posted"
}
],
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z"
},
"meta": {
"request_id": "<string>",
"installments": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
],
"generated_titles": 123
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"request_id": "<string>",
"fields": {},
"required_permissions": [
"<string>"
]
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"request_id": "<string>",
"fields": {},
"required_permissions": [
"<string>"
]
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"request_id": "<string>",
"fields": {},
"required_permissions": [
"<string>"
]
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"request_id": "<string>",
"fields": {},
"required_permissions": [
"<string>"
]
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"request_id": "<string>",
"fields": {},
"required_permissions": [
"<string>"
]
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"request_id": "<string>",
"fields": {},
"required_permissions": [
"<string>"
]
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"request_id": "<string>",
"fields": {},
"required_permissions": [
"<string>"
]
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"request_id": "<string>",
"fields": {},
"required_permissions": [
"<string>"
]
}
}Autorizações
Cabeçalhos
Um identificador único deste pedido (um UUID serve), de 8 a 100 caracteres. Repetir o pedido com a mesma chave devolve a mesma resposta, sem criar outro registro (24 h); a mesma chave com outro conteúdo é recusada (422). A resposta repetida vem com o cabeçalho Idempotent-Replayed: true.
Required string length:
8 - 100