Example: Create Sales Invoice in PHP

<?php
 function signURL($id, $key, $timestamp, $json) {
   $signable = $id.$timestamp.$json;
   // NOTICE:  bool $raw_output = TRUE
   $rawSig = hash_hmac('sha256', $signable, $key, true);
   $base64Sig = base64_encode($rawSig);
   return $base64Sig;
 }
 function postStuff($stuff, $endpoint) {
   $ch = curl_init();
 // random test company
   $APIID = "axxxxxx938-7xxxx-4f6c-89d6-axxxxxxxxf";
   $APIKEY = "BddhqYuxxxxxlc=";
   $TIMESTAMP = date("YmdHis");
 $signature = signURL($APIID,$APIKEY, $TIMESTAMP,  json_encode($stuff));
   curl_setopt($ch, CURLOPT_URL, "http://localhost:56035/api/v1/".$endpoint."?ApiId=".$APIID."&timestamp=".$TIMESTAMP."&signature=".$signature);
   curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: application/json'));
   curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($stuff));
 curl_exec($ch);
 if(curl_getinfo($ch, CURLINFO_RESPONSE_CODE) != 200) {
     print("ERROR ".curl_getinfo($ch, CURLINFO_RESPONSE_CODE)."\r\n");
     print_r(curl_getinfo($ch));
   }
 curl_close($ch);
 }

$jayParsedAry = [
   "Customer" => [
         "Name" => "Mari Maasikas",
         "NotTDCustomer" => "true",
         "Address" => "Tuleviku tee 6",
         "City" => "Lohkva",
         "County" => "Luunja vald, Tartumaa",
         "PostalCode" => "EE80034",
         "CountryCode" => "EE",
         "PhoneNo" => "",
         "Email" => "mari@example.com"
      ],
   "DocDate" => "20200106",
   "DueDate" => "20200116",
   "TransactionDate" => "20200106",
   "InvoiceNo" => "A00003",
   "RefNo" => "99999",
   "CurrencyCode" => "EUR",
   "InvoiceRow" => [
            [
               "Item" => [
                  "Code" => "MAAKLER",
                  "Description" => "Maaklerteenus",
                  "Type" => 2
               ],
               "Quantity" => "1.000",
               "Price" => "416.67",
               "DiscountPct" => "10.00",
               "DiscountAmount" => "41.67",
               "TaxId" => "b9b25735-6a15-4d4e-8720-25b254ae3d21"
            ]
         ],
   "RoundingAmount" => 5,
   "TotalAmount" => "375.00",
   "Payment" => [
                     "PaymentMethod" => "Swedbank",
                     "PaidAmount" => 455,
                     "PaymDate" => "20200106"
                  ],
   "TaxAmount" => [
                        [
                           "TaxId" => "b9b25735-6a15-4d4e-8720-25b254ae3d21",
                           "Amount" => "75.00"
                        ]
                     ],
   "HComment" => "",
   "FComment" => ""
];

postStuff($jayParsedAry, "sendinvoice");

?>