Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

213
Vistas
Coinbase Commerce api return a 400 error because "pricing_type" is required
const query = {
               name: 'The Sovereign Individual',
               description: 'Mastering the Transition to the Information Age',
               local_price: {
                   amount: '100.00',
                   currency: 'USD',
                },
               pricing_type: 'fixed_price',
               metadata: {
                   customer_id: 'id_1005',
                   customer_name: 'Satoshi Nakamoto',
               },
               redirect_url: 'https://charge/completed/page',
               cancel_url: 'https://charge/canceled/page',
           };
           const opts = {
               method: 'POST',
               headers: {
                   'Content-Type': 'application/json',
                   'X-CC-Api-Key': 'api_key',
                   'X-CC-Version': '2018-03-22',
               },
               body: JSON.stringify({
                   query
               }),
           };

            fetch('https://api.commerce.coinbase.com/charges', opts)
                .then(res => res.json())
                .then(jsonRes => console.log(jsonRes));


and the response is this


error:{
   message: "Required parameter missing: pricing_type"
   type: "invalid_request"
}

but i passed the pricing_type parameter as you can see,but i keep getting a 400 error with the response invalid request

who has an idea how i can solve this

about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

body: JSON.stringify({query})

I believe it should be

body: JSON.stringify(query)
about 4 years ago · Juan Pablo Isaza Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda