Skip to main content

Send orders from your ERP

Your ERP, WMS or webshop is where sales orders are created. Without an integration, someone retypes each one that needs delivering into Alrik Connect — and again every time it changes.

With this integration, every order that needs delivering appears in Connect on its own, changes and cancellations follow it there, and your system finds out when it has been planned and delivered.

What you will build

  • Orders flow from your system into the planner's inbox in Connect, with the goods, time windows and contacts the planner needs.
  • Amendments and cancellations in your system are passed on.
  • Your warehouse reports packing progress, so planners know what is ready.
  • Your system learns when each order is planned and delivered.

Before you begin, ask Alrik for an API key with permission to create, update and cancel orders, and read How Alrik works if order draft, inbox and tour are new terms.

1. Map your branches to locations​

Every order belongs to a location — the branch or warehouse it ships from. Each location has an origin_reference, chosen when it was set up — usually a code your system already has, such as a warehouse number.

Look up your locations once with Get your integration and store the mapping from your branches to their origin_reference. Every order you send will need it.

2. Send each order when it needs delivering​

Decide the moment in your own flow that an order should be delivered — when it is confirmed, when it is released to the warehouse — and create an order draft at that point.

An order needs your order number, its location, and where it is picked up and dropped off. Give the planner as much as your system knows beyond that:

SendSo the planner can
Earliest pickup and latest deliveryPlan within the customer's window
Weight and a description of the cargoPick a vehicle that can carry it
Contacts and phone numbers at each endReach the right person on the day
Driver instructions and tagsBrief the driver, and filter orders while planning
Your customer and project referencesFind the order again, and report on it later
A shipment with its linesSee the individual items, and whether a signature or photo is required
Before you send
  • Give each end of the delivery either an address or the name of a known location. If you send both, the address wins.
  • Time windows are UTC. Convert from local time before you send.
  • Weight is whole kilograms — decimals are dropped, not rounded.
  • Fields Alrik does not recognise are ignored, so read your first orders back to check they arrived as intended.

3. Store the order_draft_id​

Alrik answers each new order with an order_draft_id. Store it against the order in your system and use it from then on.

Order numbers are not deduplicated

Alrik does not check whether it has seen an origin_order_number before, so sending the same order twice creates two orders. Use the order_draft_id to change or cancel an order, and if a send times out, look for it in order drafts before you send it again.

4. Pass on changes and cancellations​

When an order changes in your system, update it in Alrik. Send only what changed — anything you leave out keeps its value. When an order is called off, cancel it; it is kept as a closed draft rather than deleted.

Two things to know when updating
  • Tags are replaced, not merged. Send the whole list each time.
  • On update, a shipment's items go in lines; on create they go in shipment_lines. The create name is ignored on update.

5. Report packing progress​

If your warehouse system knows when an order has been packed and is ready to load, report it on the shipment. Planners see each order move from packable to packed, loadable and dispatched, alongside any status text of your own.

6. Find out when it is planned and delivered​

Ask Alrik to send your system callback events — when the order is planned onto a tour, when it is ready to pick, when it is delivered — so you never have to poll.

If you also want to check on demand, order drafts tells you whether an order arrived, has been planned (converted_at) or was cancelled (closed_at), and get an order shows how far a planned delivery has got.

You are done when​

  • A new order in your system appears in the Connect inbox with its goods and time window.
  • Changing it in your system changes it in Connect, and cancelling it closes it.
  • Resending after a timeout does not create a duplicate.
  • Your system is told when the order is delivered.