Get your orders with the API V2

Lengow's solution is provided with an API that allows you to retrieve the orders for your various feeds. Initially, you need to enter the IP used to submit queries to our API.

You then need to call the following XML feed retrieval URL: http://api.lengow.com/V2/#DATE_FROM#/#DATE_TO#/#ID_CLIENT#/#ID_GROUP#/#ID_FLUX#/commands/#STATE#/#FORMAT#/

1. Settings

#DATE_FROM# and #DATE_TO# : Date in YYYY-mm-dd format (e.g.: 2013-09-16)

#ID_CLIENT# : Your Client ID on Lengow.

#ID_GROUP# : Your Group ID. For all groups, enter the value 0; for several groups, separate them with commas.

#ID_FLUX# : The ID of the feed for which you would like to retrieve the orders Enter “orders” for all your feeds.

#STATE# : Status of the order. Possible values: all, new, processing, shipped and cancel.

#FORMAT# : Output format: newxml (new XML structure = API V2), oldxml (old XML structure = API V1) or json.

You can retrieve the information in XML or JSON format.

Below is an explanation of the XML structure returned by our API.

2. Overall information

Information on generating order feeds

<statistics ip="127.0.0.1" timeGenerated="2013-09-16 12:00:00.120000">

Information on the number of orders returned by the API

At <orders_count> node level.

  • Total number of orders.
<count_total>23</count_total>
  • Number of orders by Marketplace
<count_by_marketplace>
	<laredoute>10</laredoute>
	<cdiscount>7</cdiscount>
	<rueducommerce>2</rueducommerce>
	<amazon>3</amazon>
	<brandalley>1</brandalley>
</count_by_marketplace>
  • Number of orders by Status
<count_by_status>
	<cancel>2</cancel>
	<new>0</new>
	<shipped>21</shipped>
	<processing>0</processing>
</count_by_status>

2.1 Order information

Main node including all orders

<orders>...</orders>

Each order is encapsulated in a <order>…</order> node.

Here is the detailed information contained in this node:

2.2 General information

Name of the marketplace where the order originated

Possible values : amazon, ebay, brandalley, monechelle, pixplace, rueducommerce, fnac, priceminister, cdiscount, laredoute, rakuten_de, spartoo, zalando, mistergooddeal, galeries_lafayette, darty, natdec, moncornerdeco, delamaison, atlasformen, auchan, boulanger, comptoirsante, gosport, home24, immochan_v2, macway, menlook, moncornerdeco, privalia, ricardo, thebeautyst, wish.

<marketplace><![CDATA[amazon]]></marketplace>

The feed ID (idFlux) relevant to your order, which is used to determine from which feed the order originates when you have several feeds for a single marketplace.

When you have several feeds for the same marketplace account, by default Lengow associates the orders to the older feed (with the smallest ID number) which is active in the solution.

For example, I have three ID feeds - 75002, 76455 & 76457 - for a single Amazon account ⇒ My orders will be associated with the feed with the smallest ID, i.e. 75002.

<idFlux><![CDATA[26588]]></idFlux>

2.3 Status information

Order status

There are two items of information about status in the <order_status> node:

- The status of the marketplace

<marketplace><![CDATA[accepted]]></marketplace>

- The homogenized Lengow status

<lengow><![CDATA[shipped]]></lengow>

Here are the various possible statuses for each marketplace with, in red, the status that corresponds to “awaiting shipping” and that you must (in our opinion) take into consideration to trigger an import in your order management system.

<fc #606060>The possible values for marketplace statuses are:</fc>

  • Atlas For men : STAGING, WAITING_ACCEPTANCE, WAITING_DEBIT, WAITING_DEBIT_PAYMENT, SHIPPING, INCIDENT_OPEN, WAITING_REFUND, WAITING_REFUND_PAYMENT, SHIPPED, RECEIVED, CLOSED, CANCELED, REFUSED, REFUNDED
  • Auchan : STAGING, WAITING_ACCEPTANCE, WAITING_DEBIT, WAITING_DEBIT_PAYMENT, SHIPPING, INCIDENT_OPEN, WAITING_REFUND, WAITING_REFUND_PAYMENT, SHIPPED, RECEIVED, CLOSED, CANCELED, REFUSED, REFUNDED
  • Amazon : new, canceled, accept, accepted
  • Boulanger : STAGING, WAITING_ACCEPTANCE, WAITING_DEBIT, WAITING_DEBIT_PAYMENT, SHIPPING, INCIDENT_OPEN, WAITING_REFUND, WAITING_REFUND_PAYMENT, SHIPPED, RECEIVED, CLOSED, CANCELED, REFUSED, REFUNDED
  • Brandalley : processing, accepted, refused
  • Cdiscount : CancelledByCustomer, WaitingForSellerAcceptation, AcceptedBySeller, PaymentInProgress, WaitingForShipmentAcceptation, Shipped, RefusedBySeller, AutomaticCancellation, PaymentRefused, ShipmentRefusedBySeller, ValidatedFianet, RefusedNoShipment
  • eBay : new, ToShip, Shipped,
  • Fnac.com : ToAccept, Refunded, ToShip, NotReceived, Received, Shipped, Refused, Cancelled
  • Immochan : STAGING, WAITING_ACCEPTANCE, WAITING_DEBIT, WAITING_DEBIT_PAYMENT, SHIPPING, INCIDENT_OPEN, WAITING_REFUND, WAITING_REFUND_PAYMENT, SHIPPED, RECEIVED, CLOSED, CANCELED, REFUSED, REFUNDED
  • La Redoute : Created, Accepted, Refused,Toship,Tocancel, Shipped, Cancelled, Torefund, Refunded, Notrefunded
  • PixPlace : accepted
  • Rakuten-PriceMinister : REQUESTED, REMINDED, ON_HOLD, COMMITTED, SHIPPED, CLOSED, CANCELLED, REFUSED
  • MacWay : STAGING, WAITING_ACCEPTANCE, WAITING_DEBIT, WAITING_DEBIT_PAYMENT, SHIPPING, INCIDENT_OPEN, WAITING_REFUND, WAITING_REFUND_PAYMENT, SHIPPED, RECEIVED, CLOSED, CANCELED, REFUSED, REFUNDED
  • Menlook : STAGING, WAITING_ACCEPTANCE, WAITING_DEBIT, WAITING_DEBIT_PAYMENT, SHIPPING, INCIDENT_OPEN, WAITING_REFUND, WAITING_REFUND_PAYMENT, SHIPPED, RECEIVED, CLOSED, CANCELED, REFUSED, REFUNDED
  • Privalia : STAGING, WAITING_ACCEPTANCE, WAITING_DEBIT, WAITING_DEBIT_PAYMENT, SHIPPING, INCIDENT_OPEN, WAITING_REFUND, WAITING_REFUND_PAYMENT, SHIPPED, RECEIVED, CLOSED, CANCELED, REFUSED, REFUNDED
  • Rueducommerce : new, processing, restocking, shipped, cancelled
  • The Beautyst : STAGING, WAITING_ACCEPTANCE, WAITING_DEBIT, WAITING_DEBIT_PAYMENT, SHIPPING, INCIDENT_OPEN, WAITING_REFUND, WAITING_REFUND_PAYMENT, SHIPPED, RECEIVED, CLOSED, CANCELED, REFUSED, REFUNDED

The possible values for Lengow statuses are:

New orders : new
Order awaiting shipping : processing
Order shipped : shipped
Order cancelled or refunded : cancel

2.4 Order information

Order numbers

Your main order ID is located in the <order_id> node. It corresponds to the number assigned by the marketplace.

<order_id><![CDATA[123-1234567-1234567]]></order_id>

Additional order numbers

For some marketplaces, additional information is provided. You can find this information in the following nodes: <order_mrid> and <order_refid> :

For RDC, you have both a morid and a refid.

For Ebay, both nodes contain the transaction number.

For the other marketplaces, these values are identical to the main number.

<order_mrid><![CDATA[123-1234567-1234567]]></order_mrid>
<order_refid><![CDATA[123-1234567-1234567]]></order_refid>

External order ID

If you use Prestashop, Magento or some other eCommerce solution, you can find the order ID for your eCommerce solution here:

<order_external_id><![CDATA[100034239]]></order_external_id>

By default, we retrieve the Prestashop and Magento order IDs through our modules. If you use another eCommerce solution and you would like to incorporate your internal order IDs in Lengow so that they then appear in this XML node, you must make calls to our WebServices.

Date and time

The date and time of the order.

<order_purchase_date><![CDATA[2013-08-21]]></order_purchase_date>
<order_purchase_heure><![CDATA[08:03:40]]></order_purchase_heure>

This information is sent to us by the marketplaces. It is therefore the time zone of the country where the order was placed that is applied.

Order amount

Order amount including tax.

<order_amount><![CDATA[37.35]]></order_amount>

Tax

Tax applied to the order.

Not all marketplaces provide this information.

<order_tax><![CDATA[0.00]]></order_tax>

Shipping fees

Amount of shipping fees including tax.

<order_shipping><![CDATA[4.9]]></order_shipping>

Commission

Amount of commission taken by the marketplace.

Not all marketplaces provide this information.

<order_commission><![CDATA[0.0]]></order_commission>

Order processing fees

Amount of any order processing fees related, for example, to payments in several instalments.

Not all marketplaces provide this information.

<order_processing_fee><![CDATA[0]]></order_processing_fee>

Currency

Currency of the order.

Not all marketplaces provide this information.

<order_currency><![CDATA[EUR]]></order_currency>

2.5 Payment information

Information about payment is grouped togetherin the <order_payment> node.

Checkout

<payment_checkout><![CDATA[]]></payment_checkout>

This information is specific to Ebay orders.

Statuts

Payment status

<payment_status><![CDATA[]]></payment_status>

Type

Payment type used by the client: Credit/debit card, cheque, interest-free payment in three instalments…

Not all marketplaces provide this information.

<payment_type><![CDATA[]]></payment_type>

Date and time

Date and time payment for the order is received.

Not all marketplaces provide this information.

<payment_date><![CDATA[2013-08-21]]></payment_date>
<payment_heure><![CDATA[08:03:40]]></payment_heure>

2.6 Invoicing information

Invoicing information is grouped together in the <order_invoice> node.

<Invoice number>

<invoice_number>AZ1223</invoice_number>

<Invoice URL>

<invoice_url>https://solution.lengow.com/invoice/RDC/15042/245693915.pdf</invoice_url>

2.7 Client information

This information, contained within <billing_address> can be empty in certain statuses in some marketplaces:

  • Cdiscount : retrieved using the status WaitingForShipmentAcceptation
  • LaRedoute : retrieved using the status ToShip (switch from Accepted to ToShip performed by La Redoute automatically when issuing the invoice)

Some marketplaces send us Last name and First name in the same field, which is why the information can end up only in the information can end up only in the <billing_lastname> field.

<billing_address>
	<billing_society><![CDATA[Lengow]]></billing_society>
	<billing_civility><![CDATA[Mr]]></billing_civility>
	<billing_lastname><![CDATA[Dupont]]></billing_lastname>
	<billing_firstname><![CDATA[Jean]]></billing_firstname>
	<billing_email><![CDATA[d9kbsc9zrdsfsf24pdb14h@marketplace.amazon.fr]]></billing_email>
	<billing_address><![CDATA[51 place de la lune]]></billing_address>
	<billing_address_2><![CDATA[]]></billing_address_2>
	<billing_address_complement><![CDATA[]]></billing_address_complement>
	<billing_zipcode><![CDATA[44000]]></billing_zipcode>
	<billing_city><![CDATA[Nantes]]></billing_city>
	<billing_country><![CDATA[FR]]></billing_country>
	<billing_country_iso><![CDATA[]]></billing_country_iso>
	<billing_phone_home><![CDATA[0123456789]]></billing_phone_home>
	<billing_phone_office><![CDATA[]]></billing_phone_office>
	<billing_phone_mobile><![CDATA[0678987678]]></billing_phone_mobile>
	<billing_full_address><![CDATA[51 place de la lune 44000 Nantes FR]]></billing_full_address>
</billing_address>

2.8 Delivery information

Regarding the delivery addresses, as with the client information, we do not receive this directly for the Cdiscount and La Redoute marketplaces.

<delivery_address>
	<delivery_society><![CDATA[Lengow]]></delivery_society>
	<delivery_civility><![CDATA[Mr]]></delivery_civility>
	<delivery_lastname><![CDATA[Dupont]]></delivery_lastname>
	<delivery_firstname><![CDATA[Jean]]></delivery_firstname>
	<delivery_email><![CDATA[d9kbsc9zrdsfsf24pdb14h@marketplace.amazon.fr]]></delivery_email>
	<delivery_address><![CDATA[51 place de la lune]]></delivery_address>
	<delivery_address_2><![CDATA[]]></delivery_address_2>
	<delivery_address_complement><![CDATA[]]></delivery_address_complement>
	<delivery_zipcode><![CDATA[44000]]></delivery_zipcode>
	<delivery_city><![CDATA[Nantes]]></delivery_city>
	<delivery_country><![CDATA[FR]]></delivery_country>
	<delivery_country_iso><![CDATA[]]></delivery_country_iso>
	<delivery_phone_home><![CDATA[0123456789]]></delivery_phone_home>
	<delivery_phone_office><![CDATA[]]></delivery_phone_office>
	<delivery_phone_mobile><![CDATA[0678987678]]></delivery_phone_mobile>
	<delivery_full_address><![CDATA[51 place de la lune 44000 Nantes FR]]></delivery_full_address>
</delivery_address>

2.9 Shipping information

Information about parcels is grouped together in the <tracking_informations> node.

You will find :

  • The shipping method: Tracked, Standard, Registered, Parcel collection point, etc.
  • The Carrier : Unrestricted or defined by the marketplace
  • Parcel number
  • Tracking url
  • Shipping date
  • Parcel collection point number
  • Shipping managed by the marketplace (value "1" ; i.e. the programm FBA of Amazon) or by the seller (value "0").

Obviously, this information will be completed according to the information sent to us by the marketplace.

<tracking_informations>
	<tracking_method><![CDATA[]]></tracking_method>
	<tracking_carrier><![CDATA[Standard]]></tracking_carrier>
	<tracking_number><![CDATA[005VGB14]]></tracking_number>
	<tracking_url><![CDATA[]]></tracking_url>
	<tracking_shipped_date><![CDATA[2013-08-22 16:18:12]]></tracking_shipped_date>
        <tracking_relay><![CDATA[]]></tracking_relay>
	<tracking_deliveringByMarketPlace><![CDATA[0]]></tracking_deliveringByMarketPlace>
</tracking_informations>

2.10 Miscellaneous information

Some additional information about the order.

Comments

A comment may be made about the order by the client; this will be entered in this node.

<order_comments><![CDATA[]]></order_comments>

Client ID

Some marketplaces provide their website's internal ID for the client that has placed the order.

Currently, only eBay and Cdiscount send us this kind of information.

<customer_id><![CDATA[]]></customer_id>

Client IP address

Some marketplaces provide the client's IP address.

<order_ip><![CDATA[]]></order_ip>

Number of items

Total number of items in the order

In the example, '3' may mean two of product A and one of product B.

<order_items><![CDATA[3]]></order_items>

2.11 Product information

The full cart is contained in the <cart> node with the number of separate products inside and then the list of products encapsulated in the <products> node.

Number of separate items

The number of different products in your cart.

Continuing with our example, we have two of product A and one of product B, which makes two different products.

<cart_products>2</cart_products>

You then have the detail of your cart with each product:

Product IDs

The product ID in the Lengow system.

<idLengow><![CDATA[10001]]></idLengow>

When the product no longer exists in Lengow, this XML node becomes empty. In this case, refer to the value contained in the XML node <sku> to be able to identify the product ordered.

The ID returned by the Marketplace

<idMP><![CDATA[S9849GHD0]]></idMP>

Some marketplaces assign their own IDs to the products. Not all marketplaces provide this information.

Your product ID sent to the marketplace from Lengow.

<sku field="ID_PRODUCT"><![CDATA[BB0201]]></sku>

A “field” attribute indicates the matching field in Lengow (information used by Lengow during the import of orders to Prestashop or Magento).

The EAN of your product sent by the marketplace

<ean><![CDATA[1234567890987]]></ean>

Only Cdiscount currently sends this information.

Title

Title of your product.

<title><![CDATA[Les blagues de totos]]></title>

If the product no longer exists in Lengow, this node will be empty.

Category

Category of the product.

<category><![CDATA[LIVRES]]></category>

If the product no longer exists in Lengow, this node will be empty.

Brand

Brand of the product.

<brand><![CDATA[TOTO]]></brand>

Currently, only RDC sends this information.

Url

URL of your product on your website.

<url_product><![CDATA[http://www.site.com/monproduit.html]]></url_product>

Image

Image associated with your product.

<url_image><![CDATA[http://medias.site.com/monproduit.jpg]]></url_image>

Order line ID

Product order line ID sent by the marketplace to manage line-based actions.

<order_lineid><![CDATA[]]></order_lineid>

Not all marketplaces provide this information.

Quantity

Quantity of the product in the order.

<quantity><![CDATA[2]]></quantity>

Price

Price including tax of the product, taking into consideration the quantity ordered.

<price><![CDATA[64.90]]></price>

Unit price including tax of the product

<price_unit><![CDATA[32.45]]></price_unit>

Shipping fees

Shipping fees for the product.

Depending on the marketplace, the shipping fees of each product are not stated, only the order's highest shipping fee is used.

<shipping_price><![CDATA[]]></shipping_price>

Tax

Tax applied to the item.

Not all marketplaces provide this information.

<tax><![CDATA[]]></tax>

Status

Status of your product.

Products with the status 'cancel' or 'refused', for example, are not to be taken into consideration.

<status><![CDATA[]]></status>

3. Fetching an order by its ID

You can fetch a specific order by its ID with the following URL:

http://api.lengow.com/V2/#ID_CLIENT#/#ID_FLUX#/orderid/#ID_COMMANDE#/

With parameters:

  • #ID_CLIENT# : client ID
  • #ID_FLUX# : feed ID
  • #ID_COMMANDE# : order ID