Missing property when creating basic discount code

Hi there,

when creating a basic discount code via GraphQL API (discountCodeBasicCreate - GraphQL Admin) and then checking it on the Shopify admin, I can see this property enabled by default:

image

This is completely ok, indeed it is what I need. However, I can’t see that property configuration in the API, it seems there is no field for that ‘Only apply discount once per order‘ property.

Please could you tell me if it is configurable via API?

Kind regards

Hey @sinuhe Yep, that setting is configurable through the API. For fixed amount basic discounts, the Admin UI’s “Only apply discount once per order” checkbox maps to customerGets.value.discountAmount.appliesOnEachItem on discountCodeBasicCreate.

Set appliesOnEachItem to false to apply the amount once across the order, like the checkbox state in your screenshot. If it is true, the fixed amount applies to each eligible item.

mutation CreateBasicDiscount($basicCodeDiscount: DiscountCodeBasicInput!) {
  discountCodeBasicCreate(basicCodeDiscount: $basicCodeDiscount) {
    codeDiscountNode {
      id
    }
    userErrors {
      field
      message
    }
  }
}

For example, pass this as the mutation variables.

{
  "basicCodeDiscount": {
    "title": "£53.78 off",
    "code": "SAVE5378",
    "startsAt": "2026-04-28T00:00:00Z",
    "customerGets": {
      "value": {
        "discountAmount": {
          "amount": "53.78",
          "appliesOnEachItem": false
        }
      },
      "items": {
        "all": true
      }
    },
    "context": {
      "all": "ALL"
    }
  }
}

One easy field to mix this up with is appliesOncePerCustomer, but that controls whether the same customer can use the discount more than once, so it is a different setting.

hi @Donal-Shopify ,

thanks a lot.