$query = <<<‘QUERY’
mutation discountCodeBasicCreate($basicCodeDiscount: DiscountCodeBasicInput!) {
discountCodeBasicCreate(basicCodeDiscount: $basicCodeDiscount) {
codeDiscountNode {
codeDiscount {
… on DiscountCodeBasic {
title
codes(first: 10) {
nodes {
code
}
}
startsAt
endsAt
customerSelection {
… on DiscountCustomers {
customers
}
customerGets {
value {
… on DiscountPercentage {
percentage
}
}
items {
… on AllDiscountItems {
allItems
}
}
}
appliesOncePerCustomer
}
}
}
userErrors {
field
code
message
}
}
}
QUERY;
$variables = [
“basicCodeDiscount” => [
“title” => “20% Rajith Sahampathh”,
“code” => “SUMMER20”,
“startsAt” => “2022-06-21T00:00:00Z”,
“endsAt” => “2022-09-21T00:00:00Z”,
“customerSelection” => [
“customers” => [
81044372851254
],
],
“combinesWith” => [
“orderDiscounts” => true
],
“customerGets” => [
“value” => [
“percentage” => 0.2,
],
“items” => [
“all” => true,
],
],
“appliesOncePerCustomer” => true,
],
];
What is the issue of this. When add for all customers works fine.