/consolidated-shipments
PREMIUM PLUS ADD-ON
Consolidated-shipments is how you print shipment documents continuously while holding the EDI message.
Important
Availability of consolidated shipment may vary by carrier and service. Please refer to Help > Code lists > "Service codes - Integration".
Note
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 |
Creates an open consolidated shipment.
Note
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
Parameter | Type | Description | Category |
---|---|---|---|
returnFile | boolean | 'true' if the PDF/ZPL file should be returned inline. | Optional |
{ "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" } ] } }
[ { "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 |
Fetch a list of open consolidated shipments.
Note
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
Parameter | Type | Description | Category |
---|---|---|---|
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 | Field to search in. Valid values: orderNo | reference | shipmentNo | Optional | |
searchOp | Operator used on the field. Valid values: equals | contains | startsWith |endsWith | Optional | |
searchValue | string | Value to search for. | Optional |
status | Shipment status Valid values: ready | invalid | failed | warned | Optional |
[ { "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 |
Deletes a parcel group from the consolidated shipment.
Note
No response body is returned when a parcel group is successfully deleted.
URI parameters
Parameter | Type | Description | Category |
---|---|---|---|
consolidatedId | string | Identifies the consolidated shipment | Required |
Part Order No | string | The parcel group order number | Required |
Delete a consolidated shipment
DELETE |
Deletes a consolidated shipment.
Note
No response body is returned when a consolidated shipment is successfully deleted.
A cancelled consolidated shipment will be added to the shipment history to represent the previously printed documents related to the consolidated shipment.
URI parameters
Parameter | Type | Description | Category |
---|---|---|---|
consolidatedId | string | Identifies the consolidated shipment | Required |
Fetch a list of consolidated shipment documents
GET |
Fetch a list of all PDF or ZPL documents for a consolidated shipment.
Note
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
Parameter | Type | Description | Category |
---|---|---|---|
consolidatedId | string | Identifies the consolidated shipment | Required |
Query parameters
Parameter | Type | Description | Category |
---|---|---|---|
returnFile | boolean | 'true' if the PDF/ZPL file should be returned inline. | Optional |
[ { "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 |
Fetch a PDF or ZPL document for a consolidated shipment.
Note
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
Parameter | Type | Description | Category |
---|---|---|---|
consolidatedId | string | Identifies the consolidated shipment | Required |
printId | string | Identifies the PDF or ZPL document. | Required |
Close a consolidated shipment and create shipment documents
POST |
Closes an open consolidated shipment and creates PDF or ZPL shipment documents.
Note
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
Parameter | Type | Description | Category |
---|---|---|---|
consolidatedId | string | Identifies the consolidated shipment | Required |
Query parameters
Parameter | Type | Description | Category |
---|---|---|---|
returnFile | boolean | 'true' if the PDF/ZPL file should be returned inline. | Optional |
{ "target1Media": "thermo-190", "target1Type": "zpl", "target1Options": [ { "key": "mode", "value": "DT" } ], "target2Media": "laser-a4", "target2Type": "pdf" }
[ { "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 |
Closes an open consolidated shipment and creates PDF or ZPL shipment documents for the shipments identified by their part order number.
Note
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
Parameter | Type | Description | Category |
---|---|---|---|
consolidatedId | string | Identifies the consolidated shipment | Required |
Query parameters
Parameter | Type | Description | Category |
---|---|---|---|
returnFile | boolean | 'true' if the PDF/ZPL file should be returned inline. | Optional |
{ "printConfig": { "target1Media": "thermo-190", "target1Type": "zpl", "target1Options": [ { "key": "mode", "value": "DT" } ], "target2Media": "laser-a4", "target2Type": "pdf" }, "partOrderNos": [ "PART-001", "PART-002" ] }
[ { "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": [] } ]
Tip
For schema and testing, please refer to https://api.unifaun.com/rs-docs/.
For description of properties, please refer to the Property reference guide.
For information about some crucial objects, please refer to REST API Objects.
Key | Value |
---|---|
mode | "DT" = Direct thermal printers "TT" = Thermal transfer printers |
rotate | "NONE" "180" = Rotate the printing 180 degrees |
dpi | "203" "300" |
charset | "CP850" (ZPL default) "UTF8" NoteEven when UTF8 is used, the standard font in the printer normally only supports cp850 characters. |
printmode | "T" = Tear-off (default) "P" = Peel-off (not available on S-300) "R" = Rewind (depends on printer model) "A" = Applicator (depends on printer model) "C" = Cutter (depends on printer model) "D" = Delayed cutter "F" = RFID "K" = Kiosk |
speed | (ZPL only) Min. value: 2 Max. value: 8 |
darkness | (ZPL only) Min. value: 0 Max. value: 30 |
compression | (ZPL only) Z64 = Binary compression ascii = ASCII compression CautionSome printers, even though supporting ZPL, may have problems with or not support the compression methods. |