Overview

The cartCreate mutation returns the newly created Cart.
mutation CartCreate($input: CartCreateInput!) {
  cartCreate(input: $input) {
    id
    # Check the Cart type for its fields
  }
}
You are not required to, but you can provide metadata and products to the cartCreate mutation. The β€˜metadata’ field doesn’t have a set structure and can accept any correctly formatted JSON object.
{
  "input": {
    "metadata":  {
      "source": "instagram"
    },
    "products": [
      {
        "productId": "prd_ZJQYAR_-ypwOLKEz",
        "quantity": 1
      },
      {
        "productId": "prd_ZJQYAR_-ypwOLKE0",
        "quantity": 1
      }
    ]
  }
}