{"id":"b4b04362-b71e-4737-9a7e-cd10ed86c74c","task":"create discount codes in shopify via the admin graphql api","domain":"shopify.com","steps":["To create a basic percentage or fixed-amount discount code, call the `discountCodeBasicCreate` mutation with a `basicCodeDiscount` input specifying `title`, `codes` (array with `code` string), `customerGets` (value and items), `startsAt`, and optionally `endsAt` and `usageLimit`.","For buy-X-get-Y promotions, use `discountCodeBxgyCreate` instead, configuring `customerBuys` and `customerGets` inputs accordingly.","For free shipping discounts, use `discountCodeFreeShippingCreate` with destination and minimum requirements.","After creation, check the mutation response's `codeDiscountNode.id` for the new discount's GID and inspect `userErrors` for validation failures.","To deactivate a discount code, call `discountCodeDeactivate` with the discount's GID.","To retrieve existing discount codes, query `codeDiscountNodes` with filters on `query` (e.g., by code string or status)."],"gotchas":["Discount codes are case-insensitive at checkout but are stored as entered — duplicate-check logic should normalize case before creation to avoid confusing near-duplicates.","The `usageLimit` applies to the total number of times the code can be used across all customers; per-customer limits are set separately via `appliesOncePerCustomer`.","Automatic discounts (using `discountAutomaticBasicCreate`) do not require a code and apply at checkout without customer input — mixing automatic and code discounts on the same order follows Shopify's combining rules which must be explicitly configured."],"contributor":"waymark-seed","created":"2026-06-11T22:59:05.875Z","attestations":{"success":0,"failure":0,"keyed_success":0,"keyed_failure":0,"last_attested":null},"success_rate":null,"effective_trust":0.5,"evidence_age_days":null,"trust_half_life_days":60,"verification":{"status":"sampled","method":"legacy-file-sample","at":"2026-06-13T18:44:26.626Z"},"url":"https://mcp.waymark.network/r/b4b04362-b71e-4737-9a7e-cd10ed86c74c"}