checkoutAttributesUpdateV2 mutation returns checkout not found error

Iam trying to update the custom attributes when a checkout is created right now i have subscribed to a checkout/create web-hook so that every time checkout is created i will be able to push the custom attributes using storefront graphql API but below mutation throws checkout not found error even though it is a valid checkout ID

mutation checkoutAttributesUpdateV2($checkoutId: ID!, $input: CheckoutAttributesUpdateV2Input!) {
  checkoutAttributesUpdateV2(checkoutId: $checkoutId, input: $input) {
    checkout {
     id
    }
    checkoutUserErrors {
      field
      code
      message
    }
  }
}
{
  "checkoutId": "gid://shopify/Checkout/36603304411456",
  "input": {
    "allowPartialAddresses": true,
    "customAttributes": [
      {
        "key": "_testAttribute",
        "value": "testing"
      }
    ]
  }
}

Ive tried coverting the ID to base 64 string but still same error

Hi @skipper17 :waving_hand:

The checkoutAttributesUpdateV2 mutation generally expects a checkout ID with the format gid://shopify/Checkout/{...}key={...} as demonstrated in this guide.

Hope that helps!

Hi @ShopifyDevSup Ive tried this but still same error ive even tried this in base64 encoding

I was getting this same error because the key parameter on my checkout id was changing faster than I was keeping it up to date in state. You could try making sure that the key is accurate and the latest version.