Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

427
Views
How to make API request in a Shopify private APP

So I'm developing a private app in Shopify using node.js and react, so far it's just a form that submits new products to the store, pretty simple, the thing that I have realized is that the Admin API from Shopify won't let me make request as a private app, or so thats what I understand from it, apparently the solution has to do with setting up a back-end server, which I'm at a loss because I quickstarted the app with the Shopify CLI and sets up a ngrok tunnel server for you, I'm unsure if I would need to set up another one or what to do next. its scaffolded with this process: https://shopify.dev/apps/getting-started/create

This article describes the perfect solution but they don't go into details about it so that's why I'm comming here:https://metafieldsmanager.thebestagency.com/articles/how-to-build-a-private-app

Code:

AddProductForm.js

let headers = {'X-Shopify-Access-Token': 'access token',
'host': 'store-example.myshopify.com', 
'Content-Type': 'application/json',
'Access-Control-Allow-Origin': '*'
}

let baseUrl = 'https://store-example.myshopify.com/admin/api/2021-07/'

Right now I'm just attempting a simple fetch request.


let handleSubmit = () => {  
        let toAdd = {
            product:{
                title: title,
                body_html: bodyHtml,
                vendor: vendor,
            }

        }
        console.log(baseUrl + 'products.json')
        fetch(baseUrl + 'products.json', {  
            headers:  headers
        }).then(res=>console.log(res))

I've omitted the rest of the code to keep it simple but its pretty much basic JSX and form handling.

over 4 years ago · Santiago Trujillo
1 answers
Answer question

0

After a while of dealing with Shopify apps, you DO need another server that has some https configuration or tunnel it with Ngrok, that server needs to call Shopify api instead of your front-end and then the app that the Shopify CLI scaffolds for you has to call that server.

over 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!