All Projects → revolunet → node-sellsy

revolunet / node-sellsy

Licence: MIT license
Node Sellsy API wrapper

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to node-sellsy

iogrowCRM
CRM for Social Selling, on Google. Integrated with LinkedIn, Twitter, Facebook & Gmail.
Stars: ✭ 28 (+86.67%)
Mutual labels:  crm
logtacts
Better contact management.
Stars: ✭ 54 (+260%)
Mutual labels:  crm
springcrm
An open-source CRM.
Stars: ✭ 14 (-6.67%)
Mutual labels:  crm
itflow
Free and open-source web application for MSPs that streamlines IT documentation, ticketing, invoicing, and accounting, an alternative to ITGlue. It helps in managing and organizing client's IT information, increasing efficiency and profitability.
Stars: ✭ 282 (+1780%)
Mutual labels:  crm
bizbook-client
The repository of bizbook client project
Stars: ✭ 28 (+86.67%)
Mutual labels:  crm
personal-crm
🗂 Minimalist personal CRM to keep in touch with contacts
Stars: ✭ 23 (+53.33%)
Mutual labels:  crm
dhan-gaadi
A complete online bus reservation system (Node, React, Mongo, NextJS, ReactNative)
Stars: ✭ 207 (+1280%)
Mutual labels:  crm
SugarRestSharp
SugarRestSharp is a .NET C# SugarCRM/SuiteCRM Rest API Client. It is .NET C# Wrapper for the SugarCRM/SuiteCRM REST API Client.
Stars: ✭ 29 (+93.33%)
Mutual labels:  crm
codizer-core
Laravel CMS, CRM, E-Commerce
Stars: ✭ 43 (+186.67%)
Mutual labels:  crm
corebos
core Business Operating System. An OPEN SOURCE business application that helps small and medium business handle all the day to day tasks.
Stars: ✭ 128 (+753.33%)
Mutual labels:  crm
Oreka
Enterprise telephony recording and retrieval system with web based user interface.
Stars: ✭ 20 (+33.33%)
Mutual labels:  crm
kasir
Cashier Management & Inventory Management System
Stars: ✭ 28 (+86.67%)
Mutual labels:  crm
FoodDelivery
E-Commerce demo project. Food delivery application project made with.
Stars: ✭ 106 (+606.67%)
Mutual labels:  crm
cdp-service
cdp数据平台,帮助企业充分了解客户,实现千人千面的精准营销。
Stars: ✭ 30 (+100%)
Mutual labels:  crm
mira
A place for notes, but for the people I keep in touch with
Stars: ✭ 99 (+560%)
Mutual labels:  crm
eidea4
企业框架 scm erp wms
Stars: ✭ 53 (+253.33%)
Mutual labels:  crm
permacoop
Open source and eco design ERP solution reserved for worker-owned business.
Stars: ✭ 167 (+1013.33%)
Mutual labels:  crm
huankemao-php
企业微信私域流量裂变引流SCRM系统,开源PHP版官方Git
Stars: ✭ 50 (+233.33%)
Mutual labels:  crm
vtiger
🐯 Vtiger is the #1 business automation software. Try it with Docker!
Stars: ✭ 59 (+293.33%)
Mutual labels:  crm
ng-crm
A Simple Angular 6 CRM (CRUD Example)
Stars: ✭ 50 (+233.33%)
Mutual labels:  crm

node-sellsy

npm license github-issues

nodei.co

Node Sellsy API wrapper - works in NodeJS and in the browser.

The official Sellsy API is PHP based so here's a JavaScript handy replacement.

It can helps you automate most of Sellsy from their API.

For example i use a Stripe webhook to automate actions in Sellsy.

Features

QuickStart

npm i --save node-sellsy

var Sellsy = require("node-sellsy");

var sellsy = new Sellsy({
  creds: {
    consumerKey: "myConsumerKey",
    consumerSecret: "myConsumerSecret",
    userToken: "myUserToken",
    userSecret: "myUserSecret",
  },
});

var params = {
  search: {
    contains: "test",
  },
};

sellsy
  .api({
    method: "Client.getList",
    params: params,
  })
  .then((data) => {
    console.log("data", data);
  })
  .catch((e) => {
    console.log("error:", e);
  });

API

You can access the full Sellsy API using sellsy.api({ method, params }).

This call returns a promise.

Browser usage

Sellsy API doesnt provide CORS access so here's a drop-in proxy you can deploy on your own to use node-bookeo on the client : revolunet/sellsy-proxy.

Then, define the endPoint when creating your Sellsy instance :

var sellsy = new Sellsy({
  creds,
  endPoint: "http://path/to/sellsy/proxy",
});

Higher-level API methods :

Customer

Document

  • sellsy.documents.create(data)
  • sellsy.documents.createPayment(docType, docId, paymentData)
  • sellsy.documents.getList(docType, search)
  • sellsy.documents.getById(docType, docId)
  • sellsy.documents.updateStep(docType, docId, step)

Scripts

  • npm run readme : node ./node_modules/node-readme/bin/node-readme.js
  • npm run test : find ./spec -iname '*.spec.js' -exec ./node_modules/.bin/babel-node {} \; | ./node_modules/.bin/tap-spec
  • npm run zuul : ./node_modules/zuul/bin/zuul -- spec/**/*.spec.js
  • npm run build : babel -d ./dist ./src

Examples

Create an invoice

let sellsy = new Sellsy({
  creds: {
    consumerKey: "myConsumerKey",
    consumerSecret: "myConsumerSecret",
    userToken: "myUserToken",
    userSecret: "myUserSecret",
  },
});

const customerIdent = "1234";
const amountHorsTaxes = 42;

sellsy.customers.get({ ident: customerIdent }).then((customer) => {
  const documentData = {
    document: {
      doctype: "invoice",
      thirdid: customer.id,
      notes: customer.email,
      currency: "1",
      displayedDate: new Date().getTime() / 1000,
      subject: "Sujet de la facture",
      tags: "bookeo,stripe",
    },
    row: {
      1: {
        // use 'item' for object from catalog
        row_type: "once",
        row_name: "titre ligne facture",
        row_linkedid: null,
        row_notes: "notes ligne facture",
        row_tax: 20,
        row_unitAmount: amountHorsTaxes,
        row_qt: 1,
      },
    },
  };

  return sellsy.documents.create(documentData);
});

Then you can use

sellsy.documents.updateStep(createdDocument.type, createdDocument.id, 'paid') to mark invoice as paid and sellsy.documents.createPayment to record the payment method

Tests

  Customers.create should call sellsy api

    ✔ should call API twice
    ✔ should call Client.create with correct data
    ✔ should call Client.getList with correct data

  Customers.get should call sellsy api

    ✔ should call API
    ✔ should call get with correct data
    ✔ should return first result

  sellsy.api should be defined

    ✔ should be equal

  sellsy.api should init call oAuth.OAuth with correct parameters

    ✔ consumerKey
    ✔ consumerSecret

  sellsy.api post correct data to API

    ✔ userToken
    ✔ userSecret
    ✔ request
    ✔ io_mode
    ✔ method
    ✔ params

  Sellsy should use default api endPoint

    ✔ https://apifeed.sellsy.com/0/

  Sellsy should use given api endPoint

    ✔ http://path.to/proxy/test/


  total:     17
  passing:   17
  duration:  1.8s

Author

Julien Bouquillon [email protected] http://github.com/revolunet and contributors

License

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].