I am publishing an app using Shopify Functions.
There is an issue with coupon codes created by the app, and coupon codes using customer segments are not working.
Problem Details:
When applying the coupon on our checkout page (logged in using an eligible customer), I get the error: “discount code isn’t available to you right now"
Additionally, I have received the following feedback from multiple app users.
- The code was working perfectly fine earlier, and suddenly stopped working last Wednesday.
- This issue started on Friday, when shopify stated they experienced an outage.
I will share the data for the code.
API schema : Admin
API version : 2025-07
{
"data": {
"discountNode": {
"discount": {
"__typename": "DiscountCodeApp",
"asyncUsageCount": 0,
"appliesOnOneTimePurchase": true,
"appliesOncePerCustomer": false,
"appliesOnSubscription": true,
"codesCount": {
"count": 1
},
"combinesWith": {
"orderDiscounts": false,
"productDiscounts": false,
"shippingDiscounts": false
},
"discountClasses": [
"ORDER"
],
"endsAt": null,
"codeRecurringCycleLimit": null,
"startsAt": "2026-02-23T18:58:22Z",
"status": "ACTIVE",
"title": "TEST000",
"usageLimit": null,
"customerSelection": {
"__typename": "DiscountCustomerSegments",
"segments": [
{
"id": "gid://shopify/Segment/597449638186",
"name": "vip"
}
]
},
"codes": {
"edges": [
{
"node": {
"code": "TEST000"
}
}
]
}
},
"id": "gid://shopify/DiscountCodeNode/1585678647594"
}
}
}
The discount codes are functioning when set for all customers or specific customers.
I will share the x-request-id for checking the log at checkout.
x-request-id: c8041f96-9266-4b4a-8459-f624821b734c-1771878812
Using context instead of customerSelection to set discounts worked successfully.
However, since this change cannot be immediately reflected in the app, I would like it to also function with customerSelection.