/orders

This endpoint is used to query your orders in the Lengow API. Select accepted parameters/filters in your query to refine your request.

/orders/actions
This endpoint allows you to perform actions on your orders.

GET orders and conventions

GET /orders/

This is the main entrance of our API! This endpoint will deliver you a list of all your orders. Complete this GET request with parameters/filters to get exactly what you are looking for. 

Conventions

Find below some convention points you should know before making a request to the Lengow API.

  • 1. Pagination

The orders endpoint supports pagination. When omitted, the default value for page is 1.
The API can show a maximum of 100 results per page with page_size parameter. 

Exemple
/orders/?account_id=1 → Page 1 - implicit (by default)
/orders/?account_id=1&page=5&page_size=50 → Page 5 - explicit (5 pages with max 50 results per pages)

  • 2. Ordering

You can control the ordering of results with the ordering parameter. To reverse the ordering, your can prefix your field by -List of supported ordering fields here.  

The default ordering is:marketplace-marketplace_order_date-imported_at
Example:  /orders/?account_id=1&ordering=marketplace,-updated_at

  • 3. Query parameters (Filtering)

You can send query parameters with your requests using the URL field and the Params tab.
account_id is a mandatory parameter. Use it for any request/action you send to the API
These query parameters will help you get a specific order for example, adding the "&marketplace_order_id" or get all orders from a specific marketplace.Example: /orders/?account_id=1&marketplace=menlook 

  • 4.  Changing the currency

By default, all amount fields are returned in your account’s currency.

If you want to change the currency, you can use the set_currency parameter. The value must be specified as three characters (ISO 4217).
Example:  /orders/?account_id=1&set_currency=USD  

Use as many parameters as you like with the symbol "&".
Example:  /orders/?account_id=1&lengow_status=waiting_shipment&marketplace_order_id=1123456789  

Typical GET order API response

In the response, you will find several elements sent from the marketplace all classified in different object with multiple variables.

All the details of the order sent by the marketplace such as the marketplace_order_id, marketplace_status (status of the order), total_ordermarketplace_order_date will help you take action on your order.

All the order items that are part of the order. There can be only one item (in case the customer orders only 1 item), or more in case the customer orders more than one item within the same customer order. 

Tip: Find the "is_delivered_by_marketplace" info in the object "tracking".

List of supported parameters

Find below the list of possible parameters you can add to your requests for this endpoint.

  • account_id:  id of your Lengow account. Mandatory filter. Use it for any request or action
  • marketplace_order_date_from:  Mandatory. By default, set to current day - 7 days. 
  • marketplace: marketplace name, can be multiple but separate them with coma. Exemple: "amazon_uk", or "amazon_uk,darty"  
  • marketplace_order_id: ID of the order
  • merchant_order_id
  • lengow_status: The lengow status, can be one or multiple statuses but separate them with coma. Example: "shipped", "shipped, waiting_shipment"
  • marketplace_status
  • marketplace_order_date_to:  By default, set to current day  
  • order_type: Example: "is_business", "is_business, is_express"
  • imported_from
  • imported_to
  • updated_from
  • updated_to
  • set_currency
  • no_currency_conversion
  •  catalog_ids: Example: " id1,id2" 
Note that if you use a parameter not supported by our API or not yet developed your request might end up in error or the parameter will simply be ignored.
Example: "is_delivered_by_marketplace" is not a valid filter, but exists in the API response as a field.So it will be ignored if used in a request or action.
Each marketplace has its own status. In Lengow, all these statuses are converted in a Lengow status.    

Get all actions on orders

GET /orders/actions/ 
You can track the status of each action with “queued” and “processed” fields.
  • queued: true 
Means the action is waiting for processing (or retrying on failure)
  • "queued": false
Means the action has been processed
  • “processed”: true 
Means the action is valid and has been successfully sent
  • "processed": false
Means the action is invalid, check the "error" parameter.
Example: (see image) 
This "GET" action also enables you to check if the order is in error by looking at the "errors" parameter.
Read our use cases for more details.

Create an action on an order

POST /orders/actions/
With this endpoint you can make actions on your orders.

  • This is where you can ship, cancel or refund an order if these actions are accepted by the marketplace.

API / Orders

/orders

This endpoint is used to query your orders in the Lengow API. Select accepted parameters/filters in your query to refine your request.

/orders/actions
This endpoint allows you to perform actions on your orders.

GET orders and conventions

GET /orders/

This is the main entrance of our API! This endpoint will deliver you a list of all your orders. Complete this GET request with parameters/filters to get exactly what you are looking for. 

Conventions

Find below some convention points you should know before making a request to the Lengow API.

  • 1. Pagination

The orders endpoint supports pagination. When omitted, the default value for page is 1.
The API can show a maximum of 100 results per page with page_size parameter. 

Exemple
/orders/?account_id=1 → Page 1 - implicit (by default)
/orders/?account_id=1&page=5&page_size=50 → Page 5 - explicit (5 pages with max 50 results per pages)

  • 2. Ordering

You can control the ordering of results with the ordering parameter. To reverse the ordering, your can prefix your field by -List of supported ordering fields here.  

The default ordering is:marketplace-marketplace_order_date-imported_at
Example:  /orders/?account_id=1&ordering=marketplace,-updated_at

  • 3. Query parameters (Filtering)

You can send query parameters with your requests using the URL field and the Params tab.
account_id is a mandatory parameter. Use it for any request/action you send to the API
These query parameters will help you get a specific order for example, adding the "&marketplace_order_id" or get all orders from a specific marketplace.Example: /orders/?account_id=1&marketplace=menlook 

  • 4.  Changing the currency

By default, all amount fields are returned in your account’s currency.

If you want to change the currency, you can use the set_currency parameter. The value must be specified as three characters (ISO 4217).
Example:  /orders/?account_id=1&set_currency=USD  

Use as many parameters as you like with the symbol "&".
Example:  /orders/?account_id=1&lengow_status=waiting_shipment&marketplace_order_id=1123456789  

Typical GET order API response

In the response, you will find several elements sent from the marketplace all classified in different object with multiple variables.

All the details of the order sent by the marketplace such as the marketplace_order_id, marketplace_status (status of the order), total_ordermarketplace_order_date will help you take action on your order.

All the order items that are part of the order. There can be only one item (in case the customer orders only 1 item), or more in case the customer orders more than one item within the same customer order. 

Tip: Find the "is_delivered_by_marketplace" info in the object "tracking".

List of supported parameters

Find below the list of possible parameters you can add to your requests for this endpoint.

  • account_id:  id of your Lengow account. Mandatory filter. Use it for any request or action
  • marketplace_order_date_from:  Mandatory. By default, set to current day - 7 days. 
  • marketplace: marketplace name, can be multiple but separate them with coma. Exemple: "amazon_uk", or "amazon_uk,darty"  
  • marketplace_order_id: ID of the order
  • merchant_order_id
  • lengow_status: The lengow status, can be one or multiple statuses but separate them with coma. Example: "shipped", "shipped, waiting_shipment"
  • marketplace_status
  • marketplace_order_date_to:  By default, set to current day  
  • order_type: Example: "is_business", "is_business, is_express"
  • imported_from
  • imported_to
  • updated_from
  • updated_to
  • set_currency
  • no_currency_conversion
  •  catalog_ids: Example: " id1,id2" 
Note that if you use a parameter not supported by our API or not yet developed your request might end up in error or the parameter will simply be ignored.
Example: "is_delivered_by_marketplace" is not a valid filter, but exists in the API response as a field.So it will be ignored if used in a request or action.
Each marketplace has its own status. In Lengow, all these statuses are converted in a Lengow status.    

Get all actions on orders

GET /orders/actions/ 
You can track the status of each action with “queued” and “processed” fields.
  • queued: true 
Means the action is waiting for processing (or retrying on failure)
  • "queued": false
Means the action has been processed
  • “processed”: true 
Means the action is valid and has been successfully sent
  • "processed": false
Means the action is invalid, check the "error" parameter.
Example: (see image) 
This "GET" action also enables you to check if the order is in error by looking at the "errors" parameter.
Read our use cases for more details.

Create an action on an order

POST /orders/actions/
With this endpoint you can make actions on your orders.

  • This is where you can ship, cancel or refund an order if these actions are accepted by the marketplace.
Was this article helpful?
0 out of 1 found this helpful
Have more questions? Submit a request