MISSINdevelopersLog in

API reference

UpdateDiscountCode

Update a discount code and push the change to its placements. Write access, discounts toolset, MCP tool update_discount_code.

Access: Write

Variables

VariableTypeRequiredAcceptsDescription
inputUpdateDiscountCodeInput!yesInput object, below

Input types

UpdateDiscountCodeInput

FieldTypeRequiredAcceptsDescription
bodyJSON!yesObject, fields below
connectionIdUUIDnoOptional. Omit to edit a workspace-level (unplaced) discount; when present, the store the edit was initiated from (audit stamp + placement push).
idUUID!yes
partnerIdUUIDnoat least 1 charactersPartner attribution patch, independent of the discount body. Omit BOTH partnerId and tier to preserve the current link; send partnerId: null to clear it; send a partnerId (with an optional tier slug) to attribute. A tier requires a partner.
tierStringno

UpdateDiscountCodeInput.body

FieldTypeRequiredAcceptsDescription
codestringno1 to 255 characters, matches ^\S+$
aliased_codeslist of objectnoObject, fields below. at most 1000 items
titlestringno1 to 255 characters
display_namestring or nullnoat most 255 characters
value_kindstringnoOne of percent, amount
value_percentnumber or nullno0 to 100
value_amountnumber or nullno0 to 5000
usage_limitinteger or nullno1 to 999999
start_atstring,nullno
ends_atstring,nullno
one_time_purchasebooleanno
statusstringnoOne of EXPIRED, DRAFT, SCHEDULED, ACTIVE
is_publicbooleanno
public_tierstringnoOne of BASIC, QUICK, ENHANCED
originstringno1 to 255 characters
tagsobjectno
placementslist of objectnoObject, fields below

UpdateDiscountCodeInput.body.aliased_codes

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

UpdateDiscountCodeInput.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":"UpdateDiscountCode","variables":{"input":{"body":{"code":"…"},"id":"00000000-0000-0000-0000-000000000000"}},"extensions":{"persistedQuery":{"version":1,"sha256Hash":"625598f2e218a1fd910be98982bbff0855c55670f970738f4f1d6e5fd1f410bc"}}}'

Document

graphql
mutation UpdateDiscountCode($input: UpdateDiscountCodeInput!) { __typename updateDiscountCode(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.