WooCommerce · Arazzo Workflow

WooCommerce Create Product and Targeted Coupon

Version 1.0.0

Create a product, then create a coupon restricted to that product.

1 workflow 2 source APIs 1 provider
View Spec View on GitHub E-CommerceOpen-SourceOrderProductWordPressArazzoWorkflows

Provider

woocommerce

Workflows

create-product-coupon
Create a product and a coupon restricted to that product.
Creates a product, creates a coupon limited to that product, and reads the coupon back to verify the product restriction.
3 steps inputs: couponAmount, couponCode, productName, regularPrice outputs: couponCode, couponId, productId
1
createProduct
Create the product that the coupon will be restricted to.
2
createCoupon
Create a percentage coupon whose applicable products are restricted to the new product.
3
getCoupon
Read the coupon back to confirm the product restriction persisted.

Source API Descriptions

Arazzo Workflow Specification

Raw ↑
arazzo: 1.0.1
info:
  title: WooCommerce Create Product and Targeted Coupon
  summary: Create a product, then create a coupon restricted to that product.
  description: >-
    Launches a product alongside a promotion scoped to it. The workflow creates
    a product, then creates a percentage coupon whose applicable product list is
    restricted to the new product, and finally reads the coupon back to confirm
    the restriction was stored. 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
sourceDescriptions:
- name: couponsApi
  url: ../openapi/woocommerce-coupons-api-openapi.yml
  type: openapi
- name: productsApi
  url: ../openapi/woocommerce-products-api-openapi.yml
  type: openapi
workflows:
- workflowId: create-product-coupon
  summary: Create a product and a coupon restricted to that product.
  description: >-
    Creates a product, creates a coupon limited to that product, and reads the
    coupon back to verify the product restriction.
  inputs:
    type: object
    required:
    - productName
    - regularPrice
    - couponCode
    - couponAmount
    properties:
      productName:
        type: string
        description: Name of the product to create.
      regularPrice:
        type: string
        description: Regular price of the product as a decimal string.
      couponCode:
        type: string
        description: Code for the coupon to create.
      couponAmount:
        type: string
        description: Discount amount as a decimal string.
  steps:
  - stepId: createProduct
    description: >-
      Create the product that the coupon will be restricted to.
    operationId: createProduct
    requestBody:
      contentType: application/json
      payload:
        name: $inputs.productName
        type: simple
        status: publish
        regular_price: $inputs.regularPrice
    successCriteria:
    - condition: $statusCode == 201
    outputs:
      productId: $response.body#/id
  - stepId: createCoupon
    description: >-
      Create a percentage coupon whose applicable products are restricted to the
      new product.
    operationId: createCoupon
    requestBody:
      contentType: application/json
      payload:
        code: $inputs.couponCode
        amount: $inputs.couponAmount
        discount_type: percent
        product_ids:
        - $steps.createProduct.outputs.productId
    successCriteria:
    - condition: $statusCode == 201
    outputs:
      couponId: $response.body#/id
  - stepId: getCoupon
    description: >-
      Read the coupon back to confirm the product restriction persisted.
    operationId: getCoupon
    parameters:
    - name: id
      in: path
      value: $steps.createCoupon.outputs.couponId
    successCriteria:
    - condition: $statusCode == 200
    outputs:
      couponId: $response.body#/id
      couponCode: $response.body#/code
  outputs:
    productId: $steps.createProduct.outputs.productId
    couponId: $steps.getCoupon.outputs.couponId
    couponCode: $steps.getCoupon.outputs.couponCode

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/woocommerce-create-product-coupon-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.