Code Monkey home page Code Monkey logo

gumroad-api's Introduction

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) {
    ...
});

gumroad-api's People

Contributors

adrianmcli avatar samypesse avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.