inventora-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.
46 lines (45 loc) • 1.88 kB
TypeScript
import * as Options from '../options';
import { ProductVariant, ProductVariantCreate, ProductVariantUpdate } from '../interfaces';
import { BaseService } from '../infrastructure';
/**
* A service for manipulating a blog's product variants.
*/
export declare class ProductVariants extends BaseService {
constructor(shopDomain: string, accessToken: string);
/**
* Gets a variant with the given id.
* @param id Id of the variant being retrieved.
* @param options Options for filtering the result.
*/
get(id: number, options?: Options.ProductVariantGetOptions): Promise<ProductVariant>;
/**
* Lists up to 250 variants for the given product.
* @param productId Id of the product that the variants belong to.
* @param options Options for filtering the results.
*/
list(productId: number, options?: Options.ProductVariantListOptions): Promise<ProductVariant>;
/**
* Counts the variants on the given product.
* @param productId Id of the product that the variants belong to.
*/
count(productId: number): Promise<number>;
/**
* Creates a new product variant
* @param productId Id of the product that the varaint belongs to.
* @param productVariant The updated variant.
*/
create(productId: number, variant: ProductVariantCreate): Promise<ProductVariant>;
/**
* Updates an variant with the given id.
* @param id Id of the variant.
* @param productVariant The updated variant.
*/
update(id: number, variant: ProductVariantUpdate): Promise<ProductVariant>;
/**
* Deletes the variant with the given variantId.
* @param productId Id of the product that the varaint belongs to.
* @param variantId Id of the variant to delete.
*/
delete(productId: number, variantId: number): Promise<void>;
}
export default ProductVariants;