campaigns_write
Arguments
required
The discount code to create.
Show fields
Show fields
String!
required
The code customers enter at checkout.
required
When the code stops working.
Show fields
Show fields
Int
Required when
type is AFTER_DAYS.Whether the code never expires, expires on a date, or after a number of days.
Must be STATIC (one shared checkout code). DYNAMIC unique-per-customer codes are not supported.
required
The commerce platform that should host this code.
required
How the discount reduces the order. Pass exactly one of amountOff, freeShipping, or buyXGetY.
Show fields
Show fields
A percent-off or amount-off discount.
A buy-X-get-Y discount.
A free-shipping discount.
String!
required
The merchant-facing name of the discount.
Returns
required
A discount configuration hosted on Shopify or BigCommerce.
Show fields
Show fields
String!
required
The code customers enter at checkout.
String!
required
A short human-readable summary of what the code does.
required
When this code stops working.
Show fields
Show fields
Int
Days after creation when
type is AFTER_DAYS.required
Whether the code never expires, expires on a date, after a number of days, or on delivery.
String!
required
The platform’s id for this discount (a Shopify GID or a BigCommerce promotion id).
required
Whether this is one fixed code or a unique code per customer.
ID!
required
The id of this discount code.
How the discount reduces the order. Null when the config has no settings type.
String!
required
The discount’s legacy Mongo ObjectId (24-char hex) from before the CockroachDB migration.
required
The commerce platform that hosts this code.
How the discount reduces the order.
String!
required
The merchant-facing name of the discount.
Example
mutation {
createDiscountCode(input: { ... }) {
code
createdAt
description
externalId
groupType
id
kind
legacyId
# ...
}
}