zoined_api

1.3.16 • Public • Published

npm version

zoined_api

Description

Allows easy validation and posting to the Zoined api. Each line is validated against the api docs and returns an error with the cause and position if fails. If a null value is sent for a non required field then a default is used.

Installation

npm install --save zoined_api

Usage

const zoinedAPI = require(zoined_api)
zoinedAPI.init('myzoinedapikey')
....

zoinedAPI.dataPost(JSON.stringify(myData), 'dataType')
    .then(response => {
    ..
    })
    .catch(error => {
    ...
    });

Available dataTypes

  • sales
  • suppliers
  • campaigns
  • campaignproducts
  • departments
  • budgets
  • products
  • customers
  • organisations
  • salesperson
  • currencyrates
  • inventorysnapshots
  • inventorytransactions
  • flathierarchies
  • producthierachies
  • rebatecodes
  • salesorders
  • salessummary
  • visitors
  • visitordemographics
  • idmapping

Example Success Response

{
  "status": "OK",
  "msg": "1 entity added"
}

Example Error Response

{
    "errorSupplierID":"",
    "errorField":"supplier_id",
    "errorReason":"Missing Required Property"
}
  • request: Simplified HTTP request client.
  • request-promise: The simplified HTTP request client 'request' with Promise support. Powered by Bluebird.
  • babel-preset-env: A Babel preset for each environment.
  • chai: BDD/TDD assertion library for node.js and the browser. Test framework agnostic.
  • mocha: simple, flexible, fun test framework
  • mos: A pluggable module that injects content into your markdown files via hidden JavaScript snippets
  • nyc: the Istanbul command line interface

License

MIT © Dave Grix - Pavers LTD

/zoined_api/

    Package Sidebar

    Install

    npm i zoined_api

    Weekly Downloads

    3

    Version

    1.3.16

    License

    MIT

    Unpacked Size

    688 kB

    Total Files

    91

    Last publish

    Collaborators

    • davegrix