// install dependency
// $ composer require guzzlehttp/guzzle
<?php
require_once('vendor/autoload.php');
$client = new \GuzzleHttp\Client();
$transaction = [
"type" => "RECEIVAL_NOTICE",
"content" => [
"header" => [
"receivalAdviceNumber" => "RCV-2024-001",
"receivalDate" => "2024-06-15T10:30:00.000000Z",
"deliveryNoteNumber" => "DN-2024-456",
"customerOrderNumber" => "PO-2024-123",
"deliveryNoteDate" => "2024-06-14T14:00:00.000000Z",
"orderDate" => "2024-06-01T09:00:00.000000Z",
"comments" => "All items received in good condition",
"carrierId" => "DHL",
"carrierDomain" => "SCAC",
"trackingNumber" => "1234567890",
"trackingUrl" => "https://tracking.example.com/1234567890",
"shipFrom" => [
"name" => "Supplier Warehouse GmbH",
"identifiers" => [
[
"domain" => "GS1",
"identifier" => "4200000123456"
]
],
"postalAddress" => [
"name" => "Supplier Warehouse GmbH",
"street" => "Industriestraße 10",
"addressExtra" => "Building A",
"city" => "Munich",
"postalCode" => "80331",
"countryCode" => "DE"
]
],
"shipTo" => [
"name" => "Customer Warehouse GmbH",
"identifiers" => [
[
"domain" => "GS1",
"identifier" => "4200000654321"
]
],
"postalAddress" => [
"name" => "Customer Warehouse GmbH",
"street" => "Lagerstraße 25",
"addressExtra" => "Receiving Dock 3",
"city" => "Hamburg",
"postalCode" => "20095",
"countryCode" => "DE"
]
],
"customer" => [
"name" => "Customer Company GmbH",
"identifiers" => [
[
"domain" => "GS1",
"identifier" => "4200000654321"
]
],
"postalAddress" => [
"name" => "Customer Company GmbH",
"street" => "Hauptstraße 50",
"city" => "Hamburg",
"postalCode" => "20095",
"countryCode" => "DE"
]
],
"supplier" => [
"name" => "Supplier Company GmbH",
"identifiers" => [
[
"domain" => "GS1",
"identifier" => "4200000123456"
]
],
"postalAddress" => [
"name" => "Supplier Company GmbH",
"street" => "Lieferantenweg 15",
"city" => "Munich",
"postalCode" => "80331",
"countryCode" => "DE"
]
]
],
"transportUnits" => [
[
"unitIdentifier" => "342601560208144493",
"unitType" => "EURO_PALLET",
"containedTradeUnitCount" => 4,
"items" => [
[
"lineNumber" => 1,
"receivedQuantity" => 10,
"shippedQuantity" => 10,
"orderedQuantity" => 10,
"identifiers" => [
[
"domain" => "GS1",
"identifier" => "12345678901234"
],
[
"domain" => "BUYER",
"identifier" => "CUST-PROD-001"
]
],
"orderLineNumber" => 1,
"unitOfMeasure" => "EA",
"description" => "Premium Product A",
"unitPrice" => 24.50,
"currency" => "EUR",
"batches" => [
[
"batchIdentifier" => "BATCH-2024-06-001",
"expirationDate" => "2025-12-31",
"quantity" => 10
]
]
],
[
"lineNumber" => 2,
"receivedQuantity" => 18,
"shippedQuantity" => 20,
"orderedQuantity" => 20,
"rejectedQuantity" => 2,
"rejectReason" => "Damaged packaging",
"identifiers" => [
[
"domain" => "GS1",
"identifier" => "98765432109876"
]
],
"orderLineNumber" => 2,
"unitOfMeasure" => "EA",
"description" => "Standard Product B",
"unitPrice" => 12.75,
"currency" => "EUR"
]
]
]
]
]
];
$response = $client->request('POST', 'https://api.procuros.io/v2/transactions', [
'headers' => [
'Accept' => 'application/json',
'Authorization' => 'Bearer <your-api-token>',
],
'json' => $transaction,
]);