Recreate Shipment of the Package Command
This command deletes a package's existing shipment and shipping label and generates a new AWB, shipment and shipping label through the cargo company integration, using the selected (or currently assigned) cargo company.
Business Logic
Deletes the package's current shipment and shipping label records.
Generates a brand new AWB, shipment and shipping label via the cargo company integration.
If no cargo company is provided, the package's current cargo company is reused.
Difference from UPDATE_SHIPMENT_INFO_OF_THE_PACKAGE
UPDATE_SHIPMENT_INFO_OF_THE_PACKAGEupdates the existing shipment with a tracking number you provide (in-place update).RECREATE_SHIPMENT_OF_THE_PACKAGEproduces a new AWB through the cargo company integration, replacing the shipment and label entirely. This is the command to use when a package was assigned to the wrong cargo company.
Applicable Package States
Valid states:
packed,shipped,delivery_failed,attempted_delivery.The package remains in the same state after the command runs.
ready_for_customer_pickupis not supported (in-store flow — no cargo regeneration is required).
Endpoint
POST /api/v1/oms/packages/{packageId}/command/Recreate the shipment and shipping label of a package.
Prerequisites
Package must be in
packed,shipped,delivery_failed, orattempted_deliverystate.Package must have an existing shipment.
A valid state transition for the
RECREATE_SHIPMENT_OF_THE_PACKAGEcommand must exist for the package's current state.Either
transition(transition ID) orslug(transition slug) must be provided in the request body.
Request Requirements
If
transitionis provided,slugis not required.If
slugis provided,transitionis not required.At least one of
transitionorslugmust be present.input_parameters.cargo_companyis optional. When omitted, the package's current cargo company is used to generate the new AWB.
Side Effects
The existing shipment and shipping label are replaced with new ones.
A new AWB (tracking number) and label are produced by the cargo company integration.
Response
Returns HTTP 204 No Content on success.
The regenerated package/shipment can be retrieved separately if needed.
Authentication
Token-based authentication. Send the token in the request header:
Path Parameters
packageId
path
integer
Yes
The ID of the package to recreate shipment for
Request Body
input_parameters
object
Yes
Command input parameters.
input_parameters.cargo_company
integer
No
ID of an active cargo company to use for the new AWB. If omitted, the current one is reused.
transition
integer
No*
State transition ID to execute (required if slug is not provided).
slug
string
No*
State transition slug to execute (required if transition is not provided).
At least one of transition or slug is required.
Examples
Responses
204 No Content
Shipment recreated successfully. No response body.
400 Bad Request
Invalid parameters or validation errors.
Missing transition/slug:
404 Not Found
No package matches the given ID, or no command exists with the supplied transition ID/slug.
406 Not Acceptable
The command could not be completed. The response contains a descriptive message.
Last updated
Was this helpful?

