// install dependency
// $ composer require guzzlehttp/guzzle
<?php
require_once('vendor/autoload.php');
$client = new \GuzzleHttp\Client();
$transaction = [
'type' => 'INVOICE',
'content' => [
'header' => [
'invoiceIdentifier' => 'API-INV-2022-08-31-001',
'invoiceDate' => '2022-08-31',
'shippingNoticeIdentifier' => 'SFTP-SHIP-2022-08-31-001',
'shippingNoticeDate' => '2022-08-31',
'orderIdentifier' => 'SFTP-2022-08-31-001',
'orderDate' => '2022-08-31',
'requestedDeliveryDate' => '2022-08-31',
'expectedDeliveryDate' => '2022-08-31',
'paymentTerms' => [
[
'payInNumberOfDays' => 30,
'percentage' => 0
]
],
'supplier' => [
'identifiers' => [
[
'domain' => 'GS1',
'identifier' => 'C10000'
]
]
],
'buyer' => [
'identifiers' => [
[
'domain' => 'GS1',
'identifier' => 'C20000'
]
]
]
],
'items' => [
[
'lineNumber' => 1,
'identifiers' => [
[
'domain' => 'GS1',
'identifier' => '2330010000019'
]
],
'isDepositItem' => false,
'quantity' => 10,
'unitPrice' => 10,
'tax' => [
'percentage' => 19,
'amount' => 1.9,
'description' => 'MwSt. 19%'
]
]
]
]
];
$response = $client->request('POST', 'https://api.procuros.io/v2/transactions', [
'headers' => [
'Accept' => 'application/json',
'Authorization' => 'Bearer <your-api-token>',
],
'json' => $transaction,
]);