arazzo: 1.0.1 info: title: Commerce Layer Guest Order Add Line Item and Place summary: Open a guest order, add a SKU line item, then place the order in one flow. description: >- A streamlined Commerce Layer guest checkout flow. The workflow opens a guest order in a market with a customer email, adds a SKU line item, and then patches the order with the documented _place transition flag to submit it. 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: guest-order-add-line-item-place summary: Open a guest order, add a line item, and place it. description: >- Creates a guest order with a customer email, adds a SKU line item, then patches the order with the documented _place flag to submit it. inputs: type: object required: - accessToken - marketId - customerEmail - skuCode - quantity properties: accessToken: type: string description: Bearer access token for the Commerce Layer organization. marketId: type: string description: The id of the market the order belongs to. customerEmail: type: string description: The guest customer email for the order. skuCode: type: string description: The SKU code to add as a line item. quantity: type: integer description: The quantity of the SKU to add. steps: - stepId: createGuestOrder description: Open a guest order in the market with the customer email. operationId: POST/orders parameters: - name: Authorization in: header value: "Bearer $inputs.accessToken" requestBody: contentType: application/vnd.api+json payload: data: type: orders attributes: guest: true customer_email: $inputs.customerEmail relationships: market: data: type: markets id: $inputs.marketId successCriteria: - condition: $statusCode == 201 outputs: orderId: $response.body#/data/id - stepId: addLineItem description: Add a SKU line item to the guest order. operationId: POST/line_items parameters: - name: Authorization in: header value: "Bearer $inputs.accessToken" requestBody: contentType: application/vnd.api+json payload: data: type: line_items attributes: sku_code: $inputs.skuCode quantity: $inputs.quantity relationships: order: data: type: orders id: $steps.createGuestOrder.outputs.orderId successCriteria: - condition: $statusCode == 201 outputs: lineItemId: $response.body#/data/id - stepId: placeOrder description: Toggle the documented _place transition flag to submit the order. operationId: PATCH/orders/orderId parameters: - name: Authorization in: header value: "Bearer $inputs.accessToken" - name: orderId in: path value: $steps.createGuestOrder.outputs.orderId requestBody: contentType: application/vnd.api+json payload: data: type: orders id: $steps.createGuestOrder.outputs.orderId attributes: _place: true successCriteria: - condition: $statusCode == 200 outputs: status: $response.body#/data/attributes/status outputs: orderId: $steps.createGuestOrder.outputs.orderId lineItemId: $steps.addLineItem.outputs.lineItemId status: $steps.placeOrder.outputs.status