Creates shipments and stored shipments from a prepared shipment.
Sections in this article:
- Fetch a prepared shipment
- Delete a prepared shipment
- Create a shipment from a prepared shipment
- Create a stored shipment from a prepared shipment
Fetch a prepared shipment
GET /prepared-shipments/{prepareId}
Fetches a prepared shipment that was previously created.
URI parameters
prepareId |
string |
Identification of the prepared shipment. |
Required |
Response example
{
"sender": {
"quickId": "1",
"name": "nShift AB",
"address1": "Skeppsbron 5-6",
"zipcode": "41121",
"city": "GÖTEBORG",
"country": "SE",
"phone": "+46 31 725 35 00",
"email": "email1@example.com"
},
"senderPartners": [
{
"id": "PLAB",
"custNo": "XX"
}
],
"receiver": {
"name": "nShift AB",
"address1": "Tegnérgatan 34",
"zipcode": "11359",
"city": "STOCKHOLM",
"country": "SE",
"phone": "+46 8 34 35 15",
"email": "email2@example.com"
},
"service": {
"id": "P15"
},
"parcels": [
{
"copies": "1",
"weight": "37.5",
"contents": "important things",
"valuePerParcel": true
}
],
"orderNo": "order number 123",
"senderReference": "sender ref 234",
"receiverReference": "receiver ref 345",
"options": [
{
"message": "This is order number 123",
"to": "email2@example.com",
"id": "ENOT",
"languageCode": "SE",
"from": "email1@example.com"
}
]
}
For a description of properties, please refer to the Property reference guide.
For schema and testing, please refer to https://api.unifaun.com/rs-docs/ and navigate to /prepared-shipments/{prepareId} GET.
Delete a prepared shipment
DELETE /prepared-shipments/{prepareId}
Deletes a prepared shipment.
When the prepared shipment is deleted no further operation will be possible on the prepared shipment ID.
URI parameters
prepareId |
string |
Identification of the partial shipment |
Required |
No response body is returned when a prepared shipment is successfully deleted.
For a description of properties, please refer to the Property reference guide. For schema and testing, please refer to https://api.unifaun.com/rs-docs/ and navigate to /prepared-shipments/{prepareId} DELETE.
Create a shipment from a prepared shipment
POST /prepared-shipments/{prepareId}/shipments
Creates a shipment from a prepared shipment.
The shipment data in the request body must fulfill the specific requirements of the shipment's service. Multiple shipments can be created if the stored shipment represents a combined normal and return shipment. 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
prepareId |
string |
Identification of the prepared shipment. |
Required |
Query parameters
returnFile |
boolean |
'true' if the PDF/ZPL file should be returned inline. |
Optional |
keepPreparedShipment |
boolean |
The prepare ID should be used again. For example, if an order contains shipments that should be sent from different locations, if an item in the order is backordered or for a return service. |
Optional |
Body example
{
"printConfig": {
"target1Media": "thermo-250",
"target1Type": "zpl",
"target1XOffset": 0,
"target1YOffset": 0,
"target1Options": [
{
"key": "mode",
"value": "DT"
}
],
"target2Media": "laser-a4",
"target2Type": "pdf",
"target2XOffset": 0,
"target2YOffset": 0,
"target3Media": null,
"target3Type": null,
"target3XOffset": 0,
"target3YOffset": 0,
"target4Media": null,
"target4Type": null,
"target4XOffset": 0,
"target4YOffset": 0
},
"shipment": {
"parcels": [
{
"copies": "1",
"weight": "2.75",
"contents": "important things",
"valuePerParcel": true
}
],
"orderNo": "order number 123",
"senderReference": "sender ref 234",
"receiverReference": "receiver ref 345",
"options": [
{
"message": "This is order number 123",
"to": "email2@example.com",
"id": "ENOT",
"languageCode": "SE",
"from": "email1@example.com"
}
]
}
}
Response example
{
"href": "https://api.unifaun.com/ufoweb-prod-202002111305/rs-extapi/v1/stored-shipments/4127538",
"id": "4127538",
"sndName": "nShift AB",
"sndZipcode": "41121",
"sndCity": "GÖTEBORG",
"sndCountry": "SE",
"rcvName": "nShift AB",
"rcvZipcode": "11359",
"rcvCity": "STOCKHOLM",
"rcvCountry": "SE",
"serviceId": "P15",
"orderNo": "order number 123",
"reference": "sender ref 234",
"parcelCount": 1,
"normalShipment": true,
"returnShipment": false,
"status": "READY",
"shipDate": "2015-06-02T14:05:56.342+0000",
"created": "2015-06-02T14:05:56.569+0000",
"changed": "2015-06-02T14:05:56.569+0000",
"statuses": [
{
"message": "maximum value (35) exceeded",
"messageCode": "MaximumFlt",
"field": "ParcelGroup_Weight",
"location": "ParcelGroupWeight",
"type": "ignorable"
}
]
}
For a description of properties, please refer to the Property reference guide.
For schema and testing, please refer to https://api.unifaun.com/rs-docs/ and navigate to /prepared-shipments/{prepareId}/shipments POST.
Create a stored shipment from a prepared shipment
POST /prepared-shipments/{prepareId}/stored-shipments
Creates a stored shipment from a prepared shipment.
The shipment data in the request body must fulfill the specific requirements of the shipment's service.
URI parameters
prepareId |
string |
Identification of the prepared shipment. |
Required |
Query parameters
keepPreparedShipment |
boolean |
The prepare ID should be used again. For example, if an order contains shipments that should be sent from different locations, if an item in the order is backordered or for a return service. |
Optional |
Body example
{
"parcels": [
{
"copies": "1",
"weight": "37.5",
"contents": "important things",
"valuePerParcel": true
}
],
"orderNo": "order number 123",
"senderReference": "sender ref 234",
"receiverReference": "receiver ref 345",
"options": [
{
"message": "This is order number 123",
"to": "email2@example.com",
"id": "ENOT",
"languageCode": "SE",
"from": "email1@example.com"
}
]
}
Response example
{
"href": "https://api.unifaun.com/ufoweb-prod-202002111305/rs-extapi/v1/stored-shipments/4127538",
"id": "4127538",
"sndName": "nShift AB",
"sndZipcode": "41121",
"sndCity": "GÖTEBORG",
"sndCountry": "SE",
"rcvName": "nShift AB",
"rcvZipcode": "11359",
"rcvCity": "STOCKHOLM",
"rcvCountry": "SE",
"serviceId": "P15",
"orderNo": "order number 123",
"reference": "sender ref 234",
"parcelCount": 1,
"normalShipment": true,
"returnShipment": false,
"status": "READY",
"shipDate": "2015-06-02T14:05:56.342+0000",
"created": "2015-06-02T14:05:56.569+0000",
"changed": "2015-06-02T14:05:56.569+0000",
"statuses": [
{
"message": "maximum value (35) exceeded",
"messageCode": "MaximumFlt",
"field": "ParcelGroup_Weight",
"location": "ParcelGroupWeight",
"type": "ignorable"
}
]
}
For a description of properties, please refer to the Property reference guide.
For schema and testing, please refer to https://api.unifaun.com/rs-docs/ and navigate to /prepared-shipments/stored-shipments POST.