• 0
moisesh18

Cancelar una orden

Question

Hola, estoy haciendo una app que sincroniza ordenes entre shopfy y mercadolibre en ruby. Ya logré hacer que al comprar u producto en meli, se cree la orden en shopify, pero los clientes necesitan poder sicronizar la cancelación de las ordenes. Como es posible?

Actualmente estoy usando este codigo:

    body = {"status"=>"cancelled"}
    response = meli.put("/orders/1631163900", body, {:access_token => meli.access_token})
    res = JSON.parse response.body
    puts res

 

pero la respuesta es:

{"message"=>"Oops! Something went wrong...", "error"=>"not_allowed_application", "status"=>403, "cause"=>[]}

Ya verifique que en la parte de log in está bien, porque si pongo otro id de la orden dice que está mal, y si cambio algo en el body, me dice que es incorrecto.

Gracias por su ayuda

Edito:

body = {"fulfilled": false}

body = {"fulfilled": nil}

tampoco funcionan, retornan {"message"=>"Oops! Something went wrong...", "error"=>"invalid_post_body", "status"=>400, "cause"=>[]}

 

 

SOLUCION:

body = {"fulfilled"=>false,"rating"=>"neutral"}
    response = meli.post("/orders/#{data["note_attributes"][0]["value"]}/feedback", body, {:access_token => meli.access_token})
    res = JSON.parse response.body
    puts res

Edited by moisesh18

Share this post


Link to post
Share on other sites

0 answers to this question

Recommended Posts

There have been no answers to this question yet

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...