curl --request POST \
--url https://economy.synxbr.com/api/v1/receivables \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'Idempotency-Key: <idempotency-key>' \
--data '
{
"description": "<string>",
"amount": "<string>",
"due_date": "2023-12-25"
}
'const options = {
method: 'POST',
headers: {
'Idempotency-Key': '<idempotency-key>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({description: '<string>', amount: '<string>', due_date: '2023-12-25'})
};
fetch('https://economy.synxbr.com/api/v1/receivables', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://economy.synxbr.com/api/v1/receivables"
payload = {
"description": "<string>",
"amount": "<string>",
"due_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/receivables",
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([
'description' => '<string>',
'amount' => '<string>',
'due_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",
"external_ref": "<string>",
"description": "<string>",
"status": "pending",
"amount": "1234.56",
"discount": "1234.56",
"interest": "1234.56",
"interest_type": "interest",
"settled_amount": "1234.56",
"open_amount": "1234.56",
"issue_date": "2023-12-25",
"due_date": "2023-12-25",
"competence_date": "2023-12-25",
"settled_at": "2023-11-07T05:31:56Z",
"canceled_at": "2023-11-07T05:31:56Z",
"document": {
"number": "<string>",
"type": "bank_slip",
"has_fiscal_note": true
},
"payment_method": "pix",
"branch": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>"
},
"category": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>"
},
"subcategory": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>"
},
"cost_center": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>"
},
"bank_account": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>"
},
"recurrence": {
"is_recurring": true,
"occurrence_number": 123,
"rule_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
},
"splits": [
{
"company": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>"
},
"branch": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>"
},
"employee": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>"
},
"category": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>"
},
"subcategory": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>"
},
"amount": "1234.56"
}
],
"settlements": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"channel": "bank_statement",
"date": "2023-12-25",
"amount": "1234.56",
"bank_transaction_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"note": "<string>"
}
],
"notes": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"customer": {
"name": "<string>",
"tax_id": "<string>",
"email": "<string>",
"phone": "<string>"
}
},
"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>"
]
}
}Cria uma conta a receber (ou várias, dividida em parcelas).
As regras são as da tela: valor e datas conferidos, filial obrigatória quando a empresa tem filiais, categoria do tipo certo (despesa ou receita) e a subcategoria dela, mês fechado recusado. Com installments, o valor é repartido em centavos pelo SynX (os que sobram vão nas primeiras parcelas) e cada parcela vira uma conta; com external_ref, cada parcela recebe a referência seguida de /1, /2… O rateio (splits) é dentro da empresa da chave e soma o valor da conta.
Permissão exigida: Criar contas a receber (receivables.create).
curl --request POST \
--url https://economy.synxbr.com/api/v1/receivables \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'Idempotency-Key: <idempotency-key>' \
--data '
{
"description": "<string>",
"amount": "<string>",
"due_date": "2023-12-25"
}
'const options = {
method: 'POST',
headers: {
'Idempotency-Key': '<idempotency-key>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({description: '<string>', amount: '<string>', due_date: '2023-12-25'})
};
fetch('https://economy.synxbr.com/api/v1/receivables', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://economy.synxbr.com/api/v1/receivables"
payload = {
"description": "<string>",
"amount": "<string>",
"due_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/receivables",
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([
'description' => '<string>',
'amount' => '<string>',
'due_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",
"external_ref": "<string>",
"description": "<string>",
"status": "pending",
"amount": "1234.56",
"discount": "1234.56",
"interest": "1234.56",
"interest_type": "interest",
"settled_amount": "1234.56",
"open_amount": "1234.56",
"issue_date": "2023-12-25",
"due_date": "2023-12-25",
"competence_date": "2023-12-25",
"settled_at": "2023-11-07T05:31:56Z",
"canceled_at": "2023-11-07T05:31:56Z",
"document": {
"number": "<string>",
"type": "bank_slip",
"has_fiscal_note": true
},
"payment_method": "pix",
"branch": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>"
},
"category": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>"
},
"subcategory": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>"
},
"cost_center": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>"
},
"bank_account": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>"
},
"recurrence": {
"is_recurring": true,
"occurrence_number": 123,
"rule_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
},
"splits": [
{
"company": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>"
},
"branch": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>"
},
"employee": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>"
},
"category": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>"
},
"subcategory": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>"
},
"amount": "1234.56"
}
],
"settlements": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"channel": "bank_statement",
"date": "2023-12-25",
"amount": "1234.56",
"bank_transaction_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"note": "<string>"
}
],
"notes": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"customer": {
"name": "<string>",
"tax_id": "<string>",
"email": "<string>",
"phone": "<string>"
}
},
"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.
8 - 100