# Hermoso: create_shopify_discount_code · Hermoso developer docs

> Machine-readable twin of https://hermoso.ai/docs/reference/publish/create_shopify_discount_code/. Generated from the shipped page. Do not edit by hand.
> Full agent guide: https://hermoso.ai/llms.txt · MCP: https://app.hermoso.ai/mcp

[Docs](https://hermoso.ai/docs/) / [Tool reference](https://hermoso.ai/docs/reference/) / [Publishing & scheduling](https://hermoso.ai/docs/reference/publish/) / create_shopify_discount_code

# `create_shopify_discount_code`

Create a Shopify discount code destructive

Area: SHOPIFY: the merchant's own storefront · [Publishing & scheduling](https://hermoso.ai/docs/reference/publish/). Generated from the running MCP server, like the rest of the [tool reference](https://hermoso.ai/docs/reference/).

## Description

Create a discount code customers type at checkout on the merchant's Shopify store, for every product: percentOff (20 = 20% off) OR amountOff (a fixed amount in the store's currency), with an optional minimum purchase (minSubtotal OR minQuantity, not both), startsAt (default now), endsAt, usageLimit (total uses) and oncePerCustomer. THE CODE WORKS AT THE LIVE CHECKOUT AND EVERY USE IS MONEY OFF THE STORE'S SALES, so without confirm:true NOTHING is created and the reply describes exactly the code that would be: show the user, get a yes, then call again with confirm:true. The reply after creating is Shopify's own copy of the code, read back. Nothing the user wrote is changed: an impossible value (a code with a space, 0% or over 100%, an end date in the past) is refused with the reason. The first time, the store may need to approve Hermoso's discount permission: the reply says how. Works for the Shopify store connected to this brand (Connectors > Shopify, or connect_shopify_store) or the store this account was installed on. Free.

## Parameters

Parameter Type Description

`code` required `string` what customers type at checkout, e.g. SUMMER20 (no spaces)

`title` `string` the name shown in Shopify admin; defaults to the code

`percentOff` `number` percent off, more than 0 and at most 100 (20 = 20% off). Pass this OR amountOff.

`amountOff` `number` a fixed amount off, in the store's currency (10 = 10.00 off). Pass this OR percentOff.

`appliesOnEachItem` `boolean` amountOff only: true takes the amount off EACH item; false (default) splits it across the order

`minSubtotal` `number` minimum order subtotal in the store's currency. Pass this OR minQuantity, not both.

`minQuantity` `number` minimum number of items in the cart. Pass this OR minSubtotal, not both.

`startsAt` `string` ISO date or date-time the code starts working; default now

`endsAt` `string` ISO date or date-time it stops working; leave out for no end date

`usageLimit` `number` how many times the code can be used in total; leave out for no limit

`oncePerCustomer` `boolean` true = each customer can use it once

`confirm` `boolean` true to create it; without it nothing is created and the reply describes the code

## Example call

Every required parameter is shown, filled from the schema where it gives a value and otherwise with a placeholder naming the type. Replace the placeholders with real values. The same call works on the MCP server, the CLI and `POST https://app.hermoso.ai/v1/tools/create_shopify_discount_code`.

**MCP** (`tools/call`)

`{"jsonrpc":"2.0","id":1,"method":"tools/call","params":{"name":"create_shopify_discount_code","arguments":{"code":"<string>"}}}`
**CLI**

`hermoso call create_shopify_discount_code --json '{"code":"<string>"}'`

## Credits

Credits are spent only on two things: running an AI model (image, video, voice, text, planning, post-production) and Ad Spy research. See [Credits & costs](https://hermoso.ai/docs/credits/).

## Related tools

- [connect_shopify_store](https://hermoso.ai/docs/reference/publish/connect_shopify_store/) Connect a Shopify store
- [delete_shopify_marketing_activity](https://hermoso.ai/docs/reference/publish/delete_shopify_marketing_activity/) Delete a Shopify marketing activity
- [list_shopify_discount_codes](https://hermoso.ai/docs/reference/publish/list_shopify_discount_codes/) List Shopify discount codes
- [list_shopify_marketing_activities](https://hermoso.ai/docs/reference/publish/list_shopify_marketing_activities/) List Shopify marketing activities
- [disable_shopify_discount_code](https://hermoso.ai/docs/reference/publish/disable_shopify_discount_code/) Disable a Shopify discount code
- [record_shopify_marketing_activity](https://hermoso.ai/docs/reference/publish/record_shopify_marketing_activity/) Record an ad or campaign in Shopify > Marketing
- [list_shopify_orders](https://hermoso.ai/docs/reference/publish/list_shopify_orders/) List Shopify orders
- [publish_to_shopify_product](https://hermoso.ai/docs/reference/publish/publish_to_shopify_product/) Publish an image or video onto a Shopify product
- [shopify_sales_report](https://hermoso.ai/docs/reference/publish/shopify_sales_report/) Shopify sales report
- [list_shopify_products](https://hermoso.ai/docs/reference/publish/list_shopify_products/) List the Shopify catalog

[All 728 Publishing & scheduling tools](https://hermoso.ai/docs/reference/publish/) · [tools.json](https://hermoso.ai/docs/reference/tools.json)
