NAV
shell

Introduction

easyops API is organized around REST. Our API has predictable URLs, and uses codes to indicate API errors. We use built-in HTTP features, like HTTP authentication and HTTP verbs, which are understood by off-the-shelf HTTP clients. We support cross-origin resource sharing, allowing you to interact securely with our API from a client-side web application (though you should never expose your secret API key in any public website’s client-side code). JSON is returned by all API responses, including errors, although our API libraries convert responses to appropriate language-specific objects.

To make the API as explorable as possible, accounts have test client & production client credentials.

Sandbox Environment

Test server url: https://sandbox-access.easyops.in

The sandbox is a staging setup where you can design, program, and test applications in a controlled environment before implementing them in the production environment. Products listed in this environment are not real; however, changing the base URL to that of the production environment enable the applications to go live with real products and users.

Production Environment

Production server url: https://access.easyops.in

The production environment is the live platform.

Authentication

Get an access token:

# With curl, you can just pass the correct header with each request
curl -v https://sandbox-access.easyops.in/v1/oauth2/token \
  -H "Accept: application/json" \
  -u "appId:appSecret" \
  -d "grant_type=client_credentials"

Response

{
  "scope":"",
  "access_token":"Access-Token",
  "token_type":"Bearer",
  "app_id":"appId",
  "expires_in":28800
}

Make a /token call using your application’s OAuth keys for the basic authentication values (the keys are the values of your client_id and secret). In the request body, set grant_type to client_credentials. When you run the command, easyops generates and returns a new access token.

Make an API call

The access token is an OAuth bearer token, and is included in the header of your requests with the following syntax:

Authorization: Bearer Access-Token

All API requests must be made over HTTPS. Calls made over plain HTTP will fail. API requests without authentication will also fail.

Reponse Object

Example Response

{
  "data": [], 
  "message": "OK",
  "request_id": "3d6b29b3-b7ef- 4da1-b25d- 4c8ba2594209",
  "errors": [],
  "timestamp": 1476701296017,
  "status": "200"
}

Each rest api call returns a standard response object

Attribute Description
data data for the given api call
message status message string
request_id Request Id
errors List of errors if any
timestamp Request timestamp
status response status code

Request IDs

Each API request has an associated request identifier. You can find this value in the response data, under Request-Id. If you need to contact us about a specific request, providing the request identifier will ensure the fastest possible resolution.

Errors

easyops api uses response codes to indicate the success or failure of an API request. In general, codes in the 2xx range indicate success, codes in the 4xx range indicate an error that failed given the information provided (e.g., a required parameter was omitted, a charge failed, etc.), and codes in the 5xx range indicate an error with easyops’s servers (these are rare).

Status Description
200 Ok
201 Created
204 No content
206 Partial Content
304 Not modified
404 Not found

Stock

This is an object representing your easyops stock. You can retrieve it to see the stock currently on your account.

Get Stock Quantity

Example Request

curl "https://access.easyops.in/api/v1/stock/{sku}" \
  -H "X-TenantId:{$tenantId}"

Example Response

{
  "data": [
    {
      "quantity": 291,
      "warehouse": "default",
      "sku": "{sku}"
    }
  ], 
  "message": "OK",
  "request_id": "3d6b29b3-b7ef-4da1-b25d-4c8ba2594209",
  "errors": [],
  "timestamp": 1476701296017,
  "status": "200"
}

This endpoint returns stock quantity for the specified sku.

HTTP Request

GET https://access.easyops.in/api/v1/stock/{sku}

Query Parameters

Parameter Default Description
warehouse all warehouses configured for the account. Fetch stock for a specific warehouse.

Returns Data

Attribute Description
quantity stock quantity for given sku
warehouse the warehouse for which the sku and quantity is returned
sku sku identifier

Status Codes

Code Description
200 Ok
204 No content
206 Partial Content
304 Not modified
404 Not found

Update Stock Quantity

Example Request

curl -X PUT "https://access.easyops.in/api/v1/stock/{sku}" \
  -d quantity=90 \
  -H "X-tenantId:{$tenantId}"

Example Response

{
  "data": ["{sku}"], 
  "message": "OK",
  "request_id": "3d6b29b3-b7ef-4da1-b25d-4c8ba2594209",
  "errors": [],
  "timestamp": 1476701296017,
  "status": "200"
}

This endpoint updates the stock quantity for the specified sku.

HTTP Request

PUT https://access.easyops.in/api/v1/stock/{sku}

Query Parameters

Parameter Default Description
warehouse all warehouses configured for the account. Update stock for a specific warehouse.
quantity Update stock with specified quantity. (Mandatory parameter)

Returns Data

Attribute Description
sku sku identifier

Status Codes

Code Description
200 Ok
206 Partial Content
204 No content
404 Not found
304 Not modified

Stocks

This is an object representing your easyops stocks. You can retrieve it to see the list of stock in your account.

Get Stock Quantity

Example Request

curl "https://access.easyops.in/api/v1/stocks" \
  -d skus={sku1},{sku2} \
  -H "X-TenantId:{$tenantId}"

Example Response

{
  "data": [
    {
      "quantity": 291,
      "warehouse": "default",
      "sku": "{sku1}"
    }
  ], 
  "message": "Partial Content",
  "request_id": "3d6b29b3-b7ef-4da1-b25d-4c8ba2594209",
  "errors": [ "{sku2}" ],
  "timestamp": 1476701296017,
  "status": "206"
}

This endpoint returns stock quantity for the specified sku.

HTTP Request

GET https://access.easyops.in/api/v1/stocks?skus={sku1},{sku2}

Query Parameters

Parameter Default Description
warehouse all warehouses configured for the account. Fetch stock for a specific warehouse.
skus Comma separated list of skus for which the stock is to be retrieved

Returns Data

Attribute Description
quantity stock quantity for given sku
warhouse the warehouse for which the sku and quantity is returned
sku sku identifier

Status Codes

Code Description
200 Ok
204 No content
206 Partial Content
304 Not modified
404 Not found

Update Stock Quantity

Example Request

curl -X PUT "https://access.easyops.in/api/v1/stocks" \
  -H "Content-Type: application/json" \
  -d '[{"sku":"{sku1}","quantity":201},{"sku":"{sku2}","quantity":201}]' \
  -H "X-TenantId:{$tenantId}"

Example Response

{
  "data": ["{sku1}"], 
  "message": "Partially Modified",
  "request_id": "3d6b29b3-b7ef- 4da1-b25d- 4c8ba2594209",
  "errors": [ "{sku2}" ],
  "timestamp": 1476701296017,
  "status": "200"
}

This endpoint updates stock quantity for the specified skus.

HTTP Request

PUT https://access.easyops.in/api/v1/stocks

Body Data

Parameter default Description
sku Comma separated list of skus for which the stock is to be retrieved
warehouse all warehouses configured for the account. Update stock for a specific warehouse.
quantity Update stock with specified quantity. (Mandatory parameter)

Returns Data

Attribute Description
sku sku identifier

Status Codes

Code Description
200 Ok
204 No content
206 Partial Content
304 Not modified
404 Not found

Sku

This is an object representing your easyops sku. You can use this object to create and view sku in your account.

Create Sku

Example Request

curl "https://access.easyops.in/api/v1/sku/{sku}" \
  -X POST \
  -d quantity=10 \
  -H "X-TenantId:{$tenantId}"

Example Response

{
  "data": ["{sku}"], 
  "message": "Created",
  "request_id": "3d6b29b3-b7ef-4da1-b25d-4c8ba2594209",
  "errors": [],
  "timestamp": 1476701296017,
  "status": "201"
}

This endpoint creates the specified sku.

HTTP Request

POST https://access.easyops.in/api/v1/sku/{sku}?quantity=10

Query Parameters

Parameter Default Description
quantity 0 default stock quantity. (Not mandatory)

Returns Data

Attribute Description
sku sku identifier

Status Codes

Code Description
200 Ok
201 Created
204 No content
206 Partial Content
304 Not modified
404 Not found

Skus

This is an object representing your easyops skus. You can use this object to create and view skus in your account.

Create Skus

Example Request

curl "https://access.easyops.in/api/v1/skus" \
  -X POST \
  -d '[{"sku":"{sku1}","quantity":20},{"sku":"{sku2}","quantity":220}]' \
  -H "X-TenantId:{$tenantId}"

Example Response

{
  "data": ["{sku1}", "{sku}"], 
  "message": "Created",
  "request_id": "3d6b29b3-b7ef-4da1-b25d-4c8ba2594209",
  "errors": [],
  "timestamp": 1476701296017,
  "status": "201"
}

This endpoint creates the specified skus.

HTTP Request

POST https://access.easyops.in/api/v1/skus

Query Parameters

Parameter Default Description
sku sku identifier for new sku
quantity 0 Update stock with specified quantity. (Not mandatory)

Returns Data

Attribute Description
sku sku identifier

Status Codes

Code Description
200 Ok
201 Created
204 No content
206 Partial Content
304 Not modified
404 Not found

Orders

This is an object representing your easyops orders. You can retrieve it to see and track the orders in your account.

Search orders

Example Request

curl "https://access.easyops.in/api/v1/orders/search" \
  -d '{"filter": { "orderStates": ["NEW"], "channels": ["Flipkart"] }}' \
  -H "X-TenantId:{$tenantId}"

Example Request Body

{
 "filter": {
   "orderStates": [
     ""
   ],
   "channels": [
     ""
   ],
   "orderDate": {
     "fromDate": "ISO DateTime", 
     "toDate": "ISO DateTime" 
   },
   "modifiedDate": {
     "fromDate": "ISO DateTime",
     "toDate": "ISO DateTime"
   }
 },
 "pagination": {
   "pageSize": 100,
   "pageNumber": 0
 }
}

Example Response

{  
  "hasMore":false,
  "nextUrl":"",
  "message":"Success",
  "orderItems":[  
     {  
        "orderId":2,
        "orderTrackingNumber":"522d3as",
        "orderDate":1476901800000,
        "channel":"Flipkart",
        "modeOfPayment":"Debit Card",
        "currentStatus":"New",
        "billingAddress":{  
           "billTo":"John Doe",
           "address":"Wyatt drive",
           "city":"Bangalore",
           "state":"Karnataka",
           "country":"India",
           "pincode":"560076",
           "tin":"",
           "cst_no":""
        },
        "orderItems":[  
           {  
              "itemId":123,
              "productTitle":"Test Product",
              "channelSku":"sku-abc",
              "channelIdentifier":"s-111",
              "easyopsSku":"abc",
              "quantity":1,
              "unitPrice":800
           }
        ],
        "priceDetails":{  
           "orderDiscount":0,
           "shippingCharges":0,
           "codCharges":0,
           "otherCharges":0
        },
        "shipmentDetails":{  
           "courier":"Ekart",
           "awb":"12346",
           "packageWeight":0,
           "packageLength":0,
           "packageWidth":0,
           "packageHeight":0,
           "packageCount":"1"
        },
        "shippingAddress":{  
           "shipTo":"John Doe",
           "address":"Bangalore",
           "city":"Bangalore",
           "state":"Karnataka",
           "country":"India",
           "pincode":"560076"
        }
     }
  ],
  "request_id":"66392dff-9e6f-4b13-bd2b-db85a39a1776",
  "errors":[  

  ],
  "timestamp":1477059527608,
  "status":"200"
}

This endpoint returns list of orders based on the search criteria.

Request Body Parameters

Parameter Description
orderStates Filter based on order status. Possible values are UPCOMING, NEW, CONFIRMED, IN_PROGRESS, READY_TO_SHIP, SHIPPED, RETURNING, RETURNED
channels Filter based on sales channel
orderDate Filter based on orders placed within the selected date range, where the date strings are in ISO format
modifiedDate Filter for orders that were modified within the selected date range, where the date strings are in ISO format
pageSize Number of search results to display in one page. Maximum size is 100
pageNumber Page number for nagivation.

Response Body Parameters

Parameter Description
hasMore flag indicating there are more records for the fetched orders
nextUrl url for next page request
previousUrl url for next page request
orderId System generated order ID (internal id)
orderTrackingNumber order Tracking Number (public identifier)
orderDate date of order in ISO format
channel name of sales channel
modeOfPayment payment mode
currentStatus status of order
billTo person to whom the order is billed
address billing address
city billing city
state billing state
country billing country
pincode billing pincode
tin billing tin number
cst_no billing cst number
itemId order line item id
productTitle order line item product name
channelSku order line item channel sku
channelIdentifier order line item channel identifier
easyopsSku order line item easyops sku
quantity order line item quantity
unitPrice order line item unit price
orderDiscount order related discount
shippingCharges order related shipping charges
codCharges order cod charges
otherCharges order other charges
courier courier name
awb airway bill name
packageWeight package weight
packageLength package length
packageWidth package width
packageHeight package height
packageCount package count
shipTo person to whom the order is shipped
address shipping address
city shipping city
state shipping state
country shipping country
pincode shipping pincode

Status Codes

Code Description
200 Ok
204 No content
206 Partial Content
304 Not modified
404 Not found