Smartlane API

The Smartlane API Developer Hub

Welcome to the Smartlane API developer hub. You'll find comprehensive guides and documentation to help you start working with Smartlane API as quickly as possible, as well as support if you get stuck. Let's jump right in!

Get Started    

API Handling Extras

Filter Queries

The filter query parameter q can be used to filter results. It must be a JSON string of the following format:

For comparing with a String or numerical value
> q={'filters':[{'name': <fieldname>, 'op': <operatorname>, 'val': <argument>}],'option':optionvalue}

or

For comparing with a value from another field
> q={'filters':[{'name': <fieldname>, 'op': <operatorname>,'field': <fieldname>}],'option':optionvalue}

Operatornames

Possible operators for operatorname are:

  • ==, eq, equals, equals_to
  • !=, neq, does_not_equal, not_equal_to
  • >, gt, <, lt
  • >=, ge, gte, geq, <=, le, lte, leq
  • in, not_in
  • is_null, is_not_null
  • like
  • has
  • any

Optionvalues

Possible options for optionvalue are:

  • limit, offset, group_by, single
  • order_by

Possible parameters for order_by are a list of objects of the form;
{'field': <fieldname>, 'direction': <directionname>}

directionname is asc or desc

Reference

For a detailed description including examples, check the Flask query format

Delivery Stati

Status key
Description
Status ID

none

The delivery is either completely new and was never assigned to a tour or it was reset after cancelling a tour containing this delivery. Deliveries in status 'none' can used for new tour planning processes and can also be deleted if needed. But be aware that you should never delete deliveries while there is a tour planning in process which uses these deliveries!

0

assigned

The delivery is assigned to a tour

1

delivered

The delivery was assigned to a tour and successfully delivered by the driver to the recipient. Additional codes can be used (see Delivery codes below)

2

tooearly

The delivery was assigned to a tour, the tour has already been started and ETA calculations noticed that this delivery's ETA is predicted to be earlier than the planned delivery time (PDT) if there won't be any further delay or a driver break.

3

delayed

The delivery was assigned to a tour, the tour has already beenstarted and ETA calculations noticed that this delivery's ETA is predicted to be later than the planned delivery time (PDT) and thus, there is a delay which is relevant for the customer.

4

cancelled

The delivery is marked as cancelled and will not be reused for tour plannings (again)

5

problem

The 'problem' status can be used to indicate any kind of issues with this delivery. It has no technical implications on the tour itself

6

repeat

The delivery is marked as 'to be repeated'. This status is not used in the standard routing process but can be used by API developers to indicate that this delivery should be deliverd again for some reason.

7

undelivered

The delivery was assigned to a tour and the driver tried to deliver it to the recipient but he/she was not successful (e.g. because the recipient was not at home). Additional codes can be used (see Delivery codes below)

8

notready

The delivery is created but not ready for tour assignment. This can e.g. happen if the order data is already processed but the item to be delivered is not yet available in the depot. Deliveries in this status will not be used for tour planning

9

Delivery Codes

Code ID
Label (EN/DE)

1

'Delivery to the recipient' /
'Zustellung beim Empfänger'

2

'Delivery to a neighbor' /
Zustellung beim Nachbarn

3

'Delivery to a parcel shop' /
Zustellung im Paketshop

4

'Recipient not available' /
'Empfänger nicht anwesend'

5

'Acceptance refused' /
'Annahme verweigert'

6

'Recipient could not be identified' /
'Empfänger nicht auffindbar'

7

'Delivery to the recipient in a parcel shop' /
'Übergabe an Empfänger aus Paketshop'

Route Stati

none

Tour was successfully calculated but neither assigned to a driver nor started yet

0

driverassigned

Tour was successfully calculated and is assigned to a driver

1

accepted

Tour was successfully calculated, assigned to a driver and the driver has already accepted the tour (e.g. vie the "accept" button in the driver app)

2

ontheway

Tour was successfully calculated, assigned to a driver, the driver has already accepted the tour and the drivers has given notice that he has started the tour (e.g. vie the "start tour" button in the driver app). As soon as the tour switches to the status "ontheway", ETA and tracking notifications are sent to the recipient if notification mails are set to active in the configuration

3

cancelled

The route was already calculated, assigned or even started but was manually cancelled by the dispatcher for some reason

4

problem

The 'problem' status can be used to indicate any kind of issues with this tour. It has no technical implications on the tour itself

5

finished

All deliveries in this tour were completed (either delivered or undelivered or deleted/cancelled)

6

archived

The tour was finished and archived manually afterwards

7

replaced

The tour was calculated but later replaced by another instance of this exact tour (e.g. via re-calculation from another starting position or by updating it with new or deleted deliveries)

8