1.1.2 • Published 4 years ago

ati-crm v1.1.2

Weekly downloads
1
License
ISC
Repository
gitlab
Last release
4 years ago

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

PropertyType
next_bill_dateUTC String
totalFloat
countNumber

Path: crm/event/future/billing

Kind: static method of Event

ParamType
bodyObject

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

PropertyType
total_billed_countNumber
total_billed_moneyFloat
total_refund_countNumber
total_refund_moneyFloat
front_end_failsNumber
rebill_failsNumber
monthly_capFloat

Path: crm/event/gateway/mid/:mid

Kind: static method of Event

ParamTypeDescription
bodyObject
midstring(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.

PropertyType
dateUTC String
order_numberString
account_numberString
product_idString
priceFloat

Path: crm/event/refund/aid/:aid

Kind: static method of Event

ParamTypeDescription
bodyObject
aidstringAID 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.

PropertyType
dateUTC String
order_numberString
account_numberString
product_idString
priceFloat

Path: crm/event/sale/aid/:aid

Kind: static method of Event

ParamTypeDescription
bodyObject
aidstring(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.

PropertyType
statusString
nameString
priceFloat

Path: crm/entity/product/pid/:pid

Kind: static method of Entity

ParamTypeDescription
bodyObject
pidstring(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.

PropertyType
nameString
mspString
signerString

Path: crm/entity/merchant/mid/:mid

Kind: static method of Entity

ParamTypeDescription
bodyObject
midstring(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.

PropertyType
firstnameString
lastnameString
companyString
sign_dateUTC String

Path: crm/entity/affiliate/aid/:aid

Kind: static method of Entity

ParamTypeDescription
bodyObject
aidstring(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

ParamTypeDescription
hoststringthe hostname to the service (example: http://127.0.0.1)
optsobjectoptions 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

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

1.1.2

4 years ago

1.1.1

4 years ago