Overview

This method allows you to create multiple prebooks in Komet Sales.

Request

https://api.kometsales.com/api/multiple.prebooks.create

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

The method requires a JSON format request.

Input JSON Parameters:

  • authenticationToken (required) (string:50): Komet Sales security token.
  • customerCode (required) (string:20): customer code.
  • customerName (required) (string:200): customer name.
  • customerBillingStreet (required) (string:200): customer billing street.
  • customerBillingCity (required) (string:200): customer billing city.
  • customerBillingState (required) (string:200): customer billing state.
  • customerBillingZipcode (required) (string:200): customer billing zipcode.
  • customerBillingCountry (required) (string:200): customer billing country.
  • customerShippingStreet (required) (string:200): customer shipping street.
  • customerShippingCity (required) (string:200): customer shipping city.
  • customerShippingState (required) (string:200): customer shipping state.
  • customerShippingZipcode (required) (string:200): customer shipping zipcode.
  • customerShippingCountry (required) (string:200): customer shipping country.
  • customerPhone (required) (string:100): customer phone. 
  • shipViaId (logical)(integer:1): ship via ID. ID of location where the product will be shipped from. Assign 0 for warehouse or 1 for grower.
  • customerPO (optional)(string:20): customer purchase order.
  • autoGeneratePOsfromPrebooks (optional)(integer:1): specify 1 if you want the system to automatically generate the purchase orders. Default = 0. If this value is 1, the vendor and costs must be specified. The orders created will be left as Approved.
  • companyLocationCode (required: if the company is Multi Location)(string:20): Location code. 
  • prebookItems: array of products:
    • carrierCode (required) (string:20) : carrier code.
    • carrierName (required) (string:200) : carrier name.
    • shipDate (required) (date): shipping date (date format YYYY-MM-DD).
    • identifier (required)(string:30): use this field to identify your lines and receive the same value in the response.
    • vendorCode (required: if autoGeneratePOsfromPrebooks is 1)(string:20): vendor or grower code.
    • vendorName (required: if autoGeneratePOsfromPrebooks is 1)(string:200): vendor or grower name.
    • productCode (required)(string:20): code of the product.
    • productDescription (required)(string:200): description of the product.
    • boxTypeCode (required)(string:3): code of the box type.
    • boxes (required)(integer:10): number of boxes.
    • unitType (required) (string:5): stem or bunch are the unique valid values.
    • bunches (required) (integer:10): bunches per box.
    • stemsBunch (required) (integer:10): stems for bunch.
    • cost (required: if autoGeneratePOsfromPrebooks is 1) (decimal:10,2): when unitType is bunch you must use the bunch cost. When unitType is stem you must use the stem cost.
    • price (required) (decimal:10,2): when unitType is bunch you must use the bunch price. When unitType is stem you must use the stem price.
    • markCode (optional)(string:50): mark code for item.
    • notes (optional)(string:200): any additional notes.
    • boxWeight (optional)(decimal:10,2): Weight of one box in kilograms. 
    • boxLength (optional)(decimal:10,2): Length of one box in inches. 
    • boxWidth (optional)(decimal:10,2): Width of one box in inches. 
    • boxHeight (optional)(decimal:10,2): Height of one box in inches. 


Response

Output:

  • status (integer:1): transaction status. 1 for success or 0 for failure.
  • message (string:500): description of the status of the transaction.
  • items (array)
    • identifier (string:20). The value that identifies the line. This is the same value of the request. 
    • status: (integer:1): transaction status. 1 for success or 0 for failure.
    • message (string:500): description of the status of the transaction.
    • prebookId (integer:20): prebook ID that was created
    • prebookNumber (string:10): Prebook number that was created. 
    • prebookItemId (integer:10) ID of the product line that was added to the order.
    • purchaseOrderNumber (string:20) PO number that was created, if autoGeneratePOsfromPrebooks is given.