Basic Parameters

In order to return valid and meaningful delivery options, the Delivery Options API requires a minimum set of parameters to be passed. These are listed below, together with code samples that show you how to build a call.

Note

To view Delivery Options reference documentation, go to https://metapack-delivery-options-api-v1.redoc.ly/. It is the most up-to-date low-level information about the API.

Note

The parameters do not have to be supplied in the order given below. They can be in any order, provided that they are separated using the & character.

For the other possible parameters that can be passed, refer to Extended Parameters.

  • key

    The API key provided by Metapack. Refer to Configuring your Security.

    GET https://dmo.metapack.com/dmoptions/find?key=<API-Key>
  • wh_code

    The warehouse code as set up in Delivery Manager (refer to Configuring Shipping and Allocation). This serves to identify the required carrier configurations, e.g.

    GET https://dmo.metapack.com/dmoptions/find?key=<API-Key>&wh_code=SL123

    Your Order Management System or equivalent service can determine the required warehouse. Failure to specify a wh_code will result in an empty response.

  • c_cc

    The ISO 3166 alpha-3 three-letter country code of the delivery address. This filters out couriers who cannot deliver to the specified country, although it is not strictly necessary if you are delivering to a specific latitude/longitude and/or postcode that does not cross borders.

    GET https://dmo.metapack.com/dmoptions/find?key=<API-Key>&wh_code=SL123&c_cc=NLD

    If you enter nothing, then GBR is assumed.

  • c_pc

    The postal code of the delivery location.

    GET https://dmo.metapack.com/dmoptions/find?key=<API-Key>&wh_code=SL123&c_cc=NLD&c_pc=1083 HN

    Note

    If you are presenting delivery options prior to final checkout, i.e. before the consumer has entered the required delivery address, you can use a default postal code. For the purposes of estimation, this should, if possible, be a small town code, rather than one in a large city or the middle of the countryside.

  • c_lat and c_long

    c_lat is the latitude coordinate of the search point for the delivery location, whilst c_long is the longitude coordinate. Both need to be specified as double precision floating point numbers, e.g.

    GET https://dmo.metapack.com/dmoptions/find?key=<API-Key>&wh_code=SL123&c_cc=NLD&c_lat=52.33646&c_long=4.884971

    If you are delivering to a single location, you would typically specify either c_pc or c_lat/c_long. However, you might use both when delivering to a HOME address, but with additional PUDO/OWNSTORE options. In this case, c_lat/c_long is used for PUDO/OWNSTORE lookup and c_pc is used for HOME delivery.

    Caution

    To guarantee a consistent PUDO/OWNSTORE lookup when both c_lat/c_long and c_pc are provided, the c_lat/c_long coordinates should represent the c_pc.

  • optionType

    This determines the delivery type(s) for which options are returned: HOME (for home deliveries), PUDO (for deliveries to pickup/drop off points), and/or OWNSTORE (for 'Click and Collect').

    If specifying more than one optionType, use a comma-separated list, e.g.

    GET https://dmo.metapack.com/dmoptions/find?key=<API-Key>&wh_code=SL123&c_cc=NLD&c_pc=1083 HN&c_lat=52.33646&c_long=4.884971&optionType=HOME,PUDO

    If you enter no optionType, then options for all types (HOME,PUDO,OWNSTORE) are returned.

  • r_t

    This stands for 'return type'. Specify a single three-letter code, from the following:

    • lgg - Returns the cheapest next available delivery option for each carrier 'service group'.

      Note

      The 'cheapest' service is based on cost (as paid by you, the retailer, to the carrier).

      If a carrier service is in more than one carrier 'service group', then, each time that service is selected, it will cause the associated group to appear. So, in lgg and ggg queries, you may see 'service groups' appear more than once in the response.

    • lsc - Returns the next available delivery option for each carrier service.

    • ggg - Returns the cheapest delivery option for each carrier 'service group', for the next 20 days.

    • gsc - Returns the delivery options for each carrier service, for the next 20 days.

    Where a code starts with 'l', it signifies List, and where it starts with 'g', it signifies Grid. The second letter distinguishes between carrier 'service groups' ('g'), and carrier services ('s').

    For example:

    GET https://dmo.metapack.com/dmoptions/find?key=<API-Key>&wh_code=SL123&c_cc=NLD&c_pc=1083 HN&c_lat=52.33646&c_long=4.884971&optionType=HOME,PUDO&r_t=lsc

Note

If you omit the r_t parameter, then options will be returned based on the default Delivery Manager allocation hierarchy, i.e.

  1. Prioritised service (if one has been selected automatically via the Carrier Allocation Rules).

  2. Shipping cost (the system will always try and select the cheapest service where there is no prioritised service).

  3. Earliest despatch (if two services cost the same, the one that leaves the warehouse first will be chosen).

  4. Earliest delivery (if two services cost the same and leave the warehouse at the same time, the one that can deliver first is selected),