Skip to content

Instantly share code, notes, and snippets.

@jahidulsaeid
Created December 16, 2020 09:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jahidulsaeid/04f030ce7e92c51fe9fdb226d5764a09 to your computer and use it in GitHub Desktop.
Save jahidulsaeid/04f030ce7e92c51fe9fdb226d5764a09 to your computer and use it in GitHub Desktop.
<?php
function insert_order(){
$token = 'MYtoken';
$post_data =[
'orders' =>[
[
"UseChannelTax" => "true",
"pkOrderId" => "fc1dd6d9-749c-4622-9725-f6ccf7c55299"
]
],
"location" =>[
"Default"
]
];
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "https://eu-ext.linnworks.net/api/Orders/CreateOrders");
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($post_data));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
'Authorization: ' . $token,
'Content-Type: application/x-www-form-urlencoded'
));
$response = curl_exec($ch);
$response = json_decode($response);
var_dump($response);
}
insert_order();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment