MISSINdevelopersLog in

API reference

CreateDiscountCode

Create a discount code and, with connectionId, place it on that store. Write access, discounts toolset, MCP tool create_discount_code.

Access: Write

Variables

VariableTypeRequiredAcceptsDescription
inputCreateDiscountCodeInput!yesInput object, below

Input types

CreateDiscountCodeInput

FieldTypeRequiredAcceptsDescription
bodyJSON!yesObject, fields belowDiscount create body. Invalid input returns userErrors.
connectionIdUUIDnoOptional owner connection. Omit to create a workspace-level (unplaced) discount and place it on connections later; pass a connectionId to seed a single owner placement.

CreateDiscountCodeInput.body

FieldTypeRequiredAcceptsDescription
codestringyes1 to 255 characters, matches ^\S+$
aliased_codeslist of objectyesObject, fields below. at most 1000 items
titlestringyes1 to 255 characters
display_namestring or nullnoat most 255 characters
value_kindstringyesOne of percent, amount
value_percentnumber or nullyes0 to 100
value_amountnumber or nullyes0 to 5000
usage_limitinteger or nullyes1 to 999999
start_atstring,nullyes
ends_atstring,nullyes
one_time_purchasebooleanno
statusstringyesOne of EXPIRED, DRAFT, SCHEDULED, ACTIVE
is_publicbooleanno
public_tierstringnoOne of BASIC, QUICK, ENHANCED
originstringno1 to 255 characters
tagsobjectno
placementslist of objectnoObject, fields below

CreateDiscountCodeInput.body.aliased_codes

FieldTypeRequiredAcceptsDescription
idstringno1 to 255 characters
codestringyes1 to 255 characters, matches ^\S+$

CreateDiscountCodeInput.body.placements

FieldTypeRequiredAcceptsDescription
connectionIdstringyes1 to 255 characters
childobjectno

Call it

bash
curl https://api.missin.co.uk/graphql/v1 \
  -H "Authorization: Bearer $MISSIN_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"operationName":"CreateDiscountCode","variables":{"input":{"body":{"code":"…","aliased_codes":[],"title":"…","value_kind":"percent","value_percent":20,"value_amount":20,"usage_limit":20,"start_at":{},"ends_at":{},"status":"EXPIRED"}}},"extensions":{"persistedQuery":{"version":1,"sha256Hash":"f4ca9e669e52156460beaf9f84994e2f356794298c6bb5a3a7fc9bfdda2d1919"}}}'

Document

graphql
mutation CreateDiscountCode($input: CreateDiscountCodeInput!) { __typename createDiscountCode(input: $input) { __typename id pendingSync userErrors { __typename code field message } } }

For AI agents: a markdown index of this site is at /llms.txt, and every page is available as markdown by adding .md to its URL.