Я пытаюсь подключиться к следующему API
{
"draft": false,
"documenttype": "4400000040000123",
"series": "4400000040000456",
"number": "1",
"date": "2018-10-25",
"due_date": "2018-11-25",
"client": "3300000040000100",
"client_display_name": "Acme Inc.",
"client_address": "4 Catherine St., Southaven, MS 38671, USA",
"client_shipping_address": "",
"client_profession": "",
"client_vat_number": "",
"client_tax_office": "string",
"client_contact_person": "John Doe",
"client_phone_number": "662-222-2222",
"client_email": "john@doe.com",
"calculator_mode": "initial",
"items": [
{
"product": "9900000040000600",
"title": "Pair of socks",
"description": "Super-cool expensive socks!",
"quantity": "2.00",
"unit_value": "40.00",
"unit_discount": "0.00",
"taxes": [
"6600230050000705"
],
"unit_total": "50.00",
"unit_measure": 14
}
],
"withholding_taxes": [
"6600230050000704"
],
"currency_code": "USD",
"exchange_rate": "1.000000",
"terms": "Terms and conditions here",
"public_notes": "Notes visible on the invoice",
"notes": "Some notes",
"template_settings": {
"discount_appearance": 0,
"hide_client_due": true,
"hide_contact_information": true,
"hide_creator_information": true,
"hide_description": true,
"hide_payments": true,
"hide_product_code": true,
"hide_quantity": true,
"hide_vat": true,
"hide_vat_table": true,
"theme": "1100000022000129",
"unit_measure_appearance": 0
},
"trackingcategories": [
{
"trackingcategory": "7000230020000553",
"option": "My custom tag"
}
]
}
и пытаюсь жадно (с laravel) сделать запрос на почту со следующим кодом:
$headers = ['authorization' => 'Token XXXXXXXXXXXXXXXXXX','x-elorus-organization' => 'XXXXXXXXXXXXXXXXXX','cookie' => 'gwshow=do',];
$client = new \GuzzleHttp\Client();
$url = "https://api.elorus.com/v1.0/invoices/";
$myBody['company'] = "Demo";
$request = $client->post($url, [
'form_params'=>[
'draft'=>true,
'documenttype' => 'XXXXXXXXXXXXXX',
'number' => 0,
'date' => '2020-03-18',
'client' => 'XXXXXXXXXXXX',
'calculator_mode' => 'initial',
'template_settings' => array(
"discount_appearance" => 0,
"hide_client_due" => true,
"hide_contact_information" => true,
"hide_creator_information" => true,
"hide_description" => true,
"hide_payments" => true,
"hide_product_code" => true,
"hide_quantity" => true,
"hide_vat" => true,
"hide_vat_table" => true,
"theme" => "1100000022000129",
"unit_measure_appearance" => 0),
],
'headers' => $headers]);
echo $request->getBody();
поэтому, когда я выполняю код, я возвращаю следующую ошибку
{
"template_settings": [
"This field is required."
],
}
Вероятно, я не отправляю, с правильным способом template_settings, который я пробовал в течение 7 часов go, но без какого-либо результата счастья .
Может кто-нибудь помочь, пожалуйста?
Спасибо