@plasma-platform/service-orders
v2.8.1
Published
Service Orders Api
Downloads
32
Readme
Full documentation
install:npm i @plasma-platform/service-orders -S
Short documentation
Table of Contents
- OrdersService
OrdersService
messages
object with class service messages
Type: object
changeOrderPhoneNumber
Orders - Change the phone number of the order
Parameters
params
object
Examples
(async () => {
const service = new Service(url, token);
const request = await service.changeOrderPhoneNumber(orderId);
})();
Returns Promise<any>
checkOrders
Check orders
Parameters
params
object params objectparams.productType
string Type of product. Allowed values: 'template', 'offer', 'membership'.params.productIds
string ID's of productsparams.orderIds
string ID's of ordersparams.userId
string Customer's IDparams.email
string Customer's emailparams.status
number Order statusparams.dateFrom
string Date range startparams.dateTo
string Date range endparams.paidOnly
boolean Search only paid ordersparams.strict
boolean Strict search mode
Examples
(async () => {
const service = new Service('http://service-orders.dev/api/v2/');
const request = await service.checkOrders(params);
})();
Returns Promise<any>
checkRepurchase
Check repurchase
Parameters
params
object params objectparams.products
object Array of products objects.params.orderIds
string ID's of ordersparams.userId
string Customer's IDparams.email
string Customer's emailparams.status
number Order statusparams.dateFrom
string Date range startparams.dateTo
string Date range endparams.paidOnly
boolean Search only paid ordersparams.strict
boolean Strict search mode
Examples
(async () => {
const service = new Service('http://service-orders.dev/api/v2/');
const request = await service.checkRepurchase(params);
})();
Returns Promise<any>
getListOfUserOrders
Get list of users orders
Parameters
params
object params objectparams.page
number page number to view.params.perPage
number records per page.params.productType
string type of product. Allowed values: 'template', 'offer', 'membership'.params.productIds
string ID's of products.params.orderIds
string ID's of orders.params.status
number order statusparams.email
number Customer's emailparams.dateFrom
number Date range startparams.dateTo
number Date range endparams.paidOnly
number Search only paid ordersparams.strict
number Strict search mode
Examples
(async () => {
const service = new Service('http://service-orders.dev/api/v2/', token);
const request = await service.getListOfUserOrders(params);
})();
Returns Promise<any>
getOrderById
Get order by ID
Parameters
orderId
string ID of order.
Examples
(async () => {
const service = new Service('http://service-orders.dev/api/v2/', token);
const request = await service.getOrderById(orderId);
})();
Returns Promise<any>
getOrderByIdPublic
Orders - Get order public data
Parameters
orderId
string ID of order (required).
Examples
(async () => {
const service = new Service(url);
const request = await service.getOrderByIdPublic(orderId);
})();
Returns Promise<any>
checkDownloadLinkStatusByToken
Check download link status by access token
Parameters
params
object params object
Examples
(async () => {
const service = new Service('http://service-orders.dev/api/v1/', token);
const request = await service.checkDownloadLinkStatusByToken(params);
})();
Returns Promise<any>
restoreDownloadLinkStatusByToken
Restore download link status by access token
Parameters
params
object params object
Examples
(async () => {
const service = new Service('http://service-orders.dev/api/v1/', token);
const request = await service.restoreDownloadLinkStatusByToken(params);
})();
Returns Promise<any>
getInvoiceData
Get invoice data
Parameters
Examples
(async () => {
const service = new Service('http://service-orders.dev/api/v2/', token);
const request = await service.getInvoiceData(params);
})();
Returns Promise<any>
createInvoice
Invoices - Create Invoice
Parameters
params
object params objectparams.order_id
string (required) Order ID for importparams.billingName
string (required) Billing user nameparams.billingCountryISO2
string (required) Country in ISO2params.billingCity
string (required) Cityparams.billingAddress
string (required) Addressparams.billingZip
string (required) Zipparams.companyName
string Company nameparams.billingStateISO2
string State in ISO2params.taxId
string taxID
Examples
(async () => {
const service = new Service('http://service-orders.dev/api/v2/', token);
const request = await service.createInvoice(params);
})();
Returns Promise<any>