Post Orders

This REST API is used by marketplaces to post new orders in Uniware. Generally, the orders are fetched by Uniware using the Get Orders API, however this is an additional functionality where the marketplaces can post the orders to the Uniware.

Tip

  • This is an optional feature used only when the marketplaces wish to post orders in Uniware.
  • This API request is initiated by the marketplace to post information (orders) in Uniware. For such APIs a unique static securitykey is provided by the Unicommerce to the marketplaces for authentication. This securitykey should be passed in header as mentioned below.
  • It is recommended to check out Notes for the reader. You might find this helpful as it contains Guidelines for using API references and Terminologies used here.

Flow

Order Flow

Tip

Complete integration flow is available on Basic Overview page.

Basic Information

NAME DETAILS
Usage: Optional, Either Get Orders or Post Orders API to be used
URL: https://apiproxy.unicommerce.com/
Endpoint: /uc/v1/order
Request Type: POST
Scheme: HTTPS
Header (Content-Type): application/json
Header (clientid): ID (provided by Unicommerce)
Header (merchantid): username
Header (securitykey): key (provided by Unicommerce), Eg.: 12121212-232323-232323

NOTE:

The charges and price details can be provided either at order level or order item level (charges which are common), but not in both. However, it is recommended to send price at order item level for better handling.

Request Payload

{
   "id": "string",
   "displayOrderNumber": "string",
   "orderDate": "2022-12-05 08:12:53",
   "orderStatus": "CREATED",
   "sla": "2022-12-06 08:12:53",
   "priority": 0,
   "paymentType": "string",
   "orderPrice": {
      "currency": "string",
      "totalCashOnDeliveryCharges": 0,
      "totalDiscount": 0,
      "totalGiftCharges": 0,
      "totalStoreCredit": 0,
      "totalPrepaidAmount": 0,
      "totalShippingCharges": 0
   },
   "orderItems": [
      {
         "orderItemId": "string",
         "status": "CREATED",
         "productId": "string",
         "variantId": "string",
         "sku": "string",
         "title": "string",
         "shippingMethodCode": "STD",
         "orderItemPrice": {
            "cashOnDeliveryCharges": 0,
            "sellingPrice": 0,
            "shippingCharges": 0,
            "discount": 0,
            "totalPrice": 0,
            "transferPrice": 0,
            "currency": "string"
         },
         "quantity": 0,
         "giftWrap": {
            "giftWrapMessage": "string",
            "giftWrapCharges": 0
         },
         "onHold": false,
         "packetNumber": 0,
         "facilityCode" : "string"
      }
   ],
   "taxExempted": false,
   "cFormProvided": false,
   "thirdPartyShipping": false,
   "shippingAddress": {
      "addressLine1": "string",
      "addressLine2": "string",
      "city": "string",
      "country": "string",
      "email": "string",
      "name": "string",
      "phone": "string",
      "pincode": "string",
      "state": "string"
   },
   "billingAddress": {
      "addressLine1": "string",
      "addressLine2": "string",
      "city": "string",
      "country": "string",
      "email": "string",
      "name": "string",
      "phone": "string",
      "pincode": "string",
      "state": "string"
   },
   "additionalInfo": "string"
}

Request Payload Details

LEVEL PARAMETER TYPE DESCRIPTION MANDATORY NOTES
1 id string Unique identifier for an order (Order ID) Yes Eg: 12322
15 displayOrderNumber string This number corresponds to Display Order Number on Unicommerce. Opt Eg: ABCDE, If the Marketplace does not have this field, don’t use this parameter then the Order ID will be used in Display Order Number.
2 orderDate date Order creation date on marketplace Yes Format : yyyy-MM-dd HH:mm:ss
Eg: 2022-12-02 08:12:53
3 orderStatus string Status of the order Yes Allowable: PENDING_VERIFICATION, CREATED, CANCELLED
4 sla date Max. time for which order processing can be delayed, beyond which the system will start giving alerts to take action. Yes Format: yyyy-MM-dd HH:mm:ss
Eg: 2022-12-02 08:12:53
5 priority integer Order fullfillment priority No Default: 0, High Value equals High Priority
6 paymentType string Mode of payment No Allowable: COD, PREPAID.
7 orderPrice object Sale Order Pricing Components No Opt: orderItemPrice, Rec: orderItemPrice
7.1 currency string Currency codes (3 digit) No Default: INR, Currency Codes
7.2 totalCashOnDeliveryCharges number Total Charges for COD No Sale order level
7.3 totalDiscount number Total Discount amount No Sale order level
7.4 totalGiftCharges number Total Gift charges No Sale order level
7.5 totalStoreCredit number Total Store Credit charges No Sale order level
7.6 totalPrepaidAmount number Total Amount paid while ordering No Sale order level
7.7 totalShippingCharges number Total Shipping charges No Sale order level
8 orderItems list List of items in an order Yes -
8.1 orderItemId string The ID of an item present inside the order Yes length must be between 0 and 45
8.2 status string Generally same as orderStatus. Only is case of partial order fulfilment the status of item in the order will vary. Yes Allowable: CANCELLED, CREATED, DISPATCHED, DELIVERED
8.3 productId string Product ID of the item Yes length must be between 0 and 45
8.4 variantId string Variant ID of the item Yes length must be between 0 and 45
8.5 sku string SKU code of the item on the marketplace Yes -
8.6 title string Title of the item Listing Yes -
8.7 shippingMethodCode string The shipping method of the order No Allowable: STD (Standard)
8.8 orderItemPrice object Item price details Yes Opt: orderPrice, Rec: orderItemPrice
8.8.1 cashOnDeliveryCharges number COD charges No -
8.8.2 sellingPrice number Selling price of single item Yes -
8.8.3 shippingCharges number Total (cumulative) shipping charges of all unique items No -
8.8.4 discount number Total (cumulative) Discount amount of all unique items No -
8.8.5 totalPrice number Total price of single item Yes -
8.8.6 transferPrice number - No -
8.8.7 currency string Currency codes (3 digit) No Default: INR, Currency Codes
8.9 quantity integer Qty of the item ordered Yes Default: 1
8.10 giftWrap object Gift wrap details No -
8.10.1 giftWrapMessage string No
8.10.2 giftWrapCharges number Extra charges for the wrap No -
8.11 onHold boolean true if order not available for processing No Default: false
8.12 packetNumber integer Packet number No Default: 1
8.13 facilityCode string This is the code passed by the Marketplace corresponding to their internal Location ID, and we will create orders based on the Location ID Map put in the connectors by the seller for that Marketplace. Else Skip this parameter or pass Null No -
9 taxExempted boolean Tax Exemption on item No Fixed: false
10 cFormProvided boolean Pre-GST configuration No Fixed: false
11 thirdPartyShipping boolean true if the shipping to end customer is taken care by the Marketplace. false for self shipping Yes -
12 shippingAddress object Shipping address details Yes -
12.1 addressLine1 string Precise address of the customer Yes length must be between 0 and 100
12.2 addressLine2 string Additional address information No length must be between 0 and 100
12.3 city string City name Yes Eg: Surat
12.4 country string Country name Yes Eg: India
12.5 email string Email ID No case insensitive
12.6 name string Name of receiver Yes -
12.7 phone string Contact no. Yes -
12.8 pincode string Area pincode (min. 6 digits) Yes Eg: 395006
12.9 state string State name Yes Eg: Gujrat
13 billingAddress object Billing address details Yes -
13.1 addressLine1 string Precise address of the customer Yes length must be between 0 and 100
13.2 addressLine2 string Additional address information No length must be between 0 and 100
13.3 city string City name Yes Eg: Surat
13.4 country string Country name Yes Eg: India
13.5 email string Email ID No case insensitive
13.6 name string Name of receiver Yes -
13.7 phone string Contact no. Yes -
13.8 pincode string Area pincode (min. 6 digits) Yes Eg: 395006
13.9 state string State name Yes Eg: Gujrat
14 additionalInfo string Any additional information No -

Response Payload

{
   "status": "success",
   "message": "Order created successfully",
   "data": null
}

Response Payload Details

LEVEL PARAMETER TYPE DESCRIPTION MANDATORY NOTES
1 Status string Success after cancellation is acknowledged Yes success/failure
2 message string Response message - -
3 data string Null - -

Error Codes

Refer Response Codes section to know about specific errors codes.

FAQs/Notes

Q1. If facilityCode is not passed by any Marketplace, what will happen in that case?
Ans. The facility will be allocated according to the Uniware facility allocation rules.

Q2. What will happen in the cases where such a “facilityCode” is passed by channel which is not available in the Location ID Mapping in the connectors?
Ans. In such cases, orders will not be created into the system, provided there is a mapping set by the seller already.

Q3. Will it affect any old integration?
Ans. This will not affect any of our existing integrations in any way, as previously their orders were processed using facility allocation rules and now also it’ll still work the same way. But in future if the marketplace wants to use this “facilityCode” based handling, we’ll have to update the merchant in our database.

Q4. Can billing addresses be fetched and updated via API as we are working on a bill to ship to a business model where the customer invoice raised has to be billed by the MP?
Ans. The billing address can be fetched using both Post Orders API and Get Orders API. But using MP integration we can’t update the same instead the updated address can only be re-fetched if needed.

Q5. There are two types of status fields in the response for this API, for order item and order item id, what is the difference between them?
Ans. There are two types of status mappings in UC, one for order as a whole and one for the order item id for the separate products in the order. For more details refer to the Status Definition header on Get Orders document.

Q6. There are two types of chnarge as order level and order item level, what is the difference between them??
Ans. The charges and price details can be provided either at order level or order item level (charges which are common), but not in both. However, it is recommended to send price at order item level for better handling. Also, order item level charges (except sellingPrice and totalPrice) are cumulative or sum for all unique items.

Unicommerce Website

Copyright © 2022 Unicommerce eSolutions Pvt. Ltd.