// install dependency
// $ composer require guzzlehttp/guzzle
<?php
require_once('vendor/autoload.php');
$client = new \GuzzleHttp\Client();
$transaction = [
"type" => "RECEIVAL_NOTICE",
"content" => [
"header" => [
"receivalAdviceNumber" => "RA-20250424-667",
"receivalDate" => "2025-01-24T14:40:00.000000+01:00",
"deliveryNoteNumber" => "DN-24110125",
"customerOrderNumber" => "PO-FR-24110125",
"customer" => [
"name" => "Customer Company Name",
"identifiers" => [
[
"domain" => "GS1",
"identifier" => "4301234567891",
],
],
],
"supplier" => [
"name" => "Supplier Company Name",
"identifiers" => [
[
"domain" => "GS1",
"identifier" => "4401234567892",
],
],
],
],
"transportUnits" => [
[
"items" => [
[
"lineNumber" => 1,
"orderLineNumber" => 2,
"shippedQuantity" => 100,
"receivedQuantity" => 100,
"identifiers" => [
[
"domain" => "BUYER",
"identifier" => "Customer_Product_ID_1",
],
[
"domain" => "SUPPLIER",
"identifier" => "Vendor_Product_ID_1",
],
[
"domain" => "GS1",
"identifier" => "4401234000001",
],
],
"description" => "Product 1 Name",
"unitOfMeasure" => "EA",
"batches" => [
[
"batchIdentifier" => "100126",
"expirationDate" => "2026-01-10",
"quantity" => 30,
],
[
"batchIdentifier" => "150126",
"expirationDate" => "2026-01-15",
"quantity" => 70,
]
],
],
[
"lineNumber" => 2,
"orderLineNumber" => 4,
"shippedQuantity" => 100,
"receivedQuantity" => 95,
"rejectedQuantity" => 5,
"rejectReason" => "Damaged",
"identifiers" => [
[
"domain" => "BUYER",
"identifier" => "Customer_Product_ID_2",
],
[
"domain" => "SUPPLIER",
"identifier" => "Vendor_Product_ID_2",
],
[
"domain" => "GS1",
"identifier" => "4401234000002",
],
],
"description" => "Product 2 Name",
"unitOfMeasure" => "EA",
"batches" => [
[
"batchIdentifier" => "180126",
"expirationDate" => "2026-01-18",
"quantity" => 95,
]
],
],
],
],
],
],
];
$response = $client->request('POST', 'https://api.procuros.io/v2/transactions', [
'headers' => [
'Accept' => 'application/json',
'Authorization' => 'Bearer <your-api-token>',
],
'json' => $transaction,
]);