arazzo: 1.0.1
info:
title: Commerce Layer Create SKU, Price It, and Read SKU Back
summary: Create a SKU, create a price for it in a price list, then retrieve the SKU.
description: >-
The full Commerce Layer catalog onboarding flow. The workflow creates a SKU
under a shipping category, creates a price for that SKU inside a price list,
and then retrieves the SKU so the caller can confirm its persisted
attributes. 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-440.20
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-440.20
capability_name: Price List Management
spec: commerce-layer-prices-api-openapi.yml
confidence: 0.82
model: Turbo EA Capabilities by Vincent Verdet — Turbo EA, https://github.com/vincentmakes/turbo-ea-capabilities, CC BY 4.0
sourceDescriptions:
- name: pricesApi
url: ../openapi/commerce-layer-prices-api-openapi.yml
type: openapi
- name: skusApi
url: ../openapi/commerce-layer-skus-api-openapi.yml
type: openapi
workflows:
- workflowId: create-sku-price-and-get
summary: Create a SKU, price it, and read the SKU back.
description: >-
Creates a SKU, creates a price for it in a price list, then retrieves the
SKU to confirm its persisted attributes.
inputs:
type: object
required:
- accessToken
- shippingCategoryId
- priceListId
- code
- name
- amountCents
properties:
accessToken:
type: string
description: Bearer access token for the Commerce Layer organization.
shippingCategoryId:
type: string
description: The id of the shipping category for the SKU.
priceListId:
type: string
description: The id of the price list the price belongs to.
code:
type: string
description: The unique SKU code.
name:
type: string
description: The SKU display name.
amountCents:
type: integer
description: The price amount in cents.
steps:
- stepId: createSku
description: Create the SKU under the supplied shipping category.
operationId: POST/skus
parameters:
- name: Authorization
in: header
value: "Bearer $inputs.accessToken"
requestBody:
contentType: application/vnd.api+json
payload:
data:
type: skus
attributes:
code: $inputs.code
name: $inputs.name
relationships:
shipping_category:
data:
type: shipping_categories
id: $inputs.shippingCategoryId
successCriteria:
- condition: $statusCode == 201
outputs:
skuId: $response.body#/data/id
- stepId: createPrice
description: Create a price for the SKU inside the supplied price list.
operationId: POST/prices
parameters:
- name: Authorization
in: header
value: "Bearer $inputs.accessToken"
requestBody:
contentType: application/vnd.api+json
payload:
data:
type: prices
attributes:
sku_code: $inputs.code
amount_cents: $inputs.amountCents
relationships:
price_list:
data:
type: price_lists
id: $inputs.priceListId
sku:
data:
type: skus
id: $steps.createSku.outputs.skuId
successCriteria:
- condition: $statusCode == 201
outputs:
priceId: $response.body#/data/id
- stepId: getSku
description: Retrieve the SKU to confirm its persisted attributes.
operationId: GET/skus/skuId
parameters:
- name: Authorization
in: header
value: "Bearer $inputs.accessToken"
- name: skuId
in: path
value: $steps.createSku.outputs.skuId
successCriteria:
- condition: $statusCode == 200
outputs:
code: $response.body#/data/attributes/code
name: $response.body#/data/attributes/name
outputs:
skuId: $steps.createSku.outputs.skuId
priceId: $steps.createPrice.outputs.priceId
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.