Skip to main content

supplyCreateShipment

Creates a new supply shipment that tracks product movement from suppliers to your facilities.

Authentication

Requires authentication and the supply:create_shipment permission.

Behavior

  • If shipmentNumber is not provided, a unique number will be automatically generated based on your brand's configuration.
  • New shipments can be linked to an existing purchase order via purchaseOrderId.
  • When createFromPurchaseOrder is true and a purchaseOrderId is provided, shipment details will be pre-filled from the associated purchase order.
  • The shipment type (SHIPMENT or ASN) determines which fields are relevant:
    • For SHIPMENT type: use destinationName for intermediate destinations (e.g., port name).
    • For ASN type: use destinationBuildingId to specify the arrival facility.
  • Shipment creation is processed asynchronously and returns a process ID for tracking.

Validation Rules

  • brandId must be provided and the brand must exist.
  • shipmentType is required and must be either SHIPMENT or ASN.
  • If purchaseOrderId is provided, the purchase order must exist and belong to the specified brand.
  • For ASN type shipments, destinationBuildingId must be provided if the building destination is required by your configuration.
  • For SHIPMENT type shipments, destinationName can be used to specify intermediate destinations.
  • If shipmentItems are provided, they must reference valid products associated with the brand.

Possible Errors

  • Brand not found - The specified brand does not exist.
  • Purchase order not found - The specified purchase order does not exist.
  • Purchase order does not belong to this brand - The purchase order belongs to a different brand.
  • Destination building not found - The specified building ID does not exist.
  • Invalid shipment type - The shipment type is not SHIPMENT or ASN.
  • Destination building required for ASN shipments - An ASN type shipment was created without specifying destinationBuildingId.
supplyCreateShipment(
input: CreateSupplyShipmentInput!
): AsynchronousActionResponse

Arguments

supplyCreateShipment.input ● CreateSupplyShipmentInput! non-null input

Parameters for CreateSupplyShipment

Type

AsynchronousActionResponse object

Asynchronous action response type