Admin API / Types
DiscountCode
ObjectA code that a buyer enters at checkout to get a discount.
Requires a client key with one of these scopes:admin:discounts:readThe requirement applies to every field of DiscountCode unless that field declares its own scopes.
type DiscountCode implements NodeFields
| Field | Type | Description |
|---|---|---|
code | String! | The text that a buyer enters at checkout. |
createdAt | DateTime! | When the code was created. |
deactivatedAt | DateTime | When the code was turned off, or created off with CreateDiscountCodeInput.deactivated. Null while the code is on. |
eligibility | DiscountEligibility! | The buyers who can use the code. |
expiresAt | DateTime | When the code stops working. Null when the code does not expire. |
id | ID! | A globally unique ID. Treat this value as an opaque string. |
minimumSubtotal | Money | The lowest order subtotal that the code applies to, in the store currency. Null when there is no minimum. |
oncePerBuyer | Boolean! | True when each buyer can use the code one time only. |
reward | DiscountReward! | The discount that a buyer gets. |
status | DiscountCodeStatus! | Whether buyers can use the code now. When more than one reason applies, the first of DEACTIVATED, EXPIRED and USAGE_LIMIT_REACHED shows. |
totalDiscount | Money! | The discount given on the orders that used the code, in the store currency. Counts only the orders in the current payment mode of the marketplace: live orders while its new payments move real money, else test orders. Includes cancelled and refunded orders. |
totalSales | Money! | The sum of the totals of the orders that used the code, in the store currency. Counts only the orders in the current payment mode of the marketplace: live orders while its new payments move real money, else test orders. Includes cancelled and refunded orders. |
usageCount | NonNegativeInt! | The number of uses that count toward usageLimit. |
usageLimit | PositiveInt | The number of uses allowed. Null when there is no limit. |