Storefront API Unable to access Checkout

Highlighted
New Member
2 0 0

Hi everyone, I'm getting the next errore response when I try to run the mutation "checkoutDiscountCodeApplyV2" and "checkoutDiscountCodeRemove

{
    "data": {
        "checkoutDiscountCodeRemove": null
    },
    "errors": [
        {
            "message": "Unable to access Checkout.",
            "locations": [
                {
                    "line": 3,
                    "column": 3
                }
            ],
            "path": [
                "checkoutDiscountCodeRemove"
            ]
        }
    ]
}
 
 
I think it becouse the key I'm using on the my GrapQL, you'll see... I working on my sotre private app and with webhook I recived the creation / modification from a checkout, so I recived something like this:

{
  "checkout": {
    "id": 111111111111111,
    "token": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
    "cart_token": "bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb",
    "email": "client@some.com",
    "gateway": null,
    "buyer_accepts_marketing": false,
    "created_at": "2020-06-16T21:17:19-05:00",
    "updated_at": "2020-06-17T10:42:05-05:00",
    "landing_site": "/account/login?checkout_url=https://{my-store-name}.myshopify.com/2222222222222/checkouts/ccccccccccccccccccccccccccccccccc",
    "note": null,
    "note_attributes": [],
    "referring_site": "",
    "shipping_lines": [],
    "taxes_included": true,
    "total_weight": 6666666,
    "currency": "USD",
    "completed_at": null,
    "closed_at": null,
    "user_id": null,
    "location_id": null,
    "source_identifier": null,
    "source_url": null,
    "device_id": null,
    "phone": null,
    "customer_locale": "es",
    "line_items": [],
    "name": "#13859291693130",
    "source": null,
    "abandoned_checkout_url": "https://www.{my-domain-name}/2222222222222/checkouts/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/recover?key=ddddddddddddddd",
    "discount_codes": [],
    "tax_lines": [],
    "customer": {}
  }
}
 
So if I see the Storefront Documentation, the checkoutID is a node from the storefront gid encoded on b64.
And the checkout gid has to be:
gid://shopify/Checkout/{ cart_token }?key={ ?????}
Where I suppose to get the key to the gid?
I know some many apps are making possible the mutations i said. 
I have try to use the storefront_token from my private app and getting the same response.
If I use the recover key link on "abandoned_checkout_url" I get the next response:
 
{
    "data": {
        "checkoutDiscountCodeRemove": null
    },
    "errors": [
        {
            "message": "Unable to access Checkout.",
            "locations": [
                {
                    "line": 3,
                    "column": 3
                }
            ],
            "path": [
                "checkoutDiscountCodeRemove"
            ]
        }
    ]
}
 
 
 
 
0 Likes