1.0.3 • Published 8 years ago

bts v1.0.3

Weekly downloads
6
License
MIT
Repository
github
Last release
8 years ago

bts

bill.today server

NOTE: This package is not ready yet. Some things do NOT work atm!

Status

Build Status

Usage

Installation

Install the server:

npm install bts -g

We recommend installing bts server globally since this seperates your config away from bts itself + is easy to update

API requests

There is a billtoday package available on npm that handles requests and json parsing for you. In general an API request looks like this:
GET /someappdomain.com/userId/
Note: You have to specify your long lived bts access token in the header for authentication.

The response will be a json string as body:

{
    "btId":"someInternalBtsId",
    "btUserLink":"https://bill.today/someappdomain.com/someInternalBtsId",
    "userId":"userId",
    "userEmail":"mail@example.com",
    "status":"ok",
    "statusMessage":"Everything ok!",
    "subscribed":true,
    "subscribedUntil":"2030-12-01",
    "plan":"pro"
}
keydescription
btIdcan be used to reference to an account in the bill today server instance
btUserLinkjust for convenience -> a ready to use link you can use to redirect your user to for fixing payment issues
userIdthis represents the id that is used by your app to organize accounts
userEmailcontains email that the user used at sign up on bill.today
statushealth of billing account. Can be used to show more detailed status information in your app
statusMessagemore detailed text for status might be not ok
subscribedtells you if a plan is active
subscribedUntiltells you the left amount of time purchased
plantells you the active plan (that the user has paid for)