// install dependency
// $ composer require guzzlehttp/guzzle
<?php
require_once('vendor/autoload.php');
$client = new \GuzzleHttp\Client();
$transaction = [
'type' => 'ORDER',
'content' => [
'header' => [
'orderIdentifier' => 'bestellung-20231203-012',
'orderDate' => '2023-12-03',
'currency' => 'EUR',
'requestedDeliveryDate' => '2023-12-06',
'buyer' => [
'identifiers' => [
['domain' => 'GS1', 'identifier' => '3220010000010']
]
],
'supplier' => [
'identifiers' => [
['domain' => 'GS1', 'identifier' => '3220010000003']
]
],
'billTo' => [
'identifiers' => [
['domain' => 'GS1', 'identifier' => '3220010000010']
]
],
'shipTo' => [
'identifiers' => [
['domain' => 'GS1', 'identifier' => '3220010000011']
]
],
'paymentTerms' => [
[
'payInNumberOfDays' => 30,
'percentage' => 5
]
]
],
'items' => [
[
'identifiers' => [
['domain' => 'GS1', 'identifier' => '2330000000083']
],
'lineNumber' => 1,
'quantity' => 10,
'isDepositItem' => false,
'unitOfMeasure' => 'EA',
'description' => 'A description of the item',
'requestedDeliveryDate' => null,
'unitPrice' => 1.23,
'tax' => [
'percentage' => 7,
'description' => 'Umsatzsteuer'
],
'modificationGroups' => [
[
'modifications' => [
[
'type' => 'ALLOWANCE',
'reasonCode' => 'DISCOUNT',
'description' => 'Contract trade discount',
'percentage' => 7
]
]
]
]
]
]
]
];
$response = $client->request('POST', 'https://api.procuros.io/v2/transactions', [
'headers' => [
'Accept' => 'application/json',
'Authorization' => 'Bearer <your-api-token>',
],
'json' => $transaction,
]);