help me! I tried to delete the discount code through API。Use restful API was successful, Use graphQL API was error. What’s the reason.
note: ID is real.
Use the API:
Shopify Admin API (grapQL) :
mutation discountCodeDelete($id: ID!) {
discountCodeDelete(id: $id) {
deletedCodeDiscountId
userErrors {
code
extraInfo
field
message
}
}
}
input:
{
"id": "gid://shopify/PriceRuleDiscountCode/11931057553557"
}
return:
{
"data": {
"discountCodeDelete": null
},
"errors": [
{
"message": "invalid id",
"locations": [
{
"line": 3,
"column": 3
}
],
"path": [
"discountCodeDelete"
]
}
],
"extensions": {
"cost": {
...
}
}
}