Created
December 16, 2020 09:43
-
-
Save jahidulsaeid/04f030ce7e92c51fe9fdb226d5764a09 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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