Orders
(ms.orders)

Orders Entity .

Fields

_idThe unique identifier for the orders. This one is used for API purposes. 

{ "_id" : "54b8bbf73e2dfb0a0b640c5e" }

Read Only
additional_charges
Type: array

Read Only: No

Required: No
It is an array of object containing details of aditional charges .

{
     "name":" Offline payment Changes",
     "type":"payment_charges",
     "price" :"50"
}


Read Only
billing_address
Type: object

Read Only: No

Required: No
{ "full_name" : "null" }
{ "address" : " " }
{ "city" : "Delhi" }
{ "state" : "Delhi" }
{ "country" : "IN" }
{ "zip" : "110001" }
{ "phone" : "555-625-1199" }

The billing address associated with the payment method. This address is an optional field that will not be available on orders that do not require one. It has the following properties:

full_name: The full name of the person associated with the payment method.
address: The street address of the billing address.
city: The city of the billing address.
state: The state of the billing address.
country: The name of the country of the billing address.
zip :The zip or postal code of the billing address.
phone: The phone number at the billing address.
client_details
Type: object

Read Only: No

Required: No

This  object contain the detail of client system .

These details is gathered for navigator object of javascript.

 {
         platform:"Win", 
         browser:'Chrome'

Read Only

coupon_codeThis contain the code applied by user in order to avial some sort of discount.

{
    "coupon_code":"HIPPO"
}
currency
Type: object

Read Only: No

Required: No
It is object containing name and conversion_rate of currency

{name:'USD',conversion_rate:'0.14'}

Deprecated 
Read only
 
currency_codeThis contain  the ISO-3 Currecny code of cart

currency_code:'USD'

Read Only
 
currency_rateThis contain  the conversion rate of the currency of the  currency code 

currency_rate:'0.14'

Read Only
 
discounts
Type: string

Read Only: No

Required: No
It is an array of object containing details of cart level discounts.

{
        "_id":"53b256e9b3af14aa15e451a5",
        "saving_amount":50,
        "coupon_code":"HIPPO"
}

Read Only
ecouponThis object contain the coupon code and discount associated with it.

{
       "code":"HIPPO",
       "discount":{
                               // Complete discount object.
        }
}

Deprecated
Read Only
email
Type: string

Read Only: No

Required: No
This field contain email id of customer.


{ "email" : "trials@storehippo.com" }
financial_status
Type: string

Read Only: No

Required: No
This field show the status of payment  at various stages.

possible values :
 
Pending = This indicate that payment for order is still not pending.
Paid =  This indicate that payment for order is made.
 
items
Type: array

Read Only: No

Required: No
{
     "_id":"53b256e9b3af14aa15e451a5",               // The unique numeric identifier for the cart item
    "name":"product1" ,                                               // Normalized name of product.
    "product_id" :"53ad1eabbf5aae5a71b2f795"  ,                                        // The unique numeric identifier for the product
    "selected_options":{
                "color" : "red",
                "size" : "M"                                                // Addtional imformation regarding cart item.
    },
    " variant_id":"size|M" ,                                            //Variant_id of the selected variant
    "product":{
                                                // Unaltered Product object
     },
     "price":500,                                                         //Cost after discount per unit
     "discounts_total":  10,                                         //Total amount deducted from  single unit of item.
     "discounts_percentage":2 ,                                 //Total percentage of amount deducted for single unit of item.
     "taxes":[
              {
    
              }
     ],
     "taxes_total":10,
     "total":500,
     "quantity":1,
     "sub_total": 500   //Deprecated
     "thumbnail_url" : "/ms.option_set/55b9cecdbe8d1cd811246e0f/options/undefined/55b9ce83be8d1cd811246e0e/55b9ce83be8d1cd811246e0e-150x150.jpg",
   "image_url" : "/ms.option_set/55b9cecdbe8d1cd811246e0f/options/undefined/55b9ce83be8d1cd811246e0e/55b9ce83be8d1cd811246e0e-1024x1024.jpg
 }
item_count
Type: string

Read Only: No

Required: No
This field contain the total  number of items in order.

Read Only
invoice_numberThis field has the invoice number associated with order. 
This field can be populated by admin incase admin has selected manual invoice number generation in settings.
languageThis field has the current language of website if store support  multiple languages.

Read Only
metafieldsThis field is an object and contain the additional information inserted programatticaly .

Read Only 
 
optionsThis field is an object and contain addtional information inserted by user , limited by store owner.

Ex. delivery slot , delivery date etc. 
order_id
Type: string

Read Only: No

Required: No
This is unique id of order, which made up of two parts: 

prefix : will be retrived from settings order id prefix
sequence number : It is auto generated numeric sequence 

OID100
OID : prefix
100 : sequence number
payment_method
Type: object

Read Only: No

Required: No
This field is an object contain the inforamtion of payment method used for placing order on the cart.

{
      "_id":"55beffe5c2f7cebe6e27f41f",
      "name":"Cash On Delivery",
      "type" :"cash_on_delivery",
      "settings":{
                     validate:true,
                     check_avialablity:false
       },
       additional_charges:50
}


User can change the payment method but not  this object.
shipping_address
Type: object

Read Only: No

Required: No
{ "full_name" : "null" }
{ "address" : " " }
{ "city" : "Delhi" }
{ "state" : "Delhi" }
{ "country" : "IN" }
{ "zip" : "110001" }
{ "phone" : "555-625-1199" }

The shipping address is a required field. It has the following properties:

full_name: The full name of the person associated with the payment method.
address: The street address of the billing address.
city: The city of the billing address.
state: The state of the billing address.
country: The name of the country of the billing address.
zip :The zip or postal code of the billing address.
phone: The phone number at the billing address.
sub_total
Type: number

Read Only: No

Required: No
This field contain total sumation of all item's  total present in order.

Read Only
shipping_total
Type: number

Read Only: No

Required: No
This field contain the total shipping charges applied on order

Read Only
shipping_method
Type: object

Read Only: No

Required: No
This field is an object contain the inforamtion of shipping method used for placing order on the cart.
{
      "_id":"55beffe5c2f7cebe6e27f41f",
      "name":"Standard Shipping",
      "price":50
}

User can change the shipping method but not  this object.
status
Type: string

Read Only: No

Required: No
This field show the status of order at various stages.

possible values :
 
Open = this indicate that order is placed with any of the payment mode .
Closed = This inicate that order is completed in all respect.
Cancled = This indicate that order is cancelled be user or admin.
total
Type: number

Read Only: No

Required: No
This field contain total amount payable/paid for order.

Read Only
taxes_total
Type: number

Read Only: No

Required: No
This field contain the total tax amount charged on cart.

Read Only
total_weightThis field carry summation of weight of all items in cart.

Read Only
txn_id
Type: string

Read Only: No

Required: No
This field has unique identifier which is used for making payment. 

Read Only
user_id
Type: string

Read Only: No

Required: No
This field has the unique id of user placed the order.

Read Only
taxes
Type: array

Read Only: No

Required: No

Array of taxes applicable on the order

cart_id
Type: string

Read Only: No

Required: No

ID of the cart for which the order was generated

discounts_total
Type: number

Read Only: No

Required: No

Total discount value applied on the order

fulfillments
Type: array

Read Only: No

Required: No
Details of shipment like tracking_number, logistics company, etc of a shipped order
balance_amount
Type: number

Read Only: No

Required: No

Amount to be received from the customer for the order

seller
Type: string

Read Only: No

Required: No

ID of the order's seller


Related Resources

ms.order_options
It contains the list of  order options defined in store.

Read Only 
 

For detail description follow given link click here
ms.payment_methods
This contains the list of payment methods.

Read Only 

For detail description follow given link click here
ms.shipping_methods
This contains the list of shipping methods.

Read Only 

For detail description follow given link click here
ms.users
This contains the list of  users.

Read Only 

For detail description follow given link click here
Delete Order GET /api/1/entity/ms.orders/{#_id}

Example

Delete single order
GET /entity/ms.orders/53b256e9b3af14aa15e451a5

Example Request Json

{
    "entity":"ms.orders",
    "recordId":"53b256e9b3af14aa15e451a5"
}

Example Response Json

{
    "data":"Deleted Successfully"
}

Message

CodeMessage
401Not Authorized
406Something went wrong

Query Parameters

CodeMessage
_IdUnique Identifier of the order to be updated
Get Order GET /api/1/entity/ms.orders/{#_id}

Message

CodeMessage
401Not Authorized
406Something went wrong

Query Parameters

CodeMessage
_IdUnique Identifier of the order to be updated
Cancel Order PUT /api/1/entity/ms.orders/_/cancelOrder

This api is helpful to cancel the order

Example

Cancel Order
PUT

Example Request Json

data:{
orderId:"123456",
reason:"not intersted"
}

Example Response Json

{
status:200
}

Message

CodeMessage
401Unauthorize
406Something Went Wrong

Query Parameters

CodeMessage
_idUnique Identifier of the order to be updated
ReasonReason why you want to cancel order
List Orders GET /api/1/entity/ms.orders

Example

list orders
GET /api/1/entity/ms.orders

Example Response Json

{
  "messages": [
    {
      "name": "ms.entity.orders.list",
      "level": "success",
      "key": "ms.entity.orders.list"
    }
  ],
  "data": [
    {
      "_id": "55bef9159cad703e28e43b5e",
      "order_id": "OID221",
      "items": [
        {
          "_id": "55bc94ade2b2ac2728d4e827",
          "name": "Polka Dot Shirt /TSF3447",
          "product_id": "554764ca0553a0bc62500152",
          "product_url": "/product/polka-dot-shirt-tsf3447",
          "metafields": {
            "size": "size_charts/554c73f5a84106ea74fa8de9/554c73e46e5bae4c19946f6c.jpg",
            "size_chart": "size_charts/554c73f5a84106ea74fa8de9/554c73e46e5bae4c19946f6c.jpg"
          },
          "weight": "150",
          "selected_options": {
            "color": "White",
            "size": "L"
          },
          "variant_id": "White|L",
          "vendor": null,
          "price": "399.60",
          "list_price": 999,
          "discounts_percentage": "60.00",
          "discounts_total": "599.40",
          "discounts": [
            {
              "_id": "558a4186eeef6dd956381aab",
              "name": "Sale",
              "saved_amount": 599.4
            }
          ],
          "taxes": [
          ],
          "taxes_total": "0.00",
          "thumbnail_url": "ms.products/554764ca0553a0bc62500152/images/554764ca0553a0bc62500153/5547653b0553a0bc6250029a/5547653b0553a0bc6250029a-100x100.jpg",
          "image_url": "ms.products/554764ca0553a0bc62500152/images/554764ca0553a0bc62500153/5547653b0553a0bc6250029a/5547653b0553a0bc6250029a-1024x1024.jpg",
          "product": {
            "_id": "554764ca0553a0bc62500152",
            "name": "Polka Dot Shirt /TSF3447",
            "description": "Polka Dot Shirt",
            "option_set": "552269717215cce534407341",
            "_metadata": {
              "option_set": {
                "action": "automatic"
              }
            },
            "variants": [
              {
                "price": "999",
                "compare_price": "999",
                "sku": "TSF3447-OFFWHITE-L",
                "weight": "150",
                "inventory_management": "automatic",
                "inventory_quantity": "2",
                "options": [
                  {
                    "name": "color",
                    "value": "White"
                  },
                  {
                    "name": "size",
                    "value": "L"
                  }
                ],
                "variant_id": "White|L",
                "id": 7597
              },
              {
                "price": "999",
                "compare_price": "999",
                "sku": "TSF3447-OFFWHITE-M",
                "weight": "150",
                "inventory_management": "automatic",
                "inventory_quantity": "1",
                "options": [
                  {
                    "name": "color",
                    "value": "White"
                  },
                  {
                    "name": "size",
                    "value": "M"
                  }
                ],
                "variant_id": "White|M",
                "id": 29395
              },
              {
                "price": "999",
                "compare_price": "999",
                "sku": "TSF3447-OFFWHITE-S",
                "weight": "150",
                "inventory_management": "automatic",
                "inventory_quantity": "0",
                "options": [
                  {
                    "name": "color",
                    "value": "White"
                  },
                  {
                    "name": "size",
                    "value": "S"
                  }
                ],
                "variant_id": "White|S",
                "id": 61568
              },
              {
                "price": "999",
                "compare_price": "999",
                "sku": "TSF3447-OFFWHITE-XL",
                "weight": "150",
                "inventory_management": "automatic",
                "inventory_quantity": "2",
                "options": [
                  {
                    "name": "color",
                    "value": "White"
                  },
                  {
                    "name": "size",
                    "value": "XL"
                  }
                ],
                "variant_id": "White|XL",
                "id": 86974
              }
            ],
            "price": "999.00",
            "compare_price": "999.00",
            "collections": [
              "ss15"
            ],
            "brand": "THE VANCA",
            "sku": "TSF3447-OFFWHITE-L",
            "inventory_quantity": "2",
            "weight": "150",
            "categories": [
              "women",
              "topwear",
              "tops",
              "sale-2",
              "polka-collection"
            ],
            "publish": "1",
            "images": [
              {
                "image": "ms.products/554764ca0553a0bc62500152/images/554764ca0553a0bc62500153/5547653b0553a0bc6250029a/5547653b0553a0bc6250029a.jpg",
                "caption": "",
                "tags": "",
                "_id": "554764ca0553a0bc62500153",
                "_metadata": {
                  "image": {
                    "_id": "5547653b0553a0bc6250029a",
                    "name": "tsf34471.jpg.524233cc75.999xx.jpg",
                    "size": null,
                    "type": "image/jpeg"
                  }
                }
              },
              {
                "image": "ms.products/554764ca0553a0bc62500152/images/554764ca0553a0bc62500154/554765380553a0bc62500294/554765380553a0bc62500294.jpg",
                "caption": "",
                "tags": "",
                "_id": "554764ca0553a0bc62500154",
                "_metadata": {
                  "image": {
                    "_id": "554765380553a0bc62500294",
                    "name": "tsf34474.jpg.fd15ebc821.999xx.jpg",
                    "size": null,
                    "type": "image/jpeg"
                  }
                }
              },
              {
                "image": "ms.products/554764ca0553a0bc62500152/images/554764ca0553a0bc62500155/554765390553a0bc62500297/554765390553a0bc62500297.jpg",
                "caption": "",
                "tags": "",
                "_id": "554764ca0553a0bc62500155",
                "_metadata": {
                  "image": {
                    "_id": "554765390553a0bc62500297",
                    "name": "tsf34472.jpg.70f35b1f56.999xx.jpg",
                    "size": null,
                    "type": "image/jpeg"
                  }
                }
              },
              {
                "image": "ms.products/554764ca0553a0bc62500152/images/554764ca0553a0bc62500156/554765390553a0bc62500296/554765390553a0bc62500296.jpg",
                "caption": "",
                "tags": "",
                "_id": "554764ca0553a0bc62500156",
                "_metadata": {
                  "image": {
                    "_id": "554765390553a0bc62500296",
                    "name": "tsf34473.jpg.922dc3f85b.999xx.jpg",
                    "size": null,
                    "type": "image/jpeg"
                  }
                }
              }
            ],
            "attributes": [
              {
                "name": "fabric",
                "value": "Georgette ",
                "group": "default",
                "_id": "55bb8a43047d13de561d4c85"
              },
              {
                "name": "collar",
                "value": "Collar Neck",
                "group": "default",
                "_id": "55bb8a43047d13de561d4c86"
              },
              {
                "name": "sleeve",
                "value": "Long Sleeve",
                "group": "default",
                "_id": "55bb8a43047d13de561d4c87"
              },
              {
                "name": "Fit",
                "value": "Regular Fit",
                "group": "default",
                "_id": "55bb8a43047d13de561d4c88"
              },
              {
                "name": "_brand",
                "value": "THE VANCA",
                "_id": "55bb8a43047d13de561d4c89"
              }
            ],
            "SEO": {
              "title": "Polka Dot Shirt"
            },
            "product_has_multiple_variants": "1",
            "inventory_management": "automatic",
            "inventory_low_stock_quantity": "5",
            "alias": "polka-dot-shirt-tsf3447",
            "sort_order": 22,
            "created_on": "2015-05-04T12:32:57.679Z",
            "updated_on": "2015-07-31T14:46:27.121Z",
            "metafields": {
              "size": "size_charts/554c73f5a84106ea74fa8de9/554c73e46e5bae4c19946f6c.jpg",
              "size_chart": "size_charts/554c73f5a84106ea74fa8de9/554c73e46e5bae4c19946f6c.jpg"
            },
            "inventory_management_level": "variant",
            "available": 1,
            "_updated_by": "55018ee9b8f738e77f9fd195",
            "options": [
              {
                "name": "color",
                "value": "White"
              },
              {
                "name": "size",
                "value": "L"
              }
            ],
            "default_variant": {
              "price": "999",
              "compare_price": "999",
              "sku": "TSF3447-OFFWHITE-L",
              "weight": "150",
              "inventory_management": "automatic",
              "inventory_quantity": "2",
              "options": [
                {
                  "name": "color",
                  "value": "White"
                },
                {
                  "name": "size",
                  "value": "L"
                }
              ],
              "variant_id": "White|L",
              "id": 7597
            },
            "dimension": {
            },
            "features": [
            ],
            "variant_id": "White|L",
            "id": 7597,
            "list_price": "999",
            "our_price": 999,
            "original_price": "999"
          },
          "discount_total": "599.40",
          "quantity": 1,
          "sub_total": "999.00",
          "total": "399.60"
        }
      ],
      "sub_total": "399.60",
      "total": 448.6,
      "item_count": 1,
      "status": "open",
      "financial_status": "Paid",
      "delivery_status": null,
      "shipping_status": "Ready to ship",
      "cart_id": "55bc92039cad703e28e40ff7",
      "email": "charmingme.s@gmail.com",
      "user_id": null,
      "discounts": [
      ],
      "discount_total": 0,
      "discounts_total": 0,
      "shipping_method": {
        "_id": "555065f48d3b90e43b45ec40",
        "name": "Delivery Charges",
        "price": 49,
        "discounts_total": 0,
        "discounts_percentage": 0
      },
      "shipping_method_name": "Delivery Charges",
      "shipping_total": "49.00",
      "currency": {
        "name": "INR",
        "conversion_rate": "1"
      },
      "taxes": [
      ],
      "taxes_total": "0.00",
      "gift_cards": [
      ],
      "gift_card_total": "0.00",
      "ecoupon": {
      },
      "options": {
      },
      "billing_address": {
        "country": "IN",
        "full_name": "Sreya Ray",
        "address": "No 33 and 33/1 Krishna Reddy Colony,Domlur Layout",
        "city": "Bangalore",
        "state": "Karnataka",
        "zip": "560071",
        "phone": "7259004793"
      },
      "shipping_address": {
        "country": "IN",
        "full_name": "Sreya Ray",
        "address": "No 33 and 33/1 Krishna Reddy Colony,Domlur Layout",
        "city": "Bangalore",
        "state": "Karnataka",
        "zip": "560071",
        "phone": "7259004793"
      },
      "additional_charges": [
      ],
      "metafields": {
      },
      "price_type": "inclusive",
      "txn_id": "vPBCEX853",
      "channel": "user",
      "payment_method": {
        "type": "payment_gateways",
        "enabled": "1",
        "settings": {
          "gateways": [
            {
              "id": 42071,
              "gateway": "ccavenue",
              "gateway_options": {
                "key": "tzese3kh3cwkz4k9mu48cdeo2bwfngg2",
                "merchantid": "M_raj20967_20967"
              }
            }
          ],
          "gateway": "ccavenue"
        },
        "name": "Online Payment",
        "_id": "5433c08a8d72182379836d04",
        "image": "ms.settings/5256837ccc4abf1d39000001/551e517c838b165e08011f7d.gif",
        "_metadata": {
          "image": {
            "_id": "551e517c838b165e08011f7d",
            "name": "ccavenue_logo.gif",
            "size": 3162,
            "type": "image/gif"
          }
        }
      },
      "balance_amount": 0,
      "wallets": [
      ],
      "invoice_number": null,
      "client_details": {
        "appCodeName": "Mozilla",
        "appName": "Netscape",
        "appVersion": "5.0 (Windows NT 5.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/44.0.2403.125 Safari/537.36",
        "platform": "Win32",
        "cookieEnabled": true,
        "languages": [
          "en-US",
          "en"
        ],
        "device": "WEB"
      },
      "version": "ms.0.3.0",
      "created_on": "2015-08-03T05:16:05.021Z",
      "updated_on": "2015-08-03T09:43:08.162Z",
      "fulfillments": [
        {
          "tracking_number": "781082161340",
          "tracking_company": "shippo- FEDEX",
          "service": "FEDEX_EXPRESS_SAVER",
          "method": "regular",
          "price": "68.40",
          "status": "Ready to ship",
          "_id": "55bf37ac7325c0f42e19b750"
        }
      ],
      "shipping_label": "//cdn.storehippo.com/s/54f3fe54e8e5022a0edeebda/ms.shipping/55bf37aa7325c0f42e19b747_shipping.pdf",
      "PickupConfirmationNumber": "131",
      "Location": "DAEA",
      "_updated_by": "55018ee9b8f738e77f9fd195",
      "_resolvedData": {
        "_updated_by": {
          "_id": "55018ee9b8f738e77f9fd195",
          "email": "rajeev@thevanca.com",
          "sort_order": 35
        }
      }
    }
  ],
  "paging": {
    "total": 47,
    "count": 1,
    "limit": 1,
    "start": 0
  }
}

Message

CodeMessage
401Not Authorized
406Something went wrong

Query Parameters

CodeMessage
order_IdSend order_id in query in to get orders with specified order_id
statusSend status to get orders with status send in query
Mark As Shipped POST /api/1/entity/ms.orders/_/markAsShipped

This command takes awb number, name of logistics service and order details to create its shipment and send a mail notification to the customer

Example

Mark an order as Shipped
POST

Example Request Json

{
  "awb": "test12345",
  "details": {
    "_id": "57dbb73cd593ea345ddcc98d",
    "items": [
      {
        "_id": "57db7ce3e42b47a115e533f6",
        "name": "ppp",
        "product_id": "573d4b352e6910c3589bc34b",
        "metafields": {
          "location_based_prices": []
        },
        "weight": "10",
        "linked_product_id": null,
        "price": "100.00",
        "quantity": 2,
        "total": 100
      }
    ],
    "sub_total": 5100,
    "total": 5100,
    "item_count": "2",
    "email": "sumit.yadav@hippoinnovations.com",
    "shipping_address": {
      "country": "IN",
      "full_name": "yadav",
      "address": "Spaze I tech Park",
      "city": "gurgaon",
      "state": "Haryana",
      "zip": "122001",
      "phone": "9876543210"
    },
    "order_id": "OID806",
    "payment_status": "paid",
    "return": false
  },
  "service_used": "test service",
  "generate_shipping_label": true,
  "send_mail": false
}

Query Parameters

CodeMessage
awbThe tracking number of the shipment associated with the order
detailsOrder details
service_usedLogistics service used to ship the order
generate_shipping_labelFlag to generate shipping label
send_mailFlag to send notification to client
Receive Payment GET /api/1/entity/ms.orders/_/receivePayment

This method is called when an order's cod amount is remitted. It marks the financial_status of the cod order as "Paid". If the tracking status of the order is "Delivered" it marks the status of the order as closed.

Also, adds an transaction record in ms.transactions

Query Parameters

CodeMessage
user_idCustomer Id
user_emailCustomer email
typePurpose of calling the command like "cod_verification"
amountOrder total amount
order_idOrder Id
posting_typeType of transcation, credit or debit
financial_statusFinancial status of the order, Paid or Pending 
reference_idOrder Id used as reference Id
subtypePurpose of calling the command like "cod_remittance"
modeMode of payment, cod or online
txn_idTransaction Id associated with the payment of order
payment_detailsPayment details mentioned in the order
payment_methodPayment method mentioned in order
Get Addresses GET /api/1/entity/ms.orders/_/getAddresses

This method fetches all pickup addresses (physical location of store and warehouse addresses) associated with a store. These addresses are then use to schedule pickups of shipments

Example

Mark As Delivered PUT /api/1/entity/ms.orders/_/markAsDelivered?q={"_id":"<_id>"}

This command takes shipping status and id of the order to set its shipping_status anddelhiverystatus to "Delivered". 
If the financial status of the order is "Paid" it marks the status of the order as closed.

Example

markAsDelivered
PUT /api/1/entity/ms.orders/_/markAsDelivered?q={"_id":"<_id>"}

Example Request Json

{
"data": {
  "shipping_status": "Delivered",
  "order_delivered": "1"
 }
}
GenerateBulkShippingLabel GET /api/1/entity/ms.orders/_/generateBulkShippingLabel

This method takes an array of order objects, selects the ones that have shipping label and return shipping label pdfs displayed in new window

Example

AddTransactions PUT /api/1/entity/ms.orders/_/addTransactions?q={"order_id":"_id"}

This API takes reference id, description and amount of the order, in order to add a transaction to the order.
If the full amount (total amount of the order) is passed in it, then, the order is marked as paid.

Example

Mark as Paid
PUT

Example Request Json

data: {
amount: 10.1,
desc: "mark this order as paid",
ref_num: "OID1234",
sub_type: "payment_gateway",
type: "payment_gateways"
}

Example Response Json

{
status: 200,
data: "Added Successfully"
}

Query Parameters

CodeMessage
order_id

order_id of the order to which the transaction is to be added

AddOrder PUT /api/1/entity/ms.orders/_/addOrder?q={"allow_custom_pricing":true}

This API is used to add the order from the Admin Panel.

Example

Add Order
PUT

Example Request Json

{
                    entity: 'ms.orders',
                    data: {
                        items: [
                            {
                                product_id: "59d605da64abe444540ee6e0",
                                quantity: 1
                            }
                        ],
                        sub_total: product.price,
                        total: product.price,
                        item_count: 1,
                        email_id: 'abc@test.com',
                        user_id: user_id,
                        billing_address: {
                            address: "B4-309 Spaze iTech Park, Sector-49, Sohna Road",
                            city: "Gurgoan",
                            country: "IN",
                            full_name: "Testing",
                            phone: "1234567890",
                            state: "Harayana",
                            zip: "122001"
                        },
                        shipping_address: {
                            address: "B4-309 Spaze iTech Park, Sector-49, Sohna Road",
                            city: "Gurgoan",
                            country: "IN",
                            full_name: "Testing",
                            phone: "1234567890",
                            state: "Harayana",
                            zip: "122001"
                        },
                        payment_method: {}
                    }
                }

Example Response Json

{ status: 200,
  data: 
   { items: [ [Object] ],
     sub_total: 100,
     total: '100.00',
     item_count: 1,
     status: 'open',
     financial_status: 'Pending',
     balance_amount: '0',
     delivery_status: null,
     shipping_status: null,
     fulfillment_status: null,
     cart_id: '59d719340faf8dbc0dfe070d',
     email: 'abc@test.com',
     user_id: '59d719320faf8dbc0dfe0703',
     discounts: [],
     discount_total: 0,
     discounts_total: 0,
     shipping_method: 
      { _id: 'aersda@#$32sfas2342',
        name: 'Standard Shipping',
        price: 0,
        seller: 'all_sellers',
        prices_are: 'inclusive',
        taxes: [Object],
        taxes_total: '0.000',
        tax_applied_on: '0.00',
        tax_plus_taxable_amount: '0.00' },
     shipping_method_name: null,
     shipping_total: 0,
     shipping_by_vendor: { '5837cd72b45741dc6806b829': 0 },
     currency: 
      { name: 'INR',
        conversion_rate: '1',
        decimal_points: '1',
        symbol: '₹' },
     invoice_number: '',
     invoice_numbers: [],
     invoice_pdf_path: '',
     taxes: [ [Object] ],
     taxes_total: 9.091,
     gift_cards: [],
     gift_card_total: 0,
     ecoupon: {},
     options: {},
     billing_address: 
      { address: 'B4-309 Spaze iTech Park, Sector-49, Sohna Road',
        city: 'Gurgoan',
        country: 'IN',
        full_name: 'Testing',
        phone: '1234567890',
        state: 'Harayana',
        zip: '122001' },
     shipping_address: 
      { address: 'B4-309 Spaze iTech Park, Sector-49, Sohna Road',
        city: 'Gurgoan',
        country: 'IN',
        full_name: 'Testing',
        phone: '1234567890',
        state: 'Harayana',
        zip: '122001' },
     additional_charges: [],
     metafields: {},
     price_type: 'exclusive',
     channel: 'admin',
     payment_method: {},
     wallets: [],
     client_details: {},
     marketplace_channel: {},
     _id: '59d719440faf8dbc0dfe070e',
     txn_id: null,
     created_on: '2017-10-06T05:48:52.738Z',
     version: 'ms.0.3.0',
     orders: [ [Object] ],
     notify_customer: 'no',
     payment_status: 'paid',
     notes: [],
     fulfillments: [] },
  messages: 
   [ { name: 'ms.entity.orders.addOrder',
       level: 'success',
       key: 'ms.entity.orders.addOrder',
       message: '' } ] }

Query Parameters

CodeMessage
allow_custom_pricing

always true - used to manipulate the product price at the time of adding the order

disable_seller_notifications

if true, used to prevent the notifications of order confirmation being sent to the seller

disable_customer_notifications

if true, used to prevent the notifications of order confirmation being sent to the customer

disable_admin_notifications

if true, used to prevent the notifications of order confirmation being sent to the admin

skip_taxesIf true, taxes are not applied to the items
skip_shipping_chargesif true, shipping methods/charges are not applied to the order.