Order is flagged as sent in your system and the goal is to also activate the invoice in Hygglig.

Name Type Description
mid string Merchant’s key
ordernr string This is Order number which Hygglig checkout return back at the time of order registration.
mac string A mac or checksum generated from input parameters using merchant’s private key.

Send order example code

Send order according to the API reference. The example code is populated with example data for a test order.

//Last two digits in Handlarwebb are checksum and not to be used in API.
$ordernr = '1100012345';
$mac = sha1($ordernr . $secret);
$url = 'https://www.hygglig.com/Manage/api/CheckoutOrder/SendOrder?mId=' .  $key . '&ordernr=' .  $ordernr . '&mac=' .  $mac;
//Create postdata
$postData = array(
   'mId' => $key,
   'ordernr' => $ordernr,
   'mac' => $mac
);
//Curl
$ch = curl_init($url);
curl_setopt_array($ch, array(
   CURLOPT_POST => TRUE,
   CURLOPT_RETURNTRANSFER => 1,
   CURLOPT_HTTPHEADER => array(
      'Content-Type: application/json; encoding=utf-8'
   ),
   CURLOPT_POSTFIELDS => json_encode($postData)
));
// Send the request
$response = curl_exec($ch);