Overview

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.

Important

The orders created with this method will have a transaction fee of 1.5%.

Request

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

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

Headers

  • 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 IDs that represent the lines that will be added to the web order. You can obtain these IDs  from the ecommerce/inventory.list API method. This field is not needed if productCode is used and you have the Transactional API Access enabled. 
  • inventoryOrigin (required)(integer:1):  the inventory type. 1=OH (On Hand), 2=FS (Future SalesThis field is not needed if productCode is used and you have the Transactional API Access enabled. 
  • 🔒 productCode (required: if inventoryIds is not given)(string:20): Product Legacy Code of the Komet Sales inventory item. You can obtain this value from the product.list API method.
  • 🔒 companyProductId: (required: if inventoryIds is not given)(integer:20): Komet Sales internal product ID. This field is not needed if productCode is used. You can obtain this value from the product.list API method.
  • 🔒 boxTypeCode (required: if inventoryIds is not given)(string:3): Box type code of the Komet Sales inventory item. You can obtain this value from the boxtype.list API method.
  • 🔒kometNetworkBoxTypeCode: (required: if inventoryIds is not given)(integer:4): Komet Network Code box type ID. This field is not needed if boxTypeCode is used. You can obtain this value from the boxtype.list API method.
  • 🔒 unitsPerBox (required: if inventoryIds is not given)(integer:10): units per box.
  • 🔒 unitType (required: if inventoryIds is not given)(string:5): stem or bunch are the unique valid values.
  • price (required)(decimal:10, 2): the unit price.
  • quantity (required)(integer:10): the number of boxes. 
  • 🔒 addAvailableQuantity(boolean)(true or false): If true adds the number of boxes available in the inventory. This field is provided if quantity is added and if you have the Transactional API Access enabled.
  • carrierId (required)(integer:20): Komet Sales internal Carrier Id. You can obtain this value from the carrier.list API method.
  • date (required) (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 from the same Customer, Carrier and Date will be consolidated into one single Prebook regardless of the Web Order.

🔒 Fields with this icon are only available when the token has the Transactional API Access enabled. 


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 (OH).
    • prebookId (integer:20): The ID of the prebook (It is returned when the inventoryOrigin is 2 (FS).
    • prebookItemId (integer:20) the ID of the prebook Item created. (It is returned when the inventoryOrigin is 2 (FS).
    • orderItemId (integer:20): the ID of the Order Item created.(It is returned when the inventoryOrigin is 1 (OH).
    • invoiceNumber:(integer:10): Invoice number generated from the web order. It is returned when the inventoryOrigin is 1 (OH)
    • prebookNumber(integer:10): Prebook number associated to the web order. It is returned when the inventoryOrigin is 2 (FS)
    • 🔒 quantityAdded(integer:10): The number of products added to the web order.

🔒 Fields with this icon are only available when the token has the Transactional API Access enabled. For more info, please visit the Transactional API Access page.

Important

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