Hello to everyone,
i’m findig problem with the code for the discount. i’m tryin to get two differnt tipe:
by percentage
by amount
by percentage
percentage the code is working:
“query”: “mutation CreateSummerDiscount($input: DiscountCodeBasicInput!) { discountCodeBasicCreate(basicCodeDiscount: $input) { codeDiscountNode { id codeDiscount { … on DiscountCodeBasic { title codes(first: 10) { nodes { code } } startsAt endsAt } } } userErrors { field message } } }”,
“variables”: {
“input”: {
“title”: “edoardo2”,
“code”: “BUYNOW200”,
“startsAt”: “2025-01-21T00:00:00Z”,
“endsAt”: “2025-02-21T00:00:00Z”,
“customerSelection”: {
“all”: true
},
“customerGets”: {
“value”: {
“percentage”: 0.2
},
“items”: {
“all”: true
}
},
“appliesOncePerCustomer”: true
}
}
}’
but by amout it doesn’t.
“query”: “mutation CreateSummerDiscount($input: DiscountCodeBasicInput!) { discountCodeBasicCreate(basicCodeDiscount: $input) { codeDiscountNode { id codeDiscount { … on DiscountCodeBasic { title codes(first: 10) { nodes { code } } startsAt endsAt } } } userErrors { field message } } }”,
“variables”: {
“input”: {
“title”: “edoardo2”,
“code”: “BUYNOW200”,
“startsAt”: “2025-01-21T00:00:00Z”,
“endsAt”: “2025-02-21T00:00:00Z”,
“customerSelection”: {
“all”: true
},
“customerGets”: {
“value”: {
“amount”: 100
},
“items”: {
“all”: true
}
},
“appliesOncePerCustomer”: true
}
}
}’
any suggest help?
Thanks