Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Overview

Excerpt

This method allows you to create a Web Order in Komet Sales for a given item.This method searches for a Web Order with Pending status and adds the items to it. In case there is not an existing Order, it creates a new Web Order for the items. Keep in mind that this method only works with user's tokens.

Request

https://api.kometsales.com/api/web-order-item.add

  • Method: POST
  • Content-Type: application/json

Headers

  • X-SALES-CHANNEL (optional) (string: 20): Valid values: "WEB_APP", "MOBILE_APP", "K2K" , "ECOMMERCE_LITE". X-ACCOUNT (required)(integer:20): Company ID that is using the API. Please ask Komet Sales team to have this ID. 
  • authenticationToken (required)(string:50): Komet Sales security token.


Input parameters:

  • customerId (required)(integer:20): customer ID, used to search orders from only one customer. You can obtain this value from the customer.list API method.
  • inventoryIds (required)(string): Inventory Item ID.
  • inventoryOrigin (required)(integer:1):  the inventory type. 1=OM (Open Market), 2=FS (Future Sales), 3=VA (Vendor Availability), 4=K2K (Komet to Komet).
  • price (required)(decimal:10, 2): the unit price.
  • quantity (required)(integer:10): the number of boxes. 
  • carrierId (required)(integer:20): Komet Sales internal Carrier Id. You can obtain this value from the carrier.list API method.
  • date (date) (date format YYYY-MM-DD).
  • companyLocationId (integer:20): Required if the company is in Multi Location mode. You can obtain this value from the location.list API method.
  • shipToId (integer:20): The Ship To ID. You can obtain this value from the customer.shipto.list API method.
  • markCode (string:20): The item mark code. 
  • webOrderId (integer:20): The ID of the Web Order you want to add this item to. When this value is sent, all the items will be consolidated under the same Web Order. If this value is not specified, the system will try to find existing orders with pending status and identical information and will add the items to them or will create a new order. In the case of invoices, the system will create an invoice for every Web Order.  In the case of Prebooks, all the items for the same Customer, Carrier and Date will be consolidated into one single Prebook, regardless of the Web Order.


JSON Viewer
width100%
languagejs
themeConfluence
titleSample
{ 
   "customerId": 7349,
   "companyLocationId": 13,
   "date": "2017-06-30",
   "carrierId": 4521, 
   "quantity": 1,
   "price": 17.56,
   "inventoryOrigin": 4,
   "inventoryIds": 428720,
   "markCode": "" 
}

Response

Output:

    • message (String):  description of the transaction status.
    • status (integer:1):  transaction status. 1 for success or 0 for failure.
    • webOrderId: the ID of the Web Order created on Komet Sales.
    • orderId (integer:20): The ID of the order (It is returned when the inventoryOrigin is 1 (OM)).
    • prebookId (integer:20): The ID of the prebook (It is returned when the inventoryOrigin is 2, 3, 4 (FS, VA, K2K)).
    • prebookItemId (integer:20) the ID of the prebook Item created. (It is returned when the inventoryOrigin is 2, 3, 4 (FS, VA, K2K)).
    • orderItemId (integer:20) the ID of the Order Item created.(It is returned when the inventoryOrigin is 1 (OM)).

JSON Viewer
width100%
languagejs
themeConfluence
titleSample
height100%
{
	"message":"The item was successfully added.",
	"webOrderId":47,
	"status":1,
	"prebookId":3834,
	"prebookItemId": 928342
  
}



Panel
titleRelated Articles

Content by Label
showLabelsfalse
max10
showSpacefalse
sorttitle
cqllabel in ("create-web-order","ecommerce-lite","api","ecommerce")
labelsecommerce api create-web-order ecommerce-lite


Warning
titleImportant

This is the master API method for Web Orders creation in Komet.