Skip to content

Shopify Dude Fix

Shopify Draft Order Discounts Return ACCESS_DENIED? Check Staff Permissions, Not Just API Scopes

A November 18, 2026 change makes draftOrderCreate and draftOrderUpdate reject added discounts for staff without Apply discounts permission. Handle top-level GraphQL errors and test the staff context.

Quick answer: As of November 18, 2026, a staff-context Admin GraphQL request that adds discounts to a draft order can fail even when the app has write_draft_orders. The acting staff member also needs the apply_discounts_to_draft_orders permission. Inspect the top-level GraphQL errors array for ACCESS_DENIED; checking only mutation userErrors will miss this failure.
On this page

Why the same integration can work for one staff member and fail for another

Shopify tightened authorization for draftOrderCreate and draftOrderUpdate across all supported API versions on November 18, 2026. The condition is specific: the app is acting as a staff member and the mutation is adding a discount. The app’s OAuth scopes and the staff member’s permissions are separate gates. A successful app installation does not grant every employee permission to apply draft-order discounts.

Adding a previously absent code to discountCodes, or changing acceptAutomaticDiscounts from false to true, triggers the check. On creation, any nonempty discount-code list or acceptAutomaticDiscounts: true counts as adding a discount. Keeping or removing existing discounts is not subject to this new add-discount restriction. Offline-token requests that do not act as staff are not affected by this particular change.

What to fix in your app

  1. Log the request’s authentication context without logging tokens. Determine whether it runs as a staff member or via an offline token.
  2. Check the staff role’s Draft orders permission for applying discounts. Have a merchant administrator grant that permission only where appropriate.
  3. Handle GraphQL transport/top-level errors before reading the mutation payload. A denied request returns data.draftOrderCreate or data.draftOrderUpdate as null.
  4. Do not retry permission failures as transient errors or assume the draft was saved. Report an actionable message to the operator.
  5. Keep the normal userErrors handling for field and business-rule validation after checking top-level errors.

Example: handle both error channels

const response = await admin.graphql(MUTATION, { variables });
const result = await response.json();
const denied = (result.errors ?? []).some(
  error => error.extensions?.code === 'ACCESS_DENIED'
);
if (denied) {
  throw new Error('Staff permission required to apply draft-order discounts');
}
if (result.errors?.length) {
  throw new Error('Draft order mutation failed at GraphQL level');
}
const payload = result.data?.draftOrderUpdate;
if (!payload) throw new Error('Draft order was not saved');
if (payload.userErrors?.length) {
  throw new Error(payload.userErrors.map(e => e.message).join('; '));
}

This is an error-handling pattern, not a complete app route. Keep the specific mutation name consistent with your operation and surface the safe, actionable message to the user.

Common misunderstanding: “The API returned HTTP 200 and no userErrors, so the draft order must have saved.” GraphQL responses can carry top-level errors and a null mutation payload. HTTP success alone is not proof of a successful mutation.
How to test this

  1. Create a test staff role with draft-order access but without Apply discounts permission; run a discount-adding mutation under that staff context.
  2. Confirm errors[].extensions.code is ACCESS_DENIED, the mutation payload is null, and no draft change was saved.
  3. Repeat with the proper permission and confirm the discount is applied.
  4. Test a mutation that does not add discounts, then one that only removes an existing discount.
  5. Run a controlled offline-token request if your integration supports it and compare behavior.
  6. Verify the app’s UI displays an actionable permission message rather than silently succeeding or retrying.