You are currently viewing documentation for Linnworks Desktop, if you are looking for Linnworks.net documentation, click here.






Fulfilment Center URL post/get communication

URL communication is used to post new orders, get order status and get latest inventory levels from a fulfilment centre using very simple URL post and get methods.

Who would need to use it

  • If you are providing order fulfilment services (fulfilment company) and you would like to develop integration with Linnworks Fulfilment center functionality.
  • If you are a seller who is using fulfilment center that has a webservice which you want to communicate with.
  • You are developing a Fulfilment Center communication between Linnworks and your own system.

How it works

  • Order is allocated to a fulfilment center
  • Linnworks will post each new order to a URL specified in fulfilment center location configuration.
  • Each order field will be in the post FORM
  • The script behind the URL will then propagate this order to a fulfilment center order management system and return OK or ERROR
  • Linnworks will then be requesting order status update for each order.
  • The script behind URL will be replying with tab delimited text output.
  • During inventory sync Linnworks will request inventory changes to update its' stock levels for fulfilment center location.

Order adapter

Linnworks will post new orders to a URL in a post. Each field of an order will be posted in a form, order items will also be posted in a form. The script will have to output

  • OK – for successful acceptance of an order. If OK is received – the order will not be sent to URL again.
  • Any other text  - will be treated as an error message. The order will be resubmitted next in the next synchronization.

Note: When outputting a text, remove all headers, footers and any HTML rendring. The script expects two characters (OK) in the response string. Anything else will be treated as an error message.

Order fields posted in a form

  • OrderId – Linnworks order id. This serves as a reference for Linnworks to update order status. External system or an adapter must record this id for a reference
  • OrderDate – order date in ODBC format
  • FullName – customer name
  • Company – customer company
  • Address1 – shipping address line 1
  • Address2 – shipping address line 2
  • Address3 – shipping address line 3
  • Town – shipping address line 4
  • Region – shipping address region/state
  • PostCode – shipping postal code/zipcode
  • Country – shipping country name
  • CountryCode – shipping country code, ISO
  • BuyerPhoneNumber – customer contact phone number
  • EmailAddress – customer email address
  • ShippingService – shipping service (as specified in Linnworks)
  • ShippingVendor – shipping vendor (as specified in Linnworks)
  • ShippingCode – shipping service code (as specified in Linnworks)
  • Source – source of the order
  • SubSource – subsource of the order
  • ChannelReferenceNum – reference number the order is know on the channel where the order came from (ex. Amazon Order id, ebay transaction id etc)
  • OrderTotal – order total
  • TotalDiscount – total order discount
  • Tax – order tax
  • ShippingCost – order shipping costs
  • Currency – order currency
  • OrderItemCount – number of order items
  • ProductSKU[n] – order item SKU
  • ProductTitle[n] – order item title
  • ProductQuantity[n] – ordered quantity
  • ProductUnitCost[n] – order item unit cost
  • ProductCostExTax[n] – order item cost excluding tax
  • ProductCostIncTax[n] – order item cost including tax
  • ProductLineDiscount[n] – order item line discount
  • ProductTaxRate[n] – order item tax rate

where [n] is a sequential number for each order item line, the total number of order items is specified in OrderItemCount

Order Status adapter

Order status adapter allows Linnworks to keep track of the order fulfilment process and once order is processed/shipped get order tracking number from the fulfilment center.
Linnworks will supply one field in the Post form.

  • OrderId – Linnworks order id. This serves as a reference for Linnworks to update order status. External system or an adapter must record this id for a reference

The response must be as a flat text with 4 tab delimited fields

 

status[tab]shipping service[tab]trackingnumber[tab]error message

 

For example

PROCESSING[tab][tab][tab]

or

ERROR[tab][tab]No sufficient stock for SKU 9992

or

SHIPPED[tab]DHL[tab]JJ8907372347238[tab


Linnworks will react to status SHIPPED and process an order updating the tracking number.

 

  • If the response does not contain three tabs, exception will be raised during synchronization.
  • If field ordering does not match specified format it may cause a total mess.
  • Strip out any tabs from the error message and a status

 

Inventory sync adapter

Inventory adapter allows Linnworks to keep track of the stock levels in the fulfilment center. The adapter must break down inventory list into pages of 1000 items each and can also accept last update date. By default the adapter can handle up to 100 pages of 1000 items each. Upon encountering more pages Linnworks will throw an error.


Fields supplied in the post

  • LastUpdate – UTC time of last time Linnworks updated the stock level from the fulfilment center. You can limit the data transfer by using this date to return only changes in the inventory.
  • Page – current page number. The first request will be sent with page 1. If 1000 items are encountered in the response, the second request will be sent with Page 2 and so on. This allows you to break down very large inventory updates into smaller chunks and throttle communication between Linnworks.

 

The response must be as a flat text with 2 tab delimited fields on each line

SKU[tab]Quantity
SKU[tab]Quantity
…..
SKU[tab]Quantity

 

  • If the response contains more than 1000 lines an error will be thrown
  • You can output ERROR: followed by an error message in the response to propagate the error to Linnworks
  • Line break is \r\n
  • Avoid outputting all the inventory each time Linnworks requests the inventory update – large inventory will slow down fulfilment center system as well as Linnworks. Use LastUpdate field where possible.

Sample code

ASP.NET C# project (Visual Studio 2010)

This project demonstrates basic mechanics of the adapter. There are three .aspx pages

  • order.aspx – receives orders from Linnworks and writes them into a file order_[order_id].txt in a directory specified in web.config DataPath setting
  • orderstatus.aspx – on request will find a file order_[order_id].txt gets the first line as a status and returns the status of an order.
  • inventory.aspx – generates a list of inventory items with SKU001..n By default will generate 6 pages of inventory updates.

 

 

URL communication is used to post new orders, get order status and get latest inventory levels from a fulfilment centre using very simple URL post and get methods.

Video: Amazon FBA, Fulfilment Centers and dropshipping - This webinar demonstrates how to configure Linnworks to work with Amazon FBA, setup generic fulfilment center communication or coms with the drop shipper and introduces to Scripting in Linnworks.