/stored-shipments
Stored-shipments is how you store shipments that don't require immediate printing. Stored shipments can be printed either via the API or manually from the nShift Delivery interface.
Huomaa
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 and store a shipment
POST |
Creates a shipment and stores it for later printing.
Huomaa
Only a limited number of values are needed in the shipment data of the request body. But for a stored shipment to be created as READY
it must fulfill the specific requirements of the shipment service.
Stored shipment status
:
READY
= The stored shipment is ready for printing.WARNED
= The stored shipment has some validation error(s) that can be ignored.INVALID
= The stored shipment has some validation error(s) that must be corrected.FAILED
= The stored shipment was interrupted in the production process and couldn't be created.
{ "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": { "addons": [], "id": "FREEG", "normalShipment": true }, "orderNo": "ORD-001", "senderReference": "REF-001", "options": [ { "from": "contact.person@unifaun.com", "id": "enot", "to": "test@test.com", "message": "Your stuff is on the way!" } ], "parcels": [ { "volume": 0.1, "copies": 1, "weight": 1, "valuePerParcel": true, "contents": "Stuff", "packageCode": "SH" } ] }
{ "href": "https://api.unifaun.com/ufoweb-prod-202102031034/rs-extapi/v1/stored-shipments/8475754", "id": "8475754", "status": "READY", "orderNo": "ORD-001", "reference": "REF-001", "serviceId": "FREEG", "parcelCount": 1, "sndName": "nShift AB", "sndZipcode": "41121", "sndCity": "GÖTEBORG", "sndCountry": "SE", "rcvName": "Receiver One", "rcvZipcode": "11359", "rcvCity": "STOCKHOLM", "rcvCountry": "SE", "created": "2021-02-03T15:37:32.175+0000", "changed": "2021-02-03T15:37:32.175+0000", "shipDate": "2021-02-03T15:37:32.162+0000", "returnShipment": false, "normalShipment": true, "profileGroup": "Grundprofilgrupp", "statuses": null, "addons": [] }
Fetch stored shipments
GET |
Fetch a list of stored shipments.
Huomaa
Use the query parameters to filter out which stored shipments will be returned in the list.
Max. 50 stored shipments will be returned.
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 | 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: | Optional |
[ { "href": "https://api.unifaun.com/rs-extapi/v1/stored-shipments/8475754", "id": "8475754", "status": "READY", "orderNo": "ORD-001", "reference": "REF-001", "serviceId": "FREEG", "parcelCount": 1, "sndName": "nShift AB", "sndZipcode": "41121", "sndCity": "GÖTEBORG", "sndCountry": "SE", "rcvName": "Receiver One", "rcvZipcode": "11359", "rcvCity": "STOCKHOLM", "rcvCountry": "SE", "created": "2021-02-03T15:37:32.175+0000", "changed": "2021-02-03T15:37:32.175+0000", "shipDate": "2021-02-03T15:37:32.162+0000", "returnShipment": false, "normalShipment": true, "profileGroup": null, "statuses": null, "addons": [ "|" ] } ]
Delete a stored shipment
DELETE |
Deletes a stored shipment.
Huomaa
No response body is returned when a stored shipment is successfully deleted.
URI parameters
Parameter | Type | Description | Category |
---|---|---|---|
Stored Shipment ID | string | Identifies the stored shipment | Required |
Create a shipment from a stored shipment
POST |
Creates and prints a shipment from a stored shipment. Creates more shipments if the stored shipment represents a combined normal and return shipment.
Huomaa
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.
URI parameters
Parameter | Type | Description | Category |
---|---|---|---|
Stored Shipment ID | string | Identifies the stored 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/10252401", "id": "10252401", "status": "PRINTED", "shipmentNo": "4381701418", "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-03T15:45:30.297+0000", "changed": "2021-02-03T15:45:30.297+0000", "shipDate": "2021-02-03T15:37:32.000+0000", "returnShipment": false, "normalShipment": true, "consolidated": false, "deliveryCode": null, "profileGroup": "Grundprofilgrupp", "parcels": [ { "parcelNo": "373325382775707409", "returnParcelNo": null, "reference": null, "partOrderNo": null } ], "pdfs": [], "previousPdfs": null, "prints": [ { "href": "https://api.unifaun.com/rs-extapi/v1/shipments/10252401/prints/192371841", "id": "192371841", "description": "Label", "data": null, "media": "thermo-190", "type": "zpl" }, { "href": "https://api.unifaun.com/rs-extapi/v1/shipments/10252401/prints/192371842", "id": "192371842", "description": "Doc", "data": null, "media": "laser-a4", "type": "pdf" } ], "previousPrints": null, "addons": [] } ]
Vihje
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.