Skip to content

Instantly share code, notes, and snippets.

View mehulkaklotar's full-sized avatar
🏠
Working from home

Mehul Kaklotar mehulkaklotar

🏠
Working from home
View GitHub Profile
@mehulkaklotar
mehulkaklotar / api-adding-shipment.php
Created July 24, 2016 18:20 — forked from sparkweb/api-adding-shipment.php
Order Desk API: Adding Shipments
<?php
//Order Desk API: Insert New Shipments
//To get your Store ID and API Key, go to Order Desk > Settings > Advanced
//Setup
$store_id = 0;
$api_key = "";
//Build Shipment Here
$new_shipments = array(
<?php
//Order Desk API: Get Inventory Items
//To get your Store ID and API Key, go to Order Desk > Settings > Advanced
//Setup
$store_id = 0;
$api_key = "";
//Setup cURL Variables
$url = "https://app.orderdesk.me/api/inventory_items";
@mehulkaklotar
mehulkaklotar / process-orderdesk-json.php
Created July 24, 2016 18:20 — forked from sparkweb/process-orderdesk-json.php
Sample Code For Processing and Securing Order Desk Post JSON
<?php
//Check For Order
if (!isset($_POST['order'])) {
header(':', true, 400);
die('No Data Found');
}
//Cbeck Store ID
//Be sure to set your store ID. Ask Order Desk support if you aren't sure what it is.
if (!isset($_SERVER['HTTP_X_ORDER_DESK_STORE_ID']) || $_SERVER['HTTP_X_ORDER_DESK_STORE_ID'] != "YOUR-STORE-ID") {
@mehulkaklotar
mehulkaklotar / api-deleting-shipment.php
Created July 24, 2016 18:20 — forked from sparkweb/api-deleting-shipment.php
Order Desk API: Deleting Shipments
<?php
//Order Desk API: Delete Shipments
//To get your Store ID and API Key, go to Order Desk > Settings > Advanced
//Setup
$store_id = 0;
$api_key = "";
//Required: source_id or order_id
//Required: tracking_number or shipment_id
<?php
class OrderDeskApiClient
{
private $store_id;
private $api_key;
private $base_url = "https://app.orderdesk.me/api/v2";
public $last_status_code = "";
public function __construct($store_id, $api_key) {
@mehulkaklotar
mehulkaklotar / get-multiple-orders.php
Created July 24, 2016 18:19 — forked from sparkweb/get-multiple-orders.php
Order Desk API: Order Methods
<?php
//Order Desk API: Get Order List
//To get your Store ID and API Key, go to Order Desk > Settings > Advanced
//Setup
$store_id = 0;
$api_key = "";
//Setup Query
$args = array(