GET Orders by Status

To get all orders with pagination, for a particular order status.

HTTP Request
GET
https://access.way2order.com/api/v1/getordersbystatus/{statusID}
Request Header
Content-Type: application/json
Authorization: Bearer {access_token}
Query Parameters

The following query parameters are available

Parameter Description
sort Sort Order Refer 'Sort Fields' below
page Page Number Default 1
per_page Records per Page Default 25, Maximum 100

The query parameters are to be appended to the endpoint. To get 20 orders from page 2, for order status 'New', sorted by 'dt_create' in ascending (ASC) order, the endpoint with the query parameters will be

https://access.way2order.com/api/v1/getordersbystatus/new?sort=dt_create&page=2&per_page=20
Sort Fields

The following sort fields are available

ASC Order DESC Order
dt_create -dt_create Default
dt_update -dt_update
Request Response
{
    "data": [
        {
            "_id": "5c110920208ab40b3945e688",
            "buyer_id": "590",
            "buyerinfo": {
                "_id": "5bc875bcf9b0da3f12f97809", 
                "name": "B.S.Sharma",
                "company": "Bliss Enterprises",
                "initials": "BLISS",
                "address1": "57 Railway Road",
                "address2": "",
                "city": "New Delhi",
                "state": "New Delhi",
                "zip": "110001",
                "country": "IN",
                "email": "",
                "contact": "9464700320",
                "profilepic": "https://cdn.way2order.com/profilepics/others/b.png",
                "gstin": "03ABCDE1234F1ZZ"
            },
            "currency": "INR",
            "orderno": "ARCSMFG-00001",
            "ordertotals": {
                "submittedtotal": 7200,
                "submittedcount": 1,
                "submitteditems": 10,
                "finaltotal": 0,
                "finalcount": 0,
                "finalitems": 0
            },
            "shippinginfo": {
                "address1": "57 Railway Road",
                "address2": "",
                "city": "New Delhi",
                "state": "New Delhi",
                "zip": "110001",
                "country": "IN"
            },
            "draft": false,
            "message": "",
            "orderstatus": "New",
            "orderpriority": "Low",
            "groupexists": true,
            "dt_create": "2018-12-12T13:12:00.437Z",
            "dt_update": "2018-12-12T13:12:00.438Z",
            "id": "5c110920208ab40b3945e688"
        },
        ...
    ],
    "pagination": {
        "page": 1,
        "per_page": 25,
        "total_pages": 5,
        "total_elements": 121
    }
}
Attribute Details
Attribute Type Description
_id String ID of the Order
buyer_id String Buyer ID (ObjectId / Primary Key from your existing software / database)
buyerinfo Object Buyer's Contact Information
currency String Order Currency
orderno String Order Number
ordertotals Object Submitted / Finalised Order Totals with Line Item Count & Total Items Count
shippinginfo Object Buyer's Shipping Information
draft Boolean true if Order is in Draft Mode (Only for New Orders), false otherwise
message String Buyer's Message with the Order
orderstatus String Order Status (New, Confirmed, On-Hold, In-Process, Complete, Cancelled)
orderpriority String Order Priority (Low, Medium, High, Urgent)
groupexists Boolean true if Buyer has a Way2Order Account, false otherwise
dt_create Date Order Creation Date
dt_update Date Order Last Updation Date
id String ID of the Order

From the 'data' Array, the '_id' for a particular order can then be used to fetch complete details about the order using the endpoint /getorderdetails/{orderID}
The 'pagination' Object in the response contains the following information

Property Details
page Current Page Number
per_page Records per Page
total_pages Total Number of Pages
total_elements Total Records