arazzo: 1.0.1
info:
title: Shopify Add a Variant to an Existing Product
summary: Confirm a product exists, add a new variant to it, then read the variant list back.
description: >-
Extends an existing product with a new purchasable option. The workflow
first reads the target product to confirm it exists, adds a new variant with
its own price, SKU, and option value, and then lists the product's variants
so the caller can confirm the addition. Every step spells out its 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-2370.10
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-2370.10
capability_name: Item Master Data Management
spec: shopify-products-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: productVariantsApi
url: ../openapi/shopify-product-variants-api-openapi.yml
type: openapi
- name: productsApi
url: ../openapi/shopify-products-api-openapi.yml
type: openapi
workflows:
- workflowId: add-variant-to-product
summary: Add a new variant to an existing product and confirm via the variant list.
description: >-
Confirms the product, appends a new variant carrying price and option
values, and reads the variant list back to verify the addition.
inputs:
type: object
required:
- productId
- optionValue
- price
properties:
productId:
type: integer
description: The ID of the product to add the variant to.
optionValue:
type: string
description: The value for option1 (e.g. a size or color).
price:
type: string
description: The variant price as a decimal string.
sku:
type: string
description: Stock keeping unit for the new variant.
steps:
- stepId: confirmProduct
description: Read the target product to confirm it exists before adding a variant.
operationId: getProduct
parameters:
- name: product_id
in: path
value: $inputs.productId
successCriteria:
- condition: $statusCode == 200
outputs:
productId: $response.body#/product/id
- stepId: addVariant
description: >-
Add a new variant to the confirmed product with its own price, SKU, and
option value.
operationId: createProductVariant
parameters:
- name: product_id
in: path
value: $steps.confirmProduct.outputs.productId
requestBody:
contentType: application/json
payload:
variant:
option1: $inputs.optionValue
price: $inputs.price
sku: $inputs.sku
inventory_policy: deny
successCriteria:
- condition: $statusCode == 201
outputs:
variantId: $response.body#/variant/id
inventoryItemId: $response.body#/variant/inventory_item_id
- stepId: listVariants
description: List the product's variants to confirm the new variant was added.
operationId: listProductVariants
parameters:
- name: product_id
in: path
value: $steps.confirmProduct.outputs.productId
successCriteria:
- condition: $statusCode == 200
outputs:
variants: $response.body#/variants
outputs:
variantId: $steps.addVariant.outputs.variantId
inventoryItemId: $steps.addVariant.outputs.inventoryItemId
variants: $steps.listVariants.outputs.variants
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.