CheckoutUpdateProduct

A mutation CheckoutUpdateProduct permite editar os campos de personalização e de assinatura dos produtos no carrinho.

Exemplo de Personalização

mutation {
  checkoutUpdateProduct(
    input: {
      id: "e0398e16-889e-4b8a-a406-5ba0150dc900"
      product: {
        customization: { 
          customizationId: 35, 
          value: "Atualizado" 
        }
        customizationId: "eyJQcm9kdXRvVmFyaWFudGVJZCI6MjU2NjM5LCJFbnRpdHkiOiJDaGVja291dFByb2R1Y3RJZCIsIklkIjoxNjg2NzU5fQ=="
        productVariantId: 256639
      }
    }
  ) {
    checkoutId
    products {
      name
      quantity
      productVariantId
      productId
      customization {
        id
        values {
          cost
          name
          value
        }
      }
    }
  }
}
Mostrar resposta
{
  "data": {
    "checkoutUpdateProduct": {
      "checkoutId": "e0398e16-889e-4b8a-a406-5ba0150dc900",
      "products": [
        {
          "name": "Mochila Nike Classic",
          "quantity": 1,
          "productVariantId": 256639,
          "productId": 70129,
          "customization": {
            "id": "eyJQcm9kdXRvVmFyaWFudGVJZCI6MjU2NjM5LCJFbnRpdHkiOiJDaGVja291dFByb2R1Y3RJZCIsIklkIjoxNjg2NzczfQ==",
            "values": [
              {
                "cost": 5,
                "name": "Nome",
                "value": "Atualizado"
              }
            ]
          }
        }
      ]
    }
  }
}

Exemplo de Assinatura

mutation {
  checkoutUpdateProduct(
    input: {
      id: "e0398e16-889e-4b8a-a406-5ba0150dc901"
      product: {
        subscription: { 
          recurringTypeId: 485, 
          subscriptionGroupId: 377
        }
        productVariantId: 278821
      }
    }
  ) {
    checkoutId
    products {
      name
      quantity
      productVariantId
      productId
      subscription {
        selected {
          name
          recurringDays
          recurringTypeId
          selected
          subscriptionGroupDiscount
          subscriptionGroupId
        }
        availableSubscriptions {
          name
          recurringDays
          recurringTypeId
          selected
          subscriptionGroupDiscount
          subscriptionGroupId
        }
      }
    }
  }
}
Mostrar resposta
{
  "data": {
    "checkoutUpdateProduct": {
      "checkoutId": "e0398e16-889e-4b8a-a406-5ba0150dc901",
      "products": [
        {
          "name": "Golden Sachê Gourmet Gatos Filhotes Sabor Frango e Abóbora 70g",
          "productVariantId": 278821,
            "subscription": {
              "selected": {
               "name": "Mensal",
               "recurringDays": 30,
               "recurringTypeId": 484,
               "selected": true,
               "subscriptionGroupDiscount": 0,
               "subscriptionGroupId": 377
            },
            "availableSubscriptions": [
              {
                "name": "Semanal",
                "recurringDays": 7,
                "recurringTypeId": 482,
                "selected": false,
                "subscriptionGroupDiscount": 0,
                "subscriptionGroupId": 377
              }
            ]
          }
        }
     ]
   }
 }
}