- v0.Auth
- Transactions
Handle Tillhub Transactions from the v0 Model
- VoucherLogs
Handle Tillhub Voucher Logs.
- Vouchers
Handle Tillhub Vouchers.
- Auth ⇐
"v0.Auth"
Authenticate an app via different auth strategies
- Carts
Handle Tillhub Carts from the v1 Model
- Products
Handle Tillhub Products from the v1 Model
- Templates
Handle Tillhub Templates from the v1 Model.
Templates will drive email and document behaviours and layouts.
- authResponseStruct :
Object
Object that is returned by all authentication methods.
- authCallback :
function
Callback that will be passed by all authentication methods.
Authenticate an app via different auth strategies
Example
const Auth = require('@tillhub/node-sdk').v0.Auth
const auth = new Auth ()
auth.loginUsername('[email protected]', '123455', (err, body) => {
if (err) throw err
console.log(body.token)
console.log(body.user)
})
Handle Tillhub Transactions from the v0 Model
Get all transactions from client account.
Kind: instance method of Transactions
Param | Type | Description |
---|---|---|
[queryOrCallback] | Object | function |
query for transactions with allowed paramaters, or specify an optional callback |
[callback] | function |
optional callback. If not specified, this function returns a promise |
Handle Tillhub Voucher Logs.
Get all voucher logs for a client account.
Kind: instance method of VoucherLogs
Param | Type | Description |
---|---|---|
[queryOrCallback] | Object | function |
query for voucher logs with allowed paramaters, or specify an optional callback |
[callback] | function |
optional callback. If not specified, this function returns a promise |
Handle Tillhub Vouchers.
Kind: global class
Create a voucher.
Kind: instance method of Vouchers
Param | Type | Description |
---|---|---|
body | Object |
object defining a voucher |
[optionsOrCallback] | Object | function |
options for voucher with allowed paramaters, or specify an optional callback |
[callback] | function |
optional callback. If not specified, this function returns a promise |
Replace propertise on a voucher.
Kind: instance method of Vouchers
Param | Type | Description |
---|---|---|
body | Object |
object defining voucher properties |
[optionsOrCallback] | Object | function |
options for vouchers with allowed paramaters, or specify an optional callback |
[callback] | function |
optional callback. If not specified, this function returns a promise |
Get all vouchers from client account.
Kind: instance method of Vouchers
Param | Type | Description |
---|---|---|
[queryOrCallback] | Object | function |
query for vouchers with allowed paramaters, or specify an optional callback |
[callback] | function |
optional callback. If not specified, this function returns a promise |
Authenticate an app via different auth strategies
Kind: global class
Extends: "v0.Auth"
- Auth ⇐
"v0.Auth"
Authenticate by username
Kind: instance method of Auth
Param | Type | Description |
---|---|---|
username | String |
the tillhub client account e-mail address |
password | String |
the password corresponding to the tillhub client account\ |
[callback] | authCallback |
optional callback |
Authenticate as headless service account.
Kind: instance method of Auth
Param | Type | Description |
---|---|---|
clientAccount | String |
tillhub client account uuid |
apiKey | String |
name of service account (a type of user in the registered in the client account) |
[callback] | authCallback |
optional callback |
Handle Tillhub Carts from the v1 Model
Kind: global class
Get all carts from client account.
Kind: instance method of Carts
Param | Type | Description |
---|---|---|
[queryOrCallback] | Object | function |
query for carts with allowed paramaters, or specify an optional callback |
[callback] | function |
optional callback. If not specified, this function returns a promise |
Create a cart to consume in Tillhub Clients.
Kind: instance method of Carts
Param | Type | Description |
---|---|---|
cart | Object |
the cart body |
[optionsOrCallback] | Object | function |
query for carts with allowed paramaters, or specify an optional callback |
[callback] | function |
optional callback. If not specified, this function returns a promise |
Handle Tillhub Products from the v1 Model
Get all products from client account.
Kind: instance method of Products
Param | Type | Description |
---|---|---|
[queryOrCallback] | Object | function |
query for products with allowed paramaters, or specify an optional callback |
[callback] | function |
optional callback. If not specified, this function returns a promise |
Handle Tillhub Templates from the v1 Model.
Templates will drive email and document behaviours and layouts.
Kind: global class
Create a template.
Kind: instance method of Templates
Param | Type | Description |
---|---|---|
body | Object |
object defining a template |
[optionsOrCallback] | Object | function |
options for templates with allowed paramaters, or specify an optional callback |
[callback] | function |
optional callback. If not specified, this function returns a promise |
Replace propertise on a template.
Kind: instance method of Templates
Param | Type | Description |
---|---|---|
body | Object |
object defining template properties |
[optionsOrCallback] | Object | function |
options for templates with allowed paramaters, or specify an optional callback |
[callback] | function |
optional callback. If not specified, this function returns a promise |
Get all templates from client account.
Kind: instance method of Templates
Param | Type | Description |
---|---|---|
[queryOrCallback] | Object | function |
query for templates with allowed paramaters, or specify an optional callback |
[callback] | function |
optional callback. If not specified, this function returns a promise |
Object that is returned by all authentication methods.
Kind: global typedef
Properties
Name | Type | Description |
---|---|---|
token | String |
JWT token that will be used as Bearer Token in subsequent requests |
user | boolean |
the alphanumeric client account ID that will be used in most routes |
Callback that will be passed by all authentication methods.
Kind: global typedef
Param | Type |
---|---|
body | authResponseStruct |