Create a Standing Order

Use this method to create a Standing Order.

Valid Tokens: Customer.


Request


URL: https://api.kometsales.com/api/v2/standing-order

Method: POST

Content-Type: Application/JSON


Header

authenticationToken (required)(string:50)

Komet Sales security token.


Input parameters

customerId (required if customerCode is not sent)(integer:20)

The Customer ID.

You can get this value from the customer.list API method.


customerCode (required if customerId is not sent)(string:20)

Customer code.


customerDescription (required if customerId is not sent)(string:200)

Customer name.


carrierId (required if carrierCode is not sent)(integer:20)

Carrier ID.

You can get this value from the carrier.list API method.


carrierCode (required if carrierId is not sent)(string:20)

Carrier code.


carrierDescription (required if carrierId is not sent)(string:200)

Carrier name.


startDate (required)(date)

Standing Order starting date.

Date format: YYYY-MM-DD


endDate (optional)(date)

Standing Order end date.

Date format: YYYY-MM-DD


shipViaId (logical)(integer:1)

Ship Via ID.

Valid values: 0 = Warehouse | 1 = Grower


shipToId (optional)(integer:200)

Ship-To number ID. 

You can get this ID by using the customer.shipto.list method.


customerPO (optional)(string:20)

Customer Purchase Order number.


companyLocationId (optional)(string:20)

Location ID.

Only Applies to Multi-Location Companies.


companyLocationCode (required)(string:20)

Location code.

Only Applies to Multi-Location Companies. 


recurrence (required)(number)

The frequency of Purchase Order generation in weeks.

Valid range: 1-4


truckDays (required)(string:20)

The Truck Days for the Purchase Orders.


comments (optional)(string:200)

Special instructions or comments.


invoiceNotes (optional)(string:1000)

Additional notes for the Standing Order.

Maximum 200 characters.


items (array)

Product arrays.


identifier (optional)(string:30)

Use this parameter to identify your product lines and receive equal values in the response.


vendorId (optional)(integer:20)

Vendor or Grower ID.

You can get this value from vendor.list API method.


vendorCode (required if vendorId is not sent)(string:20)

Vendor or Grower code.


vendorName (required if vendorId is not sent)(string:200)

Vendor or Grower name.


productId (required if productCode is not sent)(integer:20)

Product ID.

You can get this value from the product.list API method.


productCode (required if productId is not given)(string:20)

Product Code.


productDescription (required if productId is not sent)(string:200)

Product description.


itemType (string:3)

Item type.

Valid values: BOX or UN (Unit).

Default is BOX.


boxTypeId (required if boxTypeCode is not sent and itemType is BOX)(integer:20) Box type ID.

You can get this value from the boxtype.list API method.


boxTypeCode (required if boxTypeId is not sent and itemType is BOX)(string:3)

Box type code.


boxTypeDescription (required if boxTypeId is not sent and itemType is BOX)(string:3)

Box type name.


boxes (required if itemType is BOX) (integer:10)

Amount of boxes.


totalUnits (required if itemType is UN)(integer:10)

Number of Units.


unitType (required)(string:5)

Unit type.

Valid Values: Stem and Bunch


bunches (required if itemType is BOX)(integer:10)

Number of Bunches per Box.


stemsBunch (required if itemType is BOX)(integer:10)

Stems per Bunch.

Leave this field empty for mixed Boxes.


price (optional)(decimal:10,2)

Weighted Average Unit price.

Use the price according to the selected unitType.


cost (optional)(decimal:10,2)

Weighted Average Unit cost.

Use the cost according to the selected unitType.

If you are using a Vendor token, the system will only accept this field if the Vendor has enabled the Allow changing cost setting.


markCode (optional)(string:50)

Product Mark Code.


generalNotes (optional)(string:1000)

Additional notes.


vendorNotes (optional)(string:1000)

Notes for the Vendor.


customFields (array)

An array containing additional information.


name (string)

Name of the additional information field.


value (string)

Additional information body.


breakdowns (optional)

Breakdown of products:


identifier (optional)(string:30)

Use this parameter to identify your product lines and receive equal values in the response.


productId (required if productCode is not sent)(integer:20)

Product ID.

You can get this value from the product.list API method.


productCode (required if productId is not sent)(string:20)

Product code.


productDescription (required if productId is not sent)(string:200)

Product description.


bunches (required)(integer:10)

Total Bunches per Box.


stemsBunch (required)(integer:10)

Stems per Bunch.


cost (required)(decimal:10,2)

Product cost by Unit type.


price (required for tokens type company)(decimal:10,2)

Product price by Unit type.


{ "authenticationToken": "token_info_goes_here", "customerId": "131313", "customerCode": "Fresh", "customerDescription": "Mr. Fresh", "carrierId": "1360", "carrierCode": "ARM", "carrierDescription": "Armellini", "startDate": "2022/04/13", "endDate": "2022/12/13", "shipViaId": "1", "shipToId": "1313", "customerPO": "122344", "companyLocationId": "147", "companyLocationCode": "MIA", "recurrence": "1", "truckDays": "Monday, Wednesday, Friday", "comments": "Keep it fresh", "invoiceNotes": "notes", "items": [ { "identifier": "1123", "vendorId": "33", "vendorCode": "333", "vendorName": "33 Flowers", "productId": "21", "productCode": "Lucky", "productDescription": "Black Monstera", "itemType": "BOX", "boxTypeId": "QB", "boxTypeCode": "QB21", "boxes": "21", "totalUnits": "777", "unitType": "Stem", "bunches": "13", "stemsBunch": "7", "price": "1.21", "cost": "1.01", "markCode": "BCK", "generalNotes": "Ship it", "vendorNotes": "Thank you", "customFields": [ { "name": "", "value": "" } ], "breakdowns": [ { "identifier": "Assorted 1", "productId": "3", "productCode": "BK", "productDescription": "Black King Rose", "bunches": "13", "stemsBunch": "13", "cost": "1.33", "price": "0.99" } ] } ] }

Response


status (integer:1)

Transaction status.

Valid values: 1 = Success | 0 = Failure


message (string:500)

Transaction status description.


status (integer:1)

Creation status.

Valid values: 1 = Success, 0 = Failure.


message (string:500)

Transaction status description.


standingOrderId (integer:20)

Standing Order ID.


standingOrderNumber (integer:10)

Standing Order number.


items (array)

An array containing items in the Standing Order.


identifier (string:20)

The value that identifies the line.

This is the same value sent in the request.


status (integer:1)

Transaction status. 

Valid values: 1 = Success, 0 = Failure.


message (string:500)

Transaction status description.


standingOrderItemId (integer)

Standing Order Item ID.


{ "standingOrderId": 3228, "standingOrderNumber": "S03228", "message": "Standing Order # S03228 was successfully saved.", "items": [ { "identifier": "P001", "status": 1, "message": "Item was successfully added.", "standingOrderItemId": 10611 } ], "status": 1 }

Peacock