End Point

The CommerceInterface API end-point URL is https://scm.commerceinterface.com/api/v4/. Please note that all timestamps in all data obtained from the CommerceInterface API are in UTC.

Authentication

All API calls require authentication. Authentication credentials are Supplier ID and Token. Suppliers can generate access token by clicking here. Parameters for Supplier ID and Token are supplier_id and token respectively. All api calls must send both the parameters.

GET   /get_orders

To get a list of orders in Supplier's account.

  • By default you will only get the orders that have not already been exported.
  • Response will be paginated with a maximum of 250 orders per page.
  • Orders are sorted by order id.
  • Orders with the same order id must be shipped together, if inventory is available and the items are shipping from the same location.
  • You can expect the orders with same order id spread across different pages.

Required Parameters
Parameter Description
supplier_id CommerceInterface supplier id.
token Authentication token. Suppliers can generate access token by clicking here.

NOTE: The format of the IDs can differ from the format given in the example response.

Request:
curl -XGET "https://scm.commerceinterface.com/api/v4/get_orders?supplier_id=1&token=xYRPKcoakMoiRzWgKLV5TqPSdNAaZQT"
Response:
{
  "meta": {
    "no_of_pages": 1,
    "current_page": 1,
    "max_items_per_page": 250,
    "no_of_items": 5
  },
  "data": [
    {
      "orderid": "1300019141",
      "amount": {
        "total": 75,
        "shipping": 0
      },
      "date": "08/10/2021 07:40PM UTC",
      "fulfillment_method": "Drop Ship (Marketplace)",
      "opp_id": "006c000000UKVKO",
      "supplier": "DSN_TACCO_UK_ON_SOR3",
      "line_items": [
        {
          "weight": "",
          "bom_sku": "",
          "opp_name": "FR_deal_VAT_test",
          "ci_lineitemid": 264275589,
          "sku": "WL18051814082469",
          "custom_field_value": "Merchant VAT responsible",
          "channel_sku_provided": "a0Yc000000DhNIo",
          "unit_price": 37.5,
          "ship_by_date": "09/13/2021 10:59PM UTC",
          "kitting_details": "Primary:1xWL18051814082469",
          "status": "open",
          "intrinsic_value": 29.68,
          "gg_account_number": "001c0000038CE9ZAAW, 001c0000038CE5bAAG, 001c0000038CEA8AAO, 001c0000038CEADAA4, 001c0000038CEAdAAO, 001c0000038CE8DAAW, 001c0000038ArvtAAC",
          "groupon_cost": 0,
          "discount": 0.94,
          "voucher_code": "",
          "permalink": "006c000000UKVKO",
          "name": "ipad-Copper-10.9_Inches-128GB",
          "po_number": null,
          "fulfillment_lineitem_id": "22996",
          "hts_code": "84713000",
          "gift_message": "",
          "order_line_item_uuid": "d4e9f13e-f9fc-11eb-a304-5254305e75ec",
          "coo": "",
          "quantity": 2
        }
      ],
      "customer": {
        "city": "LUC SUR MER",
        "state": "",
        "billing_address": {
          "city": "LUC SUR MER",
          "state": "",
          "name": "Consumer",
          "zip": "14530",
          "country": "FR",
          "address1": "1 RUE DES CHAMPS ELYSEES",
          "address2": "",
          "phone": ""
        },
        "invoice_url": "",
        "name": "Consumer",
        "zip": "14530",
        "country": "FR",
        "address1": "1 RUE DES CHAMPS ELYSEES",
        "address2": "",
        "phone": "7488392884"
      },
      "shipping": {
        "product_dimension_unit": "centimeters",
        "product_weight_unit": "kilograms",
        "product_weight": "",
        "incoterms": "",
        "3PL_warehouse": "",
        "3PL_name": "",
        "product_width": "",
        "product_length": "",
        "carrier": "",
        "product_height": "",
        "method": "standard"
      }
    }
  ],
  "success": true
}
import requests #requires "requests" package
response = requests.get('https://scm.commerceinterface.com/api/v4/get_orders',
                       params={'supplier_id':'1', 'token':'xYRPKcoakMoiRzWgKLV5TqPSdNAaZQT'}).json()
if response['success'] == True:
   #Your business logic here
   print(response)
else:
   #Alarm!
   pass
		  
<?php
   $response = file_get_contents ( 'https://scm.commerceinterface.com/api/v4/get_orders?supplier_id=1&token=xYRPKcoakMoiRzWgKLV5TqPSdNAaZQT' );
   if( $response ) {
      $response_json = json_decode ( $response );
      if( $response_json->success == true ) {
        //Your business logic here
      } else {
        //Alarm!
      }
   }
		  
Optional Parameters
Parameters Description
start_datetime Use this parameter if you want to pull orders between a time range. It should be used in combination with end_datetime parameter. Both the parmaeters should be in 24 hours range. Timestamp should be in MM/DD/YYYY HH:MM format (UTC). All order data is returned irrespective they are marked as exported or not.
end_datetime Same as start_datetime except that it is used to determine the end of time range.
page The responses has 250 items per page. To get data from next page use this parameter.

POST   /mark_exported

This endpoint is to acknowledge that lineitem(s) has been exported. Please note that if you are utilizing the get_orders endpoint to obtain order data, you must call this endpoint immediately after the get_orders endpoint.
Also you have to put parameters in form data for POST method.

Required Parameters
Parameter Description
supplier_id CommerceInterface supplier id.
token Authentication token. Suppliers can generate access token by clicking here.
ci_lineitem_ids A list of ci_lineitemid in json format. It supports upto 1000 ci_lineitemid at a time.
Request:
curl -XPOST "https://scm.commerceinterface.com/api/v4/mark_exported" \
  -d"supplier_id=1" \
  -d"token=xYRPKcoakMoiRzWgKLV5TqPSdNAaZQT" \
  -d"ci_lineitem_ids=[54553919, 54553920]"
Response:
{
    "success": true
}
import requests #requires "requests" package
import json
response = requests.post('https://scm.commerceinterface.com/api/v4/mark_exported',
                       params={'supplier_id':'1', 'token':'xYRPKcoakMoiRzWgKLV5TqPSdNAaZQT',
                             'ci_lineitem_ids':json.dumps([54553919, 54553920])}).json()
if response['success'] == True:
   #Successfully marked as exported (only items which are not already marked exported)
   pass
else:
   pass
		  
<?php
   // requires PHP cURL http://no.php.net/curl
   $datatopost = array (
      "supplier_id" => "1",
      "token" => "xYRPKcoakMoiRzWgKLV5TqPSdNAaZQT",
      "ci_lineitem_ids" => json_encode ( array (54553919, 54553920) ),
   );
   $ch = curl_init ("https://scm.commerceinterface.com/api/v4/mark_exported");
   curl_setopt ($ch, CURLOPT_POST, true);
   curl_setopt ($ch, CURLOPT_POSTFIELDS, $datatopost);
   curl_setopt ($ch, CURLOPT_RETURNTRANSFER, true);
   $response = curl_exec ($ch);
   if( $response ) {
      $response_json = json_decode( $response );
      if( $response_json->success == true ) {
        //Successfully marked as exported (only items which are not already marked exported
      } else {

      }
   }

POST   /tracking_notification

To send tracking information about a lineitem using ci_lineitem_id.

Required Parameters
Parameter Description
supplier_id CommerceInterface supplier id.
token Authentication token. Suppliers can generate access token by clicking here.
tracking_info A list of json objects having ci_lineitem_id, carrier & tracking. Additionally it also supports quantity which you can use if you ship items less than the ordered quantity. It supports upto 1000 lineitems at a time. In case a lineitem is already closed or cancelled it will be skipped. It supports the upload of different tracking numbers to the same ci_lineitem_id by using the quantity accordingly. In case of any other error no data will be saved.
Request:
curl -XPOST "https://scm.commerceinterface.com/api/v4/tracking_notification" \
  -d"supplier_id=1" \
  -d"token=xYRPKcoakMoiRzWgKLV5TqPSdNAaZQT" \
  -d'tracking_info=[{"carrier": "UPS", "ci_lineitem_id": 54553918, "tracking": "123456"}, {"quantity": 1, "carrier": "UPS", "ci_lineitem_id": 54553919, "tracking": "234567"}]'
Response:
{
    "success": true,
    "data": {
        "non_open_ids": []
    }
}
import requests #requires "requests" package
import json

req_data = {'supplier_id':'1',
            'token':'xYRPKcoakMoiRzWgKLV5TqPSdNAaZQT',
            'tracking_info':[{"carrier": "UPS", "ci_lineitem_id": 54553918, "tracking": "123456"}, {"tracking": "234567", "carrier": "UPS", "ci_lineitem_id": 54553919, "quantity": 1}]}

response = requests.post('https://scm.commerceinterface.com/api/v4/tracking_notification',
                         params=req_data).json()
if response['success'] == True:
   #Successfully saved tracking info of items other than those in data["non_open_ids"] list
   pass
else:
   pass
		  
<?php
   // requires PHP cURL http://no.php.net/curl
   $datatopost = array (
      "supplier_id" => "1",
      "token" => "xYRPKcoakMoiRzWgKLV5TqPSdNAaZQT",
      "tracking_info" => '[
{ "carrier" : "UPS", "ci_lineitem_id" : 54553918, "tracking" : "123456")},
{ "quantity" : 1, "carrier" : "UPS", "ci_lineitem_id" : 54553919, "tracking" : "234567"}
]'
   );
   $ch = curl_init ("https://scm.commerceinterface.com/api/v4/tracking_notification");
   curl_setopt ($ch, CURLOPT_POST, true);
   curl_setopt ($ch, CURLOPT_POSTFIELDS, $datatopost);
   curl_setopt ($ch, CURLOPT_RETURNTRANSFER, true);
   $response = curl_exec ($ch);
   if( $response ) {
      $response_json = json_decode( $response );
      if( $response_json->success == true ) {
        //Successfully saved tracking info of items other than those in data["non_open_ids"] array
      } else {

      }
   }

POST   /lineitem_tracking_notification

To send tracking information about a lineitem using fulfillment_lineitem_id.

Required Parameters
Parameter Description
supplier_id CommerceInterface supplier id.
token Authentication token. Suppliers can generate access token by clicking here.
tracking_info A list of json objects having fulfillment_lineitem_id, carrier & tracking. Additionally it also supports quantity which you can use if you ship items less than the ordered quantity. It supports upto 1000 lineitems at a time. In case a lineitem is already closed or cancelled it will be skipped. It supports the upload of different tracking numbers to the same fulfillment_lineitem_id by using the quantity accordingly. In case of any other error no data will be saved.
Request:
curl -XPOST "https://scm.commerceinterface.com/api/v4/lineitem_tracking_notification" \
  -d"supplier_id=1" \
  -d"token=xYRPKcoakMoiRzWgKLV5TqPSdNAaZQT" \
  -d'tracking_info=[{"carrier": "UPS", "fulfillment_lineitem_id": "34054258", "tracking": "123456"}, {"quantity": 1, "carrier": "UPS", "fulfillment_lineitem_id": "3074475935094527184", "tracking": "234567"}]'
Response:
{
    "success": true,
    "data": {
        "non_open_ids": []
    }
}
import requests #requires "requests" package
import json

req_data = {'supplier_id':'1',
            'token':'xYRPKcoakMoiRzWgKLV5TqPSdNAaZQT',
            'tracking_info':[{"carrier": "UPS", "fulfillment_lineitem_id": "34054258", "tracking": "123456"}, {"tracking": "234567", "carrier": "UPS", "fulfillment_lineitem_id": "3074475935094527184", "quantity": 1}]

response = requests.post('https://scm.commerceinterface.com/api/v4/lineitem_tracking_notification',
                         params=req_data).json()
if response['success'] == True:
   #Successfully saved tracking info of items other than those in data["non_open_ids"] list
   pass
else:
   pass
		  
<?php
   // requires PHP cURL http://no.php.net/curl
   $datatopost = array (
      "supplier_id" => "1",
      "token" => "xYRPKcoakMoiRzWgKLV5TqPSdNAaZQT",
      "tracking_info" => '[
{ "carrier" : "UPS", "fulfillment_lineitem_id" : "34054258", "tracking" : "123456")},
{ "quantity" : 1, "carrier" : "UPS", "fulfillment_lineitem_id" : "3074475935094527184", "tracking" : "234567"}
]'
   );
   $ch = curl_init ("https://scm.commerceinterface.com/api/v4/lineitem_tracking_notification");
   curl_setopt ($ch, CURLOPT_POST, true);
   curl_setopt ($ch, CURLOPT_POSTFIELDS, $datatopost);
   curl_setopt ($ch, CURLOPT_RETURNTRANSFER, true);
   $response = curl_exec ($ch);
   if( $response ) {
      $response_json = json_decode( $response );
      if( $response_json->success == true ) {
        //Successfully saved tracking info of items other than those in data["non_open_ids"] array
      } else {

      }
   }

GET   /packing_slip/{fulfillment_id}

To get packing slip for passed fulfillment_id.

  • PDF file will be downloaded for successful response.
  • Filename will in format: packing_slip_{fulfillment_id}.pdf
  • If wrong fulfillment_id is passed which is not linked with the supplier_id, response will show as 'Internal Error Occurred'

Required Parameters
Parameter Description
supplier_id CommerceInterface supplier id.
token Authentication token. Suppliers can generate access token by clicking here.
fulfillment_id Fulfillment_Lineitem_Id.
Request:
curl -o packing_slip_12345.pdf "https://scm.commerceinterface.com/api/v4/packing_slip/12345?supplier_id=1&token=xYRPKcoakMoiRzWgKLV5TqPSdNAaZQT"
Response:
Downloaded File- packing_slip_12345.pdf
import requests #requires "requests" package
response = requests.get('https://scm.commerceinterface.com/api/v4/packing_slip/12345?supplier_id=1&token=xYRPKcoakMoiRzWgKLV5TqPSdNAaZQT')
if response.status_code == 200:
   #downloaded file - packing_slip_12345.pdf
else:
   #Alarm!
   pass
		  
<?php
   $url = 'https://scm.commerceinterface.com/api/v4/packing_slip/12345?supplier_id=1&token=xYRPKcoakMoiRzWgKLV5TqPSdNAaZQT';
   $file_name = basename($url);

    if(file_put_contents( $file_name,file_get_contents($url))){
        echo "File downloaded successfully!";
        //downloaded file - packing_slip_12345.pdf
    }else{
       
    }