UNPKG

@spree/storefront-api-v2-sdk

Version:

Node module to easily integrate your JavaScript or TypeScript application with Spree Storefront API V2. You can create an entirely custom Storefront in JS/TS with this package including one page checkout, Single Page Apps, PWAs and so on.

43 lines (42 loc) 1.34 kB
import { Http } from '@spree/core-api-v2-sdk'; import type { ListOptions, ShowOptions, VendorResult, VendorsResult } from '../interfaces/Vendor'; /** * The multi-vendor marketplace feature is only available via [Vendo](https://www.getvendo.com). */ export default class Vendors extends Http { /** * Returns a list of Vendors in a Spree marketplace. * * **Success response schema:** [Success schema](../pages/response-schema.html#success-schema) * * **Failure response schema:** [Error schema](../pages/response-schema.html#error-schema) * * **Example:** * ```ts * const vendors = await client.vendors.list({ * include: 'products' * }) * ``` */ list(options?: ListOptions): Promise<VendorsResult>; /** * Returns a single Vendor in a Spree marketplace. * * **Options schema:** * ```ts * interface options { * id: string * } * ``` * * **Success response schema:** [Success schema](../pages/response-schema.html#success-schema) * * **Failure response schema:** [Error schema](../pages/response-schema.html#error-schema) * * **Example:** * ```ts * const vendor = await client.vendors.show({ id: '123' }) * ``` */ show(options: ShowOptions): Promise<VendorResult>; }