Allocating via service group
Use Consignment’s Allocate With Service Group endpoint to assign packages from a custom pool of services. Ideal for routing based on goods type or region.
What is a carrier service group?
Service groups enable you to specify a custom pool of carrier services to allocate a package from. This page explains how to configure service groups, and how to use the Allocate Consignment With Service Group endpoint to allocate from within those groups.
The Consignments carrier service groups are user-defined pools of carrier services. They are designed to be used in conjunction with the Allocate Consignment With Service Group endpoint as a means of limiting the carrier services that a particular package could be allocated to.
For example, you could set up a group containing all services that will ship dangerous goods. You would then allocate within that group for all packages involving dangerous items.
You can use any combination of carrier services in a carrier service group.
Configure carrier service groups
You will need to configure carrier service groups in the Consignments UI. To add a carrier service groups:
Log in to the Consignments UI and open the Carrier Service Groups page (Settings > Carrier Service Groups) to display a list of existing carrier service groups.
Click Add Service Group to display the Add Carrier Service Group page.
Enter a Name for the new service group. This is used as an identifier for the group within the Consignments UI.
Enter a Service Group Code for the new service group. This is used as an identifier for the group when selecting it via the Allocate Consignment With Service Group endpoint (referred to as the
{mpdCarrierServiceGroupReference}
in the API reference documentation).Select the services you want to add to the group by clicking on them in the service list.
If required, you can filter the list of services by clicking Filter and entering data into the filter fields displayed. All fields are optional.
Click Save to save the group. A new tile is added for the group on the Carrier Service Groups page, and you can now use the group when calling the Allocate Consignment With Service Group endpoint.
To edit an existing carrier service group, click its Edit link.
To delete an existing carrier service group, click its Delete This Group link.
Using the allocate with service group endpoint
To call Allocate Consignment With Service Group, send a PUT
request to https://api.electioapp.com/allocation/{consignmentReference}/allocatewithservicegroup/{mpdCarrierServiceGroupReference}
, where {consignmentReference}
is the unique reference for the consignment you want to allocate and {mpdCarrierServiceGroupReference}
is the Service Group Code of the group you want to allocate within.
For full reference information on the Allocate Consignment With Service Group endpoint, see the Allocate Consignment With Service Group page of the API reference.
To find the Service Group Code for a particular group, log in to the Consignments UI, navigate to the Carrier Service Groups page (Settings > Carrier Service Groups), and locate the tile for that group. The Service Group Code is shown in the Code field.
Once the request is received, the Consignments platform uses allocation rules to eliminate any carrier services in the group that would not be suitable to take the consignment, allocates the consignment to the cheapest remaining service, and returns an Allocation Summary.
For information on using allocation rules, see the What Is An Allocation Rule? section of the Allocating Consignments To Carriers page.
Allocate consignment with service group example
The example shows a request to allocate a consignment with a {consignmentReference}
of EC-000-05B-MMA within a group that has a {mpdCarrierServiceGroupReference}
of valuableGoods.
Allocate consignment with service group request
PUT https://api.electioapp.com/allocation/EC-000-05B-MMA/allocatewithservicegroup/valuableGoods