With the example query giving free shipping here (also attached below): https://shopify.dev/docs/api/admin-graphql/2023-07/mutations/discountCodeFreeShippingCreate
I how would I modify it to apply to one customer: “gid://shopify/Customer/12345” ?
Thanks in advance!
{
data: {
"query": `mutation discountCodeFreeShippingCreate($freeShippingCodeDiscount: DiscountCodeFreeShippingInput!) {
discountCodeFreeShippingCreate(freeShippingCodeDiscount: $freeShippingCodeDiscount) {
codeDiscountNode {
id
codeDiscount {
... on DiscountCodeFreeShipping {
title
startsAt
endsAt
maximumShippingPrice {
amount
}
customerSelection {
... on DiscountCustomerAll {
allCustomers
}
}
destinationSelection {
... on DiscountCountryAll {
allCountries
}
}
minimumRequirement {
... on DiscountMinimumSubtotal {
greaterThanOrEqualToSubtotal {
amount
}
}
}
codes(first: 2) {
nodes {
code
}
}
}
}
}
userErrors {
field
code
message
}
}
}`,
"variables": {
"freeShippingCodeDiscount": {
"startsAt": "2022-06-22T21:12:07.000Z",
"appliesOncePerCustomer": false,
"title": "FreeShipping",
"code": "FreeShipping",
"minimumRequirement": {
"subtotal": {
"greaterThanOrEqualToSubtotal": 20.0
}
},
"customerSelection": {
"all": true
},
"destination": {
"all": true
}
}
},
},
}