Примеры запросов
Ниже — создание счёта на оплату с ответом в JSON. Подставьте свой ключ вместо doc_xxxxxxxx.
Тело запроса:
{
"format": "pdf",
"template": 100,
"response": "json",
"number": "15",
"date": "2026-08-23",
"seller": {
"name": "ООО Ромашка",
"inn": "7701234567",
"kpp": "770101001",
"address": "г. Москва",
"bank": {
"name": "ПАО Сбербанк",
"bik": "044525225",
"correspondent_account": "30101810400000000225",
"checking_account": "40702810900000000001"
}
},
"buyer": {
"name": "ООО Покупатель",
"inn": "7707654321"
},
"items": [
{
"name": "Сплит-система",
"quantity": 2,
"price": 10000,
"vat": 20
}
]
}
- cURL
- PHP
- JavaScript
- Python
curl -X POST "https://rfdk.ru/api/v1/documents/so" \
-H "Authorization: Bearer doc_xxxxxxxx" \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-d '{
"format": "pdf",
"template": 100,
"response": "json",
"number": "15",
"date": "2026-08-23",
"seller": {
"name": "ООО Ромашка",
"inn": "7701234567",
"kpp": "770101001",
"address": "г. Москва",
"bank": {
"name": "ПАО Сбербанк",
"bik": "044525225",
"correspondent_account": "30101810400000000225",
"checking_account": "40702810900000000001"
}
},
"buyer": {
"name": "ООО Покупатель",
"inn": "7707654321"
},
"items": [
{
"name": "Сплит-система",
"quantity": 2,
"price": 10000,
"vat": 20
}
]
}'
<?php
$apiKey = 'doc_xxxxxxxx';
$url = 'https://rfdk.ru/api/v1/documents/so';
$payload = [
'format' => 'pdf',
'template' => 100,
'response' => 'json',
'number' => '15',
'date' => '2026-08-23',
'seller' => [
'name' => 'ООО Ромашка',
'inn' => '7701234567',
'kpp' => '770101001',
'address' => 'г. Москва',
'bank' => [
'name' => 'ПАО Сбербанк',
'bik' => '044525225',
'correspondent_account' => '30101810400000000225',
'checking_account' => '40702810900000000001',
],
],
'buyer' => [
'name' => 'ООО Покупатель',
'inn' => '7707654321',
],
'items' => [
[
'name' => 'Сплит-система',
'quantity' => 2,
'price' => 10000,
'vat' => 20,
],
],
];
$ch = curl_init($url);
curl_setopt_array($ch, [
CURLOPT_POST => true,
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
'Authorization: Bearer ' . $apiKey,
'Content-Type: application/json',
'Accept: application/json',
],
CURLOPT_POSTFIELDS => json_encode($payload, JSON_UNESCAPED_UNICODE),
]);
$response = curl_exec($ch);
$status = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);
echo $status . PHP_EOL;
echo $response;
const apiKey = 'doc_xxxxxxxx';
const url = 'https://rfdk.ru/api/v1/documents/so';
const payload = {
format: 'pdf',
template: 100,
response: 'json',
number: '15',
date: '2026-08-23',
seller: {
name: 'ООО Ромашка',
inn: '7701234567',
kpp: '770101001',
address: 'г. Москва',
bank: {
name: 'ПАО Сбербанк',
bik: '044525225',
correspondent_account: '30101810400000000225',
checking_account: '40702810900000000001',
},
},
buyer: {
name: 'ООО Покупатель',
inn: '7707654321',
},
items: [
{
name: 'Сплит-система',
quantity: 2,
price: 10000,
vat: 20,
},
],
};
const response = await fetch(url, {
method: 'POST',
headers: {
Authorization: `Bearer ${apiKey}`,
'Content-Type': 'application/json',
Accept: 'application/json',
},
body: JSON.stringify(payload),
});
const data = await response.json();
console.log(response.status, data);
import requests
api_key = "doc_xxxxxxxx"
url = "https://rfdk.ru/api/v1/documents/so"
payload = {
"format": "pdf",
"template": 100,
"response": "json",
"number": "15",
"date": "2026-08-23",
"seller": {
"name": "ООО Ромашка",
"inn": "7701234567",
"kpp": "770101001",
"address": "г. Москва",
"bank": {
"name": "ПАО Сбербанк",
"bik": "044525225",
"correspondent_account": "30101810400000000225",
"checking_account": "40702810900000000001",
},
},
"buyer": {
"name": "ООО Покупатель",
"inn": "7707654321",
},
"items": [
{
"name": "Сплит-система",
"quantity": 2,
"price": 10000,
"vat": 20,
}
],
}
response = requests.post(
url,
headers={
"Authorization": f"Bearer {api_key}",
"Accept": "application/json",
},
json=payload,
timeout=60,
)
print(response.status_code)
print(response.json())
В ответе при "response": "json" приходит JSON со ссылкой на файл. Без этого параметра API вернёт сам PDF (201).
Другие документы вызываются так же — меняется только путь: /documents/sf, /documents/korr_sf, /documents/torg12, /documents/m15, /documents/ttn, /documents/akt, /documents/dogovor, /documents/kp, /documents/smeta, /documents/ks2, /documents/ks3, /documents/chek, /documents/asv. Подробности полей — на страницах документов.