{"id":21385137,"url":"https://github.com/tmilar/meli-manager","last_synced_at":"2025-07-13T14:31:54.610Z","repository":{"id":33762343,"uuid":"123318788","full_name":"tmilar/meli-manager","owner":"tmilar","description":"Node.js + MercadoLibre API + Google Spreadsheets API = 🎉","archived":false,"fork":false,"pushed_at":"2023-02-28T00:58:49.000Z","size":2730,"stargazers_count":29,"open_issues_count":45,"forks_count":4,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-07T12:52:01.434Z","etag":null,"topics":["google-spreadsheet","mercadolibre-api","nodejs","now-sh"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/tmilar.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-02-28T17:32:06.000Z","updated_at":"2023-12-21T01:53:53.000Z","dependencies_parsed_at":"2023-01-15T02:23:20.391Z","dependency_job_id":null,"html_url":"https://github.com/tmilar/meli-manager","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/tmilar/meli-manager","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tmilar%2Fmeli-manager","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tmilar%2Fmeli-manager/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tmilar%2Fmeli-manager/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tmilar%2Fmeli-manager/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tmilar","download_url":"https://codeload.github.com/tmilar/meli-manager/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tmilar%2Fmeli-manager/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":265155776,"owners_count":23719585,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["google-spreadsheet","mercadolibre-api","nodejs","now-sh"],"created_at":"2024-11-22T11:44:43.260Z","updated_at":"2025-07-13T14:31:54.180Z","avatar_url":"https://github.com/tmilar.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# MeLi Manager\n\n[![Greenkeeper badge](https://badges.greenkeeper.io/tmilar/meli-manager.svg)](https://greenkeeper.io/)\n\nNode.js + MercadoLibre API + Google SpreadSheets API = :tada:\n\n## Table of Contents\n\n\u003c!-- toc --\u003e\n\n- [About](#about)\n  * [Features](#features)\n  * [Soon](#soon)\n  * [Planned](#planned)\n- [Usage](#usage)\n  * [Requirements](#requirements)\n  * [First time Setup](#first-time-setup)\n  * [Run](#run)\n  * [Deploy to Now](#deploy-to-now)\n    + [Setup \u0026 Config](#setup--config)\n    + [Deploy](#deploy)\n  * [Test](#test)\n  * [Misc](#misc)\n    + [MercadoLibre Test Accounts CLI tool](#mercadolibre-test-accounts-cli-tool)\n    + [Google Spreadsheet API Keys Setup](#google-spreadsheet-api-keys-setup)\n- [API docs](#api-docs)\n  * [Authorize MercadoLibre Account](#authorize-mercadolibre-account)\n  * [MercadoLibre notifications listener](#mercadolibre-notifications-listener)\n  * [Get MercadoLibre Orders](#get-mercadolibre-orders)\n      - [URL Params](#url-params)\n  * [Get MercadoLibre Questions](#get-mercadolibre-questions)\n      - [URL Params](#url-params-1)\n  * [Answer Mercadolibre Question](#answer-mercadolibre-question)\n      - [URL Params](#url-params-2)\n      - [Body Params](#body-params)\n- [Contributing](#contributing)\n\n\u003c!-- tocstop --\u003e\n\n## About\nMeli Manager is a set of tools to help small and medium sized sellers of MercadoLibre manage their operations in an easy, scalable, and more time/cost effective way in comparison to official MercadoLibre UI.\n\n### Features\n- [x] Synchronize Orders with Google Spreadsheet\n- [x] Real time synchronization support.\n- [x] Multi-account support.\n- [x] Simplify order status information (delivery and payment statuses).\n- [x] Manage customer Questions.\n\n### Soon\n- [ ] Manage customer Messages.\n- [ ] Synchronize Customers data related to Orders.\n- [ ] Build Customers profiles and relate to questions and messages.\n\n### Planned\n- [ ] Spreadsheet Aggregated Listings UI - CRUD\n- [ ] Catalog Items definition and mapping to Listings\n\n## Usage\n### Requirements\n* [Node.js 8+](https://nodejs.org/es/download/)\n* [MongoDB 3.4+](https://www.mongodb.com/download-center#community)\n* MercadoLibre API [client keys](https://developers.mercadolibre.com.ar/apps/create-app) ([more info](https://developers.mercadolibre.com/en_us/register-your-application))\n* Google Spreadsheet API [client keys](https://cloud.google.com/docs/authentication/api-keys) (see [setup steps](#google-spreadsheet-api-keys-setup))\n\n### First time Setup\n\n```\nnpm install\n```\n\nThen, `npm run setup` to initialize .env file. Edit it to fill in the blanks:\n\n```\n# Express server port (ie. 3000)\nPORT=\n\n# MercadoLibre application credentials\nMELI_CLIENT_ID=\nMELI_CLIENT_SECRET=\n\n# Google Spreadsheet application credentials\nSPREADSHEET_PRIVATE_KEY_ID=\nSPREADSHEET_PRIVATE_KEY=\nSPREADSHEET_CLIENT_EMAIL=\nSPREADSHEET_CLIENT_ID=\n\n# Mongo DB url. (ie. local dev: mongodb://localhost/melimgr)\nMONGODB_URL=\n\n# Google Spreadsheet document ID where to store MeLi Orders\nORDERS_SPREADSHEET_ID=\n# Orders sheet name (ie. 'Sheet 1', 'Ventas'...)\nORDERS_SPREADSHEET_SHEETNAME=\n\n# Google Spreadsheet document ID where to store MeLi Questions\nQUESTIONS_SPREADSHEET_ID=\n# Questions sheet name (ie. 'Sheet 1', 'Ventas'...)\nQUESTIONS_SPREADSHEET_SHEETNAME=\n```\n\n### Run\nEnsure Mongo DB instance is running (specified in `.env` file). Then:\n```\nnpm start\n```\n\n### Deploy to Now\n\nDeploying is easy!\n\n#### Setup \u0026 Config\n1) Make sure [Now client](https://zeit.co/download) is installed.\n2) Configure app secrets:\n```\nnow secret add meli-manager-meli_client_secret \"my_meli_client_secret\"\nnow secret add meli-manager-mongodb_url \"my_mongodb_url\"\nnow secret add meli-manager-spreadsheet_private_key_id \"my_spreadsheet_private_key_id\"\nnow secret add meli-manager-spreadsheet_private_key \"my_spreadsheet_private_key\"\n```\n_Note:_ the spreadsheet private key might be trickier to add to Now, due to it's multiline complexity.\nA [workaround](https://github.com/zeit/now-cli/issues/749#issuecomment-496674978) is saving the key text in a clean file, and then run instead:\n```\nnow secret add meli-manager-spreadsheet_private_key -- \"`\u003c google-secret-key`\"\n```\n\n3) Edit [`now.json`](./now.json) file `env` variables as you seem fit for your instance.\n\n#### Deploy\n\nSimply run:\n```\nnow\n```\nAnd in a few moments you'll see the URL of your running instance. See the [now docs](https://zeit.co/docs/v2/getting-started/introduction-to-now/) for more deployment options.\n\n### Test\nEnsure test Mongo DB instance is running (specified in `.env.test` file). Then:\n```\nnpm test\n```\n\n### Misc\n\n#### MercadoLibre Test Accounts CLI tool\nAn optional command line utility to locally create, authorize and store a MeLi test user account is provided.\n\n__How to use__\n1. Setup env variables in `bin/cli-meli-accounts` path:\n```\n$ npm run meli:test-account:setup\n```\nThis will initialize a fresh `bin/cli-meli-accounts/.env` file like this, for you to complete:\n```\n# Port to use for oauth server. 3001 is suggested.\nPORT=3001\n\n# Mongo DB URL where to register/retrieve user Accounts.\nMONGODB_URL=\n\n# MercadoLibre Application keys used to create Test accounts \u0026 refresh Account access tokens.\nMELI_CLIENT_ID=\nMELI_CLIENT_SECRET=\n```\n\n2. Ensure the configured Mongo DB instance is running.\n3. Run it. For example:\n\n```\n$ npm run meli:test-account \nUsage: cli-meli-accounts [options]\n\nWelcome!\n? What do you want to do? (Use arrow keys)\n\u003e Create a new Test account\n  Login \u0026 Save existing account\n  List saved accounts\n  ──────────────\n  Exit\n```\n\n\n#### Google Spreadsheet API Keys Setup\n\nTo write to your own spreadsheet you need to set up “Service Account Keys”. Follow these steps:\n\n1. Go to [https://console.cloud.google.com/apis/credentials](https://console.cloud.google.com/apis/credentials)\n\n2. Click on “Create credentials”; choose “Service account key”\n\n3. Select JSON when it asks you how to download the key.\n\n4. The service account key you have just generated includes a client_email. Navigate to your google spreadsheet that will hold the data and allow the client_email to have Write access on the document.\n\n5. With the downloaded JSON data, now you have to fill in the properties in the .env variables:\n\n    ```\n        SPREADSHEET_PRIVATE_KEY_ID=\u003cprivate_key_id\u003e\n        SPREADSHEET_PRIVATE_KEY=\u003cprivate_key\u003e\n        SPREADSHEET_CLIENT_EMAIL=\u003cclient_email\u003e\n        SPREADSHEET_CLIENT_ID=\u003cclient_id\u003e\n    ```\n\n    \u003e _Note_: the rest of the JSON properties are already set by default in the [`config/index.js`](../master/config/index.js) file.\n\n6. For this specific project, we'll also need the document Id and Sheet Name where we'll save the MercadoLibre Orders data:\n\n    \u003e The spreadsheet id can be found in the document URL. For example, in:\n    \u003e \"\u003chttps://docs.google.com/spreadsheets/d/1k0ip0Zvr9g9fXEnkLzNHs_recXFjTAlOFQ19nNdi4Tw/edit#gid=0\u003e\"\n    \u003e the spreadsheet Id is: __1k0ip0Zvr9g9fXEnkLzNHs_recXFjTAlOFQ19nNdi4Tw__\n\n    ```\n        ORDERS_SPREADSHEET_ID=\n    ```\n\n    \u003e The SHEETNAME is the literal name of the sheet to be used.\n    \u003e Usually defaults to \"Sheet 1\", but can be otherwise.\n\n    ```\n        ORDERS_SPREADSHEET_SHEETNAME=\n    ```\n\n7. Repeat step (6) for Questions sheet, if you'd like.\n\n    ```\n        QUESTIONS_SPREADSHEET_ID=\n    ```\n    ```\n        QUESTIONS_SPREADSHEET_SHEETNAME=\n    ```\n\n\n\n## API docs\n\n### Authorize MercadoLibre Account\n\n```\nGET /auth/mercadolibre\n```\nRun MercadoLibre account authorization flow.\nOn success, account tokens and relevant profile info will be stored in the DB, and will be available for the other endpoints.\n\n### MercadoLibre notifications listener\n\n```\nPOST /notification\n{\n    \"resource\": \"/orders/1499111111\",\n    \"user_id\": 33687004,\n    \"topic\": \"orders\",\n    \"application_id\": 2069392825111111,\n    \"attempts\": 1,\n    \"sent\": \"2017-10-09T13:58:23.347Z\",\n    \"received\": \"2017-10-09T13:58:23.329Z\"\n}\n```\nThis endpoint is used for listening notifications sent by the Mercadolibre application.\nMercadoLibre will send a notification each time a resource of the registered 'topics' is updated.\nSome of the currently registered topics are 'questions' and 'orders_v2'.\n\n\n### Get MercadoLibre Orders\n```\nGET /order\n```\nRetrieve all MercadoLibre orders of the available accounts.\n\n##### URL Params\n\nAll params are *optional*:\n\n| Param | Type | Example | Description |\n|---|---|---|---|\n| start | String | 01-01-19 | Start date filter (format \"DD-MM-YY\"). Inclusive. |\n| end | String | 31-01-19 | End date filter (format \"DD-MM-YY\"). Inclusive. |\n| accounts | String | \"MELI USER1,MELI USER2\" | Retrieve orders only from selected account usernames. |\n| store | Boolean | true, false| Wether to store retrieved orders in the configured spreadsheet. |\n\n### Get MercadoLibre Questions\n\n```\nGET /question\n```\n\nRetrieve all MercadoLibre questions of the available accounts.\n\n##### URL Params\n\nAll params are *optional*:\n\n| Param | Type | Example | Description |\n|---|---|---|---|\n| start | String | 01-01-19 | Start date filter (format \"DD-MM-YY\"). Inclusive. |\n| end | String | 31-01-19 | End date filter (format \"DD-MM-YY\"). Inclusive. |\n| accounts | String | \"MELI USER1,MELI USER2\" | Retrieve questions only from selected account usernames. |\n| store | Boolean | true, false| Wether to store retrieved questions in the configured spreadsheet. |\n\n### Answer Mercadolibre Question\n\n```\nPOST /question/{id}/answer\n{\n    \"sellerId\": 123456,\n    \"answerText\": \"Hola, esta en stock! Saludos.\"\n}\n```\n\n##### URL Params\n\nAll params are *required*.\n\n| Param | Type | Example | Description |\n|---|---|---|---|\n| id | Number | 111111111 | ID of the MercadoLibre Question to answer. |\n\n\n##### Body Params\n\nAll params are *required*.\n\n| Param  | Type | Example | Description |\n|---|---|---|---|\n| sellerId | Number | 12121212 | ID of MercadoLibre seller account. Requires account to be authorized. |\n| answerText | String | \"answer text\" | Text of the answer to be sent for the selected question |\n\n## Contributing\n- Create a new GitHub issue.\n- Submit a Pull Request.\n- All suggestions welcome!\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftmilar%2Fmeli-manager","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftmilar%2Fmeli-manager","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftmilar%2Fmeli-manager/lists"}