Package Commands
Operations for managing package state transitions and commands
Executes the UpdateShipmentLabelOfThePackageCommand to create or update the shipping label for a package.
Prerequisites:
Package must be in
preparing,waiting_cargo_label,packed, orshippedstatePackage must have an associated shipment
Valid state transition must exist from source state to destination state
Either
transition(transition ID) orslug(transition slug) must be provided in the request body
Request Requirements:
If
transitionis provided,slugis not requiredIf
slugis provided,transitionis not requiredAt least one of
transitionorslugmust be present
Process:
Validates package state and parameters
Checks that package has an associated shipment
Locks the package for processing
Calls ShippingLabelService to create/update shipping label
If package is in
waiting_cargo_labelstate and destination ispacked, transitions package stateFires PackagePackedStateEvent when transitioning to packed state
Validates that shipping label was successfully created
Side Effects:
Shipping label is created or updated for the package
Package state may be transitioned (waiting_cargo_label → packed)
PackagePackedStateEvent is triggered on state transition
Label is retrieved from cargo company integration
Response:
Returns HTTP 204 No Content on success
The updated package with shipping label can be retrieved separately if needed
API key for authentication
The ID of the package to update shipment label for
12345Request body for updating shipment label. Either transition or slug must be provided.
- If
transitionis provided,slugis not required - If
slugis provided,transitionis not required - Providing both is allowed but not necessary
State transition ID to execute (required if slug is not provided)
925State transition slug to execute (required if transition is not provided)
UPDATE_SHIPMENT_LABELShipment label update completed successfully (No Content)
Bad Request - Invalid parameters or validation errors
Not Found - No Package matches the given query
Not Acceptable - Command execution failed or post-validation failed
No content
Last updated
Was this helpful?

