Create a Cart
Ensure you have a region ID, for example the default region ID
mutation createCart($defaultRegionId: ID!) {
cart {
createCart(input: {
regionId: $defaultRegionId,
currencyCode: "GBP"
}) {
errors { label message value }
cart {
id
}
}
}
}
Will result in:
{
"data": {
"cart": {
"createCart": {
"errors": [],
"cart": {
"id": "T3Bwb3J0dW5pdHk6OTQ4" # < -- COPY THIS!
}
}
}
}
}
Ensure you copy the returned cart id for subsequent mutations