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
x-realizes-capability-ids:
- BC-520.40
x-capability-derivation:
method: 'deterministic join: sourceDescriptions -> per-tag OpenAPI -> tag/capability edge. No classification at this step.'
min_confidence: 0.7
sources:
- capability_id: BC-520.40
capability_name: Order Fulfilment Management
spec: commerce-layer-shipments-api-openapi.yml
confidence: 0.72
model: Turbo EA Capabilities by Vincent Verdet — Turbo EA, https://github.com/vincentmakes/turbo-ea-capabilities, CC BY 4.0
sourceDescriptions:
- name: shipmentsApi
url: ../openapi/commerce-layer-shipments-api-openapi.yml
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
Calls without X-API-Key need no key. Calls with it need a paid plan — get a key.
Get an API key
Free tier, no form to fill in. Signing in shares your email address with us — we
store it to create your key and to recognise you if you sign in with another
provider. By signing up you are subscribing to the APIs.io and API Evangelist
newsletters — you can unsubscribe from any issue. See our
Privacy Policy and Terms.