upodi

0.0.30 • Public • Published

upodi-js

Unofficial NodeJs library for consuming the upodi.com API

Overview

Getting started

Install

npm install upodi

Initialization

const UpodiApi = require('upodi')

const upodi = new UpodiApi('${api key}')
const listOfCustomer = await upodi.customers.list({pagesize: '000, pagenumber: 1})

Working with Customers

List all customers. Options to limited list all or paged results. See limited lists below.

var customers = upodi.customers.list(all: true);

Create a new customer. Requires accountnumber, fullname and currencycode.

var newId = upodi.customers.create("acocuntnumber", "fullname", "USD");

Working with Subscriptions

List all subscriptions. Options to limited list all or paged results. See limited lists below.

var subscriptions = upodi.Subscriptions.list(all: true);

Create a new subscription. Requires the customer and product plan id.

var newId = upodi.subscriptions.create(customerId, productPlanId, DateTime.UtcNow);

Subscriptions enable various actions.

var result = upodi.subscriptions.activate(subscriptionId);
var result = upodi.subscriptions.cancel(subscriptionId);
var result = upodi.subscriptions.expire(subscriptionId);
var result = upodi.subscriptions.hold(subscriptionId);
var result = upodi.subscriptions.resume(subscriptionId);

Update amount of a subscription charge.

var result = upodi.Subscriptions.SetAmount(subscriptionId, productPlanChargeId, 302.34);

Limited lists

Using the .List() method on customer and subscription (ex. upodi.Subscriptions.List()) will return a reduced number of records due to performance. You will have to iterate through the list fetching each object to get the full object.

List Properties
Customer ID,CompanyName,AccountNumber,CurrencyCode,FullName,AutoBill,RefKey,CreatedDate,ModifiedDate
Subscription ID,SubscriptionNumber,CustomerID,ProductPlanID,StartDate,StateCode,Status,EndDate,RefKey,CreatedDate,ModifiedDate

Versions

Current Tags

VersionDownloads (Last 7 Days)Tag
0.0.300latest

Version History

VersionDownloads (Last 7 Days)Published
0.0.300
0.0.290
0.0.280
0.0.270
0.0.260
0.0.250
0.0.240
0.0.230
0.0.220
0.0.210
0.0.200
0.0.190
0.0.180
0.0.170
0.0.160
0.0.150
0.0.140
0.0.130
0.0.120
0.0.110
0.0.100
0.0.90
0.0.80
0.0.70
0.0.60
0.0.50
0.0.40
0.0.30
0.0.20
0.0.10

Package Sidebar

Install

npm i upodi

Weekly Downloads

0

Version

0.0.30

License

MIT

Unpacked Size

26 kB

Total Files

20

Last publish

Collaborators

  • ppalludan