// install dependency
// $ composer require guzzlehttp/guzzle
<?php
require_once('vendor/autoload.php');
$client = new \GuzzleHttp\Client();
$transaction = [
"type" => "DISPATCH_INSTRUCTION",
"content" => [
"header" => [
"orderIdentifier" => "valid-order-id",
"orderDate" => "2023-06-01",
"shipmentIdentifier" => "valid-dispatch-instruction-shipment-id-1",
"noticeDate" => "2023-06-01",
"requestedDeliveryDate" => "2023-06-05",
"customer" => [
"addressId" => "valid-dispatch-instruction-customer-1",
"identifiers" => [
[
"identifier" => "3220010000001",
"domain" => "GS1",
],
],
],
"supplier" => [
"addressId" => "valid-dispatch-instruction-supplier-1",
"identifiers" => [
[
"identifier" => "3220010000002",
"domain" => "GS1",
],
],
],
"shipFrom" => [
"addressId" => "valid-dispatch-instruction-shipFrom-1",
"identifiers" => [
[
"identifier" => "3220010000003",
"domain" => "GS1",
],
],
],
],
"items" => [
[
"orderLineNumber" => 1,
"shippingNoticeLineNumber" => 1,
"shippedQuantity" => 1,
"orderedQuantity" => 1,
"openQuantityAction" => "DISCARDED",
"unitOfMeasure" => "EA",
"identifiers" => [
[
"identifier" => "valid-dispatch-instruction-identifier-1",
"domain" => "GS1",
],
],
],
],
],
];
$response = $client->request('POST', 'https://api.procuros.io/v2/transactions', [
'headers' => [
'Accept' => 'application/json',
'Authorization' => 'Bearer <your-api-token>',
],
'json' => $transaction,
]);