Я не буду вызывать API с таким запросом (это пример запроса json):
Код: Выделить всё
{
"costCenterCode":"CDC-00070964",
"paperless":"false",
"shipmentDate":"2020-11-26T08:02:20.986+0000",
"waybills":[
{
"clientReferenceId":"12312312341",
"printFormat":"A4",
"product":"APT000901",
"data":{
"declared":[
{
"weight":"10",
"height":"10",
"length":"30",
"width":"25"
}
],
}
}
]
}
Код: Выделить всё
$insert = Http::withHeaders([
'POSTE_clientID' => '4815fd18-xxxx-xxxx-xxxx-d1a1edbd7a12',
'Authorization' => $auth,
])
->post('https://apiw.gp.posteitaliane.it/gp/internet/postalandlogistics/parcel/waybill', [
"costCenterCode" => "CDC-00051975",
"paperless" => "false",
"shipmentDate" => "2024-06-29T08=>02=>20.986+0000",
"waybills" => [
"clientReferenceId" => "1404343485",
"printFormat" => "A4",
"product" => "APT000901",
"data" => [
"declared" => [
"weight" => "0",
"height" => "44",
"length" => "30",
"width" => "25"
],
]
]
])
->json();
Можете ли вы мне помочь?
Подробнее здесь: https://stackoverflow.com/questions/786 ... ke-example