{"id":15664144,"url":"https://github.com/revolunet/node-sellsy","last_synced_at":"2025-07-26T17:34:17.043Z","repository":{"id":35961218,"uuid":"40251324","full_name":"revolunet/node-sellsy","owner":"revolunet","description":"Node Sellsy API wrapper","archived":false,"fork":false,"pushed_at":"2023-02-10T10:47:42.000Z","size":212,"stargazers_count":17,"open_issues_count":3,"forks_count":7,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-05-05T22:52:28.740Z","etag":null,"topics":["api","crm","nodejs","sellsy-api"],"latest_commit_sha":null,"homepage":"https://github.com/revolunet/node-sellsy","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/revolunet.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2015-08-05T14:52:41.000Z","updated_at":"2023-03-10T07:28:37.000Z","dependencies_parsed_at":"2024-06-19T01:46:43.948Z","dependency_job_id":"4bbdb111-3b29-45b6-849a-566bce89132c","html_url":"https://github.com/revolunet/node-sellsy","commit_stats":{"total_commits":70,"total_committers":8,"mean_commits":8.75,"dds":0.4714285714285714,"last_synced_commit":"c750f54926af5c78f57efdce5f0878f8dc07e137"},"previous_names":[],"tags_count":16,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/revolunet%2Fnode-sellsy","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/revolunet%2Fnode-sellsy/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/revolunet%2Fnode-sellsy/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/revolunet%2Fnode-sellsy/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/revolunet","download_url":"https://codeload.github.com/revolunet/node-sellsy/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252590530,"owners_count":21772935,"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":["api","crm","nodejs","sellsy-api"],"created_at":"2024-10-03T13:41:26.010Z","updated_at":"2025-05-05T22:52:45.522Z","avatar_url":"https://github.com/revolunet.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# node-sellsy\n\n[![npm](https://img.shields.io/npm/v/node-sellsy.svg)](https://www.npmjs.com/package/node-sellsy) ![license](https://img.shields.io/npm/l/node-sellsy.svg) [![github-issues](https://img.shields.io/github/issues/revolunet/node-sellsy.svg)](https://github.com/revolunet/node-sellsy/issues)\n\n![nodei.co](https://nodei.co/npm/node-sellsy.png?downloads=true\u0026downloadRank=true\u0026stars=true)\n\nNode Sellsy API wrapper - works in NodeJS **and** in the browser.\n\nThe official [Sellsy API](http://api.sellsy.fr/index) is PHP based so here's a JavaScript handy replacement.\n\nIt can helps you automate most of Sellsy from their API.\n\nFor example i use a Stripe webhook to automate actions in Sellsy.\n\n## Features\n\n- Works with your oauth private app id\n- Simple promise call for all methods in http://api.sellsy.fr/documentation/methodes\n\n## QuickStart\n\n`npm i --save node-sellsy`\n\n```js\nvar Sellsy = require(\"node-sellsy\");\n\nvar sellsy = new Sellsy({\n  creds: {\n    consumerKey: \"myConsumerKey\",\n    consumerSecret: \"myConsumerSecret\",\n    userToken: \"myUserToken\",\n    userSecret: \"myUserSecret\",\n  },\n});\n\nvar params = {\n  search: {\n    contains: \"test\",\n  },\n};\n\nsellsy\n  .api({\n    method: \"Client.getList\",\n    params: params,\n  })\n  .then((data) =\u003e {\n    console.log(\"data\", data);\n  })\n  .catch((e) =\u003e {\n    console.log(\"error:\", e);\n  });\n```\n\n## API\n\nYou can access the full Sellsy API using `sellsy.api({ method, params })`.\n\nThis call returns a promise.\n\n### Browser usage\n\nSellsy API doesnt provide CORS access so here's a drop-in proxy you can deploy on your own to use `node-sellsy` on the client : [revolunet/sellsy-proxy](http://github.com/revolunet/sellsy-proxy).\n\nThen, define the endPoint when creating your `Sellsy` instance :\n\n```js\nvar sellsy = new Sellsy({\n  creds,\n  endPoint: \"http://path/to/sellsy/proxy\",\n});\n```\n\n### Higher-level API methods :\n\n#### Customer\n\n- `sellsy.customers.create(data)`\n- `sellsy.customers.get({ email: 'customer@gmail.com' })`\n\n#### Document\n\n- `sellsy.documents.create(data)`\n- `sellsy.documents.createPayment(docType, docId, paymentData)`\n- `sellsy.documents.getList(docType, search)`\n- `sellsy.documents.getById(docType, docId)`\n- `sellsy.documents.updateStep(docType, docId, step)`\n\n## Scripts\n\n- **npm run readme** : `node ./node_modules/node-readme/bin/node-readme.js`\n- **npm run test** : `find ./spec -iname '*.spec.js' -exec ./node_modules/.bin/babel-node {} \\; | ./node_modules/.bin/tap-spec`\n- **npm run zuul** : `./node_modules/zuul/bin/zuul -- spec/**/*.spec.js`\n- **npm run build** : `babel -d ./dist ./src`\n\n## Examples\n\n### Create an invoice\n\n```js\nlet sellsy = new Sellsy({\n  creds: {\n    consumerKey: \"myConsumerKey\",\n    consumerSecret: \"myConsumerSecret\",\n    userToken: \"myUserToken\",\n    userSecret: \"myUserSecret\",\n  },\n});\n\nconst customerIdent = \"1234\";\nconst amountHorsTaxes = 42;\n\nsellsy.customers.get({ ident: customerIdent }).then((customer) =\u003e {\n  const documentData = {\n    document: {\n      doctype: \"invoice\",\n      thirdid: customer.id,\n      notes: customer.email,\n      currency: \"1\",\n      displayedDate: new Date().getTime() / 1000,\n      subject: \"Sujet de la facture\",\n      tags: \"bookeo,stripe\",\n    },\n    row: {\n      1: {\n        // use 'item' for object from catalog\n        row_type: \"once\",\n        row_name: \"titre ligne facture\",\n        row_linkedid: null,\n        row_notes: \"notes ligne facture\",\n        row_tax: 20,\n        row_unitAmount: amountHorsTaxes,\n        row_qt: 1,\n      },\n    },\n  };\n\n  return sellsy.documents.create(documentData);\n});\n```\n\nThen you can use\n\n`sellsy.documents.updateStep(createdDocument.type, createdDocument.id, 'paid')` to mark invoice as paid and `sellsy.documents.createPayment` to record the payment method\n\n## Tests\n\n```\n  Customers.create should call sellsy api\n\n    ✔ should call API twice\n    ✔ should call Client.create with correct data\n    ✔ should call Client.getList with correct data\n\n  Customers.get should call sellsy api\n\n    ✔ should call API\n    ✔ should call get with correct data\n    ✔ should return first result\n\n  sellsy.api should be defined\n\n    ✔ should be equal\n\n  sellsy.api should init call oAuth.OAuth with correct parameters\n\n    ✔ consumerKey\n    ✔ consumerSecret\n\n  sellsy.api post correct data to API\n\n    ✔ userToken\n    ✔ userSecret\n    ✔ request\n    ✔ io_mode\n    ✔ method\n    ✔ params\n\n  Sellsy should use default api endPoint\n\n    ✔ https://apifeed.sellsy.com/0/\n\n  Sellsy should use given api endPoint\n\n    ✔ http://path.to/proxy/test/\n\n\n  total:     17\n  passing:   17\n  duration:  1.8s\n```\n\n## Author\n\nJulien Bouquillon \u003cjulien@bouquillon.com\u003e http://github.com/revolunet and [contributors](https://github.com/revolunet/node-sellsy/graphs/contributors)\n\n## License\n\n- **MIT** : http://opensource.org/licenses/MIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frevolunet%2Fnode-sellsy","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frevolunet%2Fnode-sellsy","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frevolunet%2Fnode-sellsy/lists"}