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).
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", "hi@example.com", "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.
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.
Coupon Endpoint
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)
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)
Product Endpoint
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.
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.
Section Endpoint
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.
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.
Feedback Endpoint
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
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
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.
Ticket Endpoint
Ticket Message Endpoint
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.