curl --request POST \
--url https://economy.synxbr.com/api/v1/card-invoices/{id}/payments \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'Idempotency-Key: <idempotency-key>' \
--data '
{
"bank_account_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"amount": "<string>",
"date": "2023-12-25"
}
'const options = {
method: 'POST',
headers: {
'Idempotency-Key': '<idempotency-key>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
bank_account_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
amount: '<string>',
date: '2023-12-25'
})
};
fetch('https://economy.synxbr.com/api/v1/card-invoices/{id}/payments', 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}/payments"
payload = {
"bank_account_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"amount": "<string>",
"date": "2023-12-25"
}
headers = {
"Idempotency-Key": "<idempotency-key>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://economy.synxbr.com/api/v1/card-invoices/{id}/payments",
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([
'bank_account_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'amount' => '<string>',
'date' => '2023-12-25'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json",
"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",
"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",
"invoice": {
"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>"
]
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"request_id": "<string>",
"fields": {},
"required_permissions": [
"<string>"
]
}
}Registra o pagamento de uma fatura de cartão.
É o Pagar fatura da tela, sem a escolha da linha do extrato (ligar a linha é conciliar, e conciliar fica na tela). O que acontece depende da conta: se ela recebe extrato no SynX, o pagamento fica registrado à espera da linha (statement_line: awaiting) e a Conciliação sugere ligá-lo quando ela chegar — nada novo entra no extrato; se a conta não recebe extrato, o SynX lança a saída nela (statement_line: registered). O valor não pode passar do que falta na fatura; a menos, a fatura fica paga em parte. A data não pode ser depois de hoje nem cair em mês fechado (409 period_closed). Fatura de cartão do banco não recebe pagamento por aqui: ele chega pelo extrato (409 invalid_state). Além de cards.invoices.manage, pede bank.accounts.view.
Permissão exigida: Fechar e pagar faturas (cards.invoices.manage).
curl --request POST \
--url https://economy.synxbr.com/api/v1/card-invoices/{id}/payments \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'Idempotency-Key: <idempotency-key>' \
--data '
{
"bank_account_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"amount": "<string>",
"date": "2023-12-25"
}
'const options = {
method: 'POST',
headers: {
'Idempotency-Key': '<idempotency-key>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
bank_account_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
amount: '<string>',
date: '2023-12-25'
})
};
fetch('https://economy.synxbr.com/api/v1/card-invoices/{id}/payments', 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}/payments"
payload = {
"bank_account_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"amount": "<string>",
"date": "2023-12-25"
}
headers = {
"Idempotency-Key": "<idempotency-key>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://economy.synxbr.com/api/v1/card-invoices/{id}/payments",
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([
'bank_account_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'amount' => '<string>',
'date' => '2023-12-25'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json",
"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",
"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",
"invoice": {
"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>"
]
}
}{
"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.
8 - 100