npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

sell-app-fixed

v1.1.1

Published

Fixed version of https://www.npmjs.com/package/sell-app

Downloads

2

Readme

Sell.app API Wrapper

A simple Node.js API Wrapper made for Sell.app. CONTRIBUTING

This is a fork from fsalinas26's Sellix API Wrapper made to access the Sell.app's API

TO-DO List

  • [ ] Hi uh ik there has been lack of updates since i was too busy w uni and stuffs, i'll try to get back to update when i can (also published new changes to npm btw, forgot to update it when i merged a few pull requests from an awesome contributor).
  • [ ] Add full support for Product API V2
  • [ ] Make a wiki to replace this long listed examples.

Requirements

Installation

npm install sell-app

Usage

const Sellapp = require("sell-app");
const API = new Sellapp.API("YOUR_API_KEY");

API.getAllProducts().then((res) => {
	console.log(res); // returns a list of all products
});

API.createBlacklist("email", "[email protected]", "evil user").then((res) => {
	console.log(res); // blacklisting the said user with the string "evil user" as description
});

Multi-Store Support

Say you are part of multiple stores and want to access bob.sell.app, you would pass the slug bob as your store.

Supported Endpoints

Click on an endpoint to see its example.

Blacklists Endpoint

  • getAllBlacklists(): Returns a list of all the blacklists created.
  • getBlacklist(id): Retrieves a blacklist by the entered ID.
  • createBlacklist(type, data, description): Creates a blacklist and returns the created blacklist.
  • updateBlacklist(id, type, data, description): Updates a blacklist by the entered ID.
  • deleteBlacklist(id): Deletes a blacklist by the entered ID.

Coupons Endpoint

  • getAllCoupons(): Returns a list of all the coupons created.
  • getCoupon(id): Retrieves a coupon by the entered ID.
  • createCoupon(fields): Creates a coupon and returns the created coupon.
  • updateCoupon(id, fields): Updates a coupon by the entered ID.
  • deleteCoupon(id): Deletes a coupon by the entered ID.

Listings/Products Endpoint

  • getAllProducts(): Returns a list of all the listings created.
  • getProduct(id): Retrieves a listing by the entered ID.
  • createProduct(fields): Creates a listing and returns the created listing.
  • updateProduct(id, fields): Updates a listing by the entered ID.
  • deleteProduct(id): Deletes a listing by the entered ID.

Listings/Products v2 Endpoint

  • getAllProductsv2(): Returns a list of all products created.
  • createListing(fields): Create Listing.
  • getListing(id): Gets listing by the entered ID.
  • updateListing(id, fields): Updates a listing by the entered ID.
  • deleteListing(id): Deletes a listing by the entered ID.
  • searchVariants(id): Search for product variants by the entered ID.
  • getAllVariants(id): Returns a list of all product variants created by the entered ID.

Sections Endpoint

  • getAllSections(): Returns a list of all the listings created.
  • getSection(id): Retrieves a section by the entered ID.
  • createSection(fields): Creates a section and returns the created section.
  • updateSection(id, fields): Updates a section by the entered ID.
  • deleteSections(id): Deletes a section by the entered ID.

Feedback Endpoint

  • getAllFeedback(): Returns a list of all the feedback received.
  • getFeedback(id): Retrieves a feedback by the entered ID.
  • replyFeedback(id, replyMessage): Responds to a given feedback by the entered ID.

Invoices Endpoint

  • getAllOrders(): Returns a list of all the orders that have been placed.
  • getOrder(id): Retrieve a specific order by the entered ID.
  • getOrderDeliverables(id): Retrieve deliverables from a specific order by the entered ID.
  • createInvoice(fields): Generates an invoice, and returns the invoice that is generated.
  • issueReplacement(id, fields): Issue a replacement for an order by the entered ID.
  • createPayment(id): Generates a payment session for the given order.

Tickets Endpoint

  • getAllTickets(): Retrieves a list of all the tickets received.
  • getTicket(id): Retrieves a ticket by the entered ID.

Ticket Messages Endpoint

  • getAllTicketMessages(id): Retrieves a list of all the messages within a ticket by its entered ID.
  • getTicketMessage(id, messageId): Retrieves a specific message within a ticket by their respective entered IDs.
  • respondTicket(id, fields): Creates a message to a ticket by its entered ID and returns the created message.

Endpoints' examples of usage

Blacklist Endpoint

API.getAllBlacklists().then((res) => {
	console.log(res);
});
API.getBlacklist("164").then((res) => {
    console.log(res);
});

| Parameters | Type | Required | Description | | :--------: | :----: | :------: | :--------------------: | | id | string | ✔️ | ID of a blacklist rule |

API.createBlacklist("ip", "1.3.3.7", "Block hackers").then((res) => {
    console.log(res);
});

| Parameters | Type | Required | Description | | :-----------: | :----: | :------: | :------------------------------------------------------------------------------------------------: | | type | string | ✔️ | Your blacklist rule's type, can be one of the following - "email", "ip", "country" | | data | string | ✔️ | Depending on the type you chose, you can enter an IP address, email address, or country code here. | | description | string | ✔️ | A description that will help you remember why this blacklist rule was created. |

API.updateBlacklist(
	"164",
	"country",
	"MX",
	"sorry my fellow Mexican friends :sob:"
).then((res) => {
	console.log(res);
});

| Parameters | Type | Required | Description | | :-----------: | :----: | :------: | :------------------------------------------------------------------------------------------------: | | id | string | ✔️ | ID of the blacklist rule you want to update | | type | string | ✔️ | Your blacklist rule's type, can be one of the following - "email", "ip", "country" | | data | string | ✔️ | Depending on the type you chose, you can enter an IP address, email address, or country code here. | | description | string | ✔️ | A description that will help you remember why this blacklist rule was created. |

API.deleteBlacklist("164").then((res) => {
    console.log(res);
});

| Parameters | Type | Required | Description | | :--------: | :----: | :------: | :--------------------: | | id | string | ✔️ | ID of the blacklist rule you want to delete |

Coupon Endpoint

API.getAllCoupons().then((res) => {
	console.log(res);
});
API.getCoupon("468").then((res) => {
    console.log(res);
});

| Parameters | Type | Required | Description | | :--------: | :----: | :------: | :--------------------: | | id | string | ✔️ | ID of the coupon |

API.createCoupon({
	"code": "15off",
	"type": "PERCENTAGE",
	"discount": "15",
	"store_wide": false
}).then((res) => {
	console.log(res);
});

| Parameters | Type | Required | Description | | :--------: | :----: | :------: | :------------: | | fields | object | ✔️ | Coupon's field |

| Fields' Values | Type | Required | Description | | :------------: | :---------: | :------: | :--------------------------------------------------------------------------: | | code | string | ✔️ | The coupon code the customer enters during checkout. | | type | string | ✔️ | This can be either "PERCENTAGE" or "AMOUNT". | | discount | string | ✔️ | The discount value in percentage or cents. | | limit | int/null | ❌ | The maximum amount of times a coupon code can be used, across all customers. | | store_wide | boolean | ✔️ | Whether the coupon applies to all products within your store or not. | | expires_at | string/null | ❌ | The coupon's expiry date. (format: YY-MM-DD HH-MM-SS) |

API.updateCoupon("468", {
	"code": "free20",
	"type": "AMOUNT",
	"discount": "20", // price reduces by 20 dollars
	"limit": 2, // can only be used twice then expires
	"store_wide": true, // the code now can be used across all of your products
	"expires_at": "2023-01-01 12:00:00"
}).then((res) => {
	console.log(res);
});

| Parameters | Type | Required | Description | | :--------: | :----: | :------: | :---------------------------------: | | id | string | ✔️ | ID of the coupon you want to update | | fields | object | ✔️ | Coupon's field |

| Fields' Values | Type | Required | Description | | :------------: | :---------: | :------: | :--------------------------------------------------------------------------: | | code | string | ✔️ | The coupon code the customer enters during checkout. | | type | string | ✔️ | This can be either "PERCENTAGE" or "AMOUNT". | | discount | string | ✔️ | The discount value in percentage or cents. | | limit | int/null | ❌ | The maximum amount of times a coupon code can be used, across all customers. | | store_wide | boolean | ✔️ | Whether the coupon applies to all products within your store or not. | | expires_at | string/null | ❌ | The coupon's expiry date. (format: YY-MM-DD HH-MM-SS) |

API.deleteCoupon("468").then((res) => {
    console.log(res);
});

| Parameters | Type | Required | Description | | :--------: | :----: | :------: | :--------------------: | | id | string | ✔️ | ID of the coupon you want to delete |

Product Endpoint

API.getAllProducts().then((res) => {
	console.log(res);
});
API.getProduct("4982").then((res) => {
    console.log(res);
});

| Parameters | Type | Required | Description | | :--------: | :----: | :------: | :--------------------: | | id | string | ✔️ | ID of the product |

API.createProduct({
	"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);
	});

| Parameters | Type | Required | Description | | :--------: | :----: | :------: | :-------------: | | fields | object | ✔️ | Product's field |

| Fields' Values | Type | Required | Description | | :-------------------------: | :-------------: | :------: | :----------------------------------------------------------------------------------------------------------------------------------------------: | | title | string | ✔️ | The product's title. | | description | string | ✔️ | The product's description. | | image | object/null | ❌ | An image binary which will be visible when someone views your product. | | order | int/null | ❌ | The product's order in which it is sorted on your storefront. | | visibility | string | ✔️ | Either "PUBLIC", "HIDDEN", or "PRIVATE" - depending on whether you want this product to be visible. | | deliverable | object | ✔️ | The product's deliverable which will be sent to the customer. Consists of three pieces of nested data, being "delivery_text", "type", and "data" | | price | object | ✔️ | The product's price in nested format. Consists of two variables "PRICE" (in cents) and "CURRENCY". | | humble | boolean | ❌ | Whether you want to allow the customer to pay more than the product's price. ( ͡° ͜ʖ ͡°) | | payment_methods | array of string | ✔️ | Items Enum: "COINBASE" "PAYDASH" "PAYPAL" "STRIPE". The product's payment methods in array format. | | additional_information | array | ❌ | Additional info that can be requested from the customer during the checkout process. | | bulk_discount | array | ❌ | An array of discounts when a customer purchases more than a specified quantity. | | minimum_purchase_quantity | int | ✔️ | The minimum amount a customer is able to purchase. | | maximum_purchase_quantity | int/null | ❌ | The maximum amount a customer is able to purchase. | | webhook | string/null | ❌ | A webhook URL that will receive updates when orders are placed. | | warranty | object/null | ❌ | The warranty time in which a customer is able to request a refund. | | locked | boolean | ❌ | Whether this product is locked by the admins or moderators. | | section | int/null | ❌ | The ID of a section to associate with this product. Use null to disassociate a section. |

API.updateProduct("4982", {
	"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);
	});

| Parameters | Type | Required | Description | | :--------: | :----: | :------: | :---------------------------------: | | id | string | ✔️ | ID of the coupon you want to update | | fields | object | ✔️ | Coupon's field |

| Fields' Values | Type | Required | Description | | :-------------------------: | :-------------: | :------: | :----------------------------------------------------------------------------------------------------------------------------------------------: | | title | string | ✔️ | The product's title. | | description | string | ✔️ | The product's description. | | image | object/null | ❌ | An image binary which will be visible when someone views your product. | | order | int/null | ❌ | The product's order in which it is sorted on your storefront. | | visibility | string | ✔️ | Either "PUBLIC", "HIDDEN", or "PRIVATE" - depending on whether you want this product to be visible. | | deliverable | object | ✔️ | The product's deliverable which will be sent to the customer. Consists of three pieces of nested data, being "delivery_text", "type", and "data" | | price | object | ✔️ | The product's price in nested format. Consists of two variables "PRICE" (in cents) and "CURRENCY". | | humble | boolean | ❌ | Whether you want to allow the customer to pay more than the product's price. ( ͡° ͜ʖ ͡°) | | payment_methods | array of string | ✔️ | Items Enum: "COINBASE" "PAYDASH" "PAYPAL" "STRIPE". The product's payment methods in array format. | | additional_information | array | ❌ | Additional info that can be requested from the customer during the checkout process. | | bulk_discount | array | ❌ | An array of discounts when a customer purchases more than a specified quantity. | | minimum_purchase_quantity | int | ✔️ | The minimum amount a customer is able to purchase. | | maximum_purchase_quantity | int/null | ❌ | The maximum amount a customer is able to purchase. | | webhook | string/null | ❌ | A webhook URL that will receive updates when orders are placed. | | warranty | object/null | ❌ | The warranty time in which a customer is able to request a refund. | | locked | boolean | ❌ | Whether this product is locked by the admins or moderators. | | section | int/null | ❌ | The ID of a section to associate with this product. Use null to disassociate a section. |

API.deleteProduct("4982").then((res) => {
    console.log(res);
});

| Parameters | Type | Required | Description | | :--------: | :----: | :------: | :--------------------: | | id | string | ✔️ | ID of the product you want to delete |

Section Endpoint

API.getAllSections().then((res) => {
	console.log(res);
});
API.getSection("694").then((res) => {
    console.log(res);
});

| Parameters | Type | Required | Description | | :--------: | :----: | :------: | :--------------------: | | id | string | ✔️ | ID of a section |

API.createSection({
	"title": "Gaming Goods",
	"hidden": false
})
	.then((res) => {
		console.log(res);
	})
	.catch((err) => {
		console.log(err);
	});

| Parameters | Type | Required | Description | | :--------: | :----: | :------: | :-------------: | | fields | object | ✔️ | Section's field |

| Fields' Values | Type | Required | Description | | :------------: | :-----: | :------: | :----------------------------------------------------------------------------------: | | title | string | ✔️ | The section's title. | | hidden | boolean | ✔️ | Whether this section is hidden from public view (can only be accessed by direct URL) | | order | int | ❌ | The order of the section in which it is displayed on your storefront. |

API.updateSection("694", {
	"title": "Gaming Goods",
	"hidden": false,
	"order": 1,
	"slug": "gaming-goods"
}).then((res) => {
	console.log(res);
});

| Parameters | Type | Required | Description | | :--------: | :----: | :------: | :---------------------------------: | | id | string | ✔️ | ID of the coupon you want to update | | fields | object | ✔️ | Coupon's field |

| Fields' Values | Type | Required | Description | | :------------: | :-----: | :------: | :----------------------------------------------------------------------------------: | | title | string | ✔️ | The section's title. | | hidden | boolean | ✔️ | Whether this section is hidden from public view (can only be accessed by direct URL) | | order | int | ❌ | The order of the section in which it is displayed on your storefront. |

API.deleteSection("694").then((res) => {
    console.log(res);
});

| Parameters | Type | Required | Description | | :--------: | :----: | :------: | :--------------------: | | id | string | ✔️ | ID of the section you want to delete |

Feedback Endpoint

API.getAllFeedback().then((res) => {
	console.log(res);
});
API.getFeedback("666").then((res) => {
    console.log(res);
});

| Parameters | Type | Required | Description | | :--------: | :----: | :------: | :--------------------: | | id | string | ✔️ | ID of a feedback |

API.replyFeedback("666", "Thanks for the positive feedback!").then((res) => {
	console.log(res);
});

| Parameters | Type | Required | Description | | :------------: | :----: | :------: | :-----------------------------------------------------------------------: | | id | string | ✔️ | ID of the coupon you want to update | | replyMessage | string | ✔️ | A reply message that was left by the store owner who received this rating |

Invoice Endpoint

API.getAllOrders().then((res) => {
	console.log(res);
});
API.getOrder("666").then((res) => {
    console.log(res);
});

| Parameters | Type | Required | Description | | :--------: | :----: | :------: | :--------------------: | | id | string | ✔️ | ID of an order |

API.getOrderDeliverables("666").then((res) => {
    console.log(res);
});

| Parameters | Type | Required | Description | | :--------: | :----: | :------: | :--------------------: | | id | string | ✔️ | ID of an order |

API.createInvoice({
	"customer_email": "[email protected]",
	"total": "4.99",
	"payment_method": "PAYPAL",
	"products": {
		"1210": {
			"quantity": 5,
			"additional_information": [
				{
					"accept_terms_and_conditions": true,
					"read_terms_and_conditions_before_accepting": true
				}
			],
			"fill_once": true
		}
	}
})
	.then((res) => {
		console.log(res);
	})
	.catch((err) => {
		console.log(err);
	});

| Parameters | Type | Required | Description | | :--------: | :----: | :------: | :-------------: | | fields | object | ✔️ | Invoice's field |

| Fields' Values | Type | Required | Description | | :--------------: | :----: | :------: | :-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------: | | customer_email | string | ❌ | The email of the customer who placed this order. | | total | string | ❌ | The total amount to pay for this order. Can be excluded to create free-of-charge orders. | | payment_method | string | ❌ | Enum: "COINBASE" "PAYDASH" "PAYPAL" "STRIPE". The payment gateway to process this order with.The selected payment gateway must be configured for the issuing store and should only be included in the request if the total of the order is greater than zero. | | coupon | string | ❌ | The coupon code to apply to this order. | | products | object | ❌ | Association of products with quantity and additional information to include in the order. The object keys must be the ids of the listings to include |

API.issueReplacement("666", {
  "listings": [
    1,
    2,
    3
  ]
}).then((res) => {
	console.log(res);
});

| Parameters | Type | Required | Description | | :--------: | :----: | :------: | :-----------------------------------------------------------------------------------------------: | | id | string | ✔️ | ID of the order you want to issue a replacement | | fields | array | ❌ | The listings that should be replaced. If no listings are provided, all listings will be replaced. |

API.createPayment("4982")
	.then((res) => {
		console.log(res);
	})
	.catch((err) => {
		console.log(err);
	});

| Parameters | Type | Required | Description | | :--------: | :----: | :------: | :--------------------: | | id | string | ✔️ | Generates a payment session for the given ORDER ID. |

Ticket Endpoint

API.getAllTickets().then((res) => {
	console.log(res);
});
API.getTicket("69").then((res) => {
    console.log(res);
});

| Parameters | Type | Required | Description | | :--------: | :----: | :------: | :--------------------: | | id | string | ✔️ | Retrieves a ticket by the entered ID. |

Ticket Message Endpoint

API.getAllTicketMessages("69").then((res) => {
    console.log(res);
});

| Parameters | Type | Required | Description | | :--------: | :----: | :------: | :--------------------: | | id | string | ✔️ | Retrieves a list of all the messages within a ticket by its entered ID. |

API.getTicketMessage("69", "420").then((res) => {
    console.log(res);
});

| Parameters | Type | Required | Description | |:-----------:|:----:|:--------:|:-----------------------------------------------------------------------------:| | id | int | ✔️ | ID of a ticket | | messageId | int | ✔️ | Retrieves a specific message within a ticket by their respective entered IDs. |

API.respondTicket("69", {
	"author": "STORE",
	"content": "This is a response message."
}).then((res) => {
	console.log(res);
});

| Parameters | Type | Required | Description | | :--------: | :----: | :------: | :----------------------------------: | | id | string | ✔️ | ID of the ticket you want to respond | | fields | object | ✔️ | Response's field |

| Parameters | Type | Required | Description | | :--------: | :----: | :------: | :-----------------------------------------------------------------------: | | author | string | ❌ | Either "STORE" or "CUSTOMER" depending on who sent this specific message. | | content | string | ✔️ | The message that was left. |

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

Please make sure to update tests as appropriate.

License

MIT