Quantcast
Channel: Mercado Libre Developers
Viewing all articles
Browse latest Browse all 99

New Feedback API Tutorial

$
0
0

Overview

After completing a sale and a purchase, according to MercadoLibre’s rules, both parties must provide feedback about the transaction (order). This feedback says whether the order has been fulfilled or not and both the seller and buyer rate each other. Seller’s and buyer’s scores on the MercadoLibre platform are calculated based on these ratings.

Table of Contents

Resource description

 Attribute  Description
 fulfilled  True or False. Tell us if the order was achieved or not. Required.
 message  A string under 160 chars. Required.
 rating  Possible values are ‘negative’, ‘neutral’ in case ‘fulfilled': ‘false’ or positive in case ‘fulfilled': ‘true’. Required.
 reason  It’s a mandatory field in case ‘fulfilled': ‘false’.
 restock_item  It’s only for sellers, when ‘fulfilled': ‘false’. When you send this field ‘true’ you are saying the order wasn’t achieved and the item should be restocked, the API will accept restock_item anytime, but the item status can’t be ‘closed’ in order to be restocked.
has_seller_refunded_money Only for sellers, when the order is ‘fulfilled': ‘false’ and there’s a payment associated. This field tell us if the user has refunded the money outside from MercadoPago.

Accepted values to send as ‘reason':

  • SELLER (For all sites except for MLB, MPA, MRD y MPT):
  • SELLER_OUT_OF_STOCK
  • SELLER_DIDNT_TRY_TO_CONTACT_BUYER
  • BUYER_NOT_ENOUGH_MONEY
  • BUYER_REGRETS
  • SELLER (For MLB, MPA, MRD y MPT):
  • SELLER_REGRETS
  • THEY_DIDNT_ANSWER
  • BUYER_REGRETS
  • SELLER_OUT_OF_STOCK
  • SELLER_DIDNT_TRY_TO_CONTACT_BUYER
  • BUYER_NOT_ENOUGH_MONEY
  • THEY_NOT_HONORING_POLICIES
  • OTHER_MY_RESPONSIBILITY
  • OTHER_THEIR_RESPONSIBILITY
  • BUYER (All sites)
  • SELLER_OUT_OF_STOCK
  • BUYER_PAID_BUT_DID_NOT_RECEIVE
  • OTHER_MY_RESPONSIBILITY

Post feedback

To send feedback to an order, make a POST to the order like this:

curl -X POST -H "Content-Type: application/json" -d
'{
  "fulfilled": false,
  "rating": "neutral",
  "message": "Operation not completed",
  "reason": "THEY_DIDNT_ANSWER",
  "restock_item": true,
  "has_seller_refunded_money": false
}'

"https://api.mercadolibre.com/orders/{order_Id}/feedback?version=3.0&access_token=$ACCESS_TOKEN"

Reply

You can reply to the feedback you got from the other party in order to explain your reasons or give additional information by making a POST to the API, including their feedback_id like in the following example:

curl -X POST -H "Content-Type: application/json" -d'{
"reply":"COMMENT 2."
}' "https://api.mercadolibre.com/feedback/{feedback_Id}/reply?version=3.0&access_token=$ACCESS_TOKEN"

How do I know the other party feedback Id?

This is very easy, just make a GET to orders. If you did this in a previous step, you already have the feedback_id and you don’t need to do it again.

curl -X GET "https://api.mercadolibre.com/orders/{order_Id}?access_token=$ACCESS_TOKEN"

RESPONSE:

{
  "id": 825103323,
  "status": "confirmed",
  "status_detail": {
    "code": null,
    "description": null
  },
  "date_created": "2014-03-17T23:27:53.000-04:00",
  "date_closed": "2014-03-17T23:27:53.000-04:00",
  "last_updated": "2014-06-01T16:36:28.000-04:00",
  "order_items": [
    {
      "item": {
        "id": "MLA494467937",
        "title": "Tag Heuer Aquaracer Automatico 43mm Cal16 Day-d Linea Nueva",
        "variation_id": null,
        "variation_attributes": []
      },
      "quantity": 1,
      "unit_price": 24100,
      "currency_id": "ARS"
    }
  ],
  "total_amount": 24100,
  "currency_id": "ARS",
  "buyer": {
    "id": 9981145,
    "nickname": "CARLITOS8665",
    "email": "carlitos8665@gmail.com",
    "phone": {
      "area_code": "011",
      "number": "1544706706",
      "extension": null
    },
    "alternative_phone": {
      "area_code": "011",
      "number": "48027618",
      "extension": null
    },
    "first_name": "Carlos",
    "last_name": "Acuña",
    "billing_info": {
      "doc_type": null,
      "doc_number": null
    }
  },
  "seller": {
    "id": 114499680,
    "nickname": "WATCHES-LUXURY2",
    "email": "watches-luxury2@hotmail.com",
    "phone": {
      "area_code": null,
      "number": "( 011) 1552490473",
      "extension": null
    },
    "alternative_phone": {
      "area_code": null,
      "number": "",
      "extension": null
    },
    "first_name": "carolina soledad",
    "last_name": "casares"
  },
  "payments": [],
  "feedback": {
    "purchase": {
      "id": 5040068164512,
      "date_created": "2014-04-07T11:20:00.000-04:00",
      "fulfilled": true,
      "rating": "positive",
      "status": "active"
    },
    "sale": {
      "id": 5040068160032,
      "date_created": "2014-04-07T11:20:57.000-04:00",
      "fulfilled": true,
      "rating": "neutral",
      "status": "active"
    }
  },
  "shipping": {
    "status": "to_be_agreed"
  },
  "tags": [
    "paid",
    "not_delivered"
  ],
  "mediations": [],
  "application_id": "2568868276694852",
  "hidden_for_seller": false,
  "buying_mode": "buy_it_now"
}

You’ll find a feedback_id for each experience: sale and purchase. In this test example, "id": 5040103892781 it’s the feedback_id for the sale experience, while "id": 5040103885872 it’s for the purchase experience.

Change feedback

In case you want to change the feedback, you’ve already learned how to GET the other party feedback ID, so now you just have make a PUT to the API like this:

curl -X PUT -H "Content-Type: application/json" -d '{
  "fulfilled": true,
  "rating": "positive",
  "message": "It’s ok.",
}' "https://api.mercadolibre.com//feedback/{feedback_id}?version=3.0&access_token=$ACCESS_TOKEN"

Other way of doing this is by making a PUT to the order specifying the experience in the url, like in the following examples.

https://api.mercadolibre.com/orders/{order_id}/feedback/EXPERIENCE?version=3.0&access_token=$ACCESS_TOKEN

A seller will add the parameter sale to the url:

curl -X PUT -H "Content-Type: application/json" -d '{
  "fulfilled": false,
  "rating": "neutral",
  "message": "fine",
  "reason": "THEY_DIDNT_ANSWER"
}' "https://api.mercadolibre.com/orders/{order_id}/feedback/sale?version=3.0&access_token=$ACCESS_TOKEN"

While a buyer will do exactly the same, but adding purchase:

url -X PUT -H "Content-Type: application/json" -d '{
  "fulfilled": false,
  "rating": "neutral",
  "message": "fine",
  "reason": "THEY_DIDNT_ANSWER"
}' "https://api.mercadolibre.com/orders/{order_id}/feedback/purchase?version=3.0&access_token=$ACCESS_TOKEN"

Important: Note that we’re including the parameter version=3.0 in the url. This will be mandatory to use the new Feedback API during a 3 month adaptation period, deadline: October 28, when the previous version of the API wont be available anymore.

Please, rate this article


Viewing all articles
Browse latest Browse all 99