Skip to main content

supplyRevertShipment

Reverts a shipment to the previous status in its lifecycle.

This mutation transitions a shipment to its previous logical status based on the current state. The mutation requires authentication and the user must have appropriate permissions on the associated brand.

Status Flow

Shipments can be reverted through the following transitions:

  • in_transitpending
  • at_destinationin_transit
  • deliveredat_destination

The pending status is the initial state and cannot be reverted further. The canceled status is a terminal state and cannot be reverted.

Auditing

Each status transition is recorded with the user who performed the action and the timestamp, creating a complete audit trail in the shipment's status history.

Errors

  • Returns "Shipment not found" if the shipment ID doesn't exist
  • Returns "Shipment is in initial state and cannot be reverted" if trying to revert from pending
  • Returns "Cannot revert a canceled shipment" if the shipment is in canceled status
  • Requires authentication (login_required)
  • Validates user permissions on the brand
supplyRevertShipment(
input: RevertShipmentInput!
): SupplyShipment

Arguments

supplyRevertShipment.input ● RevertShipmentInput! non-null input

Parameters for RevertShipment

Type

SupplyShipment object

Represents a shipment in the supply chain system.

Shipments are physical movements of goods through the supply chain. They can be linked to purchase orders and track the movement of materials from origin to destination. Each shipment maintains its status, payment information, and relationship to other shipments (hierarchical parent-child structure).

Shipment Types

  • **Shipment**: Direct shipment to a final destination (building/warehouse)
  • **ASN**: Advanced Shipment Notice, typically an intermediate shipment to a port or hub

Status Lifecycle

Shipments progress through various statuses: pending, in_transit, at_destination, delivered, or canceled

Each shipment includes associated items, status history, brand information, purchase order reference, and destination facility information. Shipments can have parent-child relationships for consolidated/split shipment scenarios.