Getting Consignment Data
PRO offers several endpoints that return consignment data. This page explains how to fetch data on an individual consignment, and how to search for consignments that meet a particular set of criteria.
Getting Data For a Specific Consignment
Perhaps the most straightforward way of getting PRO consignment data is to use the Get Consignment endpoint. This endpoint takes the consignmentReference
of the consignment you want to view as a path parameter, and returns full details for the specified consignment. The information returned is structured in a broadly similar way to a Create Consignment request, but can also (where applicable) include additional information, including:
- Information on the carrier service the consignment is allocated to
- Tracking references for each of the consignment's packages
- Information on the number of shipment legs required to deliver the consignment
- Label information, including whether labels have been printed yet and the date on which the labels were printed
- An
IsLate
flag indicating whether the consignment is late or not.
To call Get Consignment, send a GET
request to https://api.electioapp.com/consignments/{consignmentReference}
.
Note
For full reference information on the Get Consignment endpoint, see the API reference.
Example Get Consignment Call
The example below shows a simple Get Consignment request for an unallocated consignment containing just package and address details. For an example of a full Get Consignment request, see the Get Consignment API reference.
GET https://api.electioapp.com/consignments/EC-000-05C-ZB4
Checking a Consignment's Status
If you only need to check a consignment's status, you could use the Get Consignment Status endpoint instead of Get Consignment. Get Consignment Status takes a consignmentReference
as a path parameter, and returns only the consignment's current status and expected delivery date. Although Get Consignment returns both status and delivery date, it also returns a great deal of other information, which may not be useful if you simply want to check a consignment's progress.
To make a Get Consignment Status request, send a GET
request to https://api.electioapp.com/consignments/{consignmentReference}/status
.
GET https://api.electioapp.com/consignments/EC-000-087-01A/status
Searching For Consignments
As well as endpoints that return data based on a consignmentReference
, PRO also enables you to search for consignments that meet a particular set of criteria. PRO has two search endpoints: Get Consignments References and Search Consignments. Both of these endpoints enable you to specify consignment parameters in your request, and return any consignments that meet those parameters.
The two search endpoints differ in their responses: Get Consignments References returns only the consignmentReference
s of any consignments that meet the criteria, while Search Consignments returns a summary of each matching consignment. Search Consignments also includes a paging feature that enables you to specify how many results you want PRO to return, and to skip over a specified number of results.
Next Steps
- Learn how to allocate consignments at the Allocating Consignments to Carriers page.
- Learn how to get and print delivery labels at the Getting Labels page.
- Learn how to add consignments to a carrier manifest at the Manifesting Consignments page.