Order API

Method: POST

URL: /api/v1/order/enqueue

Identification

To create or update a product, add the API access key and Entity ID outside the payload part of the JSON.

access_key (required)

Generate an API Access key at System > Users. Be sure the user has enough rights to create a product.

entity_id (required)

After creating an entity, the Entity ID  is visible at System > Settings.

Payload

reference (required)

Source order reference. Must be unique. 

source_id (required)

Source id. If orders are send from multiple sources this is the identifier to split webhook calls. As an example you could add a code like webshop1, amazon, ebay,

status

0 - New

1 - Process

8 - Hold

9 - Cancel

type (required)

0 - normal order

1 - POS order

flag_partial

0 - ship complete

1 - ship any allocated stock

2 - ship any allocated stock once and switch back to complete after first shipment

priority

If not added, an order will receive priority: 0.  A higher number will process an order with higher priority. Can also be a negative number to lower the priority. This way you could give priority to orders based on a shipping method, region, customer, etc.

cod_amount

Used for webhook filters to be sure the order is send with a COD shipping method and no partial shipment is possible.

currency (required)

For example USD, EUR, GBP

delivery_at

Process order at this date

created_at

order creation date. 

Format: Y-m-d H:i:s (2020-04-22 13:34:28)

customer_id

Source customer id. Used to allocate from future stock reservation.

options

The order options part is used to add specific orderdata for features like consignment and POS processing. Also used to forward customer specific data to webhooks.

shipping_

required: firstname, lastname, street, housenumber, postcode, city, country

not required: company, housenumber_ext, region, phone, email, method

Available for update untill the order changed to state shipped.

billing_

firstname, lastname, street, housenumber, postcode, city, country, company, housenumber_ext, region, phone, email

Available for update untill the order changed to state shipped.

items


sku

if the product SKU does not exists, it will be auto created.


description

product description


weight

product weight


reference

order item source reference


unit_price

netto unit price, can be used for webhook forwarding to reporting


qty

total item quantity to deliver


custom options (optional)

order item custom options to trigger production


allocation_type (optional)

1: reservation

2: direct

3:kit


cost (optional)

if allocation type is set to direct it's possible to overrule the supplier product price with the cost


packing additional labels

if the order contains additional labels, a print button will be available on the packing page to print the labels. 

Example

{"access_key": "[Clougistic API access key]","entity_id": "[Clougistic Entity]","payload": {"status" : "0","type": 0,"options": {"info": "[STRING]","@pos_zone_id": "","@consignment_zone_id": "","carrier": {"name": "flatrate_flatrate","type": "0000"},"packing": {     "ogc":true,              "instruction": "[STRING]" },"delivery_date_strict":false},"cod_amount": "0","source_id": "mage2","reference": "000000032","customer_id": "1","currency": "USD","shipping_method": "flatrate_flatrate","flag_partial": "","created_at": "2019-04-18 08:47:25","delivery_at": "","billing_company": "Shoe Shop NY","billing_firstname": "David","billing_lastname": "Copperfield","billing_street_full": "Wallstreet 450","billing_postcode": "74983","billing_city": "New York","billing_region": "NY","billing_country": "US","billing_phone": "","billing_email": "d.copperfield@gmail.com","shipping_company": "Shoe Shop NY","shipping_firstname": "Arnold","shipping_lastname": "Schwarzenegger","shipping_street_full": "Wallstreet 450","shipping_postcode": "74983","shipping_city": "New York","shipping_region": "NY","shipping_country": "US","shipping_phone": "","shipping_email": "a.schwarzenenegger@gmail.com","items": [[{"sku": "DWS-43","description": "Dutch Wooden Shoes Size 43","weight": "","reference": "17","unit_price": "50.00","is_kit": false,"qty": 1,"custom_options": { "option_data":                       [{"label": "Color", "value": "Orange"}]                  }            },   "allocation_type": 2,   "cost": "40.12",     "packing": { "additional_labels":                                 [{"country_of_origin":"The Netherlands", "wash_instruction":"use water only"}]                      }           ]         ]}}