Create, print and follow-up consolidated shipments.
Go to:
- Create a consolidated shipment
- Fetch consolidated shipments
- Delete a parcel group from a consolidated shipment
- Delete a consolidated shipment
- Fetch a list of consolidated shipment documents
- Fetch a document for a consolidated shipment
- Close a consolidated shipment and create shipment documents
- Close a consolidated shipment and create shipment documents and exclude shipments
/consolidated-shipments
Consolidated-shipments is how you print continuously while holding the EDI-message.
Availability of consolidated shipment may vary by carrier and service. Please refer to Help > Code lists > "Services (ERP-connection XML)".
The REST API endpoints are only accessible via HTTPS and are located at api.unifaun.com.
https://api.unifaun.com/rs-extapi/v1
Before getting started you need to know your developer ID and create an API key.
Create a consolidated shipment
POST /consolidated-shipments
Creates an open consolidated shipment.
The shipment data in the request body must fulfill the specific requirements of the shipment's service. The request body must contain an option object with id 'consolidate'. PDF or ZPL documents will be created according to the provided print configuration. By default, the documents are returned as a URL. As an option the documents can be inline in the print.data object in the result. The print.data object is encoded in base64. The generated documents will only be available for one (1) hour.
Query parameters
returnFile |
boolean |
'true' if the PDF/ZPL file should be returned inline. |
Optional |
Body example
{
"printConfig": {
"target1Media": "thermo-190",
"target1Type": "zpl",
"target1Options": [
{
"key": "mode",
"value": "DT"
}
],
"target2Media": "laser-a4",
"target2Type": "pdf"
},
"shipment": {
"sender": {
"quickId": "SE",
"name": "nShift AB",
"address1": "Skeppsbron 5-6",
"zipcode": "41121",
"city": "GÖTEBORG",
"country": "SE",
"phone": "+46317253500",
"contact": "Contact person",
"mobile": "+46700000000",
"email": "contact.person@unifaun.com"
},
"receiver": {
"quickId": "RECV1",
"name": "Receiver One",
"address1": "Tegnérgatan 39",
"zipcode": "11359",
"city": "STOCKHOLM",
"country": "SE",
"phone": "031-7253501",
"contact": "Receiver contact person",
"mobile": "+46733000011",
"email": "test@test.com"
},
"service": {
"id": "FREEG"
},
"orderNo": "ORD-001",
"senderReference": "REF-001",
"options": [
{
"id": "CONSOLIDATE",
"key": "CONS-001"
}
],
"parcels": [
{
"volume": 0.1,
"copies": 1,
"weight": 1,
"valuePerParcel": true,
"contents": "Stuff",
"packageCode": "SH"
}
]
}
}
Response example
[
{
"href": "https://api.unifaun.com/rs-extapi/v1/consolidated-shipments/8477599",
"id": "8477599",
"status": "PRINTED",
"shipmentNo": "4382218446",
"orderNo": "ORD-001",
"route": null,
"routingCode": null,
"reference": "REF-001",
"serviceId": "FREEG",
"parcelCount": 1,
"sndName": "nShift AB",
"sndZipcode": "41121",
"sndCity": "GÖTEBORG",
"sndCountry": "SE",
"sndQuickId": "SE",
"rcvName": "Receiver One",
"rcvZipcode": "11359",
"rcvCity": "STOCKHOLM",
"rcvCountry": "SE",
"rcvQuickId": "RECV1",
"created": "2021-02-04T08:50:31.000+0000",
"changed": "2021-02-04T08:50:31.496+0000",
"shipDate": "2021-02-04T08:50:31.000+0000",
"returnShipment": false,
"normalShipment": true,
"consolidated": true,
"deliveryCode": null,
"profileGroup": "Grundprofilgrupp",
"parcels": [
{
"parcelNo": "373325382776640316",
"returnParcelNo": null,
"reference": null,
"partOrderNo": null
}
],
"pdfs": [],
"previousPdfs": null,
"prints": [
{
"href": "https://api.unifaun.com/rs-extapi/v1/consolidated-shipments/8477599/prints/192481387",
"id": "192481387",
"description": "Label",
"data": null,
"media": "thermo-190",
"type": "zpl"
}
],
"previousPrints": [],
"addons": []
}
]
Fetch consolidated shipments
GET /consolidated-shipments
Fetch a list of open consolidated shipments.
Use the query parameters to filter out which consolidated shipments will be returned in the list. Max. 50 consolidated shipments are returned per call.
Query parameters
dateFrom |
string |
The lower limit of a date interval. ISO-8601 date format, for example, 2020-01-01T01:00:00+00:00 |
Optional Must be used together with dateTo and dateType. |
dateTo |
string |
The upper limit of a date interval. ISO-8601 date format, for example, 2020-02-01T01:00:00+00:00 |
Optional Must be used together with dateFrom and dateType. |
dateType |
string |
The type of date. Valid values: created | ship |
Optional Must be used in combination with dateFrom and dateTo. |
searchField |
The field to search in. Valid values: orderNo | reference | shipmentNo |
Optional |
|
searchOp |
The operator used on the field. Valid values: equals | contains | startsWith |endsWith |
Optional |
|
searchValue |
string |
The value to search for. |
Optional |
status |
Shipment status Valid values: ready | invalid | failed | warned |
Optional |
Response example
[
{
"href": "https://api.unifaun.com/rs-extapi/v1/consolidated-shipments/8477599",
"id": "8477599",
"status": "OPEN",
"shipmentNo": "4382218446",
"orderNo": "ORD-001",
"route": null,
"routingCode": null,
"reference": "REF-001",
"serviceId": "FREEG",
"parcelCount": 2,
"sndName": "nShift AB",
"sndZipcode": "41121",
"sndCity": "GÖTEBORG",
"sndCountry": "SE",
"sndQuickId": "SE",
"rcvName": "Receiver One",
"rcvZipcode": "11359",
"rcvCity": "STOCKHOLM",
"rcvCountry": "SE",
"rcvQuickId": "RECV1",
"created": "2021-02-04T08:50:31.000+0000",
"changed": "2021-02-04T08:51:01.976+0000",
"shipDate": "2021-02-04T08:51:01.000+0000",
"returnShipment": false,
"normalShipment": true,
"consolidated": true,
"deliveryCode": null,
"profileGroup": null,
"parcels": null,
"pdfs": [
{
"href": "https://api.unifaun.com/rs-extapi/v1/consolidated-shipments/8477599/pdfs/192481387",
"id": "192481387",
"description": "Label",
"pdf": null,
"media": "thermo-190"
},
{
"href": "https://api.unifaun.com/rs-extapi/v1/consolidated-shipments/8477599/pdfs/192481569",
"id": "192481569",
"description": "Label",
"pdf": null,
"media": "thermo-190"
}
],
"previousPdfs": null,
"prints": null,
"previousPrints": null,
"addons": null
},
{
"href": "https://api.unifaun.com/rs-extapi/v1/consolidated-shipments/8477608",
"id": "8477608",
"status": "OPEN",
"shipmentNo": "4382221358",
"orderNo": "ORD-002",
"route": null,
"routingCode": null,
"reference": "REF-002",
"serviceId": "FREEG",
"parcelCount": 1,
"sndName": "nShift AB",
"sndZipcode": "41121",
"sndCity": "GÖTEBORG",
"sndCountry": "SE",
"sndQuickId": "SE",
"rcvName": "Receiver One",
"rcvZipcode": "11359",
"rcvCity": "STOCKHOLM",
"rcvCountry": "SE",
"rcvQuickId": "RECV1",
"created": "2021-02-04T08:51:36.000+0000",
"changed": "2021-02-04T08:51:36.224+0000",
"shipDate": "2021-02-04T08:51:36.000+0000",
"returnShipment": false,
"normalShipment": true,
"consolidated": true,
"deliveryCode": null,
"profileGroup": null,
"parcels": null,
"pdfs": [
{
"href": "https://api.unifaun.com/rs-extapi/v1/consolidated-shipments/8477608/pdfs/192481835",
"id": "192481835",
"description": "Label",
"pdf": null,
"media": "thermo-190"
}
],
"previousPdfs": null,
"prints": null,
"previousPrints": null,
"addons": null
}
]
Delete a parcel group from a consolidated shipment
DELETE /consolidate-shipments/{consolidatedId}/parcel/{partOrderNo}
Deletes a parcel group from the consolidated shipment.
No response body is returned when a parcel group is successfully deleted.
URI parameters
Consolidated Shipment ID |
string |
Identifies the consolidated shipment |
Required |
Part Order No |
string |
The parcel group order number |
Required |
Delete a consolidated shipment
DELETE /consolidated-shipments/{consolidatedId}
Deletes a consolidated shipment.
No response body is returned when a consolidated shipment is successfully deleted. A canceled consolidated shipment will be added to the shipment history to represent the previously printed documents related to the consolidated shipment.
URI parameters
Consolidated Shipment ID |
string |
Identifies the consolidated shipment |
Required |
Fetch a list of consolidated shipment documents
GET /consolidated-shipments/{consolidatedId}/prints
Fetch a list of all PDF or ZPL documents for a consolidated shipment.
By default, the documents are returned as a URL. As an option, the documents can be inline in the prints.data object in the result. The prints.data object is encoded in base64. Charset options are set in the target1Options array in the printConfig object. Generated documents are only available for one (1) hour.
URI parameters
Consolidated Shipment ID |
string |
Identifies the consolidated shipment |
Required |
Query parameters
returnFile |
boolean |
'true' if the PDF/ZPL file should be returned inline. |
Optional |
Response example
[
{
"href": "https://api.unifaun.com/rs-extapi/v1/consolidated-shipments/8477608/prints/192481835",
"id": "192481835",
"description": "Label",
"data": null,
"media": "thermo-190",
"type": "zpl"
},
{
"href": "https://api.unifaun.com/rs-extapi/v1/consolidated-shipments/8477608/prints/192482796",
"id": "192482796",
"description": "Label",
"data": null,
"media": "thermo-190",
"type": "zpl"
}
]
Fetch a document for a consolidated shipment
GET /consolidated-shipments/{consolidatedId}/prints/{printId}
Fetch a PDF or ZPL document for a consolidated shipment.
The document is returned as a raw binary stream from this endpoint. Make sure the request has the Accept header set to application/pdf for PDF documents or application/octet-stream for ZPL documents. Charset options are set in the target1Options array in the printConfig object.
URI parameters
Consolidated Shipment ID |
string |
Identifies the consolidated shipment |
Required |
Print ID |
string |
Identifies the PDF or ZPL document |
Required |
Close a consolidated shipment and create shipment documents
POST /consolidated-shipments/{consolidatedId}/shipments
Closes an open consolidated shipment and creates PDF or ZPL shipment documents.
By default the documents are returned as a URL. As an option the documents can be inline in the print.data object in the result. The print.data object is encoded in base64. The generated documents will only be available for one (1) hour.
URI parameters
Consolidated Shipment ID |
string |
Identifies the consolidated shipment |
Required |
Query parameters
returnFile |
boolean |
'true' if the PDF/ZPL file should be returned inline. |
Optional |
Body example
{
"target1Media": "thermo-190",
"target1Type": "zpl",
"target1Options": [
{
"key": "mode",
"value": "DT"
}
],
"target2Media": "laser-a4",
"target2Type": "pdf"
}
Response example
[
{
"href": "https://api.unifaun.com/rs-extapi/v1/shipments/10254169",
"id": "10254169",
"status": "PRINTED",
"shipmentNo": "4382221358",
"orderNo": "ORD-002",
"route": null,
"routingCode": null,
"reference": "REF-002",
"serviceId": "FREEG",
"parcelCount": 1,
"sndName": "nShift AB",
"sndZipcode": "41121",
"sndCity": "GÖTEBORG",
"sndCountry": "SE",
"sndQuickId": "SE",
"rcvName": "Receiver One",
"rcvZipcode": "11359",
"rcvCity": "STOCKHOLM",
"rcvCountry": "SE",
"rcvQuickId": "RECV1",
"created": "2021-02-04T09:06:27.052+0000",
"changed": "2021-02-04T09:06:27.052+0000",
"shipDate": "2021-02-04T08:53:45.000+0000",
"returnShipment": false,
"normalShipment": true,
"consolidated": false,
"deliveryCode": null,
"profileGroup": "Grundprofilgrupp",
"parcels": [
{
"parcelNo": "373325382776645236",
"returnParcelNo": null,
"reference": null,
"partOrderNo": null
}
],
"pdfs": [],
"previousPdfs": null,
"prints": [
{
"href": "https://api.unifaun.com/rs-extapi/v1/shipments/10254169/prints/192488957",
"id": "192488957",
"description": "Doc",
"data": null,
"media": "laser-a4",
"type": "pdf"
}
],
"previousPrints": null,
"addons": []
}
]
Close a consolidated shipment and create shipment documents and exclude shipments
POST /consolidated-shipments/{consolidatedId}/shipments/manifest
Closes an open consolidated shipment and creates PDF or ZPL shipment documents for the shipments identified by their part order number.
By default the documents are returned as a URL. As an option the documents can be inline in the print.data object in the result. The print.data object is encoded in base64. The generated documents will only be available for one (1) hour.
URI parameters
{
"printConfig": {
"target1Media": "thermo-190",
"target1Type": "zpl",
"target1Options": [
{
"key": "mode",
"value": "DT"
}
],
"target2Media": "laser-a4",
"target2Type": "pdf"
},
"partOrderNos": [
"PART-001",
"PART-002"
]
}
Response example
[
{
"href": "https://api.unifaun.com/rs-extapi/v1/consolidated-shipments/shipments/10254386",
"id": "10254386",
"status": "PRINTED",
"shipmentNo": "4382312199",
"orderNo": "ORD-001",
"route": null,
"routingCode": null,
"reference": "REF-001",
"serviceId": "FREEG",
"parcelCount": 2,
"sndName": "nShift AB",
"sndZipcode": "41121",
"sndCity": "GÖTEBORG",
"sndCountry": "SE",
"sndQuickId": "SE",
"rcvName": "Receiver One",
"rcvZipcode": "11359",
"rcvCity": "STOCKHOLM",
"rcvCountry": "SE",
"rcvQuickId": "RECV1",
"created": "2021-02-04T09:30:31.356+0000",
"changed": "2021-02-04T09:30:31.356+0000",
"shipDate": "2021-02-04T09:29:55.000+0000",
"returnShipment": false,
"normalShipment": true,
"consolidated": false,
"deliveryCode": null,
"profileGroup": "Grundprofilgrupp",
"parcels": [
{
"parcelNo": "373325382776804800",
"returnParcelNo": null,
"reference": null,
"partOrderNo": "PART-001"
},
{
"parcelNo": "373325382776804916",
"returnParcelNo": null,
"reference": null,
"partOrderNo": "PART-002"
}
],
"pdfs": [],
"previousPdfs": null,
"prints": [
{
"href": "https://api.unifaun.com/rs-extapi/v1/consolidated-shipments/shipments/10254386/prints/192500888",
"id": "192500888",
"description": "Doc",
"data": null,
"media": "laser-a4",
"type": "pdf"
}
],
"previousPrints": null,
"addons": []
}
]
For schema and testing, please refer to https://api.unifaun.com/rs-docs/.
For a description of properties, please see the Property reference guide.
For information about some crucial objects, please refer to REST API Objects.