API Release Note
Release note are structured as follows:
- Categories of change for an API:
- New feature - new feature added to API
- Structure change - change on data structure returned by API
- Data change - data content changes returned by API
- Deprecation - API functionalities which will be deprecated
- Removal - API functionalities which will be removed soon
- Impacted: Which API will be impacted by the changes
- Release date: Date when changes will be deployed in production
- Description: The content of changes
Current Release
- Orders: new status
partial_refunded
- Category of change: Non breaking data change
- Impacted: Orders API
- Release date: 2023-12
- Description:
- The lengow order status
partial_refunded
is added and will be available for Veepee at first.
- The lengow order status
- New meta in order meta:
shipping_deadline
- Category of change: Non breaking data change
- Impacted: Orders API
- Release date: 2023-12
- Description:
- This attribute in the order.meta object will be provided for some Mirakl marketplaces at first. See Mirakl-Orders-API-News-December-2023-New-field-available
Released
Orders list: Date filter improvement - 2023-07-25
- Category of change: Data change
- Impacted: Orders API
- Release date: 2023-07-25
- Description:
- The default date filter is now applied when none of the provided date filters is valid.
- Previously no filter was applied on time in this case, causing heavy unbounded queries.
- As a reminder, the default date filter is "ordered during the previous 7 days".
- As a consequence, the orders count in the response has changed if you are using an incorrect date filter.
Orders:
max_shipping_date
- 2022-12-20- Category of change: Structure change
- Impacted: Orders API
- Release date: 2022-12-20
- Description: Adding
max_shipping_date
field to order lines (packages.cart). This information is provided by some marketplaces.
Add account's catalog endpoint - 2021-12-03:
- Category of change: New Feature
- Impacted : Catalog APIs
- Release date: 2021-12-03
- Description: New API at
http://api.lengow.io/v3/catalog/account/
has been added, it provides a way to fetch catalog's information of an account and its child accounts.
Add account's feed endpoint - 2021-12-03:
- Category of change: New Feature
- Impacted : Feed APIs
- Release date: 2021-12-03
- Description: New API at
http://api.lengow.io/v3/feed/account/
has been added, it provides a way to fetch feed's information of an account and its child accounts.
Example :
{
"results": [
{
"marketplace": "amazon_fr",
"account_id": 1,
"marketplace_country_iso2": "FR",
"marketplace_order_id": "408-6677687-12234567",
"anonymized": false,
"order_types": [
{
"type": "is_delivered_by_marketplace",
"label": "AFN"
}
]
}
]
}
Add order types nodes - 2019-08-19:
- Category of change: Structure change
- Impacted : Orders APIs
- Release date: 2019-08-19
- Description: news nodes "order_types" and "orderline_types" are added at
order level and cart level respectively.
It provides an uniform way of characterizing an order's feature.
Current possible keys for order_type.type are :
- is_express: Needs express shipping, for example in Amazon Prime program
- is_delivered_by_marketplace: Order or product is fulfilled by marketplace
- is_business: B2B order
- is_prime: Amazon-specific
Add new amount fields - 2019-03-25
- Category of change: Structure change
- Impacted: Orders APIs
- Release date: 2019-03-25
- Description: By default, all amount fields are in the merchant account's currency. For example, if an US merchant has orders in amazon FR, even the marketplace is amazon fr which uses Euros as currency, these orders amount fields are converted to dollar. So we added these new fields which contain the account in marketplace currency: "original_total_order", "original_total_tax", "original_amount","original_tax","original_discount", "original_shipping", "original_discount", "original_commission", "original_processing_fee", "original_currency".
Example
curl https://api.lengow.io/v3.0/preprocessing/job/?account_id=1&catalog=1
- New API for preprocessing - 2018-05-22
- Category of change: New feature
- Impacted: N/A
- Release date: 2018-05-22
- Description: A new API for launching preprocessing task.
- Remove category_name field - 2017-12-18
- Category of change: Structure change
- Impacted: Orders APIs
- Release date: 2017-12-18
- Description: The category_name field was added to display the merchant category name. Actually, as *category * field contains well the merchant category name indeed of category id before, we will remove the *category_name *.
curl https://api.lengow.io/v3.0/marketplaces?marketplace=admarkt
{
"admarkt": {
"package": "mp_admarkt",
"country_iso_a2": "NL",
"country": "NLD",
"name": "Admarkt",
"legacy_code": "admarkt",
"orders": {
"carriers": {},
"actions": {},
"status": {}
},
"logo": "cdn/partners//_.jpeg",
"description": "Admarkt is a Dutch marketplace which lets you generate qualified traffic to your online shop.",
"homepage": "http://www.marktplaatszakelijk.nl/admarkt/"
}
}
- Add new filter to Marketplaces APIs - 2017-12-18
- Category of change: New feature
- Impacted: Marketplace APIs
- Release date: 2017-12-18
- Description: New filter marketplace was added
Exemple of delivery dictionary after correction:
Example
{
"delivery": {
"id": 295324,
"type": "billing",
"first_line": "25, Allée des Paix",
"zipcode": "38000",
"city": "GRENOBLE",
"company": null,
"civility": "Mr",
"first_name": "Tony",
"last_name": "DUPOND",
"second_line": null,
"complement": null,
"phone_home": null,
"phone_office": null,
"phone_mobile": null,
"full_address": null,
"full_name": null,
"email": null,
"metas": null,
"state_region": null,
"common_country_iso_a2": "FR",
"trackings": []
}
}
Fix order actions api response format - 2017-08-25
- Category of change: Structure change
- Impacted: Orders Actions API
- Release date: 2017-10-16
- Description: When the post data has an error, the orders actions API returns two different formats response. Here are two examples:
FORMAT 1 : [ "Value for tracking_number is required in the data field." ]
FORMAT 2 :
{ "account_id": [ "Ce champ est obligatoire." ] }
We will keep the format 2 and remove the format 1.
Overview
Content-Type and Accept Headers
curl https://api.lengow.io/v3.0/orders/ -X OPTIONS --header "Accept: application/json"
If you want to change the returned data format, you can set the Accept
header.
The server will respond you with the given format and change the Content-Type
header.
By default, the format is "application/json".
To get all accepted format, you can use the OPTIONS
method.
API types
Basic type | Description or aliases |
---|---|
String | String |
Integer | Integer |
Decimal | Decimal, Float |
Boolean | Boolean |
Array | Array, List |
Object | Object, Json |
Country | Depending on ressource, countries are specified as two (ISO 3166-2) or three characters |
Date | All date/time values are specified in ISO 8601 |
Currency | All currencies are specified as three characters (ISO 4217) |
None | None, null, nothing |
All monetary amounts like prices are specified as decimal number.
When the API accepts or returns several types, the format is as followed Array, String
.
HTTP Response Codes
Below is a non-exhaustive list of HTTP response codes used by the API. For more information, see the List of HTTP code status.
Code | Text | Description |
---|---|---|
200 | OK | Success |
201 | Created | The request has been fulfilled, a new resource has been created. |
202 | Accepted | The request needs asynchronous action to create the resource, but is correct and as been accepted. |
400 | Bad Request | The request has not been processed because of a client error (bad request syntax, invalid arguments...). See accompanying message for more information. |
401 | Access not granted | Authentication is required for this request and has failed. |
403 | Forbidden | User is not allowed to access this resource. |
404 | Not Found | The request resource could not be found. |
429 | Request limitation reached | Too many requests have been made in a too short amount of time. |
502 | Bad gateway | The service is unreachable, probably due to capacity problem. We are improving our systems to deal with peak hours. In the meantime, please try to query outside of peak hours (automated processing tend to use exact hour and half-hours) |
503 | Service Unavailable | The service is (temporarily) unavailable. Please retry later. |
504 | Gateway Timeout | The service is overloaded. We are improving our systems to deal these peak hours. In the meantime, please try to query outside of peak hours (automated processing tend to use exact hour and half-hours) |
530 | Logical Error | The request has failed probably due to bad input parameters (catalog that does not exist, invalid search rules...). See accompanying message for more information. |
540 | Technical Error | The request has failed due to an internal error. See accompanying message for more information. |
Authentication
You need to authenticate yourself before making any request on the Lengow API.
Get a token
curl "https://api.lengow.io/access/get_token" -X POST --data "access_token=XXXXX&secret=XXXXX"
{"token": "6b7280eb-e7d4-4b94-a829-7b3853a20126", "account_id": 1}
First, you'll need to get a token. Each token has a lifetime of 3600 seconds.
POST https://api.lengow.io/access/get_token
Parameter | Required | Description |
---|---|---|
access_token | Yes | Access token of the application |
secret | Yes | Secret of the application |
Make a request
curl https://api.lengow.io/v3.0/account/show?account_id=1 --header "Authorization: 6b7280eb-e7d4-4b94-a829-7b3853a20126"
Once you have your token, all your API request will need a Authorization
header.
Orders
Specific order type reference | Description |
---|---|
Package | Informations about package, its delivery and product |
Address | Informations about the address |
Lengow status | Informations about possible order statuses |
Payment | Informations about payment, its date and status |
BuyerTax | Informations about buyer tax |
Tax | Informations about marketplace process to handle taxes |
Ordered product | Informations about one of the order lines |
Orders Status
Each marketplace have their own statuses. In Lengow, all these status are mapped to a Lengow status
.
List of all Lengow statuses :
Status | Allowed action | Description |
---|---|---|
new | None | Order was created but no action are available for now. |
waiting_acceptance | accept,refuse | The merchant has to accept the order. |
refused | None | The order was refused by the merchant. |
accepted | None | The order has been accepted by the merchant and waiting the marketplace authorization for shipping. |
waiting_shipment | ship | The merchant has to ship the order. |
shipped | None | The order is waiting the final marketplace validation for closing. |
closed | None | The order is closed, no more action are available. |
canceled | refund | The order was canceled. Depending on marketplace, you can refund the order. |
refunding | None | The refund demand is waiting the marketplace validation. |
refunded | None | Like closed status, the order is closed and no more action are available. |
partial_refunded | None | Similar to refunded , but not all the lines have refunded status. |
pickup_to_prepare | None | The merchant has to prepare the pick up. |
to_pickup | None | The order is ready for pick up. |
pickup_completed | None | The order has been picked up by the buyer. |
pickup_canceled | None | The pick up has been canceled. |
to_refund | refund | The merchant has to refund the order. |
Simple call :
curl https://api.lengow.io/v3.0/orders/?account_id=1
Get orders
GET https://api.lengow.io/v3.0/orders/
This API allows you to retrieve your orders.
With pagination :
curl https://api.lengow.io/v3.0/orders/?account_id=1&page=5&page_size=50
Pagination
The result is paginated and different arguments can be provided to manage this pagination.
Field | Type | Default | Description |
---|---|---|---|
page | Integer | 1 | The page number |
page_size | String | 100 | Maximum 100. Number of results by page |
Ordering
With ordering :
curl https://api.lengow.io/v3.0/orders/?account_id=1&ordering=marketplace,-updated_at
You can control the ordering of results with the ordering
parameter. For reversing the ordering, your can prefix your field by -
.
The default ordering is marketplace,-marketplace_order_date,-imported_at
.
List of supported ordering fields:
Argument | Type |
---|---|
marketplace | String |
marketplace_order_id | String |
merchant_order_id | String |
lengow_status | String |
marketplace_status | String |
marketplace_order_date | Date |
imported_at | Date |
updated_at | Date |
Filtering
With filtering :
curl https://api.lengow.io/v3.0/orders/?account_id=1&marketplace=menlook
You can filter the result with differents filters.
account_id
is a mandatory filter.
By default, the marketplace_order_date_from
filter is set to current day - 7 days
.
You can search a specific order by its marketplace_order_id
by providing
a couple of filters (marketplace_order_id
- marketplace
).
This couple is mandatory, in other case the API will use the
default filter (order date in the 7 previous days range
).
List of supported fields:
Filter | Type |
---|---|
account_id | Integer |
marketplace | String |
marketplace_order_id | String |
merchant_order_id | String, None to get empty values |
lengow_status | String |
marketplace_status | String |
marketplace_order_date_from | Date |
marketplace_order_date_to | Date |
imported_from | Date |
imported_to | Date |
updated_from | Date |
updated_to | Date |
The expected date format is ISO 8601 (including the timezone offset).
A short date format YYYY-MM-DD
will work, but you can't rely on the timezone to have a precise filter.
Changing the currency
With set_currency :
curl https://api.lengow.io/v3.0/orders/?account_id=1&set_currency=USD
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).
An example of returned orders :
{
"count": 1,
"next": null,
"previous": null,
"results": [
{
"marketplace": "amazon_uk",
"account_id": 1,
"marketplace_country_iso2": "GB",
"marketplace_order_id": "order1",
"merchant_order_id": null,
"marketplace_status": "Shipped",
"lengow_status": "shipped",
"workflow_rank": 6,
"marketplace_order_date": "2019-03-22T17:54:34.369000Z",
"total_order": 809.2900000000001,
"total_tax": "134.45",
"shipping": 2.6,
"discount": 0,
"commission": "-56.47",
"processing_fee": null,
"currency": {
"iso_a3": "EUR",
"symbol": "€",
"name": "Euro"
},
"original_currency": {
"iso_a3": "GBP",
"symbol": "£",
"name": "British Pound"
},
"original_total_order": 701.25,
"original_total_tax": "116.50",
"original_shipping": 2.25,
"original_discount": 0,
"original_commission": "-48.93",
"original_processing_fee": null,
"original_total_buyer_amount": 1.00,
"original_total_buyer_tax": 1.55,
"original_buyer_currency": "EUR",
"comments": null,
"invoice_number": null,
"invoice_url": null,
"payments": [
{
"id": 1,
"checkout": null,
"status": null,
"type": "Other: Standard",
"settled_at": null,
"payment_terms": null,
"channel_order_marketplace": 1
}
],
"packages": [
{
"cart": [
{
"id": 1,
"marketplace_order_line_id": "line1",
"marketplace_product_id": "product1",
"merchant_product_id": {
"field": "ID_PRODUCT",
"id": "Product1"
},
"feed_id": 1,
"marketplace_package_id": null,
"marketplace_status": "Shipped",
"lengow_status": "shipped",
"title": "Product TEST",
"category": null,
"url_product": null,
"url_image": null,
"order_line_meta": {
},
"amount": "806.69",
"tax": "134.45",
"discount": null,
"shipping": "2.60",
"original_refunded_amount": "0.00",
"refunded_amount": "0.00",
"original_amount": "699.00",
"original_tax": "116.50",
"original_discount": null,
"original_shipping": "2.25",
"quantity": 1,
"max_shipping_date": "2019-03-25T11:48:09.071000Z",
"created_at": null,
"updated_at": null,
"original_buyer_tax": null,
"original_buyer_amount": null,
}
],
"delivery": {
"id": 1,
"type": "delivery",
"first_line": "1 Rue de la Paix",
"zipcode": "44",
"city": "Nantes",
"company": null,
"civility": null,
"first_name": null,
"last_name": null,
"second_line": null,
"complement": null,
"phone_home": null,
"phone_office": null,
"phone_mobile": null,
"full_address": null,
"full_name": "Dupont",
"email": "test@lengow.amazon.co.uk",
"metas": null,
"state_region": "",
"common_country_iso_a2": "GB",
"trackings": [
{
"number": null,
"method": "Standard",
"carrier": null,
"url": null,
"is_delivered_by_marketplace": true,
"parcel_weight": null,
"shipped_at": null,
"relay": {
"name": null,
"id": null,
"type": null
},
"marketplace_order_line_ids": [
"line1"
]
}
]
}
}
],
"billing_address": {
"id": 2,
"type": "billing",
"first_line": null,
"zipcode": "44",
"city": "Nantes",
"company": null,
"civility": null,
"first_name": null,
"last_name": null,
"second_line": null,
"complement": null,
"phone_home": null,
"phone_office": null,
"phone_mobile": null,
"full_address": null,
"full_name": "Dupont",
"email": "test@lengow.amazon.co.uk",
"metas": null,
"state_region": "",
"common_country_iso_a2": "GB"
},
"contact_address": null,
"imported_at": "2019-03-22T20:05:35.196060Z",
"updated_at": "2019-03-25T11:48:09.071000Z",
"order_meta": {
"checksum": "fffffffggghghhgu"
},
"tax": {
"order_tax_id": "T4X-1D",
"is_marketplace_deemed_supplier": true,
"tax_electronic_portal_type": "OSS",
"tax_electronic_portal_id": "OSS-1234",
"marketplace_eori_number": "EORI-5555",
"buyer_tax": {
"type": "VATIN",
"id": "123789",
},
},
"anonymized": false
}
]
}
Results
Field | Type | Description |
---|---|---|
count | Integer | Number of orders |
next | String | Link to the next page |
previous | String | Link to the previous page |
results | Array | List of orders |
Order object
Field | Type | Description |
---|---|---|
marketplace | String | Marketplace code |
account_id | Integer | Account ID |
marketplace_order_date | Date | Order date in UTC |
marketplace_country_iso2 | Country | Marketplace country. |
marketplace_order_id | String | Marketplace identifier of the order |
lengow_status | Lengow status | Lengow status |
marketplace_status | String | Marketplace status. Can be the same value than lengow_status. |
total_order | Decimal | Order price (shipping price and taxes included) |
total_tax | Decimal | Order tax |
commission | Decimal | Marketplace commission |
processing_fee | Decimal | Processing fees paid by the buyer |
shipping | Decimal | Total shipping amount paid by the buyer. Order shipping fees + Sum of order lines shipping fees. |
discount | Decimal | Total discount amount on this order. Order discount fees + Sum of order lines discount fees. |
currency | Currency | Currency of the merchant account |
original_currency | Currency | Currency of the marketplace |
original_total_order | Decimal | Order price (shipping price and taxes included) in marketplace currency |
original_total_tax | Decimal | Order tax in marketplace currency |
original_shipping | Decimal | Total shipping amount paid by the buyer. in marketplace currency |
original_discount | Decimal | Total discount amount on this order. in marketplace currency |
original_commission | Decimal | Marketplace commission in marketplace currency |
original_processing_fee | Decimal | Processing fees paid by the buyer in marketplace currency |
original_total_buyer_amount | Decimal | Total price as paid by the buyer |
original_total_buyer_tax | Decimal | Total tax as paid by the buyer |
original_buyer_currency | String | Currency of the buyer |
comments | String, Array | Comments of the buyer |
invoice_number | String | Invoice number |
invoice_url | String | Invoice URL |
billing_address | Address | Billing address |
contact_address | Address | Contact address |
payments | Array | Informations about payments |
packages | Array | List of the order packages |
order_meta |
Object | Order metadata which are specific by marketplace. If not present, a "null" value will be present |
tax | Tax | Informations about tax |
anonymized | Boolean | True when the address data is anonymized. (According to RGPD, we hide personal data for the orders older than 6 months. |
Package object
A package group all line of an order by delivery address.
Field | Type | Description |
---|---|---|
cart | Array | List of ordered products |
delivery | Address | Marketplace product identifier |
Ordered product
Field | Type | Description |
---|---|---|
marketplace_order_line_id | String | Marketplace order line ID |
marketplace_product_id | String | Marketplace product identifier |
merchant_product_id.id | String | Merchant product ID |
merchant_product_id.field | String | Source of merchant product ID |
marketplace_package_id | String | Marketplace package ID |
marketplace_status | String | Marketplace status of the line |
lengow_status | Lengow status | Lengow status of the line |
title | String | Merchant's product title |
category | String | Merchant's product category |
url_product | String | Merchant's product URL |
url_image | String | Merchant's product image (main) |
amount | Decimal | Total price of the line (product price * quantity) |
shipping | Decimal | Shipping fees for the product |
tax | Decimal | Total tax amount of the line |
discount | Decimal | Total discount amount of the line |
original_refunded_amount | Decimal | Refunded amount for the product in the marketplace currency |
refunded_amount | Decimal | Refunded amount for the product |
original_amount | Decimal | Total price of the line (product price * quantity) in marketplace currency |
original_shipping | Decimal | Shipping fees for the product in marketplace currency |
original_tax | Decimal | Total tax amount of the line in marketplace currency |
original_discount | Decimal | Total discount amount of the line in marketplace currency |
quantity | Integer | Ordered quantity |
max_shipping_date | Date | shipping deadline in UTC |
created_at | Date | Created date in UTC |
updated_at | Date | Updated date in UTC |
original_buyer_amount | Decimal | Item price as paid by the buyer |
original_buyer_tax | Decimal | Item tax as paid by the buyer |
Address object
Field | Type | Description |
---|---|---|
company | String | Company |
civility | String | Civility |
first_name | String | Firstname |
last_name | String | Lastname |
full_name | String | Fullname |
first_line | String | First line of the address |
second_line | String | Second line of the address |
complement | String | Address complement |
zipcode | Decimal | Zipcode |
city | Decimal | City |
phone_home | Decimal | Home phone number |
phone_office | Decimal | Office phone number |
phone_mobile | Integer | Mobile phone number |
full_address | Address | Full address |
String | ||
common_country_iso_a2 | Country | Country |
Tracking object
Field | Type | Description |
---|---|---|
number | String | Tracking number |
method | String | Civility |
carrier | String | Carrier |
url | String | Tracking URL |
is_delivered_by_marketplace | Boolean | Is the package delivered by marketplace ? (Amazon FBA for example) |
parcel_weight | Decimal | Package weight |
shipped_at | Date | Shipping date |
relay.id | String | Relay ID |
relay.name | String | Relay name |
relay.type | String | Relay type |
Payment object
Field | Type | Description |
---|---|---|
id | Integer | Unique identifier |
checkout | String | |
status | String | Marketplace's status for the payment |
type | String | Type of payment (example : Paypal) |
settled_at | Date | Is the package delivered by marketplace ? (Amazon FBA for example) |
Tax object
Field | Type | Description |
---|---|---|
order_tax_id | String | The relevant marketplace tax ID for the order and customs declaration. If the marketplace has collected the tax on the order |
is_marketplace_deemed_supplier | Boolean | Identifies whether the marketplace is responsible for collecting and has collected tax on the order or not |
tax_electronic_portal_type | String | Indicate the type of tax identifier of the marketplace. The tax identifier type will vary by country/region |
tax_electronic_portal_id | String | Indicate the tax identifier of the marketplace |
marketplace_eori_number | String | The marketplace EORI (Economic Operators Registration and Identification number) for customs declaration. If the marketplace has collected the tax on the order. EORI number = SIRET en France par exemple. = identifiant fiscal de l’entreprise |
buyer_tax | BuyerTax | Buyer tax informations |
BuyerTax object
Field | Type | Description |
---|---|---|
type | String | This value identifies the type of tax ID that was supplied by the buyer during the checkout process |
id | String | This value is the actual tax ID for the buyer. The type of tax ID is shown in the Type field |
Set Merchant Order ID
curl https://api.lengow.io/v3.0/orders/moi/ -X PATCH -H "Content-Type: application/json" --data
{
"account_id": 1,
"merchant_order_id": ["123456789"],
"marketplace": "marketplace_name",
"marketplace_order_id": "1234-ABC"
}
PATCH https://api.lengow.io/v3.0/orders/moi/
You can import your owns order identifiers in the Lengow systems.
Request
Parameter | Type | Description |
---|---|---|
account_id | String | Your Lengow account ID |
marketplace_order_id | String | order ID |
marketplace | String | The marketplace code of the order |
merchant_order_id | Array | Your merchant order ID |
Response
If your request was successful, the order object will be send.
Get all actions on orders
Simple call :
curl https://api.lengow.io/v3.0/orders/actions/?account_id=1
GET https://api.lengow.io/v3.0/orders/actions/
Filtering
You can filter the result with different filters.
account_id
is a mandatory filter.
With filtering :
curl https://api.lengow.io/v3.0/orders/actions/?account_id=1&marketplace_order_id=123456-ABC&marketplace=darty
List of supported filters:
Filter | Type |
---|---|
id | Integer |
account_id | Integer |
marketplace | String |
marketplace_order_id | String |
action_type | String |
processed | Boolean |
queued | Boolean |
tracking_number | String |
carrier | String |
line | String |
created_from | Date |
created_to | Date |
updated_from | Date |
updated_to | Date |
errors | String |
Result
Field | Type | Description |
---|---|---|
id | Integer | Lengow unique ID for the action |
account_id | Integer | Account ID |
marketplace | String | Marketplace code |
marketplace_order_id | String | Marketplace order ID |
action_type | String | Action type |
processed | Boolean | Is the action processed by marketplace ? |
queued | Boolean | Lengow still trying to make this action on the marketplace. |
tracking_number | String | Tracking number |
carrier | String | Carrier |
line | String | Line ID |
created_at | Date | Creation date of the action |
updated_at | Date | Date of the last action's update |
errors | String | Returned error. To have the final error, you should wait that queued becomes false. |
You can track the status of each action with "queued" and "processed" fields.
"queued" is true when the action is waiting for processing (or retrying on failure), and false when it is treated
"processed" is true when the action has been successful.
Available action types
Name | Description |
---|---|
accept | Accept the order |
refuse | Refuse the order |
ship | Ship the order |
cancel | Cancel the order |
refund | Refund the order |
partial_cancel | Partial cancellation of order |
set_delivery_date | Inform of order's delivery date (currently only available for El Corte Ingles) |
set_eligible_shipping_methods | Retrieve eligible shipping methods for current order (only available for Amazon) |
buy_shipment_label | Buy a shipment label (only available for Amazon) |
pickup_ready | Inform that an order is ready to be picked up (only available for eBay) |
pickup_complete | Inform that an order has been picked up (only available for eBay) |
pickup_cancel | Cancel a click & collect order (only available for eBay) |
pickup_refund | Refund a click & collect order (only available for eBay) |
Available actions depends on marketplace. Please refer you to the marketplace API.
Create an action on an order
curl https://api.lengow.io/v3.0/orders/actions/ -X POST -H "Content-Type: application/json" --data
{
"marketplace_order_id": "1234-ABC",
"account_id": 1,
"marketplace": "menlook",
"action_type": "ship",
"tracking_number": "123456",
"tracking_url": "http://www.ups.com/track?trackNums=123456",
"carrier": "ups",
"line": "1234-ABC-LINE"
}
POST https://api.lengow.io/v3.0/orders/actions/
With this API, you can make actions on your orders.
These actions will be sent asynchronously to the partner, and retried three times on failure.
Parameter | Required | Type | Description |
---|---|---|---|
marketplace_order_id | True | String | Order identifier of the marketplace |
account_id | True | Integer | Your account ID |
marketplace | True | String | The marketplace name |
action_type | True | String | Action type |
Depending on marketplace and action, some parameters are conditional and need to be included or to have specific values. Please refer to the marketplace API.
Parameter | Required | Type | Description |
---|---|---|---|
tracking_number | Conditional | String | Tracking number |
tracking_url | Conditional | String | Tracking URL (if not tracking_number) |
carrier | Conditional | String | Carrier |
line | Conditional | String | Line ID for partial action |
Marketplaces
Get marketplace informations
Simple call :
curl https://api.lengow.io/v3.0/marketplaces/
GET https://api.lengow.io/v3.0/marketplaces/
Marketplace code
All keys of the result are a Marketplace code
used by others API.
Always refers you to this API to get this code.
A Marketplace code
is unique and must match this regexp : [a-Z0-9-_]
Filtering
With filtering :
curl https://api.lengow.io/v3.0/marketplaces/?account_id=1
curl https://api.lengow.io/v3.0/marketplaces/?marketplace=darty
curl https://api.lengow.io/v3.0/marketplaces/?marketplace=darty&account_id=1
You can use the optionnal account_id
filter to only get your marketplaces, or marketplace
to get only one marketplace information:
Filter | Required | Description |
---|---|---|
account_id | No | To filter your marketplaces |
marketplace | No | To get only the specified marketplace information |
Result
Result json :
{
"name": "Boulanger",
"logo": "http://blog.boulanger.fr/wp-content/uploads/2010/10/logo-boulsign.jpg",
"legacy_code": "boulanger",
"description": "Launched at the end of 2014, the household electronics expert Boulanger has a rich range of items, and welcomes niche products. With brick-and-mortar experience spanning over 50 years, Boulanger now offers its expertise to internet users, and its large assortment of SKUs promises a quality audience.",
"country": "FRA",
"homepage": "http://www.boulanger.com/",
"orders": {
"status": {
"canceled": [
"CANCELED"
],
"closed": [
"RECEIVED",
"CLOSED"
],
"refunded": [
"REFUNDED"
],
"accepted": [
"WAITING_DEBIT",
"WAITING_DEBIT_PAYMENT"
],
"shipped": [
"SHIPPED"
]
},
"carriers": {
"DHL": {
"label": "DHL"
},
"Chronopost": {
"label": "Chronopost"
}
},
"actions": {
"ship": {
"status": [
"waiting_shipment"
],
"optional_args": [
"carrier",
"carrier_name",
"tracking_url"
],
"args_description": {
"tracking_url": {
"accept_free_values": true,
"depends_on": {
"operator": "allOf",
"conditions": [
{
"key_path": {
"root": "order",
"path": "order_meta.delivery_type",
},
"function": "equals",
"value": "PARCEL"
}
]
}
},
"carrier_name": {
"accept_free_values": true
}
},
"args": [
"tracking_number"
]
},
"accept": {
"status": [
"waiting_acceptance"
],
"optional_args": [
"line"
],
"args_description": {},
"args": []
},
"refuse": {
"status": [
"waiting_acceptance"
],
"optional_args": [
"line"
],
"args_description": {},
"args": []
}
}
}
}
Field | Type | Description |
---|---|---|
name | String | Marketplace name |
country | Country | Marketplace country |
description | String | Marketplace description (with HTML) |
homepage | String | Homepage of marketplace's website |
logo | String | Marketplace logo (URL) |
orders.status | Object | Mapping between lengow's status (keys) and marketplace's status (values) |
orders.carriers | Object | All carriers available |
orders.actions | Object | Informations about each actions (based on lengow's actions) |
Detail of orders.actions
Field | Type | Description |
---|---|---|
orders.actions.status .args |
String | Mandatory arguments |
orders.actions.status .optional_args |
String | Optional arguments |
orders.actions.status .args_description |
String | Description of arguments |
.args_description.field_name .depends_on |
Object | Some argument values may depend on the order data or other arguments sent during the action call. |
orders.actions.status .status |
String | Allowed status for this action |
Detail of depends_on fields / Conditional order action arguments
Field | Type | Description |
---|---|---|
depends_on.operator | String | Defines how many of the conditions should be respected. Values in oneOf, anyOf, allOf |
depends_on.conditions | Array | Informations about the specific field values |
depends_on.key_path | Object | Informations about where is located the condition data |
depends_on.key_path.root | String | Defines the source of the data, either the order data or the other parameters sent during the action call. Values in action_data, order |
depends_on.key_path.path | String | Defines the field with which the action data will be compared. The path can also be a subfield e.g. "order_meta.delivery_type" |
depends_on.function | String | Defines the operator used for the comparison, you need to adapt value type accordingly |
depends_on.value | String, Integer, Decimal, Array | Defines the value with which the data will be compared |
Detail of depends_on functions
Operator keyword | Value types associated | Description |
---|---|---|
equals | String, Integer, Decimal, Array | Action data should be equal to value |
not_equals | String, Integer, Decimal, Array | Action data should be different from value |
in_list | Array | Action data should be in value |
not_in_list | Array | Action data should not be in value |
lower_than | Integer , Decimal | Action data should be lower than value |
lower_than_or_equals | Integer , Decimal | Action data should be lower or equal to value |
greater_than | Integer , Decimal | Action data should be greater than value |
greater_than_or_equals | Integer , Decimal | Action data should be greater or equal to value |
regex | String | Action data should respect the regular expression |
contains | String | Action data should be formed with the value characters |
Conditional argument examples for order actions
Otto example
Extract from Marketplace API about Otto marketplace ship
action.
Marketplace API response for Otto (extract) :
{
"args_description": {
...
"return_tracking_number": {
"accept_free_values": true,
"type": "string",
"depends_on": {
"operator": "allOf",
"conditions": [
{
"key_path": {
"root": "order",
"path": "order_meta.delivery_type",
},
"function": "equals",
"value": "PARCEL",
}
],
},
},
"return_carrier": {
"accept_free_values": false,
"type": "list",
"valid_values": [.........],
"depends_on": {
"operator": "allOf",
"conditions": [
{
"key_path": {
"root": "order",
"path": "order_meta.delivery_type",
},
"function": "equals",
"value": "PARCEL",
}
],
},
}
}
}
In this particular case, we can see that both return_tracking_number
and return_carrier
have specific conditions.
return_tracking_number
is a string field that accept any tracking number as input.
return_carrier
is a string field that accept only one of the provided valid_values
.
Both fields have a depends_on
attribute with a condition meaning that fields are required only for an order with PARCEL delivery type (checked via the order.order_meta.delivery_type field).
Amazon MSS
This endpoint will be available only if you are eligible for the Amazon Seller Fulfilled Prime program.
Please refer to Amazon documentation for further information on how to apply.
Retrieve eligible shipment data
Simple call :
POST http://api.lengow.io/v3.0/orders/actions/
This API allows you to retrieve shipment that comply with the shipment you want to send.
It will return the shipping_service_offer_id
and shipping_service_id
necessary to determine which shipment label we are going to buy and retrieve. The information are to be stored in the meta-data of the order, or the order line if you fill in the line parameter during the call.
curl http://api.lengow.io/v3.0/orders/actions/ -X POST -H "Content-Type: application/json" --data
{
"marketplace_order_id": "123-ABCD123-EFGH456",
"account_id": 1,
"marketplace": "amazon_fr",
"action_type": "set_eligible_shipping_methods",
"carrier_pickup": "",
"delivery_date": "",
"delivery_experience": "",
"from_address_city": "",
"from_address_country_code": "",
"from_address_line": "",
"from_address_mail": "",
"from_address_name": "",
"from_address_phone": "",
"from_address_postal_code": "",
"package_dimension_height": "",
"package_dimension_length": "",
"package_dimension_unit": "",
"package_dimension_width": "",
"shipping_date": "",
"weight": "",
"weight_unit": "",
"from_address_state_province": "",
"line": ""
}
Definition of request fields:
Field | Type | Description | Use |
---|---|---|---|
marketplace_order_id | String | Amazon Order ID (3-7-7 format) | required |
account_id | Integer | Your account ID on Lengow | required |
marketplace | String | Amazon Site the order is linked to | required |
action_type | String | The action you want to make (always set_eligible_shipping_methods for this action) | required |
carrier_pickup | String | Will the carrier pick up the shipment from your warehouse | required |
delivery_date | Date | The needed delivery date for your shipment | required |
delivery_experience | String | Should be one of :
|
required |
from_address_city | String | The city your warehouse is located in | required |
from_address_country_code | Country | Country Code for your warehouse | required |
from_address_line | String | First line of your warehouse address | required |
from_address_mail | String | The mail to join you | required |
from_address_name | String | The name you want to display for your warehouse | required |
from_address_phone | String | The phone number to contact your warehouse | required |
from_address_postal_code | Integer | Postal-code of your warehouse | required |
package_dimension_height | Integer | The height of the package you want to ship (must be higher than 16) | required |
package_dimension_length | Integer | The length of the package you want to ship (must be higher than 16) | required |
package_dimension_width | Integer | The width of the package you want to ship (must be higher than 16) | required |
package_dimension_unit | String | Unit for the package dimensions values. Must be one of:
|
required |
shipping_date | Date | The estimated shipping date for the order | required |
weight | Integer | The weight of the shipment | required |
weight_unit | String | The weight unit. Choose from:
|
required |
from_address_state_province | String | State or province. Required in the Canada, US, and UK marketplaces. Also required for shipments originating from China. | optional |
line | String | If you want to ship only a part of your order | optional |
Buy the shipment label
Simple call :
POST http://api.lengow.io/v3.0/orders/actions/
This API allows you to buy the selected shipment label, that will be stored with your order.
The shipment label will be available through API or using the Lengow Platform, on the order detail page.
It will return the url where you can find the document. According to the Amazon documentation, shipment label can be:
- ZPL documents ( Zebra Printing Language)
- JPEG/PNG images
- PDF documents
This action will also set you order as shipped on Amazon platform. No need to make another one.
curl http://api.lengow.io/v3.0/orders/actions/ -X POST -H "Content-Type: application/json" --data
{
"marketplace_order_id": "123-ABCD123-EFGH456",
"account_id": 1,
"marketplace": "amazon_fr",
"action_type": "set_eligible_shipping_methods",
"carrier_pickup": "",
"delivery_date": "",
"delivery_experience": "",
"from_address_city": "",
"from_address_country_code": "",
"from_address_line": "",
"from_address_mail": "",
"from_address_name": "",
"from_address_phone": "",
"from_address_postal_code": "",
"package_dimension_height": "",
"package_dimension_length": "",
"package_dimension_unit": "",
"package_dimension_width": "",
"shipping_date": "",
"weight": "",
"weight_unit": "",
"from_address_state_province": "",
"line": "",
"shipping_service_id": "",
"shipping_service_offer_id": ""
}
Definition of request fields:
For the other fields definition, you can see the previous section
Field | Type | Description | Required |
---|---|---|---|
shipping_service_id | String | The ID of the service you want to use to ship your order | True |
shipping_service_offer_id | String | The offer ID you want to submit | True |