Admin API / Types

DiscountCode

Object

A code that a buyer enters at checkout to get a discount.

Requires a client key with one of these scopes: admin:discounts:read

The requirement applies to every field of DiscountCode unless that field declares its own scopes.

type DiscountCode implements Node

Fields

FieldTypeDescription
codeString!
The text that a buyer enters at checkout.
createdAtDateTime!
When the code was created.
deactivatedAtDateTime
When the code was turned off, or created off with CreateDiscountCodeInput.deactivated. Null while the code is on.
eligibilityDiscountEligibility!
The buyers who can use the code.
expiresAtDateTime
When the code stops working. Null when the code does not expire.
idID!
A globally unique ID. Treat this value as an opaque string.
minimumSubtotalMoney
The lowest order subtotal that the code applies to, in the store currency. Null when there is no minimum.
oncePerBuyerBoolean!
True when each buyer can use the code one time only.
rewardDiscountReward!
The discount that a buyer gets.
statusDiscountCodeStatus!
Whether buyers can use the code now. When more than one reason applies, the first of DEACTIVATED, EXPIRED and USAGE_LIMIT_REACHED shows.
totalDiscountMoney!
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.
totalSalesMoney!
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.
usageCountNonNegativeInt!
The number of uses that count toward usageLimit.
usageLimitPositiveInt
The number of uses allowed. Null when there is no limit.

Returned by