ati-crm v1.1.2
ATI CRM
SDK Documentation
Classes
Functions
AtiCrm
Pass a header as API-KEY
to gain access.
Kind: global class
AtiCrm.healthCheck()
healthCheck - server's health check
Path: crm/health
Kind: static method of AtiCrm
AtiCrm.metrics()
metrics - servers metrics
Path: crm/metrics
Kind: static method of AtiCrm
Stats
Kind: global class
Stats.metrics()
metrics - Promethus report export
Path: crm/stats/metrics
Kind: static method of Stats
Event
Kind: global class
Event.futureBilling(body)
futureBilling - Array of future billing dates and cash
Property | Type |
---|---|
next_bill_date | UTC String |
total | Float |
count | Number |
Path: crm/event/future/billing
Kind: static method of Event
Param | Type |
---|---|
body | Object |
Example
body
[
{
"next_bill_date": "Wed, 16 Sep 2020 15:05:29 GMT",
"total": 789.45,
"count": 234
},
{
"next_bill_date": "Wed, 17 Sep 2020 15:05:29 GMT",
"total": 75289.45,
"count": 2344
}
]
Event.gateway(body, mid)
gateway - Update gateway metric
Property | Type |
---|---|
total_billed_count | Number |
total_billed_money | Float |
total_refund_count | Number |
total_refund_money | Float |
front_end_fails | Number |
rebill_fails | Number |
monthly_cap | Float |
Path: crm/event/gateway/mid/:mid
Kind: static method of Event
Param | Type | Description |
---|---|---|
body | Object | |
mid | string | (example: 0) |
Example
body
{
"total_billed_count": 123,
"total_billed_money": 14.02,
"total_refund_count": 55,
"total_refund_money": 5.0,
"front_end_fails": 0,
"rebill_fails": 0,
"monthly_cap": 100000.00
}
Event.refund(body, aid)
refund - Add a new refund.
Property | Type |
---|---|
date | UTC String |
order_number | String |
account_number | String |
product_id | String |
price | Float |
Path: crm/event/refund/aid/:aid
Kind: static method of Event
Param | Type | Description |
---|---|---|
body | Object | |
aid | string | AID of the sale (example: 0) |
Example
body
{
"date": "Wed, 16 Sep 2020 15:05:29 GMT",
"order_number": "23254488",
"account_number": "23498900",
"product_id": "3498",
"price": 42.00
}
Event.sale(body, aid)
sale - Add a new sale.
Property | Type |
---|---|
date | UTC String |
order_number | String |
account_number | String |
product_id | String |
price | Float |
Path: crm/event/sale/aid/:aid
Kind: static method of Event
Param | Type | Description |
---|---|---|
body | Object | |
aid | string | (example: 0) |
Example
body
{
"date": "Wed, 16 Sep 2020 15:05:29 GMT",
"order_number": "232544848",
"account_number": "234989001",
"product_id": "3498",
"price": 42.00
}
Entity
Kind: global class
Entity.editProduct(body, pid)
editProduct - Creates a new Product or Updates a current one if the PID already exists.
Property | Type |
---|---|
status | String |
name | String |
price | Float |
Path: crm/entity/product/pid/:pid
Kind: static method of Entity
Param | Type | Description |
---|---|---|
body | Object | |
pid | string | (example: 0) |
Example
body
{
"status": "Active",
"name": "Some name",
"price": 9.00
}
Entity.editMerchant(body, mid)
editMerchant - Creates a new Merchant or Updates a current one if the MID already exists.
Property | Type |
---|---|
name | String |
msp | String |
signer | String |
Path: crm/entity/merchant/mid/:mid
Kind: static method of Entity
Param | Type | Description |
---|---|---|
body | Object | |
mid | string | (example: 0) |
Example
body
{
"name": "Some name",
"msp": "Active",
"signer": "john smith"
}
Entity.editAffiliate(body, aid)
editAffiliate - Creates a new Affiliate or Updates a current one if the AID already exists.
Property | Type |
---|---|
firstname | String |
lastname | String |
company | String |
sign_date | UTC String |
Path: crm/entity/affiliate/aid/:aid
Kind: static method of Entity
Param | Type | Description |
---|---|---|
body | Object | |
aid | string | (example: 0) |
Example
body
{
"firstname": "Some name",
"lastname": "Some name",
"company": "foo llc",
"sign_date": "Wed, 16 Sep 2020 15:05:29 GMT"
}
SDK(host, opts)
SDK - importing the SDK for use
Kind: global function
Param | Type | Description |
---|---|---|
host | string | the hostname to the service (example: http://127.0.0.1) |
opts | object | options that will be appened to every request. Fasquest Lib Options (example: {headers: {'API-KEY':'34098hodf'}}) |
Example
init
const { AtiCrm } = require('./sdk.js')('http://127.0.0.1');
Changelog
All notable changes to this project will be documented in this file. Dates are displayed in UTC.
v1.1.2
23 September 2020
- Fixed changlog template path
9ce0367
- Fixed eslint issues
d22d269
- Updated to use the latest tazi services depends
4ab2145
v1.1.1
22 September 2020
v1.1.0
22 September 2020
v1.0.3
22 September 2020
- Fixed typo
b74585a
v1.0.2
22 September 2020
- Pulled out the report metrics to its own endpoint.
ae7ca1e
v1.0.1
22 September 2020
v1.0.0
22 September 2020