@klarr-agency/gumroad--api
Client for the Gumroad API.
Last updated 6 months ago by klarr-agency .
Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install @klarr-agency/gumroad--api 
SYNC missed versions from official npm registry.

Gumroad API Client

This is a client library to access the Gumroad API. This client uses promises.

var Gumroad = require("gumroad-api");
var gumroad = new Gumroad({
	token: "<your-gumroad-token>"
});

Products

Reference: https://gumroad.com/api#products

List products

gumroad.listProducts()
.then(function(products) {
    ...
});

Create a product

gumroad.createProduct({
	"name": "..."
})
.then(function(product) {
    ...
});

Retrieve a product

gumroad.getProduct("my-product-id")
.then(function(product) {
    ...
});

Update a product

gumroad.updateProduct("my-product-id", {
	// infos
})
.then(function(product) {
    // Product has been updated
});

Enable/disable a product

gumroad.toggleProduct("my-product-id", false)
.then(function(product) {
    // Product has been disabled/enabled
});

Delete a product

gumroad.deleteProduct("my-product-id")
.then(function() {
    // Product has been deleted
});

Offer Codes

Reference: https://gumroad.com/api#offer-codes

List offers for a product

gumroad.listOffers("product-id")
.then(function(offers) {
    ...
});

Create an offer

gumroad.createOffer("product-id", {
    "name": "..."
})
.then(function(offer) {
    ...
});

Retrieve an offer

gumroad.getOffer("product-id", "offer-id")
.then(function(offer) {
    ...
});

Delete an offer

gumroad.deleteOffer("product-id", "offer-id")
.then(function() {
    // Offer has been deleted
});

Update a product

gumroad.updateOffer("product-id", "offer-id", {
    // infos
})
.then(function(offer) {
    // Offer has been updated
});

Licenses

Reference: https://help.gumroad.com/customer/portal/articles/1579327-license-keys

Verify a license key

gumroad.verifyLicense("my-product-id", "license-key")
.then(function(license) {
    // License is OK
}, function() {
    // License verification failed
});

Sales

Reference: https://gumroad.com/api#sales

List sales

gumroad.listSales("after-date", "before-date", "page-num")
.then(function(sales) {
    ...
});

Retrieve a sale

gumroad.getSale("sale-id")
.then(function(sale) {
    ...
});

Current Tags

  • 0.5.1                                ...           latest (6 months ago)

2 Versions

  • 0.5.1                                ...           6 months ago
  • 0.5.0                                ...           6 months ago
Maintainers (1)
Downloads
Today 0
This Week 3
This Month 5
Last Day 3
Last Week 1
Last Month 0
Dependencies (4)
Dev Dependencies (0)
None
Dependents (0)
None

Copyright 2014 - 2016 © taobao.org |