@klarr-agency/gumroad--api
v0.5.1
Published
Client for the Gumroad API.
Downloads
2
Readme
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) {
...
});