ShopAPI

new ShopAPI(rest)

This class is used to interact with the Shop in TidyHQ.
Parameters:
NameTypeDescription
restRestThe rest instance to use for requests.

Methods

(async) getOrder(order_id, optionsopt) → {Promise.<TidyAPI_V1_ShopOrder>}

Get a single order.
Parameters:
NameTypeAttributesDefaultDescription
order_idstringThe ID of the order.
optionsobject<optional>
{}
Properties
NameTypeAttributesDescription
access_tokenstring<optional>
The access token to use.
Returns:
- The order.
Type: 
Promise.<TidyAPI_V1_ShopOrder>

(async) getOrders(optionsopt) → {Promise.<TidyAPI_V1_ShopOrders>}

Get a list of all orders.
Parameters:
NameTypeAttributesDefaultDescription
optionsobject<optional>
{}
Properties
NameTypeAttributesDescription
access_tokenstring<optional>
The access token to use.
limitstring<optional>
The number of results to return.
offsetstring<optional>
The number of results to skip.
created_sincestring<optional>
The timestamp to begin from in ISO 8601 format.
status"all" | "pending" | "completed" | "cancelled"<optional>
The status of the orders to return.
Returns:
- The list of orders.
Type: 
Promise.<TidyAPI_V1_ShopOrders>

(async) getProduct(product_id, optionsopt) → {Promise.<TidyAPI_V1_ShopProduct>}

Get a single shop product.
Parameters:
NameTypeAttributesDefaultDescription
product_idstringThe ID of the product.
optionsobject<optional>
{}
Properties
NameTypeAttributesDescription
access_tokenstring<optional>
The access token to use.
Returns:
- The product.
Type: 
Promise.<TidyAPI_V1_ShopProduct>

(async) getProducts(optionsopt) → {Promise.<TidyAPI_V1_ShopProducts>}

Get a list of all shop products.
Parameters:
NameTypeAttributesDefaultDescription
optionsobject<optional>
{}
Properties
NameTypeAttributesDescription
access_tokenstring<optional>
The access token to use.
limitstring<optional>
The number of results to return.
offsetstring<optional>
The number of results to skip.
Returns:
- The list of products.
Type: 
Promise.<TidyAPI_V1_ShopProducts>

(async) getShippingOption(shipping_option_id, optionsopt) → {Promise.<TidyAPI_V1_ShippingOption>}

Get a single shipping option.
Parameters:
NameTypeAttributesDefaultDescription
shipping_option_idstringThe ID of the shipping option.
optionsobject<optional>
{}
Properties
NameTypeAttributesDescription
access_tokenstring<optional>
The access token to use.
limitstring<optional>
The number of results to return.
offsetstring<optional>
The number of results to skip.
Returns:
- The shipping option.
Type: 
Promise.<TidyAPI_V1_ShippingOption>

(async) getShippingOptions(optionsopt) → {Promise.<TidyAPI_V1_ShippingOptions>}

Get a list of all shipping options.
Parameters:
NameTypeAttributesDefaultDescription
optionsobject<optional>
{}
Properties
NameTypeAttributesDescription
access_tokenstring<optional>
The access token to use.
limitstring<optional>
The number of results to return.
offsetstring<optional>
The number of results to skip.
Returns:
- The list of shipping options.
Type: 
Promise.<TidyAPI_V1_ShippingOptions>