winkelco / mercadolibre-api
Mercado Libre API client
Installs: 1 992
Dependents: 1
Suggesters: 0
Security: 0
Stars: 0
Watchers: 2
Forks: 1
Open Issues: 0
Requires
- guzzlehttp/guzzle: ~5.0|~6.0|~7.0
- jms/serializer: ^1.3|^3.11
- symfony/yaml: ~2.1|~3.0|~5.0
Requires (Dev)
- phpunit/phpunit: ^5.5|^9.0
README
Documentation
Official documentation and how to use the MercadoLibre API can be found at http://developers.mercadolibre.com/api-docs/
Installation
Using composer
composer require winkelco/mercadolibre-api
Usage
<?php // Instantiate serializer with configurations. $serializer = \JMS\Serializer\SerializerBuilder::create() ->addMetadataDir(__DIR__ . '/../../resources/config/serializer') ->build(); // Instantiate client. $client = new WinkelCo\MercadoLibreApi\Client\MercadoLibreClient( [], $serializer ); // Call show user. $ml_response = $client->showUser(1); var_dump($ml_response); // object(Winkelco\MercadoLibreApi\Entity\User)
MercadoLibre API resources:
Overstriked resources are not available yet in this package. Contributions will be appreciated.
Users & Apps
-
/users/{Cust_id}?access_token=$ACCESS_TOKEN
User account information. GET PUTGet user information.
$client->userShow('123');
Update user information
-
/users/me
Returns account information about the authenticated user. GETGet information about the authenticated user.
$client->userShowMe();
-
/users/{Cust_id}/addresses?access_token=$ACCESS_TOKEN
Returns addresses registered by the user. GETGet user addresses.
-
/users/{Cust_id}/accepted_payment_methods
Returns payment methods accepted by a seller to collect its operations. GETGet accepted payment methods by user.
-
/applications/{application_id}?ACCESS_TOKEN
Returns information about the application. GETGet application details.
-
/users/{User_id}/brands
This resource retrieves brands associated to an user_id. The official_store_id attribute identifies a store. GETGet brands by user.
-
/users/{User_id}/classifieds_promotion_packs?access_token=$ACCESS_TOKEN
Manage user promotion packs. GET POSTGet promotions packs engaged by user.
$client->userPackages();
Creates a new Promotion Pack for the user.
-
/users/{user_id}/classifieds_promotion_packs/{listing_type}&categoryId={category_id}?acces_token=$ACCESS_TOKEN
Availability for the user to list under a given Listing Type and category according to packages engaged. GETGet the availability Listing Type availability by user and category.
-
/projects?access_token=$ACCESS_TOKEN
Manage projects. GET POST PUT DELETEGet all applications associated to a project
Create a new project.
Update a project.
Remove a project.
-
/projects/{Project_id}/applications?access_token=ACCESS_TOKEN_APP_OWNER
Manage applications & projects. POST DELETESave an application under your project.
Remove an application from your project.
-
/users/{Cust_id}/available_listing_types?category_id={Category_id}&access_token=$ACCESS_TOKEN
Listing types availability by user and category. GETGet available listing types.
-
/users/{Cust_id}/available_listing_type/{listing_type_id}?category_id={Category_id}&access_token=$ACCESS_TOKEN
Retrieves availability to list under a listing type for a given category. GETGet category availability.
-
/users/{User_id}/applications/{App_id}?access_token=$ACCESS_TOKEN
Application permissions. DELETERevoke permissions to an application.
-
/myfeeds?app_id={App_id}
Notifications history. GETGet historic of notifications by App.
Categories & Listings
-
/sites
Retrieves information about the sites where MercadoLibre runs. GETGet all sites.
-
/site_domains/{Site_domain_url}
Returns information about the domain. GETGet domain information.
-
/sites/{Site_id}/listing_types
Returns information about listing types. GETGet listing types by site.
-
/sites/{Site_id}/listing_exposures
Returns different exposure levels associated with all listing types in MercadoLibre. GETGet listing exposures by site.
-
/sites/{Site_id}/listing_prices?price={Price}
Returns the listing price for selling and buying in MercadoLibre. GETGet listing prices.
-
/sites/{Site_id}/categories
Returns available categories in the site. GETGet the category tree by site
$client->categoryList();
-
/categories/{Category_id}
Returns information about a category. GETGet category details.
-
/categories/{Category_id}/attributes
Displays attributes and rules over them in order to describe the items that are stored in each category. GETGet category attributes.
-
/sites/{Site_id}/category_predictor/predict
Category predictor. Retrieves the most accurate category to list your item basing on it’s title. GETPredict category.
$client->categoryPredict('MLA', 'Fiat Uno');
-
/categories/{Category_id}/classifieds_promotion_packs
Retrieves classified promotion packs by category. GETGet classified promotion packs by category
Locations & Currencies
-
/countries
Returns countries information. GETGet information about countries.
-
/countries/{Country_id}
Returns country information by country_id. GETGet country detail
-
/states/{State_id}
Returns state information. GETGet state information.
-
/cities/{City_id}
Returns city information. GETGet city information.
-
/currencies
Returns information about all available currencies in MercadoLibre. GETGet currencies information.
-
/currencies/{Currency_id}
Returns information about available currencies in MercadoLibre by currency_id. GETGet currency details.
-
/currency_conversions/search?from={Currency_id}&to={Currency_id}
Retrieves the conversion ratio between currencies that MercadoLibre uses in calculations. GETGet ratio conversion between currencies.
-
/countries/{Country_id}/zip_codes/{Zip_code}
Retrieves data for the location of the zip code entered. GETGet location information by zip code.
-
/country/{Country_id}/zip_codes/search_between?zip_code_from={zip_code_from}&zip_code_to={zip_code_to}
Retrieve all zip codes for a country_id between two given zip codes. GETGet all zip codes between two given values of zip codes.
Items & Searches
-
/items
Allows listing items. POSTList an item in MercadoLibre.
$item = new Zephia\MercadoLibre\Entity\Item; $client->itemCreate($item);
-
/items/{Item_id}
Allows managing listings GET PUTGet item details.
$client->itemShow('MLA123123');
Update an item.
-
/items/validate
Validate the JSON before posting an item. POSTValidate your JSON.
-
/items/{Item_id}/available_upgrades
Returns available listing types to upgrade an item posure. GETGet available upgrades.
-
/items/{Item_id}/relist
Allows to relist an item. GETRelist your item.
-
/items/{Item_id}/pictures/{picture_id}
Manage item pictures. GET DELETEGet pictures in all it sizes.
Delete a picture.
-
/items/{Item_id}/pictures
Add and update pictures on your item. GET PUTPost a picture.
Update items pictures.
-
/items/{Item_id}/description
Manage description for an item. GET PUTGet item description.
Update item description.
-
/sites/{Site_id}/search?q=ipod
Retrieves items from a search query. GETMETHOD DESCRIPTION
-
/sites/{Site_id}/searchUrl?q=ipod
Search for any item in MercadoLibre. It will return an array of items url that match the search criteria. GETSearch items Url by query.
-
/sites/MLA/search?category={Category_id}&official_store_id=all
Search for all items listed by Official Stores for a given category. GETSearch Official Store items.
-
/sites/{Site_id}/hot_items/search?limit=5&category={Category_id}
Retrieves an array of hot items from a specified category by parameter. Works only with the first level of categories. GETSearch hot items.
-
/sites/{Site_id}/featured_items/HP-{Category_Id}
Retrieves an array of featured items. The featured items are items that have a special posure at home page or categories page. You can use only HP for products of home or HP-{categId} for featured by category. Only works with first level of categories. GETGet items featured on the home by it’s category.
-
/sites/{Site_id}/trends/search?category={Category_id}
Retrieve an array of the trends items from the category specified by parameter. GETGet trends by category
-
/sites/{Site_id}/search?seller_id={Seller_id}&category={Category_id}&access_token=$ACCESS_TOKEN
Search items by seller_id for a category. GETGet items by seller id and cateogyr id.
-
/users/{Cust_id}/items/search?access_token=$ACCESS_TOKEN
Retrieves user’s listings. GETGet user’s listings
$client->setAccessToken(ACCESS_TOKEN)->itemList('user_id');
-
/items/{Item_id}/product_identifiers/
Retrieves the product identifier codes associated to your item. GET PUTGet item product identifiers.
Update product identifiers
-
/items/{Item_id}/variations
Manage item’s variations. GET POSTGet item’s variations.
Create a variation for your item.
-
/items/{Item_id}/variations/{Variation_id}
Manage variations. GET PUT DELETEGet variation details.
Update a variation.
Delete a variation.
-
/users/{Cust_id}/items/search?sku={seller_custom_field}&status=active&access_token=$ACCESS_TOKEN
Search item by SKU. Filter item by status. GETSearch item by SKU. Filter item by status.