Post purchase upsell applyChangeset error - "App is not installed"

I am building post purchase upsell extension and I’m having issue with reqeust to /checkouts/unstable/changesets/apply.json

Below is how I send request to create token

        const token = await fetch(`${APP_URL}/api/sign-changeset`, {
            method: "POST",
            headers: {
                Authorization: `Bearer ${inputData.token}`,
                "Content-Type": "application/json",
            },
            body: JSON.stringify({
                referenceId: inputData.initialPurchase.referenceId,
                changes: [
                    {
                        type: "add_variant",
                        variantID: selectedVariant,
                        quantity: 1,
                        discount: {
                            value: product.discount_amount,
                            valueType:
                                product.discount_type === "percent"
                                    ? "percentage"
                                    : "amount",
                            title: title,
                        },
                    },
                ],
            }),
        })

Once I receive token, then I call applyChangeset(token) but I get a response with error (code 400) as below:

{
    "errors": [
        {
            "code": "invalid_request",
            "message": "App is not installed"
        }
    ],
    "status": "unprocessed"
}

The payload of the request looks like this (just jwt with key name “changes”):

{"changes":"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiIzNGQwNmVhNWNhNGVlNTNiNTgyMzk1MmVhYzQwZTQyYyIsImp0aSI6ImJlZTIzMTZkLTQ3NjctNGE3Ny05NGNlLTg4NWNlZjNmNDkyNSIsImlhdCI6MTc1NDU4NTgwMjk5Mywic3ViIjoiOWE1Mjc0ZDMwNGRhY2E3Y2RhZjBiMThlOTA5ZGQ0ZjkiLCJjaGFuZ2VzIjpbeyJ0eXBlIjoiYWRkX3ZhcmlhbnQiLCJ2YXJpYW50SUQiOiJnaWQ6Ly9zaG9waWZ5L1Byb2R1Y3RWYXJpYW50LzUwNzY1NTE0NTA2NTYwIiwicXVhbnRpdHkiOjEsImRpc2NvdW50Ijp7InZhbHVlIjoxMCwidmFsdWVUeXBlIjoicGVyY2VudGFnZSIsInRpdGxlIjoiMTAlIG9mZiJ9fV19.rrZcjVB2BxyGA-WVW5lmkZHb2Hl7GPOua3tegFUCmfU"}

Please help!

Hi @IsaacSp :waving_hand:

Please make sure you’re following the development document that refers to test-the-extension to test your extension on a development store. The “App is not installed” error typically occurs when the post-purchase extension isn’t properly configured or
when testing outside of the required development store setup.

These steps ensure your extension is correctly installed and authorized to make changeset requests during the post-purchase flow.

Hi Caroline, thanks for getting back to me
Here’s my checklist against the documentation

  • Extension created
  • Dependencies installed
  • shopify app dev runs ok
  • Prefetch offer data in ShouldRender
  • Created 2 files - api.offer.ts, api.sign-changeset.ts
  • Deploy app with --no-release flag (also tried it without the flag)
  • Access granted

From my point of view, only thing that doesn’t match with the documentation is that my Developer console doesn’t give me the link to test the post purchase upsell.
It gives me a button View checkout_post_purchase preview instructions which shows a dialog saying that I need to install a chrome extension.

I have an update on this issue.

In our project, we have multiple toml files, per our team members.
This caused few issues when we were building some features and I guess this one is also on this multiple toml files.

I created a new app and copy pasted the files I made on our original project and got it work.

If I could know which part of the configuration is causing the mismatch, that would help me a lot.