Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to receive webhooks from 3rd party #1277

Open
nboliver-ventureweb opened this issue Jun 6, 2023 · 1 comment
Open

How to receive webhooks from 3rd party #1277

nboliver-ventureweb opened this issue Jun 6, 2023 · 1 comment

Comments

@nboliver-ventureweb
Copy link

nboliver-ventureweb commented Jun 6, 2023

How can I receive a webhook from an external service and, assuming they have been validated, use their payload to interact with the admin API?

I have set up a new route that doesn't use the /api path and have that working, but I'm not sure how to then forward a request on to an authenticated /api route from within the Express back end.

I tried using http-proxy-middleware and also tried creating a custom app session:

    const session = await shopify.api.session.customAppSession(
      'external-service-test.myshopify.com'
    );
    data = await shopify.api.rest.Product.count({
      session,
    });

With the later, I get "error": "Missing access token when creating REST client".

Any help appreciated!

As an aside, I've spent a good amount of time scouring the docs to try and figure this out, but find the documentation for interacting with the API really confusing to follow and spread out across so many different repos and doc pages that don't provide quite enough info to easily get the whole picture. For example: https://github.com/Shopify/shopify-api-js/blob/main/docs/guides/session-storage.md#load-a-session-from-storage: in the code block there it says // getSessionFromStorage() must be provided by application but there are no examples of what that does or how to set it up.

@sixkin-stephens
Copy link

Bump. I'm also trying to figure out how to do this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants