API version: unstable
API version: 2021-04 Release candidate
API version: 2021-01 Latest
API version: 2020-10
API version: 2020-07
API version: 2020-04
API version: 2020-01 Unsupported
API version: 2019-10 Unsupported

discountCodeBasicCreate mutation

Version unstable

Creates a basic code discount.

Required access

Apps must have write_discounts access scope.

Interactive example

This is an example mutation query. Use the embedded interactive tool below to edit the query.

Hint: use Ctrl + Space for autocompleting fields.


Arguments

Argument Description
basicCodeDiscount ( DiscountCodeBasicInput! ) required

The input data used to create the code discount.

DiscountCodeBasicInput fields

  • appliesOncePerCustomer (Boolean)

    Whether the discount can be applied only once per customer.

  • code (String)

    The code to use the discount.

  • customerGets (DiscountCustomerGetsInput)

    The qualifying items in an order, the quantity of each one, and the total value of the discount.

  • customerSelection (DiscountCustomerSelectionInput)

    The customers that can use the discount.

  • endsAt (DateTime)

    The date and time when the discount ends. For open-ended discounts, use null.

  • minimumRequirement (DiscountMinimumRequirementInput)

    The minimum subtotal or quantity that's required for the discount to be applied.

  • recurringCycleLimit (Int)

    The number of times a discount applies on recurring purchases (subscriptions).

  • startsAt (DateTime)

    The date and time when the discount starts.

  • title (String)

    The title of the discount.

  • usageLimit (Int)

    The maximum number of times that the discount can be used. For open-ended discounts, use null.

Return fields

Version 2021-04 (Release candidate)

Creates a basic code discount.

Required access

Apps must have write_discounts access scope.

Interactive example

This is an example mutation query. Use the embedded interactive tool below to edit the query.

Hint: use Ctrl + Space for autocompleting fields.


Arguments

Argument Description
basicCodeDiscount ( DiscountCodeBasicInput! ) required

The input data used to create the code discount.

DiscountCodeBasicInput fields

  • appliesOncePerCustomer (Boolean)

    Whether the discount can be applied only once per customer.

  • code (String)

    The code to use the discount.

  • customerGets (DiscountCustomerGetsInput)

    The qualifying items in an order, the quantity of each one, and the total value of the discount.

  • customerSelection (DiscountCustomerSelectionInput)

    The customers that can use the discount.

  • endsAt (DateTime)

    The date and time when the discount ends. For open-ended discounts, use null.

  • minimumRequirement (DiscountMinimumRequirementInput)

    The minimum subtotal or quantity that's required for the discount to be applied.

  • recurringCycleLimit (Int)

    The number of times a discount applies on recurring purchases (subscriptions).

  • startsAt (DateTime)

    The date and time when the discount starts.

  • title (String)

    The title of the discount.

  • usageLimit (Int)

    The maximum number of times that the discount can be used. For open-ended discounts, use null.

Return fields

Version 2021-01 (Latest)

Creates a basic code discount.

Required access

Apps must have write_discounts access scope.

Interactive example

This is an example mutation query. Use the embedded interactive tool below to edit the query.

Hint: use Ctrl + Space for autocompleting fields.


Arguments

Argument Description
basicCodeDiscount ( DiscountCodeBasicInput! ) required

The input data used to create the code discount.

DiscountCodeBasicInput fields

  • appliesOncePerCustomer (Boolean)

    Whether the discount can be applied only once per customer.

  • code (String)

    The code to use the discount.

  • customerGets (DiscountCustomerGetsInput)

    The qualifying items in an order, the quantity of each one, and the total value of the discount.

  • customerSelection (DiscountCustomerSelectionInput)

    The customers that can use the discount.

  • endsAt (DateTime)

    The date and time when the discount ends. For open-ended discounts, use null.

  • minimumRequirement (DiscountMinimumRequirementInput)

    The minimum subtotal or quantity that's required for the discount to be applied.

  • recurringCycleLimit (Int)

    The number of times a discount applies on recurring purchases (subscriptions).

  • startsAt (DateTime)

    The date and time when the discount starts.

  • title (String)

    The title of the discount.

  • usageLimit (Int)

    The maximum number of times that the discount can be used. For open-ended discounts, use null.

Return fields

Version 2020-10

Creates a basic code discount.

Required access

Apps must have write_discounts access scope.

Interactive example

This is an example mutation query. Use the embedded interactive tool below to edit the query.

Hint: use Ctrl + Space for autocompleting fields.


Arguments

Argument Description
basicCodeDiscount ( DiscountCodeBasicInput! ) required

The input data used to create the code discount.

DiscountCodeBasicInput fields

  • appliesOncePerCustomer (Boolean)

    Whether the discount can be applied only once per customer.

  • code (String)

    The code to use the discount.

  • customerGets (DiscountCustomerGetsInput)

    The qualifying items in an order, the quantity of each one, and the total value of the discount.

  • customerSelection (DiscountCustomerSelectionInput)

    The customers that can use the discount.

  • endsAt (DateTime)

    The date and time when the discount ends. For open-ended discounts, use null.

  • minimumRequirement (DiscountMinimumRequirementInput)

    The minimum subtotal or quantity that's required for the discount to be applied.

  • startsAt (DateTime)

    The date and time when the discount starts.

  • title (String)

    The title of the discount.

  • usageLimit (Int)

    The maximum number of times that the discount can be used. For open-ended discounts, use null.

Return fields

Version 2020-07

Creates a basic code discount.

Required access

Apps must have write_discounts access scope.

Interactive example

This is an example mutation query. Use the embedded interactive tool below to edit the query.

Hint: use Ctrl + Space for autocompleting fields.


Arguments

Argument Description
basicCodeDiscount ( DiscountCodeBasicInput! ) required

The input data used to create the code discount.

DiscountCodeBasicInput fields

  • appliesOncePerCustomer (Boolean)

    Whether the discount can be applied only once per customer.

  • code (String)

    The code to use the discount.

  • customerGets (DiscountCustomerGetsInput)

    The qualifying items in an order, the quantity of each one, and the total value of the discount.

  • customerSelection (DiscountCustomerSelectionInput)

    The customers that can use the discount.

  • endsAt (DateTime)

    The date and time when the discount ends. For open-ended discounts, use null.

  • minimumRequirement (DiscountMinimumRequirementInput)

    The minimum subtotal or quantity that's required for the discount to be applied.

  • startsAt (DateTime)

    The date and time when the discount starts.

  • title (String)

    The title of the discount.

  • usageLimit (Int)

    The maximum number of times that the discount can be used. For open-ended discounts, use null.

Return fields

Version 2020-04

Creates a basic code discount.

Required access

Apps must have write_discounts access scope.

Interactive example

This is an example mutation query. Use the embedded interactive tool below to edit the query.

Hint: use Ctrl + Space for autocompleting fields.


Arguments

Argument Description
basicCodeDiscount ( DiscountCodeBasicInput! ) required

The input data used to create the code discount.

DiscountCodeBasicInput fields

  • appliesOncePerCustomer (Boolean)

    Whether the discount can be applied only once per customer.

  • code (String)

    The code to use the discount.

  • customerGets (DiscountCustomerGetsInput)

    The qualifying items in an order, the quantity of each one, and the total value of the discount.

  • customerSelection (DiscountCustomerSelectionInput)

    The customers that can use the discount.

  • endsAt (DateTime)

    The date and time when the discount ends. For open-ended discounts, use null.

  • minimumRequirement (DiscountMinimumRequirementInput)

    The minimum subtotal or quantity that's required for the discount to be applied.

  • startsAt (DateTime)

    The date and time when the discount starts.

  • title (String)

    The title of the discount.

  • usageLimit (Int)

    The maximum number of times that the discount can be used. For open-ended discounts, use null.

Return fields

Version 2020-01 (Unsupported)

Creates a basic code discount.

Required access

Apps must have write_discounts access scope.

Interactive example

This is an example mutation query. Use the embedded interactive tool below to edit the query.

Hint: use Ctrl + Space for autocompleting fields.


Arguments

Argument Description
basicCodeDiscount ( DiscountCodeBasicInput! ) required

The input data used to create the code discount.

DiscountCodeBasicInput fields

  • appliesOncePerCustomer (Boolean)

    Whether the discount can be applied only once per customer.

  • code (String)

    The code to use the discount.

  • customerGets (DiscountCustomerGetsInput)

    The qualifying items in an order, the quantity of each one, and the total value of the discount.

  • customerSelection (DiscountCustomerSelectionInput)

    The customers that can use the discount.

  • endsAt (DateTime)

    The date and time when the discount ends. For open-ended discounts, use null.

  • minimumRequirement (DiscountMinimumRequirementInput)

    The minimum subtotal or quantity that's required for the discount to be applied.

  • startsAt (DateTime)

    The date and time when the discount starts.

  • title (String)

    The title of the discount.

  • usageLimit (Int)

    The maximum number of times that the discount can be used. For open-ended discounts, use null.

Return fields

Version 2019-10 (Unsupported)

Creates a basic code discount.

Required access

Apps must have write_discounts access scope.

Interactive example

This is an example mutation query. Use the embedded interactive tool below to edit the query.

Hint: use Ctrl + Space for autocompleting fields.


Arguments

Argument Description
basicCodeDiscount ( DiscountCodeBasicInput! ) required

The input data used to create the code discount.

DiscountCodeBasicInput fields

  • appliesOncePerCustomer (Boolean)

    Whether the discount can be applied only once per customer.

  • code (String)

    The code to use the discount.

  • customerGets (DiscountCustomerGetsInput)

    The qualifying items in an order, the quantity of each one, and the total value of the discount.

  • customerSelection (DiscountCustomerSelectionInput)

    The customers that can use the discount.

  • endsAt (DateTime)

    The date and time when the discount ends. For open-ended discounts, use null.

  • minimumRequirement (DiscountMinimumRequirementInput)

    The minimum subtotal or quantity that's required for the discount to be applied.

  • startsAt (DateTime)

    The date and time when the discount starts.

  • title (String)

    The title of the discount.

  • usageLimit (Int)

    The maximum number of times that the discount can be used. For open-ended discounts, use null.

Return fields

Version 2019-07 (Unsupported)

Creates a basic code discount.

Required access

Apps must have write_discounts access scope.

Interactive example

This is an example mutation query. Use the embedded interactive tool below to edit the query.

Hint: use Ctrl + Space for autocompleting fields.


Arguments

Argument Description
basicCodeDiscount ( DiscountCodeBasicInput! ) required

The input data used to create the code discount.

DiscountCodeBasicInput fields

  • appliesOncePerCustomer (Boolean)

    Whether the discount can be applied only once per customer.

  • code (String)

    The code to use the discount.

  • customerGets (DiscountCustomerGetsInput)

    The qualifying items in an order, the quantity of each one, and the total value of the discount.

  • customerSelection (DiscountCustomerSelectionInput)

    The customers that can use the discount.

  • endsAt (DateTime)

    The date and time when the discount ends. For open-ended discounts, use null.

  • minimumRequirement (DiscountMinimumRequirementInput)

    The minimum subtotal or quantity that's required for the discount to be applied.

  • startsAt (DateTime)

    The date and time when the discount starts.

  • title (String)

    The title of the discount.

  • usageLimit (Int)

    The maximum number of times that the discount can be used. For open-ended discounts, use null.

Return fields

Version 2019-04 (Unsupported)

Creates a basic code discount.

Required access

Apps must have write_discounts access scope.

Interactive example

This is an example mutation query. Use the embedded interactive tool below to edit the query.

Hint: use Ctrl + Space for autocompleting fields.


Arguments

Argument Description
basicCodeDiscount ( DiscountCodeBasicInput! ) required

The input data used to create the code discount.

DiscountCodeBasicInput fields

  • appliesOncePerCustomer (Boolean)

    Whether the discount can be applied only once per customer.

  • code (String)

    The code to use the discount.

  • customerGets (DiscountCustomerGetsInput)

    The qualifying items in an order, the quantity of each one, and the total value of the discount.

  • customerSelection (DiscountCustomerSelectionInput)

    The customers that can use the discount.

  • endsAt (DateTime)

    The date and time when the discount ends. For open-ended discounts, use null.

  • minimumRequirement (DiscountMinimumRequirementInput)

    The minimum subtotal or quantity that's required for the discount to be applied.

  • startsAt (DateTime)

    The date and time when the discount starts.

  • title (String)

    The title of the discount.

  • usageLimit (Int)

    The maximum number of times that the discount can be used. For open-ended discounts, use null.

Return fields