Have your say in Community Polls: What was/is your greatest motivation to start your own business?
Our Partner & Developer boards on the community are moving to a brand new home: the .dev community forums! While you can still access past discussions here, for all your future app and storefront building questions, head over to the new forums.

Storefront API Unable to access Checkout

Storefront API Unable to access Checkout

ObedPetmarkt
Visitor
2 0 2

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"
            ]
        }
    ]
}
 
 
 
 
Replies 3 (3)

Alexblbl
Visitor
1 0 2

Any updates on this? Same issue here

sushilsth21
Shopify Partner
11 0 5

Hi. Any followup on this. I am in same phase of issue. 

Soumya
Shopify Partner
6 0 0

I’m also having the same issue. Is there any resolution.