Commerce Layer · Arazzo Workflow

Commerce Layer Add Line Item and Read It Back

Version 1.0.0

Add a SKU line item to an existing order and retrieve the created line item.

1 workflow 1 source API 1 provider
View Spec View on GitHub Headless CommerceComposable CommerceAPI-FirstE-CommerceJSON:APIAuthenticationMulti-MarketMulti-CurrencyB2CB2BSubscriptionPromotionsInventoryOrder ManagementCheckoutArazzoWorkflows

Provider

commerce-layer

Workflows

add-line-item-get-line-item
Add a SKU line item to an order and read it back.
Creates a line item on the supplied order, then retrieves the line item to expose its resolved pricing attributes.
2 steps inputs: accessToken, orderId, quantity, skuCode outputs: lineItemId, totalAmountCents
1
addLineItem
Add the SKU line item to the supplied order.
2
getLineItem
Retrieve the created line item to read its resolved attributes.

Source API Descriptions

Arazzo Workflow Specification

Raw ↑
arazzo: 1.0.1
info:
  title: Commerce Layer Add Line Item and Read It Back
  summary: Add a SKU line item to an existing order and retrieve the created line item.
  description: >-
    A focused Commerce Layer cart operation. The workflow adds a SKU line item
    to an existing order and then retrieves that line item so the caller can
    read the resolved name, unit amount, and total. 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: lineItemsApi
  url: ../openapi/commerce-layer-line-items-api-openapi.yml
  type: openapi
workflows:
- workflowId: add-line-item-get-line-item
  summary: Add a SKU line item to an order and read it back.
  description: >-
    Creates a line item on the supplied order, then retrieves the line item to
    expose its resolved pricing attributes.
  inputs:
    type: object
    required:
    - accessToken
    - orderId
    - skuCode
    - quantity
    properties:
      accessToken:
        type: string
        description: Bearer access token for the Commerce Layer organization.
      orderId:
        type: string
        description: The id of the order to add the line item to.
      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: addLineItem
    description: Add the SKU line item to the supplied 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: $inputs.orderId
    successCriteria:
    - condition: $statusCode == 201
    outputs:
      lineItemId: $response.body#/data/id
  - stepId: getLineItem
    description: Retrieve the created line item to read its resolved attributes.
    operationId: GET/line_items/lineItemId
    parameters:
    - name: Authorization
      in: header
      value: "Bearer $inputs.accessToken"
    - name: lineItemId
      in: path
      value: $steps.addLineItem.outputs.lineItemId
    successCriteria:
    - condition: $statusCode == 200
    outputs:
      name: $response.body#/data/attributes/name
      unitAmountCents: $response.body#/data/attributes/unit_amount_cents
      totalAmountCents: $response.body#/data/attributes/total_amount_cents
  outputs:
    lineItemId: $steps.addLineItem.outputs.lineItemId
    totalAmountCents: $steps.getLineItem.outputs.totalAmountCents

Work with this as data

Every workflow here is available over the APIs.io API and to AI agents over MCP.

MCP server

One button, every client — Claude, Cursor, VS Code and the rest.

https://apis.io/mcp

Tools for arazzo workflows

4 MCP tools reach this
  • find_arazzoBrowse and filter every workflow in the catalog.
  • apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.
  • resolveTurn a domain, URL or GitHub org into the provider it belongs to.
  • find_cohortsEvery scored population of providers in the catalog.
All 92 tools →

Call it yourself

curl for this page
This workflow
curl "https://apis.io/api/v1/arazzo/commerce-layer-add-line-item-get-line-item-workflow"
All arazzo workflows
curl "https://apis.io/api/v1/arazzo?limit=25"

Discovery needs no key. Ratings and market analysis are Pro.

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. See our Privacy Policy and Terms.

A second provider on the same verified email joins the account you already have.