• 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

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...