Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

417
Visualizações
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 Respostas
Responde à pergunta

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 Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda