UNPKG

shopify-admin-api

Version:

Shopify Admin API is a NodeJS library built to help developers easily authenticate and make calls against the Shopify API. It was inspired by and borrows heavily from ShopifySharp.

37 lines (36 loc) 1.08 kB
import * as Options from '../options'; import { BaseService } from '../infrastructure'; import { Discount } from '../interfaces'; /** * A service for manipulating Shopify discounts. */ export declare class Discounts extends BaseService { constructor(shopDomain: string, accessToken: string); /** * Creates a new discount. */ create(discount: Partial<Discount>): Promise<Discount>; /** * Gets a list of up to 250 of the shop's discounts. * @param options Options for filtering the results. */ list(options?: Options.DiscountListOptions): Promise<Discount[]>; /** * Retrieves the discount with the given id. * @param options Options for filtering the results. */ get(id: number): Promise<Discount>; /** * Enables a discount. */ enable(id: number): Promise<Discount>; /** * Disable a discount. */ disable(id: number): Promise<Discount>; /** * Deletes the discount with the given id. */ delete(id: number): Promise<undefined>; } export default Discounts;