You can prepare shipments in Transsmart. The main difference from booking is that there are fewer validations for a prepared shipment. For example, when booking with a carrier, the carrier code and service level are required fields, but for a prepared shipment, these fields are not mandatory yet. This means you can prepare a shipment first and later complete it with all the required information before booking or booking and printing the shipment directly.
The call to create a prepared shipment in Transsmart:
POST request to /v2/shipments/{{account}}/CREATE to prepare a shipment (status NONE)
More information: https://devdocs.transsmart.com/#_2_1_shipment_booking
The request body should include at least a shipment reference. To complete a proper booking, you'll also need to provide additional details such as the sender's address, receiver's address, package information, and shipping details like carrier code, service level, and pickup date.
[{
"reference": "{{reference}}"
}]
You can continue sending this CREATE call for the same shipment reference as many times as you need. Just keep in mind one important detail: when we process the shipment creation, if we find an existing shipment with the same reference, we first delete the old shipment and then create a new one using the data you send. So, if you don't include all the fields that were already part of the shipment in our system, those missing fields will be cleared out.
If you do not have all the fields that were sent in by an application earlier in the flow, then it's important that you first do a GET shipment call, to get all fields of the prepared shipment, store them (temporarily / in the memory), and send the complete shipment body with the CREATE call.
The call to get all fields of a prepared shipment:
GET request to /v2/shipments/{{account}}/{{reference}}
More information: https://devdocs.transsmart.com/#_single_shipment_retrieval
You can continue making that call each time before sending a new CREATE call. Then, once the prepared shipment is ready, you can book or book and print using one of these calls:
POST request to /v2/shipments/{{account}}/BOOK to book a shipment (status NEW or BOOK)
or
POST request to /v2/shipments/{{account}}/PRINT to book a shipment and directly print a label (status LABL)
Same information as the CREATE call, but then with action BOOK or PRINT:
https://devdocs.transsmart.com/#_action_parameter
Important reminder! In our shipment creation and booking process, if we detect an existing shipment reference, we will delete the current shipment and create a new one using the updated information you provide. This means that if you don't include all the fields that were already part of the shipment in our system, those fields will be cleared out.