Product Variants

All endpoints related to Product Variants

Because we are dealing with 2 IDs, we will be using id for the product ID and vid for the variant ID

Supported Endpoints

  • getAllVariants(): Returns a list of all products created.

  • getVariant(id, vid): Gets listing by the entered ID.

  • createProductVariant(id, fields): Create Listing.

  • updateProductVariant(id, vid, fields): Updates a listing by the entered ID.

  • deleteProductVariant(id, vid): Deletes a listing by the entered ID.


getAllVariants()

Usage
const Sellapp = require("sellapp-node");
const API = new Sellapp.API("YOUR_API_KEY");

API.variants.getAllVariants().then((res) => {
    console.log(res)
});

getVariant()

Usage
const Sellapp = require("sellapp-node");
const API = new Sellapp.API("YOUR_API_KEY");

API.variants.getProduct("6666", "565").then((res) => {
    console.log(res)
})


createProductVariant()

Usage
const Sellapp = require("sellapp-node");
const API = new Sellapp.API("YOUR_API_KEY");

API.variants.createProductVariant({
	"title": "Millions of gold pieces",
	"description": "Get rich, buy this.",
	"deliverable": {
		"delivery_text": "Meet me in world 5",
		"type": "MANUAL",
		"data": {
			"stock": 666,
			"comment": "Thanks"
		}
	},
	"price": {
		"price": 50,
		"currency": "USD"
	},
	"payment_methods": ["PAYPAL"],
	"minimum_purchase_quantity": 1,
	"visibility": "HIDDEN"
}).then((res) => {
    console.log(res);
}).catch((err) => {
    console.log(err);
});

updateProductVariant()

Usage
const Sellapp = require("sellapp-node");
const API = new Sellapp.API("YOUR_API_KEY");

API.variants.updateProductVariant("6666, {
	"title": "Millions of gold pieces EXTRA",
	"slug": "millions-of-gold-pieces",
	"description": "Get rich, buy this.",
	"visibility": "PUBLIC",
	"deliverable": {
		"delivery_text": "Meet me in world 1000!!",
		"type": "MANUAL",
		"data": {
			"stock": 666,
			"comment": "Thanks broski (scammed, real)"
		}
	},
	"price": {
		"price": 1000, // ( ͡° ͜ʖ ͡°)
		"currency": "USD"
	},
	"humble": true,
	"payment_methods": ["PAYPAL"],
	"minimum_purchase_quantity": 1,
	"maximum_purchase_quantity": 20
}).then((res) => {
    console.log(res); 
}).catch((err) => {
    console.log(err);
});

deleteProductVariant()

Usage
const Sellapp = require("sellapp-node");
const API = new Sellapp.API("YOUR_API_KEY");

API.variants.deleteProductVariant("6666").then((res) => {
    console.log(res)
})

Last updated