Constructor
new Tillhub()
Example
const Tillhub = require('@tillhub/node-sdk')
const th = new Tillhub({
credentials: {
username: 'user@example.com',
password: '123455'
}
})
await th.init()
// do something with the instance
const transactions = th.transactions()
const { data, metadata } = await transactions.getAll()
console.log(data) // [...]
Methods
carts(options) → {Carts}
Create an authenticated carts instance
Parameters:
Name | Type | Description |
---|---|---|
options |
Object |
options object |
init(callbacknullable)
Initialise the SDK instance by authenticating the client
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
callback |
function |
<nullable> |
optional callback. I fnot specified a Promise will be returned |
products(options) → {Products}
Create an authenticated products instance
Parameters:
Name | Type | Description |
---|---|---|
options |
Object |
options object |
templates(options) → {Templates}
Create an authenticated templates instance
Parameters:
Name | Type | Description |
---|---|---|
options |
Object |
options object |
transactions(options) → {Transactions}
Create an authenticated transactions instance
Parameters:
Name | Type | Description |
---|---|---|
options |
Object |
options object |