Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/chjj/charged
High-level Chargify API binding for node.js
https://github.com/chjj/charged
Last synced: 16 days ago
JSON representation
High-level Chargify API binding for node.js
- Host: GitHub
- URL: https://github.com/chjj/charged
- Owner: chjj
- License: mit
- Created: 2012-06-06T17:57:18.000Z (over 12 years ago)
- Default Branch: master
- Last Pushed: 2014-06-02T17:41:33.000Z (over 10 years ago)
- Last Synced: 2024-10-20T01:14:56.871Z (24 days ago)
- Language: JavaScript
- Size: 447 KB
- Stars: 10
- Watchers: 3
- Forks: 5
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# charged
A high-level binding to the [Chargify](http://chargify.com/) API.
Charged also provides an interactive chargify shell for managing sites.
# Example Usage
``` js
var charged = require('charged');var chargify = charged({
subdomain: 'monthly-chili-cheese-fries',
apiKey: 'ad3rt4302ebdd'
});chargify.getSubscriptionsByCustomerRef('chjj', function(err, results) {
if (err) throw err;
console.log(results);
});
```* * *
``` bash
Usage: $ charged my-site
$ charged my-site my-key 'ls /customers/foo'
$ echo 'ls /stats' | charged my-site my-key
$ echo 'ls /stats' | charged --cfg ./config.json
$ charged --cfg ./config.json ls /customers/foo/subscriptions
```* * *
``` bash
$ charged my-site
API Key: foobar
[charged] ls /stats
{ seller_name: 'My Site Inc.',
site_name: 'my-site',
stats:
{ revenue_this_year: '$34,578.01',
total_revenue: '$34,581.01',
total_subscriptions: 1648,
subscriptions_today: 0,
revenue_this_month: '$18.00',
revenue_today: '$18.00' } }
[charged] ls /customers/foo
{ customer:
{ reference: 'foo',
email: '[email protected]',
country: null,
updated_at: '2012-09-27T15:01:17-04:00',
address: null,
created_at: '2012-08-26T16:53:03-04:00',
id: 2000,
state: null,
first_name: 'Foo',
last_name: 'Bar',
zip: null,
city: null,
organization: null,
phone: null,
address_2: null } }
[charged] cat /product_families
[ { product_family:
{ name: 'my-family',
accounting_code: null,
id: 20000,
description: 'Main product family.',
handle: 'my-family' } } ]
[charged] less /subscriptions
[charged] mk /subscriptions {product_handle:'my-product',customer_reference:'foo'}
[charged] mv {product_handle:'my-product2'} /subscriptions/[last-id]
[charged] ls customers/foo/subscriptions
[charged] cd customers
[charged] pwd
/customers
[charged] rm foo
# All of the Charged method names work as well...
[charged] get-stats
[charged] get-subscription 1000
[charged] update-subscription 1000 {product_handle:'my-product'}
[charged] get-customer-by-ref foo
```