Discussing APIs and development related to customers, discounts, and order management.
I am using postman to call the graphql api mutation discountAutomaticActivate and trying to activate an automatic discount which is now expired. However, I have got an error.
My mutation is 100% following the documentation - https://shopify.dev/docs/api/admin-graphql/2024-01/mutations/discountAutomaticActivate
And below is my mutation query in postman:
mutation discountAutomaticActivate($id: ID!) { discountAutomaticActivate(id: $id) { automaticDiscountNode { automaticDiscount { ... on DiscountAutomaticBxgy { status startsAt endsAt } } } userErrors { field message code extraInfo } } }
Variables:
{
"id": "gid://shopify/DiscountAutomaticNode/<my discount id>"
}
I have added the access token to the header and granted all of the scopes to this token, so I am pretty sure the permission is not the root cause.
The interesting thing is, with the same setting, the discountAutomaticDeactivate mutation works completely fine. But when I try to active the discount again with the discountAutomaticActivate mutation, it returns error.
Please help me with it, thank you so much!
Hi, there
May I ask what's in your params,
Follow your flow , there is no issue in my side.
nothing in my params either . Works for me . You regenerate this error every time?
Yes, i can reproduce this error every time 😞