# Example workflows

Each workflow below shows what to ask, which tools the agent calls, and what
to check. Change the names, prices and dates to fit your shop. The agent
works out the IDs itself, so you can talk about products and customers by
name or email.

The first four workflows use store setup tools and work on every plan. The
rest need [Subbly X](/developer-resources/subbly-mcp/plans-and-limits).

## Launch a subscription product

> Create a monthly coffee subscription called “Roaster's Choice” at $24 a
> month. Ship each box 3 days after billing. Keep it unpublished.

1. `create_subscription_product` makes the product. It starts unpublished
   and with no plans.
2. `create_plan` adds the monthly plan: `frequencyUnit: month`,
   `frequencyCount: 1`, `price: 2400` and a shipment schedule.
3. The agent shows you the result. When you are happy, ask it to publish:
   `publish_subscription_product`.

**Good to know.** Prices are in cents. A physical product needs a shipment
schedule on each plan; a digital product must not have one. Ask for a
3-month prepaid plan in the same message and the agent adds a second plan.

## Run a promotion

> Create a coupon SPRING20 for 20% off the first box. It ends on 31 March
> and each customer can use it once.

1. `create_coupon` with `percentOff: 20`, `duration: once`,
   `limitOnePerCustomer: 1` and `redeemBy` set to the end date.
2. `list_coupons` or `get_coupon` to show you the saved coupon.

**Good to know.** A percentage or amount off is set when the coupon is
created and cannot change later; make a new coupon instead. Conditions,
“these products only” rules and gifts need coupon customisation, which
every current plan has.

## Restock low inventory

> Which active inventory items have fewer than 20 in stock? Set the
> Ethiopia Yirgacheffe beans to 150.

1. `list_inventory_items` with `status: 1`. The agent pages through the
   list and picks the items under 20.
2. `update_inventory_item` sets the new `stockCount`.

**Good to know.** There is no stock filter on the list, so a large catalog
takes a few pages. Search by name or SKU with `query` when you know the
item.

## Tidy up the catalog

> List the products I have not published, and archive the ones with “test”
> in the name. Ask me before you archive anything.

1. `list_products` with `published: 0`.
2. The agent shows you the matches and waits for your answer.
3. `archive_subscription_product` or `archive_one_time_product` for each
   product you confirm.

**Good to know.** Archiving cannot be undone. To hide a product for a while,
ask the agent to unpublish it instead.

## Help a customer

> Find jane@example.com. She is away until 1 February: skip her coffee
> subscription until then.

1. `list_customers` with `emails: ["jane@example.com"]`.
2. `list_subscriptions` with her `customerId`.
3. `skip_subscription` with `skipUntil: "2027-02-01"`.

**Good to know.** A subscription that is paused, past due or already
skipping cannot skip. Subbly runs subscription changes one at a time per
shop, so ask for one change, check it, then ask for the next.

## Ship today's orders

> Show me the orders waiting to ship that were created this week, then
> mark order 48213 as shipped.

1. `list_orders` with `statuses: ["awaiting_delivery"]` and a `createdAt`
   range.
2. `ship_order` with the order ID.

**Good to know.** `ship_order` sends the customer the “order shipped” email
straight away and counts the shipment on the subscription. Check the order
number before you confirm.

## Chase failed payments

> List invoices that are past due from last month, with the customer's
> email.

1. `list_invoices` with `statuses: ["past_due"]`, a `createdAt` range and
   `expand: ["customer"]`.
2. To charge again, ask the agent to pick a date and time:
   `schedule_invoice_payment` sets the next payment attempt.
3. If the customer paid you another way, `mark_invoice_as_paid` records the
   payment without a charge.

**Good to know.** `void_invoice` and `forgive_invoice` close an invoice for
good; forgiving also clears the subscription's past-due state. Read the
amount and the customer before you allow either one.

## Fix webhook deliveries

> Did any webhook deliveries fail today? Retry them.

1. `list_webhook_deliveries` with `status: failed` and a `createdAt` range.
2. `get_webhook_delivery` for the attempts of one delivery, to see the
   error your endpoint returned.
3. `retry_webhook_delivery` for each one. The endpoint must be enabled.

**Good to know.** A shop can retry up to 60 deliveries a minute. If your
endpoint is still down, fix it first. `ping_webhook_endpoint` sends it a
test event, so you can see when it answers again.

## Prompts to try

Copy one of these and change the details.

```text title="Store setup — every plan"
List my published subscription products with their plans.
Create a one-time product called [name], unpublished.
Add a 3-month plan at $[price] to [product].
Create a [percent]% coupon [CODE] that ends on [date].
Which inventory items in the [group] group are inactive?
Add the [tag] tag to [product].
```

```text title="Running the business — Subbly X"
Find the customer [email] and show their subscriptions.
Pause subscription [ID] / Resume subscription [ID].
Switch subscription [ID] to the [plan] plan.
Which orders are still awaiting delivery from last week?
List past due invoices from [month].
Add a note to [email]: [note].
```

```text title="Webhooks — Subbly X"
List my webhook endpoints and what events they receive.
Create an endpoint at [URL] for order.created events.
Show failed deliveries for [endpoint] since yesterday.
Rotate the secret of endpoint [ID].
```

## Next steps

- [Tools](/developer-resources/subbly-mcp/tools) — every tool the agent
  can call.
- [Security and access](/developer-resources/subbly-mcp/security-and-access)
  — good habits before you hand an agent big changes.
