• 0
GrupoMas

No se puede quitar item de promocion

Question

Queremos poner un item en promoción, por lo que hacemos un POST al recurso:
https://api.mercadolibre.com/users/165345936/deals/MLM138/proposed_items

mandamos el json:

{
   "item_id":"MLM626820312",
   "deal_price":1470.6,
   "regular_price":1634,
   "declared_stock":1,
   "declared_free_shipping":true
}

Pero la respuesta dice que el item ya esta en la promocion:
{  
   "message":"A proposed item with id MLM626820312 already exists in the deal with id MLM138",
   "error":"bad_request",
   "cause":[  
      {  
         "code":"proposed_item.already_exists",
         "message":"A proposed item with id MLM626820312 already exists in the deal with id MLM138"
      }
   ],
   "status":400
}

Entonces eliminamos el item de la promocion, haciendo un DELETE al recurso:
https://api.mercadolibre.com/users/165345936/deals/MLM138/proposed_items/MLM626820312

La respuesta con código HTTP 200 es:
{  
   "item_id":"MLM626820312",
   "current_price":null,
   "regular_price":1470.6,
   "deal_price":1470.6,
   "declared_stock":2,
   "declared_free_shipping":true,
   "declared_oro_premium_full":false,
   "category_l1":"MLM1747",
   "category_l2":"MLM180901",
   "brand":null,
   "model":null,
   "date_created":"2018-06-20T12:23:23.000-04:00",
   "last_updated":"2018-06-27T11:25:58.492-04:00",
   "status":"rejected",
   "title":"Llanta 205\/45 R17  Nexen N8000 88w Nex389 Radial",
   "processed_by":"system",
   "source":"deals_public_api",
   "discount":0,
   "validation_color":"red",
   "rejections":[  
      {  
         "comment":null,
         "reason":[  
            "El seller quit\u00f3 al item del deal"
         ]
      }
   ]

Pero cuando volvemos a mandar  el POST para sugerir el ITEM, no nos permite guardarlo por que dice que el item sigue con la promocion

{  
   "message":"A proposed item with id MLM626820312 already exists in the deal with id MLM138",
   "error":"bad_request",
   "cause":[  
      {  
         "code":"proposed_item.already_exists",
         "message":"A proposed item with id MLM626820312 already exists in the deal with id MLM138"
      }
   ],
   "status":400
}

 

Como puedo quitar el item de la promoción para que me deje mandarla nuevamente?

Share this post


Link to post
Share on other sites

1 answer to this question

Recommended Posts

  • 0

segun la documentacion de la api: para modificar:

Modifies a proposed item for a deal

PUT
/users/:user_id/deals/:deal_id/proposed_items/:item_id
 para agregar:
Adds a proposed item to a deal
POST
/users/:user_id/deals/:deal_id/proposed_items

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now