arazzo: 1.0.1 info: title: Commerce Layer Create Shipment for Order summary: Create a shipment for an order from a stock location, then advance it toward ready to ship. description: >- A Commerce Layer fulfillment flow. The workflow creates a shipment tied to an order and an inventory stock location, then patches the shipment with the documented _ready_to_ship transition flag to move it forward in its lifecycle. Every step spells out its JSON:API request inline so the flow can be read and executed without opening the underlying OpenAPI description. version: 1.0.0 sourceDescriptions: - name: coreApi url: ../openapi/commerce-layer-core-api-openapi.json type: openapi workflows: - workflowId: create-shipment-for-order summary: Create a shipment for an order and mark it ready to ship. description: >- Creates a shipment referencing an order and an inventory stock location, then patches it with the documented _ready_to_ship transition flag. inputs: type: object required: - accessToken - orderId - inventoryStockLocationId properties: accessToken: type: string description: Bearer access token for the Commerce Layer organization. orderId: type: string description: The id of the order the shipment belongs to. inventoryStockLocationId: type: string description: The id of the inventory stock location fulfilling the shipment. steps: - stepId: createShipment description: Create the shipment for the order from the stock location. operationId: POST/shipments parameters: - name: Authorization in: header value: "Bearer $inputs.accessToken" requestBody: contentType: application/vnd.api+json payload: data: type: shipments relationships: order: data: type: orders id: $inputs.orderId inventory_stock_location: data: type: inventory_stock_locations id: $inputs.inventoryStockLocationId successCriteria: - condition: $statusCode == 201 outputs: shipmentId: $response.body#/data/id status: $response.body#/data/attributes/status - stepId: markReadyToShip description: Toggle the documented _ready_to_ship transition flag on the shipment. operationId: PATCH/shipments/shipmentId parameters: - name: Authorization in: header value: "Bearer $inputs.accessToken" - name: shipmentId in: path value: $steps.createShipment.outputs.shipmentId requestBody: contentType: application/vnd.api+json payload: data: type: shipments id: $steps.createShipment.outputs.shipmentId attributes: _ready_to_ship: true successCriteria: - condition: $statusCode == 200 outputs: status: $response.body#/data/attributes/status outputs: shipmentId: $steps.createShipment.outputs.shipmentId status: $steps.markReadyToShip.outputs.status