Home Reference Source

Function

Static Public Summary
public

PATCH /admin/recurring_application_charge/add_free_days.json

public

PUT /admin/recurring_application_charge.xml

public

countOrder(options: Object, id: Number | String): Promise

GET /admin/orders/count.json

public

GET /admin/products/count.json

public

POST /admin/accessories.json

public

POST /admin/products/{product_id}/product_accessory_links.json

public

POST /admin/accessories/{accessory_id}/values.json

public

POST /admin/application_actions.json

public

POST /admin/application_widgets.json

public

POST /admin/blogs/{blog_id}/articles.json

public

createBlog(options: Object, id: Number | String): Promise

POST /admin/blogs.json

public

POST /admin/clients/{client_id}/bonus_system_transactions.json

public

POST /admin/categories.json

public

POST /admin/properties/{property_id}/characteristics.json

public

POST /admin/application_charges.xml

public

POST /admin/clients.json

public

POST /admin/client_groups.json

public

POST /admin/collects.json

public

POST /admin/collections.json

public

POST /admin/collection_fields.json

public

POST /admin/collection_filters.json

public

POST /admin/discount_codes.xml

public

POST /admin/custom_statuses.json

public

POST /admin/delivery_variants.json

public

POST /admin/domains.json

public

POST /admin/external_discounts.json

public

createField(options: Object, id: Number | String): Promise

POST /admin/fields.json

public

createJsTag(options: Object, id: Number | String): Promise

POST /admin/js_tags.xml

public

POST /admin/marketplaces.json

public

createMenu(options: Object, id: Number | String): Promise

POST /admin/menus.json

public

POST /admin/menus/{menu_id}/items.json

public

POST /admin/o_auth_apps.json

public

POST /admin/option_names.json

public

POST /admin/option_names/{option_name_id}/option_values.json

public

createOrder(options: Object, id: Number | String): Promise

POST /admin/orders.json

public

POST /admin/outlets.json

public

createPage(options: Object, id: Number | String): Promise

POST /admin/pages.json

public

POST /admin/payment_gateways.json

public

POST /admin/price_kinds.json

public

POST /admin/products.xml

public

POST /admin/product_fields.json

public

POST /admin/products/{product_id}/product_field_values.json

public

POST /admin/products/{product_id}/images.json

public

POST /admin/properties.json

public

POST /admin/dialogs/provider_tokens.json

public

POST /admin/recurring_application_charge.xml

public

POST /admin/redirects.json

public

POST /admin/reviews.json

public

POST /admin/sales_channels.json

public

POST /admin/products/{product_id}/similars.json

public

POST /admin/stock_currencies.json

public

POST /admin/products/{product_id}/supplementaries.json

public

POST /admin/user_tasks.json

public

POST /admin/products/{product_id}/variants.json

public

POST /admin/variant_fields.json

public

POST /admin/variants/{variant_id}/variant_field_values.json

public

POST /admin/warehouses.json

public

POST /admin/webhooks.json

public

POST /admin/application_charges/{id}/decline.xml

public

PUT /admin/accessories/{accessory_id}.json

public

PUT /admin/accessories/{accessory_id}/values/{accessory_value_id}.json

public

editAccount(options: Object, id: Number | String): Promise

PUT /admin/account.json

public

PUT /admin/application_actions/{application_action_id}.json

public

PUT /admin/application_widgets/{application_widget_id}.json

public

editArticle(options: Object, id: Number | String): Promise

PUT /admin/blogs/{blog_id}/articles/{article_id}.json

public

editAsset(options: Object, id: Number | String): Promise

PUT /admin/themes/#{theme_id}/assets/#{id}.xml

public

editBlog(options: Object, id: Number | String): Promise

PUT /admin/blogs/{blog_id}.json

public

PUT /admin/categories/{category_id}.json

public

PUT /admin/properties/{property_id}/characteristics/{characteristic_id}.json

public

editClient(options: Object, id: Number | String): Promise

PUT /admin/clients/{client_id}.json

public

PUT /admin/client_groups/{client_group_id}.json

public

editCollect(options: Object, id: Number | String): Promise

PUT /admin/collects/{collect_id}.json

public

PUT /admin/collections/{collection_id}.json

public

PUT /admin/collection_fields/{collection_field_id}.json

public

PUT /admin/collections/{collection_id}/collection_field_values/{field_id}.json

public

PUT /admin/collection_filters/{filter_id}.json

public

editCoupon(options: Object, id: Number | String): Promise

PUT /admin/discount_codes/{id}.xml

public

PUT /admin/custom_statuses/{custom_status_permalink}.json

public

PUT /admin/delivery_variants/{delivery_variant_id}.json

public

editDomain(options: Object, id: Number | String): Promise

PUT /admin/domains/{domain_id}.json

public

PUT /admin/external_discounts/{external_discount_id}.json

public

editField(options: Object, id: Number | String): Promise

PUT /admin/fields/{non_select_field_id}.json

public

editJsTag(options: Object, id: Number | String): Promise

PUT /admin/js_tags/{js_tag_id}.json

public

PUT /admin/marketplaces/{ym_marketplace_id}.json

public

editMenu(options: Object, id: Number | String): Promise

PUT /admin/menus/{menu_id}.json

public

PUT /admin/menus/{menu_id}/items/{item_id}.json

public

PUT /admin/o_auth_apps/{o_auth_app_id}.json

public

PUT /admin/option_names/{option_name_id}.json

public

PUT /admin/option_names/{option_name_id}/option_values/{option_value_id}.json

public

editOrder(options: Object, id: Number | String): Promise

PUT /admin/orders/{order_id}.json

public

editOutlet(options: Object, id: Number | String): Promise

PUT /admin/outlets/{outlet_id}.json

public

editPage(options: Object, id: Number | String): Promise

PUT /admin/pages/{page_id}.json

public

PUT /admin/payment_gateways/{payment_gateway_id_1}.json

public

PUT /admin/price_kinds/{id}.xml

public

editProduct(options: Object, id: Number | String): Promise

PUT /admin/products/{id}.xml

public

PUT /admin/product_fields/{product_field_id}.json

public

PUT /admin/products/{product_id}/product_field_values/{product_field_value_id}.json

public

PUT /admin/products/{product_id}/images/{image_id}.json

public

PUT /admin/properties/{property_id}.json

public

editReview(options: Object, id: Number | String): Promise

PUT /admin/reviews/{review_id}.json

public

PUT /admin/stock_currencies/{stock_currency_id}.json

public

PUT /admin/user_tasks/{user_task_id}.json

public

editVariant(options: Object, id: Number | String): Promise

PUT /admin/products/{product_id}/variants/{variant_id}.json

public

PUT /admin/variant_fields/{variant_field_id}.json

public

PUT /admin/variants/{variant_id}/variant_field_values/{variant_field_value_id}.json

public

PUT /admin/products/variants_group_update.json

public

PUT /admin/warehouses/{warehouse_id}.json

public

editWebhook(options: Object, id: Number | String): Promise

PUT /admin/webhooks/{webhook_id}.json

public

PUT /admin/themes/#{theme_id}/widget_types/#{id}.xml

public

error(response: Object): Object

Output Request-Promise error, used to create Promise reject

public

get(conn: Object): Promise

GET request

public

GET /admin/accessories/{accessory_id}.json

public

GET /admin/accessories/{accessory_id}/values/{accessory_value_id}.json

public

getAccount(options: Object, id: number | string): Promise

GET /admin/account.xml

public

GET /admin/application_actions/{application_action_id}.json

public

GET /admin/application_widgets/{application_widget_id}.json

public

getArticle(options: Object, id: Number | String): Promise

GET /admin/blogs/{blog_id}/articles/{article_id}.json

public

getAsset(options: Object, id: Number | String): Promise

GET /admin/themes/#{theme_id}/assets/#{id}.xml

public

getAssetRaw(options: Object, id: Number | String): Promise

GET /admin/themes/#{theme_id}/assets/#{id}/raw.xml

public

getBlog(options: Object, id: Number | String): Promise

GET /admin/blogs/{blog_id}.json

public

GET /admin/bonus_system_transactions/{bst_id}.json

public

getCategory(options: Object, id: Number | String): Promise

GET /admin/categories/{category_id}.json

public

GET /admin/properties/{property_id}/characteristics/{characteristic_id}.json

public

getCharge(options: Object, id: Number | String): Promise

GET /admin/application_charges/{id}.xml

public

getClient(options: Object, id: Number | String): Promise

GET /admin/clients/{client_id}.json

public

GET /admin/client_groups/{client_group_id}.json

public

GET /admin/collections/{id}.xml

public

GET /admin/collection_fields/{collection_field_id}.json

public

GET /admin/collections/{collection_id}/collection_field_values/{field_id}.json

public

GET /admin/collection_filters/{filter_id}.json

public

getCoupon(options: Object, id: Number | String): Promise

GET /admin/discount_codes/{id}.xml

public

GET /admin/custom_statuses/{custom_status_permalink}.json

public

GET /admin/delivery_variants/{delivery_variant_id}.json

public

getDomain(options: Object, id: Number | String): Promise

GET /admin/domains/{domain_id}.json

public

GET /admin/external_discounts/{external_discount_id}.json

public

getField(options: Object, id: Number | String): Promise

GET /admin/fields/{field_id}.json

public

getFile(options: Object, id: Number | String): Promise

GET /admin/files/{account_file_id}.json

public

getJsTag(options: Object, id: Number | String): Promise

GET /admin/js_tags/{js_tag_id}.json

public

GET /admin/marketplaces/{ym_marketplace_id}.json

public

getMenu(options: Object, id: Number | String): Promise

GET /admin/menus/{menu_id}.json

public

getMenuItem(options: Object, id: Number | String): Promise

GET /admin/menus/{menu_id}/items/{item_id}.json

public

getOAuthApp(options: Object, id: Number | String): Promise

GET /admin/o_auth_apps/{o_auth_app_id}.json

public

GET /admin/option_names/{option_name_id}.json

public

GET /admin/option_names/{option_name_id}/option_values/{option_value_id}.json

public

GET /admin/option_names/{option_name_id}/option_values/{option_value_id}/destroy_status.json

public

getOrder(options: Object, id: Number | String): Promise

GET /admin/orders/{order_id}.json

public

getOutlet(options: Object, id: Number | String): Promise

GET /admin/outlets/{outlet_id}.json

public

getPage(options: Object, id: Number | String): Promise

GET /admin/pages/{page_id}.json

public

GET /admin/payment_gateways/{payment_gateway_id_1}.json

public

GET /admin/price_kinds/{id}.json

public

getProduct(options: Object, id: Number | String): Promise

GET /admin/products/{id}.xml

public

GET /admin/product_fields/{product_field_id}.json

public

GET /admin/products/{product_id}/product_field_values/{product_field_value_id}.json

public

GET /admin/products/{product_id}/images/{image_id}.json

public

getProperty(options: Object, id: Number | String): Promise

GET /admin/properties/{property_id}.json

public

GET /admin/recurring_application_charge.xml

public

getRedirect(options: Object, id: Number | String): Promise

GET /admin/redirects/{redirect_id}.json

public

getReview(options: Object, id: Number | String): Promise

GET /admin/reviews/{review_id}.json

public

GET /admin/sales_channels/{sales_channel_id}.json

public

GET /admin/stock_currencies/{stock_currency_id}.json

public

getUserTask(options: Object, id: Number | String): Promise

GET /admin/user_tasks/{user_task_id}.json

public

getVariant(options: Object, id: Number | String): Promise

GET /admin/products/{product_id}/variants/{variant_id}.json

public

GET /admin/variant_fields/{variant_field_id}.json

public

GET /admin/variants/{variant_id}/variant_field_values/{variant_field_value_id}.json

public

GET /admin/warehouses/{warehouse_id}.json

public

getWebhook(options: Object, id: Number | String): Promise

GET /admin/webhooks/{webhook_id}.json

public

GET /admin/themes/#{theme_id}/widget_types/#{id}.xml

public

GET /admin/accessories.json

public

GET /admin/products/{product_id}/product_accessory_links.json

public

GET /admin/accessories/{accessory_id}/values.json

public

GET /admin/option_values.json

public

GET /admin/application_actions.json

public

GET /admin/application_widgets.json

public

listArticle(options: Object, id: Number | String): Promise

GET /admin/blogs/{blog_id}/articles.json

public

listAsset(options: Object, id: Number | String): Promise

GET /admin/themes/#{theme_id}/assets.xml

public

listBlog(options: Object, id: Number | String): Promise

GET /admin/blogs.json

public

GET /admin/bonus_system_transactions.json

public

GET /admin/categories.json

public

GET /admin/properties/{property_id}/characteristics.json

public

listCharge(options: Object, id: Number | String): Promise

GET /admin/application_charges.xml

public

listClient(options: Object, id: Number | String): Promise

GET /admin/clients.json

public

GET /admin/clients/{client_id}/bonus_system_transactions.json

public

GET /admin/client_groups.json

public

listCollect(options: Object, id: Number | String): Promise

GET /admin/collects.json

public

GET /admin/collections.xml

public

GET /admin/collection_fields.json

public

GET /admin/collections/{collection_id}/collection_field_values.json

public

GET /admin/collection_filters.json?collection_id={collection_id}

public

listCoupon(options: Object, id: Number | String): Promise

GET /admin/discount_codes.xml

public

GET /admin/custom_statuses.json

public

GET /admin/delivery_variants.json

public

listDomain(options: Object, id: Number | String): Promise

GET /admin/domains.json

public

GET /admin/external_discounts.json

public

listField(options: Object, id: Number | String): Promise

GET /admin/fields.json

public

listFile(options: Object, id: Number | String): Promise

GET /admin/files.xml

public

listJsTag(options: Object, id: Number | String): Promise

GET /admin/js_tags.json

public

GET /admin/marketplaces.json

public

listMenu(options: Object, id: Number | String): Promise

GET /admin/menus.json

public

GET /admin/menus/{menu_id}/items.json

public

GET /admin/o_auth_apps.json

public

GET /admin/option_names.json

public

GET /admin/option_names/{option_name_id}/option_values.json

public

listOrder(options: Object, id: Number | String): Promise

GET /admin/orders.json

public

listOutlet(options: Object, id: Number | String): Promise

GET /admin/outlets.json

public

listPage(options: Object, id: Number | String): Promise

GET /admin/pages.json

public

GET /admin/payment_gateways.json

public

GET /admin/price_kinds.json

public

listProduct(options: Object, id: Number | String): Promise

GET /admin/products.xml

public

GET /admin/product_fields.json

public

GET /admin/products/{product_id}/product_field_values.json

public

GET /admin/products/{product_id}/images.json

public

GET /admin/properties.json

public

GET /admin/redirects.json

public

listReview(options: Object, id: Number | String): Promise

GET /admin/reviews.json

public

GET /admin/sales_channels.json

public

listSimilar(options: Object, id: Number | String): Promise

GET /admin/products/{product_id}/similars.json

public

GET /admin/stock_currencies.json

public

GET /admin/products/{product_id}/supplementaries.json

public

listThemes(options: Object, id: Number | String): Promise

GET /admin/themes.xml

public

listUnit(options: Object, id: Number | String): Promise

GET /admin/units.json?lang=ru

public

GET /admin/user_tasks.json

public

listVariant(options: Object, id: Number | String): Promise

GET /admin/products/{product_id}/variants.json

public

GET /admin/variant_fields.json

public

GET /admin/variants/{variant_id}/variant_field_values.json

public

GET /admin/warehouses.json

public

listWebhook(options: Object, id: Number | String): Promise

GET /admin/webhooks.json

public

GET /admin/themes/#{theme_id}/widget_types.xml

public

output(response: Object): Object

Output Request-Promise response, used to create Promise resolve

public

patch(conn: Object): Promise

PATCH request

public

post(conn: Object): Promise

POST request

public

put(conn: Object): Promise

PUT request

public

DELETE request

public

DELETE /admin/accessories/{accessory_id}.json

public

DELETE /admin/products/{product_id}/product_accessory_links/{product_accessory_link_id}.json

public

DELETE /admin/accessories/{accessory_id}/values/{accessory_value_id}.json

public

DELETE /admin/application_actions/{application_action_id}.json

public

DELETE /admin/application_widgets/{application_widget_id}.json

public

DELETE /admin/blogs/{blog_id}/articles/{article_id}.json

public

removeAsset(options: Object, id: Number | String): Promise

DELETE /admin/themes/#{theme_id}/assets/#{id}.xml

public

removeBlog(options: Object, id: Number | String): Promise

DELETE /admin/blogs/{blog_id}.json

public

DELETE /admin/categories/{category_id}.json

public

DELETE /admin/properties/{property_id}/characteristics/{characteristic_id}.json

public

DELETE /admin/clients/{client_id}.json

public

DELETE /admin/client_groups/{client_group_id}.json

public

DELETE /admin/collects/{collect_id}.json

public

DELETE /admin/collections/{collection_id}.json

public

DELETE /admin/collection_fields/{collection_field_id}.json

public

DELETE /admin/collection_filters/{filter_id}.json

public

DELETE /admin/discount_codes/{id}.xml

public

DELETE /admin/custom_statuses/{custom_status_permalink}.json

public

DELETE /admin/delivery_variants/{delivery_variant_id}.json

public

DELETE /admin/domains/{domain_id}.json

public

DELETE /admin/external_discounts/{external_discount_id}.json

public

removeField(options: Object, id: Number | String): Promise

DELETE /admin/fields/{field_id}.json

public

removeFile(options: Object, id: Number | String): Promise

DELETE /admin/files/{id}.xml

public

removeJsTag(options: Object, id: Number | String): Promise

DELETE /admin/js_tags/{js_tag_id}.json

public

DELETE /admin/marketplaces/{ym_marketplace_id}.json

public

removeMenu(options: Object, id: Number | String): Promise

DELETE /admin/menus/{menu_id}.json

public

DELETE /admin/menus/{menu_id}/items/{item_id}.json

public

DELETE /admin/o_auth_apps/{o_auth_app_id}.json

public

DELETE /admin/option_names/{option_name_id}.json

public

DELETE /admin/option_names/{option_name_id}/option_values/{option_value_id}.json

public

DELETE /admin/option_names/{option_name_id}/option_values/{option_value_id}/destroy_image.json

public

DELETE /admin/outlets/{outlet_id}.json

public

removePage(options: Object, id: Number | String): Promise

DELETE /admin/pages/{page_id}.json

public

DELETE /admin/payment_gateways/{payment_gateway_id_1}.json

public

DELETE /admin/price_kinds/{id}.json

public

DELETE /admin/products/{id}.xml

public

DELETE /admin/product_fields/{product_field_id}.json

public

DELETE /admin/products/{product_id}/product_field_values/{product_field_value_id}.json

public

DELETE /admin/products/{product_id}/images/{image_id}.json

public

DELETE /admin/properties/{property_id}.json

public

DELETE /admin/recurring_application_charge.xml

public

DELETE /admin/redirects/{redirect_id}.json

public

DELETE /admin/reviews/{review_id}.json

public

DELETE /admin/sales_channels/{sales_channel_id}.json

public

DELETE /admin/products/{product_id}/similars/{similar_id}.json

public

DELETE /admin/products/{product_id}/supplementaries/{supplementary_id}.json

public

DELETE /admin/user_tasks/{user_task_id}.json

public

DELETE /admin/products/{product_id}/variants/{variant_success_id}.json

public

DELETE /admin/variant_fields/{variant_field_id}.json

public

DELETE /admin/variants/{variant_id}/variant_field_values/{variant_field_value_id}.json

public

DELETE /admin/warehouses/{warehouse_id}.json

public

DELETE /admin/webhooks/{webhook_id}.json

public

DELETE /admin/themes/#{theme_id}/widget_types/#{id}.xml

public

renameAsset(options: Object, id: Number | String): Promise

PUT /admin/themes/#{theme_id}/assets/#{id}/rename.xml

public

Events of Request-Promise

public

token(token: String | Number, secret: String | Number): String

Generate access token for shop

public

uploadAsset(options: Object, id: Number | String): Promise

POST /admin/themes/#{theme_id}/assets.xml

public

uploadFile(options: Object, id: Number | String): Promise

POST /admin/files.xml

public

POST /admin/themes/#{theme_id}/widget_types.xml

Static Public

public addRecurringFreeDays(options: Object, id: Number | String): Promise source

import {addRecurringFreeDays} from 'insales/lib/api/recurringcharge.js'

PATCH /admin/recurring_application_charge/add_free_days.json

Examples:

 insales.addRecurringFreeDays({
   token: '1234567890',
   url: 'shop-test.myinsales.ru',
   recurring: {
     "recurring_application_charge": {
       "days_count": 21
     }
   }
 }).then(response => {
   console.info(response.data);
 }).catch(err => {
   console.error(err);
 });

Output:

 {
   "monthly": "400.0",
   "trial_expired_at": "2026-11-19",
   "created_at": "2026-10-21T23:32:54.469+03:00",
   "updated_at": "2026-10-21T23:32:54.681+03:00",
   "paid_till": "2026-11-19",
   "blocked": false
 }

Params:

NameTypeAttributeDescription
options Object
options.token string

Required, access token for shop

options.url string

Required, shop url

options.recurring object

Required, recurring application charge

id Number | String

Required, app id

Return:

Promise

public changeRecurring(options: Object, id: Number | String): Promise source

import {changeRecurring} from 'insales/lib/api/recurringcharge.js'

PUT /admin/recurring_application_charge.xml

Examples:

 insales.changeRecurring({
   token: '1234567890',
   url: 'shop-test.myinsales.ru',
   price: 1010
 }).then(output => {
   console.info(output.response.statusCode);
 }).catch(err => {
   console.error(err);
 });

Output:

 200

Params:

NameTypeAttributeDescription
options Object
options.token string

Required, access token for shop

options.url string

Required, shop url

options.price string | number

Required, price

id Number | String

Required, app id

Return:

Promise

public countOrder(options: Object, id: Number | String): Promise source

import {countOrder} from 'insales/lib/api/order.js'

GET /admin/orders/count.json

Examples:

 insales.countOrder({
   token: '1234567890',
   url: 'shop-test.myinsales.ru'
 }).then(response => {
   console.info(response.data);
 }).catch(err => {
   console.error(err);
 });

Output:

 {
   "count": 6
 }

Params:

NameTypeAttributeDescription
options Object
options.token string

Required, access token for shop

options.url string

Required, shop url

options.fulfillment_status string | string[]
  • optional

Order status or array of statuses

options.delivery_variant number | number[]
  • optional

Delivery variant id or array of ids

options.payment_gateway_id number | number[]
  • optional

Payment gateway id or array of ids

id Number | String

Required, app id

Return:

Promise

public countProduct(options: Object, id: Number | String): Promise source

import {countProduct} from 'insales/lib/api/product.js'

GET /admin/products/count.json

Examples:

 insales.countProduct({
   token: '1234567890',
   url: 'shop-test.myinsales.ru'
 }).then(response => {
   console.info(response.data);
 }).catch(err => {
   console.error(err);
 });

Output:

 {
   "count": 5
 }

Params:

NameTypeAttributeDescription
options Object
options.token string

Required, access token for shop

options.url string

Required, shop url

id Number | String

Required, app id

Return:

Promise

public createAccessory(options: Object, id: Number | String): Promise source

import {createAccessory} from 'insales/lib/api/accessory.js'

POST /admin/accessories.json

Examples:

 insales.createAccessory({
   token: '1234567890',
   url: 'shop-test.myinsales.ru',
   accessory: {
     "accessory": {
       "name": "Опция 1",
       "max_count": 7,
       "min_count": 3,
       "permalink": "opcia-1"
     }
   }
 }).then(response => {
   console.info(response.data);
 }).catch(err => {
   console.error(err);
 });

Output:

 {
   "id": 58,
   "account_id": 1,
   "name_translations": [
     "Опция 1"
   ],
   "min_count": 3,
   "max_count": 7,
   "created_at": "2026-10-21T23:15:57.629+03:00",
   "updated_at": "2026-10-21T23:15:57.629+03:00",
   "back_office_name": "Опция 1",
   "permalink": "opcia-1",
   "name": "Опция 1"
 }

Params:

NameTypeAttributeDescription
options Object
options.token string

Required, access token for shop

options.url string

Required, shop url

options.accessory object

Required, accessory

id Number | String

Required, app id

Return:

Promise
import {createAccessoryLink} from 'insales/lib/api/accessoryvalue.js'

POST /admin/products/{product_id}/product_accessory_links.json

Examples:

 insales.createAccessoryLink({
   token: '1234567890',
   url: 'shop-test.myinsales.ru',
   productid: '293978497',
   accessorylink: {
     "product_accessory_link": {
       "accessory_id": 100
     }
   }
 }).then(response => {
   console.info(response.data);
 }).catch(err => {
   console.error(err);
 });

Output:

 {
   "id": 19,
   "account_id": 1,
   "accessory_id": 100,
   "created_at": "2026-10-21T23:16:02.499+03:00",
   "updated_at": "2026-10-21T23:16:02.499+03:00",
   "product_id": 293978497,
   "accessory": {
     "id": 100,
     "account_id": 1,
     "name_translations": [
       "Опция 1"
     ],
     "min_count": 4,
     "max_count": 9,
     "created_at": "2026-10-21T23:16:02.342+03:00",
     "updated_at": "2026-10-21T23:16:02.342+03:00",
     "back_office_name": "Лоснящийся Мраморный Стол",
     "permalink": "opcia-1",
     "name": "Опция 1"
   },
   "product": {
     "category_id": 1,
     "created_at": "2026-10-21T23:16:02.000+03:00",
     "updated_at": "2026-10-21T23:16:02.000+03:00",
     "is_hidden": false,
     "account_id": 1,
     "title_translations": [
       "product 4"
     ],
     "available": null,
     "archived": false,
     "key": null,
     "price_min_cached": null,
     "price_max_cached": null,
     "price_min_available_cached": null,
     "price_max_available_cached": null,
     "canonical_url_collection_id": null,
     "collections_id": [],
     "characteristics_id": [],
     "custom_layout": null,
     "custom_template": null,
     "old_price_min_cached": null,
     "old_price_max_cached": null,
     "old_price_min_available_cached": null,
     "old_price_max_available_cached": null,
     "permalink": "product-4",
     "unit": "pce",
     "deleted": false,
     "cost_price_min_cached": null,
     "cost_price_max_cached": null,
     "stock_currency_id": 1,
     "sort_weight": null,
     "bundle": null,
     "ignore_discounts": null,
     "vat": 10,
     "dimensions": null,
     "fiscal_product_type": 1,
     "popularity": null,
     "available_at_warehouses": [],
     "auto_assign_bundle_price": null,
     "demo": null,
     "sales_channels_id": null,
     "demo_thematic": null,
     "reviews_average_rating_cached": null,
     "reviews_count_cached": null,
     "merge_product_id": null,
     "merge_group_product_id": null,
     "merge_group_hidden": null,
     "no_delivery": false,
     "id": 293978497,
     "main_image_id": null,
     "is_adult": false,
     "title": "product 4"
   }
 }

Params:

NameTypeAttributeDescription
options Object
options.token string

Required, access token for shop

options.url string

Required, shop url

options.productid number | string

Required, product id

options.accessorylink object

Required, product accessory link

id Number | String

Required, app id

Return:

Promise

public createAccessoryValue(options: Object, id: Number | String): Promise source

import {createAccessoryValue} from 'insales/lib/api/accessoryvalue.js'

POST /admin/accessories/{accessory_id}/values.json

Examples:

 insales.createAccessoryValue({
   token: '1234567890',
   url: 'shop-test.myinsales.ru',
   accessoryid: '92',
   accessoryvalue: {
     "accessory_value": {
       "name": "Значение опции",
       "price": 100,
       "accounting_variant_id": null
     }
   }
 }).then(response => {
   console.info(response.data);
 }).catch(err => {
   console.error(err);
 });

Output:

 {
   "id": 86,
   "account_id": 1,
   "accessory_id": 92,
   "name_translations": [
     "Значение опции"
   ],
   "price": "100.0",
   "created_at": "2026-10-21T23:16:00.075+03:00",
   "updated_at": "2026-10-21T23:16:00.075+03:00",
   "accounting_variant_id": null,
   "name": "Значение опции"
 }

Params:

NameTypeAttributeDescription
options Object
options.token string

Required, access token for shop

options.url string

Required, shop url

options.accessoryid number | string

Required, accessory id

options.accessoryvalue object

Required, accessory value

id Number | String

Required, app id

Return:

Promise

public createApplicationAction(options: Object, id: Number | String): Promise source

import {createApplicationAction} from 'insales/lib/api/applicationaction.js'

POST /admin/application_actions.json

Examples:

 insales.createApplicationAction({
   token: '1234567890',
   url: 'shop-test.myinsales.ru',
   applicationaction: {
     "application_action": {
       "title": "backoffice title",
       "handle": "unique_handle",
       "entity": "product",
       "url": "http://www.yandex.ru"
     }
   }
 }).then(response => {
   console.info(response.data);
 }).catch(err => {
   console.error(err);
 });

Output:

 {
   "id": 17,
   "title": "backoffice title",
   "url": "http://www.yandex.ru",
   "handle": "unique_handle",
   "entity": "product"
 }

Params:

NameTypeAttributeDescription
options Object
options.token string

Required, access token for shop

options.url string

Required, shop url

options.applicationaction object

Required, application action

id Number | String

Required, app id

Return:

Promise

public createApplicationWidget(options: Object, id: Number | String): Promise source

import {createApplicationWidget} from 'insales/lib/api/applicationwidget.js'

POST /admin/application_widgets.json

Examples:

 insales.createApplicationWidget({
   token: '1234567890',
   url: 'shop-test.myinsales.ru',
   applicationwidget: {
     "application_widget": {
       "code": "some html or javascript code",
       "height": 70,
       "page_type": "order"
     }
   }
 }).then(response => {
   console.info(response.data);
 }).catch(err => {
   console.error(err);
 });

Output:

 {
   "code": "some html or javascript code",
   "created_at": "2026-10-21T23:32:46.991+03:00",
   "id": 57,
   "height": 70,
   "page_type": "order"
 }

Params:

NameTypeAttributeDescription
options Object
options.token string

Required, access token for shop

options.url string

Required, shop url

options.applicationwidget object

Required, application widget

id Number | String

Required, app id

Return:

Promise

public createArticle(options: Object, id: Number | String): Promise source

import {createArticle} from 'insales/lib/api/article.js'

POST /admin/blogs/{blog_id}/articles.json

Examples:

 insales.createArticle({
   token: '1234567890',
   url: 'shop-test.myinsales.ru',
   blogid: '1',
   article: {
     "article": {
       "title": "new article",
       "content": "<p>content of my article<p>",
       "notice": "some notice",
       "published_at": "2014-09-09",
       "author": "My Name is panda",
       "permalink": "first_article",
       "html_title": "HTML TAG TITLE",
       "meta_keywords": "new cool products",
       "meta_description": "It's a article about our new products",
       "image_attributes": {
         "src": "https://abc.myinsales.ru/images/no_image_compact.jpg"
       },
       "related_products_attributes": [
         {
           "product_id": 1
         }
       ],
       "all_tags": [
         "test3",
         "test4"
       ],
       "pinned": true
     }
   }
 }).then(response => {
   console.info(response.data);
 }).catch(err => {
   console.error(err);
 });

Output:

 {
   "id": 332,
   "created_at": "2026-10-21T23:05:53.000+03:00",
   "updated_at": "2026-10-21T23:05:53.000+03:00",
   "published_at": "2014-09-09T00:00:00.000+04:00",
   "pinned": true,
   "custom_template": null,
   "title": "new article",
   "author": "My Name is panda",
   "permalink": "first_article",
   "html_title": "HTML TAG TITLE",
   "meta_keywords": "new cool products",
   "meta_description": "It's a article about our new products",
   "image": {
     "id": 17,
     "created_at": "2026-10-21T23:05:53.000+03:00",
     "original_url": "/images/loading.gif"
   },
   "tags": [
     {
       "title": "test3"
     },
     {
       "title": "test4"
     }
   ],
   "related_products": [
     {
       "category_id": 1,
       "created_at": "2026-10-21T14:10:26.000+03:00",
       "updated_at": "2015-07-27T17:05:35.000+03:00",
       "is_hidden": false,
       "account_id": 1,
       "title_translations": [
         "Cool t-shirt"
       ],
       "available": false,
       "archived": false,
       "key": null,
       "price_min_cached": "10.0",
       "price_max_cached": "10.0",
       "price_min_available_cached": null,
       "price_max_available_cached": null,
       "canonical_url_collection_id": 1,
       "collections_id": [
         1,
         3,
         8
       ],
       "characteristics_id": [
         7,
         9,
         12,
         13
       ],
       "custom_layout": null,
       "custom_template": null,
       "old_price_min_cached": null,
       "old_price_max_cached": null,
       "old_price_min_available_cached": null,
       "old_price_max_available_cached": null,
       "permalink": "футболка",
       "unit": "pce",
       "deleted": false,
       "cost_price_min_cached": null,
       "cost_price_max_cached": null,
       "stock_currency_id": 1,
       "sort_weight": null,
       "bundle": null,
       "ignore_discounts": null,
       "vat": -1,
       "dimensions": "10x20x30",
       "fiscal_product_type": 1,
       "popularity": null,
       "available_at_warehouses": [],
       "auto_assign_bundle_price": null,
       "demo": null,
       "sales_channels_id": null,
       "demo_thematic": null,
       "reviews_average_rating_cached": null,
       "reviews_count_cached": null,
       "merge_product_id": null,
       "merge_group_product_id": null,
       "merge_group_hidden": null,
       "no_delivery": false,
       "id": 1,
       "main_image_id": null,
       "is_adult": false,
       "title": "Cool t-shirt"
     }
   ],
   "notice": "some notice",
   "content": "<p>content of my article<p>"
 }

Params:

NameTypeAttributeDescription
options Object
options.token string

Required, access token for shop

options.url string

Required, shop url

options.blogid number | string

Required, blog id

options.article object

Required, article

id Number | String

Required, app id

Return:

Promise

public createBlog(options: Object, id: Number | String): Promise source

import {createBlog} from 'insales/lib/api/blog.js'

POST /admin/blogs.json

Examples:

 insales.createBlog({
   token: '1234567890',
   url: 'shop-test.myinsales.ru',
   blog: {
     "blog": {
       "title": "SuperBlog",
       "html_title": "HTML TAG TITLE",
       "meta_keywords": "new cool products",
       "meta_description": "It's a blog about our new products"
     }
   }
 }).then(response => {
   console.info(response.data);
 }).catch(err => {
   console.error(err);
 });

Output:

 {
   "id": 283,
   "commentable": "no",
   "notify_about_comment": true,
   "captcha_enabled": false,
   "disallow_links_in_comments": false,
   "custom_template": null,
   "handle": "superblog",
   "title": "SuperBlog",
   "html_title": "HTML TAG TITLE",
   "meta_keywords": "new cool products",
   "meta_description": "It's a blog about our new products",
   "tags": []
 }

Params:

NameTypeAttributeDescription
options Object
options.token string

Required, access token for shop

options.url string

Required, shop url

options.blog object

Required, blog

id Number | String

Required, app id

Return:

Promise

public createBonusTransaction(options: Object, id: Number | String): Promise source

import {createBonusTransaction} from 'insales/lib/api/bonustransaction.js'

POST /admin/clients/{client_id}/bonus_system_transactions.json

Examples:

 insales.createBonusTransaction({
   token: '1234567890',
   url: 'shop-test.myinsales.ru',
   clientid: '2',
   bonustransaction: {
     "bonus_system_transaction": {
       "bonus_points": 100,
       "description": "compliment"
     }
   }
 }).then(response => {
   console.info(response.data);
 }).catch(err => {
   console.error(err);
 });

Output:

 {
   "id": 145,
   "bonus_points": 100,
   "client_id": 2,
   "bonus_system_id": 1,
   "initiator_type": "ApplicationPassword",
   "initiator_id": 1,
   "description": "compliment",
   "status": "charged",
   "created_at": "2026-10-21T23:29:38.930+03:00",
   "updated_at": "2026-10-21T23:29:38.939+03:00"
 }

Params:

NameTypeAttributeDescription
options Object
options.token string

Required, access token for shop

options.url string

Required, shop url

options.clientid number | string

Required, client id

options.bonustransaction object

Required, bonus transaction

id Number | String

Required, app id

Return:

Promise

public createCategory(options: Object, id: Number | String): Promise source

import {createCategory} from 'insales/lib/api/category.js'

POST /admin/categories.json

Examples:

 insales.createCategory({
   token: '1234567890',
   url: 'shop-test.myinsales.ru',
   category: {
     "category": {
       "title": "Reebok"
     }
   }
 }).then(response => {
   console.info(response.data);
 }).catch(err => {
   console.error(err);
 });

Output:

 {
   "id": 20498706,
   "parent_id": 1,
   "title": "Reebok",
   "position": 1,
   "created_at": "2026-10-21T23:12:55.000+03:00",
   "updated_at": "2026-10-21T23:12:55.000+03:00"
 }

Params:

NameTypeAttributeDescription
options Object
options.token string

Required, access token for shop

options.url string

Required, shop url

options.category object

Required, category

id Number | String

Required, app id

Return:

Promise

public createCharacteristic(options: Object, id: Number | String): Promise source

import {createCharacteristic} from 'insales/lib/api/characteristic.js'

POST /admin/properties/{property_id}/characteristics.json

Examples:

 insales.createCharacteristic({
   token: '1234567890',
   url: 'shop-test.myinsales.ru',
   propertyid: '3',
   characteristic: {
     "characteristic": {
       "title": "Reebok"
     }
   }
 }).then(response => {
   console.info(response.data);
 }).catch(err => {
   console.error(err);
 });

Output:

 {
   "id": 898584327,
   "property_id": 3,
   "position": 3,
   "title": "Reebok",
   "permalink": "reebok"
 }

Params:

NameTypeAttributeDescription
options Object
options.token string

Required, access token for shop

options.url string

Required, shop url

options.propertyid number | string

Required, property id

options.characteristic object

Required, characteristic

id Number | String

Required, app id

Return:

Promise

public createCharge(options: Object, id: Number | String): Promise source

import {createCharge} from 'insales/lib/api/charge.js'

POST /admin/application_charges.xml

Examples:

 insales.createCharge({
   token: '1234567890',
   url: 'shop-test.myinsales.ru',
   charge: {
      'application-charge': {
        'name': 'Купи слона',
        'price': '180.0',
        'return-url': 'http://application.my/check_payment_url/%id_in_my_application'
      }
   }
 }).then(output => {
   console.info(output.response.statusCode);
 }).catch(err => {
   console.error(err);
 });

Output:

 { 'application-charge':
   { 'created-at': '2011-11-11T11:11:11+03:00',
     id: '1234',
     name: 'Купи слона',
     price: '180.0',
     'return-url': 'http://application.my/check_payment_url/%id_in_my_application',
     status: 'pending',
     test: '',
     'updated-at': '2011-11-11T11:11:11+03:00',
     'confirmation-url': 'http://shop-test.myinsales.ru/admin/invoices/123456' } }

Params:

NameTypeAttributeDescription
options Object
options.token string

Required, access token for shop

options.url string

Required, shop url

options.charge object

Required, charge info

id Number | String

Required, app id

Return:

Promise

public createClient(options: Object, id: Number | String): Promise source

import {createClient} from 'insales/lib/api/client.js'

POST /admin/clients.json

Examples:

 insales.createClient({
   token: '1234567890',
   url: 'shop-test.myinsales.ru',
   client: {
     "client": {
       "name": "Ivan",
       "surname": "Ivanov",
       "middlename": "Ivanovich",
       "registered": true,
       "email": "test@example.com",
       "password": "123456",
       "phone": "+71111111111",
       "type": "Client::Individual",
       "fields_values_attributes": [
         {
           "field_id": 1152,
           "value": "text"
         }
       ]
     }
   }
 }).then(response => {
   console.info(response.data);
 }).catch(err => {
   console.error(err);
 });

Output:

 {
   "id": 225,
   "email": "test@example.com",
   "name": "Ivan",
   "phone": "+71111111111",
   "created_at": "2026-10-21T23:29:33.000+03:00",
   "updated_at": "2026-10-21T23:29:33.000+03:00",
   "comment": null,
   "registered": true,
   "subscribe": true,
   "client_group_id": 1,
   "bonus_points": 0,
   "type": "Client::Individual",
   "correspondent_account": null,
   "settlement_account": null,
   "consent_to_personal_data": true,
   "o_auth_provider": null,
   "messenger_subscription": null,
   "external_id": null,
   "external_service": null,
   "contact_name": "Ivan",
   "surname": "Ivanov",
   "middlename": "Ivanovich",
   "progressive_discount": "25.0",
   "group_discount": "25.0",
   "ip_addr": "",
   "fields_values": [
     {
       "id": 859,
       "value": "text",
       "created_at": "2026-10-21T23:29:33.913+03:00",
       "updated_at": "2026-10-21T23:29:33.913+03:00",
       "field_id": 1152,
       "type": "Текст",
       "name": "special",
       "handle": null
     }
   ],
   "default_address": null,
   "client_tags": [],
   "full_name": "Ivanov Ivan Ivanovich"
 }

 insales.createClient({
   token: '1234567890',
   url: 'shop-test.myinsales.ru',
   client: {
     "client": {
       "name": "OOO 'Company'",
       "type": "Client::Juridical",
       "juridical_address": "123456, Moscow, Novaya st., 1, 222",
       "inn": 1234567890,
       "kpp": 123456789,
       "bik": 123456789,
       "fields_values_attributes": [
         {
           "field_id": 1184,
           "value": "text_value"
         }
       ]
     }
   }
 }).then(response => {
   console.info(response.data);
 }).catch(err => {
   console.error(err);
 });

Output:

 {
   "id": 241,
   "email": null,
   "name": "OOO 'Company'",
   "phone": null,
   "created_at": "2026-10-21T23:29:34.000+03:00",
   "updated_at": "2026-10-21T23:29:34.000+03:00",
   "comment": null,
   "registered": false,
   "subscribe": true,
   "client_group_id": null,
   "bonus_points": 0,
   "type": "Client::Juridical",
   "correspondent_account": null,
   "settlement_account": null,
   "consent_to_personal_data": true,
   "o_auth_provider": null,
   "messenger_subscription": null,
   "external_id": null,
   "external_service": null,
   "contact_name": null,
   "juridical_address": "123456, Moscow, Novaya st., 1, 222",
   "inn": "1234567890",
   "kpp": "123456789",
   "ogrn": null,
   "okpo": null,
   "bik": "123456789",
   "bank_name": null,
   "progressive_discount": null,
   "group_discount": null,
   "ip_addr": "",
   "fields_values": [
     {
       "id": 891,
       "value": "text_value",
       "created_at": "2026-10-21T23:29:34.582+03:00",
       "updated_at": "2026-10-21T23:29:34.582+03:00",
       "field_id": 1184,
       "type": "Текст",
       "name": "field_juridical",
       "handle": null
     }
   ],
   "default_address": null,
   "client_tags": [],
   "full_name": "OOO 'Company'"
 }

Params:

NameTypeAttributeDescription
options Object
options.token string

Required, access token for shop

options.url string

Required, shop url

options.client object

Required, client

id Number | String

Required, app id

Return:

Promise

public createClientGroup(options: Object, id: Number | String): Promise source

import {createClientGroup} from 'insales/lib/api/clientgroup.js'

POST /admin/client_groups.json

Examples:

 insales.createClientGroup({
   token: '1234567890',
   url: 'shop-test.myinsales.ru',
   clientgroup: {
     "client_group": {
       "title": "test group",
       "discount": 0.2,
       "discount_description": "test group discount",
       "is_default": false
     }
   }
 }).then(response => {
   console.info(response.data);
 }).catch(err => {
   console.error(err);
 });

Output:

 {
   "id": 33,
   "title": "test group",
   "discount": "0.2",
   "discount_description": "test group discount",
   "is_default": false,
   "b2b": false,
   "created_at": "2026-10-21T23:29:36.851+03:00",
   "updated_at": "2026-10-21T23:29:36.855+03:00"
 }

Params:

NameTypeAttributeDescription
options Object
options.token string

Required, access token for shop

options.url string

Required, shop url

options.clientgroup object

Required, client group

id Number | String

Required, app id

Return:

Promise

public createCollect(options: Object, id: Number | String): Promise source

import {createCollect} from 'insales/lib/api/collect.js'

POST /admin/collects.json

Examples:

 insales.createCollect({
   token: '1234567890',
   url: 'shop-test.myinsales.ru',
   collect: {
     "collect": {
       "collection_id": 2,
       "product_id": 1
     }
   }
 }).then(response => {
   console.info(response.data);
 }).catch(err => {
   console.error(err);
 });

Output:

 {
   "id": 10544,
   "collection_id": 2,
   "product_id": 1,
   "position": 1,
   "created_at": "2026-10-21T23:17:19.000+03:00"
 }

Params:

NameTypeAttributeDescription
options Object
options.token string

Required, access token for shop

options.url string

Required, shop url

options.collect object

Required, collect

id Number | String

Required, app id

Return:

Promise

public createCollection(options: Object, id: Number | String): Promise source

import {createCollection} from 'insales/lib/api/collection.js'

POST /admin/collections.json

Examples:

 insales.createCollection({
   token: '1234567890',
   url: 'shop-test.myinsales.ru',
   collection: {
     "collection": {
       "title": "T-shirts",
       "parent_id": 1,
       "position": 1,
       "sort_type": 1,
       "description": "text",
       "image_attributes": {
         "src": "https://abc.myinsales.ru/images/no_image_compact.jpg"
       },
       "field_values_attributes": [
         {
           "handle": "handle",
           "value": 12345
         }
       ]
     }
   }
 }).then(response => {
   console.info(response.data);
 }).catch(err => {
   console.error(err);
 });

Output:

 {
   "id": 20924923,
   "parent_id": 1,
   "is_hidden": false,
   "is_smart": null,
   "position": 1,
   "created_at": "2026-10-21T23:17:17.000+03:00",
   "updated_at": "2026-10-21T23:17:17.000+03:00",
   "recursive": null,
   "sort_type": 1,
   "custom_template": null,
   "title": "T-shirts",
   "html_title": null,
   "meta_description": null,
   "meta_keywords": null,
   "permalink": "t-shirts",
   "url": "/collection/t-shirts",
   "image": {
     "id": 9,
     "created_at": "2026-10-21T23:17:17.000+03:00",
     "original_url": "/images/loading.gif"
   },
   "field_values": [
     {
       "id": 538,
       "collection_field_id": 1,
       "value": "12345"
     }
   ],
   "description": "text",
   "seo_description": null
 }

Params:

NameTypeAttributeDescription
options Object
options.token string

Required, access token for shop

options.url string

Required, shop url

options.collection object

Required, collection

id Number | String

Required, app id

Return:

Promise

public createCollectionField(options: Object, id: Number | String): Promise source

import {createCollectionField} from 'insales/lib/api/collectionfield.js'

POST /admin/collection_fields.json

Examples:

 insales.createCollectionField({
   token: '1234567890',
   url: 'shop-test.myinsales.ru',
   collectionfield: {
     "collection_field": {
       "title": "Size",
       "handle": "size",
       "type": "CollectionField::TextArea"
     }
   }
 }).then(response => {
   console.info(response.data);
 }).catch(err => {
   console.error(err);
 });

Output:

 {
   "id": 59,
   "handle": "size",
   "type": "CollectionField::TextArea",
   "application_id": 1,
   "position": 3,
   "is_hidden": null,
   "title": "Size",
   "application_title": "Цифровые товары"
 }

Params:

NameTypeAttributeDescription
options Object
options.token string

Required, access token for shop

options.url string

Required, shop url

options.collectionfield object

Required, collection field

id Number | String

Required, app id

Return:

Promise

public createCollectionFilter(options: Object, id: Number | String): Promise source

import {createCollectionFilter} from 'insales/lib/api/collectionfilter.js'

POST /admin/collection_filters.json

Examples:

 insales.createCollectionFilter({
   token: '1234567890',
   url: 'shop-test.myinsales.ru',
   filter: {
     "filter": {
       "title": "new filter",
       "collection_id": 1,
       "properties_attributes": [
         {
           "title": "first property",
           "value": "first prop value"
         },
         {
           "title": "second property",
           "value": "second property value"
         }
       ],
       "options_attributes": [
         {
           "title": "first option",
           "value": "first option value"
         },
         {
           "title": "second option",
           "value": "second option value"
         }
       ],
       "field_values_attributes": [
         {
           "handle": "handle",
           "value": 12345
         }
       ]
     }
   }
 }).then(response => {
   console.info(response.data);
 }).catch(err => {
   console.error(err);
 });

Output:

 {
   "id": 162,
   "collection_id": 1,
   "description": null,
   "seo_description": null,
   "title": "new filter",
   "permalink": "new-filter",
   "html_title": null,
   "meta_keywords": null,
   "meta_description": null,
   "characteristis": [
     {
       "id": 898584351,
       "property_id": 35187364,
       "position": 1,
       "title": "first prop value",
       "permalink": "first-prop-value"
     },
     {
       "id": 898584359,
       "property_id": 35187365,
       "position": 1,
       "title": "second property value",
       "permalink": "second-property-value"
     }
   ],
   "option_values": [
     {
       "id": 21063495,
       "option_name_id": 2517869,
       "position": 1,
       "title": "first option value",
       "image_url": null,
       "permalink": "first-option-value"
     },
     {
       "id": 21063496,
       "option_name_id": 2517870,
       "position": 1,
       "title": "second option value",
       "image_url": null,
       "permalink": "second-option-value"
     }
   ]
 }

Params:

NameTypeAttributeDescription
options Object
options.token string

Required, access token for shop

options.url string

Required, shop url

options.filter object

Required, collection filter

id Number | String

Required, app id

Return:

Promise

public createCoupon(options: Object, id: Number | String): Promise source

import {createCoupon} from 'insales/lib/api/coupon.js'

POST /admin/discount_codes.xml

Examples:

 insales.createCoupon({
   token: '1234567890',
   url: 'shop-test.myinsales.ru',
   coupon: {
      'discount_code': {
        'code': 'frandom2',
        'act_once': 'true',
        'discount': 10,
        'type_id': 1,
        'description': 'API code',
        'disabled': 0,
        'expired-at': '2030-06-09'
      }
   }
 }).then(output => {
   console.info(output.response.statusCode);
 }).catch(err => {
   console.error(err);
 });

Output:

 { 'discount-code':
    { 'act-once': 'true',
      'act-once-for-client': '',
      code: 'frandom2',
      'created-at': '2011-11-11T11:11:11+03:00',
      description: 'API code',
      disabled: 'false',
      discount: '10.0',
      'expired-at': '2030-06-09',
      id: '100000',
      'min-price': '',
      'type-id': '1',
      'updated-at': '2011-11-11T11:11:11+03:00',
      worked: 'true',
      'discount-collections': '' } }

Params:

NameTypeAttributeDescription
options Object
options.token string

Required, access token for shop

options.url string

Required, shop url

options.coupon object

Required, coupon

id Number | String

Required, app id

Return:

Promise

public createCustomStatus(options: Object, id: Number | String): Promise source

import {createCustomStatus} from 'insales/lib/api/customstatus.js'

POST /admin/custom_statuses.json

Examples:

 insales.createCustomStatus({
   token: '1234567890',
   url: 'shop-test.myinsales.ru',
   customstatus: {
     "custom_status": {
       "system_status": "new",
       "title": "New (ordered by phone)"
     }
   }
 }).then(response => {
   console.info(response.data);
 }).catch(err => {
   console.error(err);
 });

Output:

 {
   "id": 73,
   "system_status": "new",
   "permalink": "new-ordered-by-phone",
   "position": 2,
   "is_default": false,
   "created_at": "2026-10-21T23:27:54.052+03:00",
   "updated_at": "2026-10-21T23:27:54.052+03:00",
   "title": "New (ordered by phone)",
   "color": "#DC5F59"
 }

Params:

NameTypeAttributeDescription
options Object
options.token string

Required, access token for shop

options.url string

Required, shop url

options.customstatus object

Required, custom status

id Number | String

Required, app id

Return:

Promise

public createDeliveryVariant(options: Object, id: Number | String): Promise source

import {createDeliveryVariant} from 'insales/lib/api/deliveryvariant.js'

POST /admin/delivery_variants.json

Examples:

 insales.createDeliveryVariant({
   token: '1234567890',
   url: 'shop-test.myinsales.ru',
   deliveryvariant: {
     "delivery_variant": {
       "title": "express delivery",
       "type": "DeliveryVariant::Fixed",
       "description": "text",
       "position": 1,
       "add_payment_gateways": true,
       "delivery_locations_attributes": [
         {
           "region": "A",
           "city": "B"
         }
       ],
       "inverted": false,
       "charge_up_to": 1000,
       "price": 300,
       "show_calendar_in_checkout": true,
       "delivery_date_required": true,
       "forbid_weekends": true,
       "estimated_delivery_period": 2,
       "order_time_is_later": "18:00",
       "forbidden_days": "23.02,08.03,01.05",
       "show_time_intervals_in_checkout": true,
       "time_intervals_required": true,
       "time_intervals": "10-12,12-16,16-20"
     }
   }
 }).then(response => {
   console.info(response.data);
 }).catch(err => {
   console.error(err);
 });

Output:

 {
   "id": 113,
   "position": 1,
   "updated_at": "2026-10-21T23:30:51.000+03:00",
   "created_at": "2026-10-21T23:30:51.000+03:00",
   "charge_up_to": "1000.0",
   "inverted": false,
   "show_zip_code": false,
   "title": "express delivery",
   "description": "text",
   "type": "DeliveryVariant::Fixed",
   "min_order_sum": null,
   "show_calendar_in_checkout": true,
   "delivery_date_required": true,
   "forbid_weekends": true,
   "utc_from_address": null,
   "estimated_delivery_period": 2,
   "order_time_is_later": "18:00",
   "forbidden_days": "23.02,08.03,01.05",
   "show_time_intervals_in_checkout": true,
   "time_intervals_required": true,
   "price": "300.0",
   "javascript": null,
   "payment_delivery_variants": [
     {
       "id": 18,
       "payment_gateway_id": 1,
       "created_at": "2026-10-21T23:30:51.000+03:00"
     },
     {
       "id": 19,
       "payment_gateway_id": 3,
       "created_at": "2026-10-21T23:30:51.000+03:00"
     },
     {
       "id": 20,
       "payment_gateway_id": 4,
       "created_at": "2026-10-21T23:30:51.000+03:00"
     }
   ],
   "delivery_locations": [
     {
       "id": 9,
       "city": "B",
       "region": "A",
       "country": "RU"
     }
   ],
   "delivery_time_intervals": [
     {
       "time_from": "10:00",
       "time_to": "12:00",
       "monday": true,
       "tuesday": true,
       "wednesday": true,
       "thursday": true,
       "friday": true,
       "saturday": true,
       "sunday": true
     },
     {
       "time_from": "12:00",
       "time_to": "16:00",
       "monday": true,
       "tuesday": true,
       "wednesday": true,
       "thursday": true,
       "friday": true,
       "saturday": true,
       "sunday": true
     },
     {
       "time_from": "16:00",
       "time_to": "20:00",
       "monday": true,
       "tuesday": true,
       "wednesday": true,
       "thursday": true,
       "friday": true,
       "saturday": true,
       "sunday": true
     }
   ]
 }

 insales.createDeliveryVariant({
   token: '1234567890',
   url: 'shop-test.myinsales.ru',
   deliveryvariant: {
     "delivery_variant": {
       "title": "express delivery",
       "type": "DeliveryVariant::External",
       "description": "text",
       "position": 1,
       "add_payment_gateways": true,
       "delivery_locations_attributes": [
         {
           "region": "A",
           "city": "B"
         }
       ],
       "inverted": false,
       "charge_up_to": 1000,
       "javascript": "<script type='text/javascript' src='http://mydelivery.ru/delivery.js'></script>\n        <script type='text/javascript'>\n          $(function(){\n          alert('Choose a point of customer pickup');\n          });\n        </script>",
       "url": "http://google.ru"
     }
   }
 }).then(response => {
   console.info(response.data);
 }).catch(err => {
   console.error(err);
 });

Output:

 {
   "id": 129,
   "position": 1,
   "updated_at": "2026-10-21T23:30:52.000+03:00",
   "created_at": "2026-10-21T23:30:52.000+03:00",
   "charge_up_to": "1000.0",
   "inverted": false,
   "show_zip_code": false,
   "title": "express delivery",
   "description": "text",
   "type": "DeliveryVariant::External",
   "min_order_sum": null,
   "show_calendar_in_checkout": null,
   "delivery_date_required": null,
   "forbid_weekends": null,
   "utc_from_address": null,
   "estimated_delivery_period": null,
   "order_time_is_later": null,
   "forbidden_days": null,
   "show_time_intervals_in_checkout": null,
   "time_intervals_required": null,
   "url": "http://google.ru",
   "javascript": "<script type='text/javascript' src='http://mydelivery.ru/delivery.js'></script>\n        <script type='text/javascript'>\n          $(function(){\n          alert('Choose a point of customer pickup');\n          });\n        </script>",
   "customer_pickup": false,
   "payment_delivery_variants": [
     {
       "id": 24,
       "payment_gateway_id": 1,
       "created_at": "2026-10-21T23:30:52.000+03:00"
     },
     {
       "id": 25,
       "payment_gateway_id": 3,
       "created_at": "2026-10-21T23:30:52.000+03:00"
     },
     {
       "id": 26,
       "payment_gateway_id": 4,
       "created_at": "2026-10-21T23:30:52.000+03:00"
     }
   ],
   "delivery_locations": [
     {
       "id": 25,
       "city": "B",
       "region": "A",
       "country": "RU"
     }
   ],
   "delivery_time_intervals": []
 }

 insales.createDeliveryVariant({
   token: '1234567890',
   url: 'shop-test.myinsales.ru',
   deliveryvariant: {
     "delivery_variant": {
       "title": "express delivery",
       "type": "DeliveryVariant::LocationDepend",
       "description": "text",
       "position": 1,
       "add_payment_gateways": true,
       "delivery_locations_attributes": [
         {
           "region": "A",
           "city": "B"
         }
       ],
       "inverted": true,
       "charge_up_to": 1000,
       "delivery_zones_attributes": [
         {
           "title": "test",
           "tariffs_attributes": [
             {
               "max_weight": 30,
               "price": 100,
               "step": 2,
               "step_price": 50
             }
           ],
           "locations_attributes": [
             {
               "country": "A",
               "region": "C",
               "city": "D"
             }
           ]
         }
       ]
     },
     "delivery_variant[delivery_zones_attributes]": {
       "title": "express delivery"
     }
   }
 }).then(response => {
   console.info(response.data);
 }).catch(err => {
   console.error(err);
 });

Output:

 {
   "id": 145,
   "position": 1,
   "updated_at": "2026-10-21T23:30:53.000+03:00",
   "created_at": "2026-10-21T23:30:53.000+03:00",
   "charge_up_to": "1000.0",
   "inverted": true,
   "show_zip_code": false,
   "title": "express delivery",
   "description": "text",
   "type": "DeliveryVariant::LocationDepend",
   "min_order_sum": null,
   "show_calendar_in_checkout": null,
   "delivery_date_required": null,
   "forbid_weekends": null,
   "utc_from_address": null,
   "estimated_delivery_period": null,
   "order_time_is_later": null,
   "forbidden_days": null,
   "show_time_intervals_in_checkout": null,
   "time_intervals_required": null,
   "payment_delivery_variants": [
     {
       "id": 30,
       "payment_gateway_id": 1,
       "created_at": "2026-10-21T23:30:53.000+03:00"
     },
     {
       "id": 31,
       "payment_gateway_id": 3,
       "created_at": "2026-10-21T23:30:53.000+03:00"
     },
     {
       "id": 32,
       "payment_gateway_id": 4,
       "created_at": "2026-10-21T23:30:53.000+03:00"
     }
   ],
   "delivery_locations": [
     {
       "id": 49,
       "city": "B",
       "region": "A",
       "country": "RU"
     }
   ],
   "delivery_time_intervals": [],
   "delivery_zones": [
     {
       "id": 9,
       "title": "test",
       "tariffs": [
         {
           "id": 9,
           "max_weight": "30.0",
           "price": "100.0",
           "step": "2.0",
           "step_price": "50.0"
         }
       ],
       "locations": [
         {
           "id": 57,
           "country": "A",
           "region": "C",
           "city": "D"
         }
       ]
     }
   ]
 }

 insales.createDeliveryVariant({
   token: '1234567890',
   url: 'shop-test.myinsales.ru',
   deliveryvariant: {
     "delivery_variant": {
       "title": "express delivery",
       "type": "DeliveryVariant::PriceDepend",
       "description": "text",
       "position": 1,
       "add_payment_gateways": true,
       "delivery_locations_attributes": [
         {
           "region": "A",
           "city": "B"
         }
       ],
       "inverted": false,
       "charge_up_to": 1000,
       "min_price": 300,
       "rules_attributes": [
         {
           "price": 300,
           "order_price": 10,
           "order_weight": 1
         }
       ]
     }
   }
 }).then(response => {
   console.info(response.data);
 }).catch(err => {
   console.error(err);
 });

Output:

 {
   "id": 161,
   "position": 1,
   "updated_at": "2026-10-21T23:30:53.000+03:00",
   "created_at": "2026-10-21T23:30:53.000+03:00",
   "charge_up_to": "1000.0",
   "inverted": false,
   "show_zip_code": false,
   "title": "express delivery",
   "description": "text",
   "type": "DeliveryVariant::PriceDepend",
   "min_order_sum": null,
   "show_calendar_in_checkout": null,
   "delivery_date_required": null,
   "forbid_weekends": null,
   "utc_from_address": null,
   "estimated_delivery_period": null,
   "order_time_is_later": null,
   "forbidden_days": null,
   "show_time_intervals_in_checkout": null,
   "time_intervals_required": null,
   "min_price": "300.0",
   "payment_delivery_variants": [
     {
       "id": 36,
       "payment_gateway_id": 1,
       "created_at": "2026-10-21T23:30:53.000+03:00"
     },
     {
       "id": 37,
       "payment_gateway_id": 3,
       "created_at": "2026-10-21T23:30:53.000+03:00"
     },
     {
       "id": 38,
       "payment_gateway_id": 4,
       "created_at": "2026-10-21T23:30:53.000+03:00"
     }
   ],
   "delivery_locations": [
     {
       "id": 73,
       "city": "B",
       "region": "A",
       "country": "RU"
     }
   ],
   "delivery_time_intervals": [],
   "rules": [
     {
       "id": 24,
       "order_price": "10.0",
       "price": "300.0",
       "order_weight": "1.0"
     }
   ]
 }

 insales.createDeliveryVariant({
   token: '1234567890',
   url: 'shop-test.myinsales.ru',
   deliveryvariant: {
     "delivery_variant": {
       "title": "express delivery",
       "type": "DeliveryVariant::PickUp",
       "description": "text",
       "position": 1,
       "add_payment_gateways": true,
       "delivery_locations_attributes": [
         {
           "region": "A",
           "city": "B"
         }
       ],
       "inverted": false,
       "charge_up_to": 1000,
       "show_calendar_in_checkout": true,
       "delivery_date_required": true,
       "forbid_weekends": true,
       "estimated_delivery_period": 2,
       "order_time_is_later": "18:00",
       "forbidden_days": "23.02,08.03,01.05",
       "show_time_intervals_in_checkout": true,
       "time_intervals_required": true,
       "time_intervals": "10-12,12-16,16-20",
       "pick_up_sources_attributes": [
         {
           "title": "My company",
           "pick_up_source_http_method": "POST",
           "url": "https://example.com/get_points",
           "point_info_url": "https://example.com/get_point_info"
         }
       ]
     },
     "delivery_variant[pick_up_sources_attributes]": {
       "title": "express delivery",
       "http_method": "post"
     }
   }
 }).then(response => {
   console.info(response.data);
 }).catch(err => {
   console.error(err);
 });

Output:

 {
   "id": 177,
   "position": 1,
   "updated_at": "2026-10-21T23:30:54.000+03:00",
   "created_at": "2026-10-21T23:30:54.000+03:00",
   "charge_up_to": "1000.0",
   "inverted": false,
   "show_zip_code": false,
   "title": "express delivery",
   "description": "text",
   "type": "DeliveryVariant::PickUp",
   "min_order_sum": null,
   "show_calendar_in_checkout": true,
   "delivery_date_required": true,
   "forbid_weekends": true,
   "utc_from_address": null,
   "estimated_delivery_period": 2,
   "order_time_is_later": "18:00",
   "forbidden_days": "23.02,08.03,01.05",
   "show_time_intervals_in_checkout": true,
   "time_intervals_required": true,
   "payment_delivery_variants": [
     {
       "id": 44,
       "payment_gateway_id": 1,
       "created_at": "2026-10-21T23:30:54.000+03:00"
     },
     {
       "id": 45,
       "payment_gateway_id": 3,
       "created_at": "2026-10-21T23:30:54.000+03:00"
     },
     {
       "id": 46,
       "payment_gateway_id": 4,
       "created_at": "2026-10-21T23:30:54.000+03:00"
     },
     {
       "id": 47,
       "payment_gateway_id": 42,
       "created_at": "2026-10-21T23:30:54.000+03:00"
     }
   ],
   "delivery_locations": [
     {
       "id": 89,
       "city": "B",
       "region": "A",
       "country": "RU"
     }
   ],
   "delivery_time_intervals": [
     {
       "time_from": "10:00",
       "time_to": "12:00",
       "monday": true,
       "tuesday": true,
       "wednesday": true,
       "thursday": true,
       "friday": true,
       "saturday": true,
       "sunday": true
     },
     {
       "time_from": "12:00",
       "time_to": "16:00",
       "monday": true,
       "tuesday": true,
       "wednesday": true,
       "thursday": true,
       "friday": true,
       "saturday": true,
       "sunday": true
     },
     {
       "time_from": "16:00",
       "time_to": "20:00",
       "monday": true,
       "tuesday": true,
       "wednesday": true,
       "thursday": true,
       "friday": true,
       "saturday": true,
       "sunday": true
     }
   ],
   "pick_up_sources": [
     {
       "id": 2,
       "url": "https://example.com/get_points",
       "point_info_url": "https://example.com/get_point_info",
       "method": "POST",
       "created_at": "2026-10-21T23:30:54.721+03:00"
     }
   ],
   "pick_up_source_delivery_variants": [
     {
       "id": 2,
       "pick_up_source_id": 2,
       "created_at": "2026-10-21T23:30:54.725+03:00"
     }
   ]
 }

Params:

NameTypeAttributeDescription
options Object
options.token string

Required, access token for shop

options.url string

Required, shop url

options.deliveryvariant object

Required, delivery variant

id Number | String

Required, app id

Return:

Promise

public createDomain(options: Object, id: Number | String): Promise source

import {createDomain} from 'insales/lib/api/domain.js'

POST /admin/domains.json

Examples:

 insales.createDomain({
   token: '1234567890',
   url: 'shop-test.myinsales.ru',
   domain: {
     "domain": {
       "domain": "another-domain.ru",
       "main": true
     }
   }
 }).then(response => {
   console.info(response.data);
 }).catch(err => {
   console.error(err);
 });

Output:

 {
   "id": 36,
   "domain": "another-domain.ru",
   "created_at": "2026-10-21T23:32:37.000+03:00",
   "updated_at": "2026-10-21T23:32:37.000+03:00",
   "main": true
 }

Params:

NameTypeAttributeDescription
options Object
options.token string

Required, access token for shop

options.url string

Required, shop url

options.domain object

Required, domain

id Number | String

Required, app id

Return:

Promise

public createExternalDiscount(options: Object, id: Number | String): Promise source

import {createExternalDiscount} from 'insales/lib/api/externaldiscount.js'

POST /admin/external_discounts.json

Examples:

 insales.createExternalDiscount({
   token: '1234567890',
   url: 'shop-test.myinsales.ru',
   discount: {
     "external_discount": {
       "description": "Birthday discount",
       "url": "https://myservice.com/birthday_external_discount",
       "order_lines_depend": false,
       "active": true,
       "observed_fields": [
         1,
         2
       ]
     }
   }
 }).then(response => {
   console.info(response.data);
 }).catch(err => {
   console.error(err);
 });

Output:

 {
   "id": 57,
   "url": "https://myservice.com/birthday_external_discount",
   "order_lines_depend": false,
   "active": true,
   "created_at": "2026-10-21T23:27:55.000+03:00",
   "updated_at": "2026-10-21T23:27:55.000+03:00",
   "description": "Birthday discount",
   "observed_fields": [
     1,
     2
   ]
 }

Params:

NameTypeAttributeDescription
options Object
options.token string

Required, access token for shop

options.url string

Required, shop url

options.discount object

Required, external discount

id Number | String

Required, app id

Return:

Promise

public createField(options: Object, id: Number | String): Promise source

import {createField} from 'insales/lib/api/field.js'

POST /admin/fields.json

Examples:

 insales.createField({
   token: '1234567890',
   url: 'shop-test.myinsales.ru',
   field: {
     "field": {
       "type": "Field::TextField",
       "office_title": "title_for_text_field",
       "destiny": 1,
       "handle": "my_awesome_field_1",
       "title": "title_for_text_field",
       "active": false,
       "for_buyer": false,
       "show_in_result": false,
       "show_in_checkout": false,
       "is_indexed": true,
       "hide_in_backoffice": true
     }
   }
 }).then(response => {
   console.info(response.data);
 }).catch(err => {
   console.error(err);
 });

Output:

 {
   "id": 1232,
   "destiny": 1,
   "position": 22,
   "office_title": "title_for_text_field",
   "for_buyer": false,
   "obligatory": false,
   "active": false,
   "system_name": null,
   "created_at": "2026-10-21T23:29:39.882+03:00",
   "updated_at": "2026-10-21T23:29:39.882+03:00",
   "show_in_result": false,
   "show_in_checkout": false,
   "is_indexed": true,
   "hide_in_backoffice": true,
   "handle": "my_awesome_field_1",
   "placeholder": null,
   "title": "title_for_text_field",
   "example": null,
   "type": "Field::TextField"
 }

 insales.createField({
   token: '1234567890',
   url: 'shop-test.myinsales.ru',
   field: {
     "field": {
       "type": "Field::Select",
       "office_title": "title_for_select_field",
       "destiny": 1,
       "handle": "my_select_field_1",
       "title": "title_for_select_field",
       "active": false,
       "for_buyer": false,
       "show_in_result": false,
       "show_in_checkout": false,
       "is_indexed": true,
       "hide_in_backoffice": true,
       "field_options_attributes": [
         {
           "value": 1
         },
         {
           "value": 2
         }
       ]
     }
   }
 }).then(response => {
   console.info(response.data);
 }).catch(err => {
   console.error(err);
 });

Output:

 {
   "id": 1248,
   "destiny": 1,
   "position": 22,
   "office_title": "title_for_select_field",
   "for_buyer": false,
   "obligatory": false,
   "active": false,
   "system_name": null,
   "created_at": "2026-10-21T23:29:41.631+03:00",
   "updated_at": "2026-10-21T23:29:41.631+03:00",
   "show_in_result": false,
   "show_in_checkout": false,
   "is_indexed": true,
   "hide_in_backoffice": true,
   "handle": "my_select_field_1",
   "placeholder": null,
   "title": "title_for_select_field",
   "example": null,
   "type": "Field::Select",
   "field_options": [
     {
       "id": 42,
       "position": 1,
       "value": "1"
     },
     {
       "id": 50,
       "position": 2,
       "value": "2"
     }
   ]
 }

Params:

NameTypeAttributeDescription
options Object
options.token string

Required, access token for shop

options.url string

Required, shop url

options.field object

Required, field

id Number | String

Required, app id

Return:

Promise

public createJsTag(options: Object, id: Number | String): Promise source

import {createJsTag} from 'insales/lib/api/jstag.js'

POST /admin/js_tags.xml

Examples:

 insales.createJsTag({
   token: '1234567890',
   url: 'shop-test.myinsales.ru',
   jstag: {
     'js-tag': {
       'type': 'JsTag::TextTag',
       'content': 'http://link'
     }
   }
 }).then(response => {
   console.info(response.data);
 }).catch(err => {
   console.error(err);
 });

Output:

 { 'file-tag':
   { 'account-id': '12345',
     'application-password-id': '12345',
     content: 'http://link',
     'created-at': '2011-11-11 11:11:11 +0300',
     id: '12345',
     name: '',
     'updated-at': '2011-11-11 11:11:11 +0300' } }

Params:

NameTypeAttributeDescription
options Object
options.token string

Required, access token for shop

options.url string

Required, shop url

options.jstag object

Required, jstag

id Number | String

Required, app id

Return:

Promise

public createMarketplace(options: Object, id: Number | String): Promise source

import {createMarketplace} from 'insales/lib/api/marketplace.js'

POST /admin/marketplaces.json

Examples:

 insales.createMarketplace({
   token: '1234567890',
   url: 'shop-test.myinsales.ru',
   marketplace: {
     "marketplace": {
       "name": "YM",
       "type": "Marketplace::ModelYandexMarket",
       "shop_name": "eBay",
       "shop_company": "eBay",
       "description_type": 1,
       "vendor_id": 6,
       "adult": 0,
       "page_encoding": "windows-1251",
       "image_style": "oroginal",
       "collection_ids": [
         6,
         1,
         2,
         3,
         4,
         5,
         8
       ]
     }
   }
 }).then(response => {
   console.info(response.data);
 }).catch(err => {
   console.error(err);
 });

Output:

 {
   "id": 57,
   "name": "YM",
   "type": "Marketplace::ModelYandexMarket",
   "created_at": "2026-10-21T23:32:41.837+03:00",
   "updated_at": "2026-10-21T23:32:41.837+03:00",
   "url": "https://quentin.insales.io:3003/marketplace/57.xml",
   "collection_ids": [],
   "delivery_price_kind": null,
   "description_type": 1,
   "local_delivery_cost": null,
   "sales_notes": null,
   "utm_label": null,
   "vendor_id": 6,
   "page_encoding": "windows-1251",
   "shop_company": "eBay",
   "shop_name": "eBay",
   "adult": false,
   "delivery": true,
   "delivery_new_style": false,
   "pickup": false,
   "store": false,
   "use_sku_as_vendor_code": false,
   "use_stock_currency": false,
   "use_variants": false
 }

 insales.createMarketplace({
   token: '1234567890',
   url: 'shop-test.myinsales.ru',
   marketplace: {
     "marketplace": {
       "name": "GM",
       "type": "Marketplace::GoogleMerchant",
       "description_type": 1,
       "adult": 0
     }
   }
 }).then(response => {
   console.info(response.data);
 }).catch(err => {
   console.error(err);
 });

Output:

 {
   "id": 73,
   "name": "GM",
   "type": "Marketplace::GoogleMerchant",
   "created_at": "2026-10-21T23:32:42.169+03:00",
   "updated_at": "2026-10-21T23:32:42.169+03:00",
   "url": "https://quentin.insales.io:3003/marketplace/73.xml",
   "collection_ids": [],
   "description_type": 1,
   "local_delivery_cost": null,
   "utm_label": null,
   "adult": false,
   "delivery_new_style": false,
   "use_stock_currency": false,
   "use_variants": false
 }

 insales.createMarketplace({
   token: '1234567890',
   url: 'shop-test.myinsales.ru',
   marketplace: {
     "marketplace": {
       "name": "LYM",
       "type": "Marketplace::LiquidYandexMarket",
       "shop_name": "eBay",
       "use_variants": 1,
       "shop_company": "eBay",
       "page_encoding": "utf-8",
       "offer_liquid": "\n<offer type=\"vendor.model\" available=\"{% if product.available %}true{% else %}false{% endif %}\" id=\"{{product.id}}\" >\n  <url>{{account.url}}/product_by_id/{{product.id}}</url>\n  <price>{{product.price}}</price>\n  <currencyId>RUR</currencyId>\n  <categoryId>{{collection.id}}</categoryId>\n  {%for image in product.images limit: 10 %}\n  <picture>{{image.url}}</picture>\n  {% endfor %}\n  <store>false</store>\n  <pickup>true</pickup>\n  <delivery>true</delivery>\n  <vendor>{{product.properties.vendor}}</vendor>\n  <model>{{product.title}}</model>\n  <description>{{product.description}}</description>\n</offer>\n        ",
       "collection_ids": [
         6,
         1,
         2,
         3,
         4,
         5,
         8
       ]
     }
   }
 }).then(response => {
   console.info(response.data);
 }).catch(err => {
   console.error(err);
 });

Output:

 {
   "id": 121,
   "name": "LYM",
   "type": "Marketplace::LiquidYandexMarket",
   "created_at": "2026-10-21T23:32:43.300+03:00",
   "updated_at": "2026-10-21T23:32:43.300+03:00",
   "url": "https://quentin.insales.io:3003/marketplace/121.xml",
   "collection_ids": [],
   "local_delivery_cost": null,
   "vendor_id": null,
   "offer_liquid": "\n<offer type=\"vendor.model\" available=\"{% if product.available %}true{% else %}false{% endif %}\" id=\"{{product.id}}\" >\n  <url>{{account.url}}/product_by_id/{{product.id}}</url>\n  <price>{{product.price}}</price>\n  <currencyId>RUR</currencyId>\n  <categoryId>{{collection.id}}</categoryId>\n  {%for image in product.images limit: 10 %}\n  <picture>{{image.url}}</picture>\n  {% endfor %}\n  <store>false</store>\n  <pickup>true</pickup>\n  <delivery>true</delivery>\n  <vendor>{{product.properties.vendor}}</vendor>\n  <model>{{product.title}}</model>\n  <description>{{product.description}}</description>\n</offer>\n        ",
   "page_encoding": "utf-8",
   "shop_company": "eBay",
   "shop_name": "eBay",
   "delivery_new_style": false,
   "use_stock_currency": false,
   "use_variants": true
 }

Params:

NameTypeAttributeDescription
options Object
options.token string

Required, access token for shop

options.url string

Required, shop url

options.marketplace object

Required, marketplace

id Number | String

Required, app id

Return:

Promise

public createMenu(options: Object, id: Number | String): Promise source

import {createMenu} from 'insales/lib/api/menu.js'

POST /admin/menus.json

Examples:

 insales.createMenu({
   token: '1234567890',
   url: 'shop-test.myinsales.ru',
   menu: {
     "menu": {
       "name": "top menu",
       "handle": "top-menu"
     }
   }
 }).then(response => {
   console.info(response.data);
 }).catch(err => {
   console.error(err);
 });

Output:

 {
   "id": 250,
   "name": "top menu",
   "handle": "top-menu",
   "used_in_theme": false
 }

Params:

NameTypeAttributeDescription
options Object
options.token string

Required, access token for shop

options.url string

Required, shop url

options.menu object

Required, menu

id Number | String

Required, app id

Return:

Promise

public createMenuItem(options: Object, id: Number | String): Promise source

import {createMenuItem} from 'insales/lib/api/menuitem.js'

POST /admin/menus/{menu_id}/items.json

Examples:

 insales.createMenuItem({
   token: '1234567890',
   url: 'shop-test.myinsales.ru',
   menuid: '1',
   menuitem: {
     "menu_item": {
       "title": "new item",
       "related_object_id": "Page_1"
     }
   }
 }).then(response => {
   console.info(response.data);
 }).catch(err => {
   console.error(err);
 });

Output:

 {
   "id": 732,
   "position": 5,
   "title": "new item",
   "url": "/",
   "related_object_id": "Page_1"
 }

 insales.createMenuItem({
   token: '1234567890',
   url: 'shop-test.myinsales.ru',
   menuid: '1',
   menuitem: {
     "menu_item": {
       "title": "new item",
       "related_object_id": "Collection_1"
     }
   }
 }).then(response => {
   console.info(response.data);
 }).catch(err => {
   console.error(err);
 });

Output:

 {
   "id": 740,
   "position": 5,
   "title": "new item",
   "url": "/collection/футболка",
   "related_object_id": "Collection_1"
 }

 insales.createMenuItem({
   token: '1234567890',
   url: 'shop-test.myinsales.ru',
   menuid: '1',
   menuitem: {
     "menu_item": {
       "title": "new item",
       "related_object_id": "Blog_1"
     }
   }
 }).then(response => {
   console.info(response.data);
 }).catch(err => {
   console.error(err);
 });

Output:

 {
   "id": 748,
   "position": 5,
   "title": "new item",
   "url": "/blog",
   "related_object_id": "Blog_1"
 }

 insales.createMenuItem({
   token: '1234567890',
   url: 'shop-test.myinsales.ru',
   menuid: '1',
   menuitem: {
     "menu_item": {
       "title": "new item",
       "url": "http://my-another-shop.com/"
     }
   }
 }).then(response => {
   console.info(response.data);
 }).catch(err => {
   console.error(err);
 });

Output:

 {
   "id": 756,
   "position": 5,
   "title": "new item",
   "url": "http://my-another-shop.com/",
   "related_object_id": "Page_0"
 }

Params:

NameTypeAttributeDescription
options Object
options.token string

Required, access token for shop

options.url string

Required, shop url

options.menuid number | string

Required, menu id

options.menuitem object

Required, menu item

id Number | String

Required, app id

Return:

Promise

public createOAuthApp(options: Object, id: Number | String): Promise source

import {createOAuthApp} from 'insales/lib/api/oauthapp.js'

POST /admin/o_auth_apps.json

Examples:

 insales.createOAuthApp({
   token: '1234567890',
   url: 'shop-test.myinsales.ru',
   oauthapp: {
     "o_auth_app": {
       "provider_handle": "provider name",
       "client_id": "10332",
       "client_secret": "NdsaPd",
       "issuer": "/.well-known/openid-configuration"
     }
   }
 }).then(response => {
   console.info(response.data);
 }).catch(err => {
   console.error(err);
 });

Output:

 {
   "client_id": "10332",
   "client_secret": "NdsaPd",
   "provider": "provider name",
   "issuer": "/.well-known/openid-configuration",
   "id": 8,
   "enabled": true
 }

Params:

NameTypeAttributeDescription
options Object
options.token string

Required, access token for shop

options.url string

Required, shop url

options.oauthapp object

Required, oauth app

id Number | String

Required, app id

Return:

Promise

public createOptionName(options: Object, id: Number | String): Promise source

import {createOptionName} from 'insales/lib/api/optionname.js'

POST /admin/option_names.json

Examples:

 insales.createOptionName({
   token: '1234567890',
   url: 'shop-test.myinsales.ru',
   optionname: {
     "option_name": {
       "title": "Colour",
       "navigational": false
     }
   }
 }).then(response => {
   console.info(response.data);
 }).catch(err => {
   console.error(err);
 });

Output:

 {
   "id": 2517866,
   "position": 3,
   "navigational": false,
   "permalink": "colour",
   "title": "Colour",
   "api_permalink": "o-colour"
 }

Params:

NameTypeAttributeDescription
options Object
options.token string

Required, access token for shop

options.url string

Required, shop url

options.optionname object

Required, option name

id Number | String

Required, app id

Return:

Promise

public createOptionValue(options: Object, id: Number | String): Promise source

import {createOptionValue} from 'insales/lib/api/optionvalue.js'

POST /admin/option_names/{option_name_id}/option_values.json

Examples:

 insales.createOptionValue({
   token: '1234567890',
   url: 'shop-test.myinsales.ru',
   optionnameid: '1',
   optionvalue: {
     "option_value": {
       "title": "Blue",
       "image": {
         "filename": "image.jpg",
         "attachment": "/9j/4AAQSkZJRgABAQEASABIAAD//gA+Q1JFQVRPUjogZ2QtanBlZyB2MS4w\nICh1c2luZyBJSkcgSlBFRyB2NjIpLCBkZWZhdWx0IHF1YWxpdHkK/9sAQwAG\nBAUGBQQGBgUGBwcGCAoQCgoJCQoUDg8MEBcUGBgXFBYWGh0lHxobIxwWFiAs\nICMmJykqKRkfLTAtKDAlKCko/9sAQwEHBwcKCAoTCgoTKBoWGigoKCgoKCgo\nKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgo/8AA\nEQgAWQBkAwEiAAIRAQMRAf/EAB0AAAEEAwEBAAAAAAAAAAAAAAgABQYHAQME\nAgn/xABEEAABAwMBBAYHBgIHCQAAAAABAgMEAAURBgcSITEIE0FRYYEUIjJx\nkbHSIzd1lKGzFRg1QkNSYqLwJSYzY3KCksLT/8QAGQEAAgMBAAAAAAAAAAAA\nAAAAAAEDBAUC/8QAIxEAAgICAgIBBQAAAAAAAAAAAAECEQMEEjEhQVEFEyIz\ngf/aAAwDAQACEQMRAD8AKmlVT7Q9oF4sGqV223NxFthpC0hxoqUSQSeO8O6o\ncvbbd23ktO/w5LiuASWFDP8AmrlzivDY+LqwiaVDwNtl5KlpDUTeQMqHobvA\nfGtLm3G9IRvlFvCOPFUZwf8AtS+7D5EEbSoYv5g7qpwIaNqUonAHo7nP/wAq\n4pHSQujDq2nFWhLiCUqSqO5kEdntV1YBVUqEtfSXvGfVVZvy7n1VpV0mL7n1\nTZfyzn1UwC6pUIKukzqDs/gv5Zz661npM6j7DZfyrn10AGFSoOVdJnU39X+C\n/lXPrr2OkjqlxIDD1jW6R/wxDdz8SrFABh0qZ9IXB67aTs1xlhAkS4bL7m4M\nJ3lIBOB2DJpUAUNt3usew67NzmRm5LLbbSeqcGQSUKA4VV8rag2JoQxY7e2w\nocFdWARU86UPUpvxVKSpbG/F6xCTglPrZwe/FVDb1Q4Vyc9HjIQyyvAku4cc\nHHhugjdB8s+NUtnHjk7mrJY5JKPFPwXBZro07aWp98YMVCsKaQ4d31f76u4d\n3fXq/SrdfYhTYoMVx5KSClZwV45lIJ9Y+GKi1usV01pdWFMOmW2jGX3DlpA7\nCByJ9/Luq2bZpyBpiE21bCHZ6R68pwZDiu0b3+h4VhuEMfn38fBS2c1A26g0\n9qELUpNtdbaPFCkxktocHhkAg+BqIXiJJknfeZWiaBhSVJwXMdo7zRoL1XLa\nixw8A2p7rG+rdxlLiBk8+Y4jj41HZ1tsGso5D8CEuafW3mMNqV78cD7+Yra1\nc7nSaKq2+PaAxP61gc6tDa7oFenrupyGHHITw6xpxQ9bHahf+NJ4E9owarAg\npUQoYIrQaa7L+PIskeSMGsVk1ikdirts/wDSDfuPyNcVd1m/pFr3K+RoA+ke\nzj7vtM/hsb9tNKls4+77TP4ZG/bTSoAHXpTuFGonhkAbkfn7lVS1tdRMkIRI\nO6CrOeQzjl8R+tXJ0qsK1M8kkZ6uPgHtOFcKHp9L7LXpLCypkEJWlQzuE8s+\nBqOcFIGX7p2/Lstl/h0Wa20pWSpDDZPDwXgDPPlXbaZl1E1wpnOSG1J+xSXd\n5RPd61UDA1M5AblJVGYeL7WG1nILTg4BYAOMgZ+NXHscntahtsx6Y71a22/R\n9xtPsrUCAodw5ms2enxtmfsY3FOTHDVe0G4yFqhz7UhEtlCmGkqGVNk8CEnx\n8fGvOkhchFEiZPhxIyXApS1kNgAcgnHEnPj8a49QliU6lltaRLDhQCsZ3TnB\nxnxzjspnf07cusT10z0pCVb286d3cAPYOVa+th4pUis+LjXRONfzEaiaSxAl\nFXo32eFew6o4OFA9vcrvobr7C6mW6hbZQQo44csH/XCr2hT4iI4bQ2SFulMh\nwD1lgJGefLPLyrfd9A2fVbyZlnddW8GwpUb2G5I5ApdPAODGCOGR7q1J6jyQ\nuL8ljTuH4+gZyhQVu4416cZcax1ja0Z5bySM0Tlk0JFtqt17diKTzjxkBCz/\nANTisk+VP0pVsYgLju2mJMiKG643JCnQoeJJ/UcakX0ebjfLyauPG8nQINd1\nm4XFr3K+Rp013ZEWPUsyPGSRCU4Vx+OfszxAz4A48qa7QP8AaDXuPyNZE4OE\nnGXaOJRcW0z6R7OPu+0z+GRv200qxs3+73TP4ZG/bTSrkQMnS6WU6kfx2Nxj\n+iqoazXRCHermgLaWnq3N44C0nsPce0HvAq9el2f955A/wCVG+SqHAAUqsTV\nkkn6fUw6gAuuQnfWZkIRkY7j2Z7+NPemrmzoqUtReffYloCHWwNzkchQwSeH\nf41Cos6TFQUR5TzSFc0oWQD5V0tyWpI3JjqgvscPH40JemRyg5KpdFkS7/Gv\nOun7rBJXbmGUuvKVkJBCcqwO/IPGsW3XLc5b5fe6tTn9mTugDuHuFQiTcYkG\nxuW+3uF56Qft3sYSEZB3R3kkDJ7hTAOfCp1kcOiJa8ZLz/C/bJMt7cZW4hS2\nXVgLQlXnnOedTS33q0Wq2b8PcMxSjiO2AXFZ7cJz29tDZbwZMF9pXEhPWDvO\nOf6Zp30/f3LddIRjoyktqQnJxneBGM+PCtjX3opRjJUmSY8Siy29Rank3+0u\nzmS4xIiK3XUJO6efAntyKY7BPdvS3WH3kNvupIbcUopSF9mTngCe3srk01MQ\n9MTujMKYkpIxzJ4EK/xA8KYWUu225vRST1gWUj3d/wAKt5MzXGS66NrBDhT9\nGvarGdbbjCc04zNb3UuNuDCknBHH4cxwPMVBbUMTmz4H5GiCv7LGudGyLbIb\n37tAiqkQXwPX+zGS0T2pKQQO44qgrYAJbZ/vA4+FYW9+2yvvY3DJb9n0X2b/\nAHeaY/DI37aaVY2bfd5pj8Mj/tppVTKZXO1nZReNZarcuMN62iKpltvckqVv\nbyc8cBJHbUI/l2vh5uWH4r+iiiKgOZFa1Ptp9pYFAAvno6Xw/wBrYB5r+isK\n6Od8PJ7T/wDn+iidVPjJ5upFa1XWEkEqkIAHeaABhV0b7+cn0jT481/RVQX6\n3x9Napm2y4W9iWuBIUy8G/VQ4U88HAIHlmjan7SdKQypK7s24ocCGULc/UDF\nBptHuEe5671BOiq3o8ia442VDBKSeHA8qQmME+5W95SPQrOmGBnO4srKvjyx\nVmaJ2IXvV+l4F9t0i0MxZYUptt8rC07qinjhBHNJ7aqXeG9x3fKi02HbR9LW\nnZpY7Xc7mmLLYQ4FpW0vdBLqyPWAxyIpgiCJ6OerEexcrInjng66OPf7FeXO\njlq1a983KyFZ5qLzuT57lE9bL/arpFTIt1wjSWFcAtpYUM93vrsEtg8nUHzp\n2xgrN9HbWbSipq72hCsYymQ8DjyRWgdGvVSTlM6whQ5EOOf/ADosw82eS0/G\nvQWk/wBYUgfkadI2x6zaUs1slKbW/DhtR3FNklJUlABIzxxwpU77w7xSoA5J\nDTqgd2mSdbZzgPV/OpNSoArefp29O56v5moxetCajuEKRG31oQ8goKkLIIBG\nOBq76VKh2CC5sX2kwlbsGe3KYHshxeFAf9wPzrhlbDNYvhx56A6uUs7yt15r\nBPwozKVFCAgOwjXa1bqbKRx9pUlvj5U7RdiG0bqgyyiNDZHAbzyVEfBNGTSp\nhQO2z7ZNqjTLMkv3Bch+SpKnDvHdGBwwPPnVhwdN3xvHWOk+dWNSpUOyLw7T\nPbx1i8+dO7ER5A9ZQpxpUxGkNKA5ilW6lQB//9k=\n"
       }
     }
   }
 }).then(response => {
   console.info(response.data);
 }).catch(err => {
   console.error(err);
 });

Output:

 {
   "id": 21063492,
   "option_name_id": 1,
   "position": 21,
   "title": "Blue",
   "image_url": "http://minio.insales.io:9000/insales-test-sber/images/option_values/1/1860/21063492/thumb/image.jpg?1792613669",
   "permalink": "blue"
 }

Params:

NameTypeAttributeDescription
options Object
options.token string

Required, access token for shop

options.url string

Required, shop url

options.optionnameid number | string

Required, option name id

options.optionvalue object

Required, option value

id Number | String

Required, app id

Return:

Promise

public createOrder(options: Object, id: Number | String): Promise source

import {createOrder} from 'insales/lib/api/order.js'

POST /admin/orders.json

Examples:

 insales.createOrder({
   token: '1234567890',
   url: 'shop-test.myinsales.ru',
   order: {
     "order": {
       "order_lines_attributes": [
         {
           "variant_id": 3,
           "quantity": 2,
           "vat": 10
         }
       ],
       "client": {
         "name": "Vasya",
         "email": "vasya@example.com",
         "phone": "79111112233"
       },
       "shipping_address_attributes": {
         "address": "Moscow, Krasnaya Presna 24"
       },
       "delivery_variant_id": 1,
       "payment_gateway_id": 1,
       "coupon": "20% discount"
     }
   }
 }).then(response => {
   console.info(response.data);
 }).catch(err => {
   console.error(err);
 });

Output:

 {
   "fields_values": [],
   "order_lines": [
     {
       "id": 26,
       "order_id": 19,
       "sale_price": 600,
       "full_sale_price": 600,
       "total_price": 1200,
       "full_total_price": 1200,
       "discounts_amount": 0,
       "quantity": 2,
       "reserved_quantity": null,
       "weight": null,
       "dimensions": null,
       "variant_id": 3,
       "product_id": 3,
       "sku": "425",
       "barcode": null,
       "title": "pants (Базовая)",
       "unit": "pce",
       "comment": null,
       "updated_at": "2026-10-21T23:27:35.000+03:00",
       "created_at": "2026-10-21T23:27:35.000+03:00",
       "bundle_id": null,
       "vat": 10,
       "fiscal_product_type": 1,
       "requires_marking": null,
       "marking_codes": null,
       "accessory_lines": [],
       "external_variant_id": null
     }
   ],
   "order_changes": [],
   "discount": {
     "id": 19,
     "description": "Скидка по купону 20% discount",
     "warning": null,
     "type_id": 1,
     "amount": 240,
     "full_amount": 240,
     "percent": "20.0",
     "discount": "20.0",
     "reference_id": 188,
     "reference_type": "DiscountCode",
     "discount_products_ids": [],
     "discount_order_lines_ids": [],
     "discount_code_id": 188,
     "created_at": "2026-10-21T23:27:35.000+03:00",
     "updated_at": "2026-10-21T23:27:35.000+03:00"
   },
   "shipping_address": {
     "id": 29,
     "fields_values": [],
     "name": "Vasya",
     "surname": null,
     "middlename": null,
     "phone": "79111112233",
     "formatted_phone": "7(911)111-22-33",
     "full_name": "Vasya",
     "full_locality_name": "",
     "full_delivery_address": "Moscow, Krasnaya Presna 24",
     "address_for_gis": "Moscow, Krasnaya Presna 24",
     "location_valid": true,
     "recipient_fields": [
       {
         "id": 11,
         "destiny": 2,
         "position": 1,
         "office_title": "Имя",
         "for_buyer": true,
         "obligatory": true,
         "active": true,
         "system_name": "name",
         "created_at": "2010-10-12T13:31:09.692+04:00",
         "updated_at": "2010-10-12T13:31:09.692+04:00",
         "show_in_result": true,
         "show_in_checkout": true,
         "is_indexed": null,
         "hide_in_backoffice": null,
         "handle": null,
         "placeholder": null,
         "title": null,
         "example": null,
         "type": "Field::ObligatoryTextField"
       },
       {
         "id": 12,
         "destiny": 2,
         "position": 2,
         "office_title": "Телефон",
         "for_buyer": true,
         "obligatory": true,
         "active": true,
         "system_name": "phone",
         "created_at": "2010-10-12T13:31:09.692+04:00",
         "updated_at": "2010-10-12T13:31:09.692+04:00",
         "show_in_result": true,
         "show_in_checkout": true,
         "is_indexed": null,
         "hide_in_backoffice": null,
         "handle": null,
         "placeholder": null,
         "title": null,
         "example": null,
         "type": "Field::Phone"
       }
     ],
     "backoffice_fields": [
       {
         "id": 4,
         "destiny": 1,
         "position": 3,
         "office_title": "Адрес",
         "for_buyer": true,
         "obligatory": false,
         "active": true,
         "system_name": "address",
         "created_at": "2010-10-12T13:31:09.692+04:00",
         "updated_at": "2010-10-12T13:31:09.692+04:00",
         "show_in_result": true,
         "show_in_checkout": true,
         "is_indexed": null,
         "hide_in_backoffice": null,
         "handle": null,
         "placeholder": null,
         "title": null,
         "example": null,
         "type": "Field::SystemTextArea"
       },
       {
         "id": 496,
         "destiny": 1,
         "position": 22,
         "office_title": "special",
         "for_buyer": true,
         "obligatory": false,
         "active": true,
         "system_name": null,
         "created_at": "2026-10-21T23:27:35.453+03:00",
         "updated_at": "2026-10-21T23:27:35.453+03:00",
         "show_in_result": true,
         "show_in_checkout": true,
         "is_indexed": null,
         "hide_in_backoffice": null,
         "handle": null,
         "placeholder": null,
         "title": "special",
         "example": null,
         "type": "Field::TextField"
       }
     ],
     "no_delivery": false,
     "kladr_autodetected_address": "",
     "country_options": [
       {
         "code": "RU",
         "title": "Россия",
         "selected": false
       }
     ],
     "address": "Moscow, Krasnaya Presna 24",
     "country": null,
     "state": null,
     "city": null,
     "zip": null,
     "street": null,
     "house": null,
     "flat": null,
     "entrance": null,
     "doorphone": null,
     "floor": null,
     "comment": null,
     "kladr_json": null,
     "location": {
       "kladr_code": null,
       "zip": null,
       "kladr_zip": null,
       "region_zip": null,
       "country": "RU",
       "state": null,
       "state_type": null,
       "area": null,
       "area_type": null,
       "city": null,
       "city_type": null,
       "settlement": null,
       "settlement_type": null,
       "address": "Moscow, Krasnaya Presna 24",
       "street": "Moscow",
       "street_type": null,
       "house": "Krasnaya Presna 24",
       "flat": null,
       "is_kladr": false,
       "latitude": null,
       "longitude": null,
       "autodetected": null
     }
   },
   "client": {
     "id": 193,
     "email": "vasya@example.com",
     "name": "Vasya",
     "phone": "79111112233",
     "created_at": "2026-10-21T23:27:35.000+03:00",
     "updated_at": "2026-10-21T23:27:35.000+03:00",
     "comment": null,
     "registered": false,
     "subscribe": true,
     "client_group_id": null,
     "bonus_points": 0,
     "type": "Client::Individual",
     "correspondent_account": null,
     "settlement_account": null,
     "consent_to_personal_data": null,
     "o_auth_provider": null,
     "messenger_subscription": null,
     "external_id": null,
     "external_service": null,
     "contact_name": "Vasya",
     "surname": null,
     "middlename": null,
     "progressive_discount": null,
     "group_discount": null,
     "ip_addr": "",
     "fields_values": []
   },
   "discounts": [
     {
       "id": 19,
       "description": "Скидка по купону 20% discount",
       "warning": null,
       "type_id": 1,
       "amount": 240,
       "full_amount": 240,
       "percent": "20.0",
       "discount": "20.0",
       "reference_id": 188,
       "reference_type": "DiscountCode",
       "discount_products_ids": [],
       "discount_order_lines_ids": [],
       "discount_code_id": 188,
       "created_at": "2026-10-21T23:27:35.000+03:00",
       "updated_at": "2026-10-21T23:27:35.000+03:00"
     }
   ],
   "total_price": 1060,
   "paid_amount": 0,
   "items_price": 960,
   "id": 19,
   "key": "b690ba78abba2ad8a36abf996eed56f4",
   "number": 1006,
   "comment": null,
   "archived": false,
   "delivery_title": "самовывоз",
   "delivery_description": "самовывоз (самовывоз из офиса)",
   "delivery_price": 100,
   "full_delivery_price": 100,
   "payment_description": null,
   "payment_title": "Наличными курьеру",
   "first_referer": null,
   "first_current_location": null,
   "first_query": null,
   "first_source_domain": null,
   "first_source": "Прямой трафик",
   "referer": "app:digital-goods-dev",
   "current_location": null,
   "query": null,
   "source_domain": null,
   "source": "Приложение",
   "fulfillment_status": "new",
   "custom_status": {
     "permalink": "new",
     "title": "Новый"
   },
   "delivered_at": null,
   "accepted_at": null,
   "created_at": "2026-10-21T23:27:35.000+03:00",
   "updated_at": "2026-10-21T23:27:35.000+03:00",
   "financial_status": "pending",
   "delivery_date": null,
   "delivery_from_hour": null,
   "delivery_from_minutes": null,
   "delivery_to_hour": null,
   "delivery_to_minutes": null,
   "delivery_time": "",
   "paid_at": null,
   "delivery_variant_id": 1,
   "payment_gateway_id": 1,
   "margin": "0.0",
   "margin_amount": "0.0",
   "client_transaction_id": null,
   "yandex_metrika_client_id": null,
   "currency_code": "RUR",
   "cookies": {},
   "account_id": 1,
   "manager_comment": null,
   "locale": "ru",
   "delivery_info": {
     "delivery_variant_id": 1,
     "tariff_id": null,
     "title": null,
     "description": null,
     "price": 100,
     "shipping_company": null,
     "shipping_company_handle": null,
     "delivery_interval": {
       "min_days": null,
       "max_days": null,
       "description": ""
     },
     "errors": [],
     "warnings": [],
     "outlet": {
       "id": null,
       "external_id": null,
       "latitude": null,
       "longitude": null,
       "type": null,
       "title": null,
       "description": null,
       "address": null,
       "payment_method": [],
       "source_id": null
     },
     "not_available": null
   },
   "responsible_user_id": null,
   "total_profit": "960.0",
   "warehouse_id": 1
 }

 insales.createOrder({
   token: '1234567890',
   url: 'shop-test.myinsales.ru',
   order: {
     "order": {
       "order_lines_attributes": [
         {
           "variant_id": 5,
           "quantity": 2
         }
       ],
       "client": {
         "name": "Vasya",
         "email": "vasya@example.com",
         "phone": "79111112233",
         "consent_to_personal_data": true
       },
       "shipping_address_attributes": {
         "address": "Moscow, Krasnaya Presna 24",
         "full_locality_name": "Moscow"
       },
       "delivery_variant_id": 1,
       "payment_gateway_id": 1,
       "coupon": "20% discount"
     }
   }
 }).then(response => {
   console.info(response.data);
 }).catch(err => {
   console.error(err);
 });

Output:

 {
   "fields_values": [],
   "order_lines": [
     {
       "id": 29,
       "order_id": 21,
       "sale_price": 375,
       "full_sale_price": 375,
       "total_price": 750,
       "full_total_price": 750,
       "discounts_amount": 0,
       "quantity": 2,
       "reserved_quantity": null,
       "weight": "0.3",
       "dimensions": null,
       "variant_id": 2,
       "product_id": 2,
       "sku": "424",
       "barcode": null,
       "title": "shirt (Зеленый / Синий)",
       "unit": "pce",
       "comment": null,
       "updated_at": "2026-10-21T23:27:37.000+03:00",
       "created_at": "2026-10-21T23:27:37.000+03:00",
       "bundle_id": 5,
       "vat": -1,
       "fiscal_product_type": 1,
       "requires_marking": null,
       "marking_codes": null,
       "accessory_lines": [],
       "external_variant_id": null
     },
     {
       "id": 30,
       "order_id": 21,
       "sale_price": 375,
       "full_sale_price": 375,
       "total_price": 750,
       "full_total_price": 750,
       "discounts_amount": 0,
       "quantity": 2,
       "reserved_quantity": null,
       "weight": null,
       "dimensions": null,
       "variant_id": 3,
       "product_id": 3,
       "sku": "425",
       "barcode": null,
       "title": "pants (Базовая)",
       "unit": "pce",
       "comment": null,
       "updated_at": "2026-10-21T23:27:37.000+03:00",
       "created_at": "2026-10-21T23:27:37.000+03:00",
       "bundle_id": 5,
       "vat": -1,
       "fiscal_product_type": 1,
       "requires_marking": null,
       "marking_codes": null,
       "accessory_lines": [],
       "external_variant_id": null
     }
   ],
   "order_changes": [],
   "discount": {
     "id": 35,
     "description": "Скидка по купону 20% discount",
     "warning": null,
     "type_id": 1,
     "amount": 300,
     "full_amount": 300,
     "percent": "20.0",
     "discount": "20.0",
     "reference_id": 204,
     "reference_type": "DiscountCode",
     "discount_products_ids": [],
     "discount_order_lines_ids": [],
     "discount_code_id": 204,
     "created_at": "2026-10-21T23:27:37.000+03:00",
     "updated_at": "2026-10-21T23:27:37.000+03:00"
   },
   "shipping_address": {
     "id": 31,
     "fields_values": [],
     "name": "Vasya",
     "surname": null,
     "middlename": null,
     "phone": "79111112233",
     "formatted_phone": "7(911)111-22-33",
     "full_name": "Vasya",
     "full_locality_name": "",
     "full_delivery_address": "Moscow, Krasnaya Presna 24",
     "address_for_gis": "Moscow, Krasnaya Presna 24",
     "location_valid": true,
     "recipient_fields": [
       {
         "id": 11,
         "destiny": 2,
         "position": 1,
         "office_title": "Имя",
         "for_buyer": true,
         "obligatory": true,
         "active": true,
         "system_name": "name",
         "created_at": "2010-10-12T13:31:09.692+04:00",
         "updated_at": "2010-10-12T13:31:09.692+04:00",
         "show_in_result": true,
         "show_in_checkout": true,
         "is_indexed": null,
         "hide_in_backoffice": null,
         "handle": null,
         "placeholder": null,
         "title": null,
         "example": null,
         "type": "Field::ObligatoryTextField"
       },
       {
         "id": 12,
         "destiny": 2,
         "position": 2,
         "office_title": "Телефон",
         "for_buyer": true,
         "obligatory": true,
         "active": true,
         "system_name": "phone",
         "created_at": "2010-10-12T13:31:09.692+04:00",
         "updated_at": "2010-10-12T13:31:09.692+04:00",
         "show_in_result": true,
         "show_in_checkout": true,
         "is_indexed": null,
         "hide_in_backoffice": null,
         "handle": null,
         "placeholder": null,
         "title": null,
         "example": null,
         "type": "Field::Phone"
       }
     ],
     "backoffice_fields": [
       {
         "id": 4,
         "destiny": 1,
         "position": 3,
         "office_title": "Адрес",
         "for_buyer": true,
         "obligatory": false,
         "active": true,
         "system_name": "address",
         "created_at": "2010-10-12T13:31:09.692+04:00",
         "updated_at": "2010-10-12T13:31:09.692+04:00",
         "show_in_result": true,
         "show_in_checkout": true,
         "is_indexed": null,
         "hide_in_backoffice": null,
         "handle": null,
         "placeholder": null,
         "title": null,
         "example": null,
         "type": "Field::SystemTextArea"
       },
       {
         "id": 544,
         "destiny": 1,
         "position": 22,
         "office_title": "special",
         "for_buyer": true,
         "obligatory": false,
         "active": true,
         "system_name": null,
         "created_at": "2026-10-21T23:27:37.138+03:00",
         "updated_at": "2026-10-21T23:27:37.138+03:00",
         "show_in_result": true,
         "show_in_checkout": true,
         "is_indexed": null,
         "hide_in_backoffice": null,
         "handle": null,
         "placeholder": null,
         "title": "special",
         "example": null,
         "type": "Field::TextField"
       }
     ],
     "no_delivery": false,
     "kladr_autodetected_address": "",
     "country_options": [
       {
         "code": "RU",
         "title": "Россия",
         "selected": false
       }
     ],
     "address": "Moscow, Krasnaya Presna 24",
     "country": null,
     "state": null,
     "city": null,
     "zip": null,
     "street": null,
     "house": null,
     "flat": null,
     "entrance": null,
     "doorphone": null,
     "floor": null,
     "comment": null,
     "kladr_json": null,
     "location": {
       "kladr_code": null,
       "zip": null,
       "kladr_zip": null,
       "region_zip": null,
       "country": "RU",
       "state": null,
       "state_type": null,
       "area": null,
       "area_type": null,
       "city": null,
       "city_type": null,
       "settlement": null,
       "settlement_type": null,
       "address": "Moscow, Krasnaya Presna 24",
       "street": "Moscow",
       "street_type": null,
       "house": "Krasnaya Presna 24",
       "flat": null,
       "is_kladr": false,
       "latitude": null,
       "longitude": null,
       "autodetected": null
     }
   },
   "client": {
     "id": 209,
     "email": "vasya@example.com",
     "name": "Vasya",
     "phone": "79111112233",
     "created_at": "2026-10-21T23:27:37.000+03:00",
     "updated_at": "2026-10-21T23:27:37.000+03:00",
     "comment": null,
     "registered": false,
     "subscribe": true,
     "client_group_id": null,
     "bonus_points": 0,
     "type": "Client::Individual",
     "correspondent_account": null,
     "settlement_account": null,
     "consent_to_personal_data": null,
     "o_auth_provider": null,
     "messenger_subscription": null,
     "external_id": null,
     "external_service": null,
     "contact_name": "Vasya",
     "surname": null,
     "middlename": null,
     "progressive_discount": null,
     "group_discount": null,
     "ip_addr": "",
     "fields_values": []
   },
   "discounts": [
     {
       "id": 35,
       "description": "Скидка по купону 20% discount",
       "warning": null,
       "type_id": 1,
       "amount": 300,
       "full_amount": 300,
       "percent": "20.0",
       "discount": "20.0",
       "reference_id": 204,
       "reference_type": "DiscountCode",
       "discount_products_ids": [],
       "discount_order_lines_ids": [],
       "discount_code_id": 204,
       "created_at": "2026-10-21T23:27:37.000+03:00",
       "updated_at": "2026-10-21T23:27:37.000+03:00"
     }
   ],
   "total_price": 1300,
   "paid_amount": 0,
   "items_price": 1200,
   "id": 21,
   "key": "c51b61c9928677af0203cdf8af6b971c",
   "number": 1006,
   "comment": null,
   "archived": false,
   "delivery_title": "самовывоз",
   "delivery_description": "самовывоз (самовывоз из офиса)",
   "delivery_price": 100,
   "full_delivery_price": 100,
   "payment_description": null,
   "payment_title": "Наличными курьеру",
   "first_referer": null,
   "first_current_location": null,
   "first_query": null,
   "first_source_domain": null,
   "first_source": "Прямой трафик",
   "referer": "app:digital-goods-dev",
   "current_location": null,
   "query": null,
   "source_domain": null,
   "source": "Приложение",
   "fulfillment_status": "new",
   "custom_status": {
     "permalink": "new",
     "title": "Новый"
   },
   "delivered_at": null,
   "accepted_at": null,
   "created_at": "2026-10-21T23:27:37.000+03:00",
   "updated_at": "2026-10-21T23:27:37.000+03:00",
   "financial_status": "pending",
   "delivery_date": null,
   "delivery_from_hour": null,
   "delivery_from_minutes": null,
   "delivery_to_hour": null,
   "delivery_to_minutes": null,
   "delivery_time": "",
   "paid_at": null,
   "delivery_variant_id": 1,
   "payment_gateway_id": 1,
   "margin": "0.0",
   "margin_amount": "0.0",
   "client_transaction_id": null,
   "yandex_metrika_client_id": null,
   "currency_code": "RUR",
   "cookies": {},
   "account_id": 1,
   "manager_comment": null,
   "locale": "ru",
   "delivery_info": {
     "delivery_variant_id": 1,
     "tariff_id": null,
     "title": null,
     "description": null,
     "price": 100,
     "shipping_company": null,
     "shipping_company_handle": null,
     "delivery_interval": {
       "min_days": null,
       "max_days": null,
       "description": ""
     },
     "errors": [],
     "warnings": [],
     "outlet": {
       "id": null,
       "external_id": null,
       "latitude": null,
       "longitude": null,
       "type": null,
       "title": null,
       "description": null,
       "address": null,
       "payment_method": [],
       "source_id": null
     },
     "not_available": null
   },
   "responsible_user_id": null,
   "total_profit": "1200.0",
   "warehouse_id": 1
 }

Params:

NameTypeAttributeDescription
options Object
options.token string

Required, access token for shop

options.url string

Required, shop url

options.order object

Required, order

id Number | String

Required, app id

Return:

Promise

public createOutlet(options: Object, id: Number | String): Promise source

import {createOutlet} from 'insales/lib/api/outlet.js'

POST /admin/outlets.json

Examples:

 insales.createOutlet({
   token: '1234567890',
   url: 'shop-test.myinsales.ru',
   outlet: {
     "outlet": {
       "title": "Point 2",
       "description": "Point description",
       "address": "some address",
       "price": 300,
       "latitude": 55.7558,
       "longitude": 37.6173
     }
   }
 }).then(response => {
   console.info(response.data);
 }).catch(err => {
   console.error(err);
 });

Output:

 {
   "id": 8,
   "account_id": 1,
   "delivery_variant_id": 241,
   "price": "300.0",
   "title_translations": [
     "Point 2"
   ],
   "description_translations": [
     "Point description"
   ],
   "address": "some address",
   "latitude": "55.7558",
   "longitude": "37.6173",
   "created_at": "2026-10-21T23:30:59.966+03:00",
   "updated_at": "2026-10-21T23:30:59.966+03:00",
   "title": "Point 2",
   "description": "Point description"
 }

Params:

NameTypeAttributeDescription
options Object
options.token string

Required, access token for shop

options.url string

Required, shop url

options.outlet object

Required, outlet

id Number | String

Required, app id

Return:

Promise

public createPage(options: Object, id: Number | String): Promise source

import {createPage} from 'insales/lib/api/page.js'

POST /admin/pages.json

Examples:

 insales.createPage({
   token: '1234567890',
   url: 'shop-test.myinsales.ru',
   page: {
     "page": {
       "title": "new page",
       "content": "<p>content of my page<p>",
       "permalink": "first_page",
       "html_title": "HTML TAG TITLE",
       "meta_keywords": "new cool products",
       "meta_description": "It's a page about our new products",
       "created_at": "2014-09-09"
     }
   }
 }).then(response => {
   console.info(response.data);
 }).catch(err => {
   console.error(err);
 });

Output:

 {
   "id": 62,
   "meta_keywords": "new cool products",
   "meta_description": "It's a page about our new products",
   "is_hidden": false,
   "kind": "only_page",
   "permalink": "first_page",
   "custom_template": null,
   "created_at": "2014-09-09T00:00:00.000+04:00",
   "updated_at": "2026-10-21T23:05:59.000+03:00",
   "is_main": false,
   "title": "new page",
   "html_title": "HTML TAG TITLE",
   "content": "<p>content of my page<p>"
 }

Params:

NameTypeAttributeDescription
options Object
options.token string

Required, access token for shop

options.url string

Required, shop url

options.page object

Required, page

id Number | String

Required, app id

Return:

Promise

public createPaymentGateway(options: Object, id: Number | String): Promise source

import {createPaymentGateway} from 'insales/lib/api/paymentgateway.js'

POST /admin/payment_gateways.json

Examples:

 insales.createPaymentGateway({
   token: '1234567890',
   url: 'shop-test.myinsales.ru',
   paymentgateway: {
     "payment_gateway": {
       "title": "cash on delivery",
       "margin": 10,
       "type": "PaymentGateway::Cod",
       "description": "text",
       "payment_delivery_variants_attributes": [
         {
           "delivery_variant_id": 1
         }
       ]
     }
   }
 }).then(response => {
   console.info(response.data);
 }).catch(err => {
   console.error(err);
 });

Output:

 {
   "id": 47,
   "type": "PaymentGateway::Cod",
   "position": 4,
   "created_at": "2026-10-21T23:30:57.000+03:00",
   "updated_at": "2026-10-21T23:30:57.000+03:00",
   "margin": "10.0",
   "available_for_individual_clients": true,
   "available_for_juridical_clients": true,
   "title": "cash on delivery",
   "description": "text",
   "payment_delivery_variants": [
     {
       "created_at": "2026-10-21T23:30:57.000+03:00",
       "delivery_variant_id": 1,
       "id": 60
     }
   ]
 }

 insales.createPaymentGateway({
   token: '1234567890',
   url: 'shop-test.myinsales.ru',
   paymentgateway: {
     "payment_gateway": {
       "title": "external payment gateway",
       "margin": 10,
       "type": "PaymentGateway::External",
       "description": "text",
       "payment_delivery_variants_attributes": [
         {
           "delivery_variant_id": 1
         }
       ],
       "url": "payment-gateway.ru/transactions/create",
       "shop_id": "123",
       "redirect_to_payment": false,
       "convert_currency": "LVL"
     }
   }
 }).then(response => {
   console.info(response.data);
 }).catch(err => {
   console.error(err);
 });

Output:

 {
   "id": 49,
   "type": "PaymentGateway::External",
   "position": 4,
   "created_at": "2026-10-21T23:30:57.000+03:00",
   "updated_at": "2026-10-21T23:30:57.000+03:00",
   "margin": "10.0",
   "available_for_individual_clients": true,
   "available_for_juridical_clients": true,
   "title": "external payment gateway",
   "description": "text",
   "password": "7e2cb9b2f6febf27",
   "url": "payment-gateway.ru/transactions/create",
   "shop_id": "123",
   "send_order": null,
   "convert_currency": "LVL",
   "widget_mode": null,
   "window_mode": null,
   "widget_html_code": null,
   "show_at_product": null,
   "show_at_collection": null,
   "show_at_cart": null,
   "design_version": null,
   "text_version": null,
   "rounding_version": null,
   "show_payment_fee": false,
   "info_page_id": null,
   "success_url": "http://quentin.insales.io:3003/payments/external/49/success",
   "fail_url": "http://quentin.insales.io:3003/payments/external/49/fail",
   "server_url": "http://quentin.insales.io:3003/payments/external/49/server",
   "redirect_to_payment": false,
   "payment_delivery_variants": [
     {
       "created_at": "2026-10-21T23:30:57.000+03:00",
       "delivery_variant_id": 1,
       "id": 62
     }
   ]
 }

Params:

NameTypeAttributeDescription
options Object
options.token string

Required, access token for shop

options.url string

Required, shop url

options.paymentgateway object

Required, payment gateway

id Number | String

Required, app id

Return:

Promise

public createPriceKind(options: Object, id: Number | String): Promise source

import {createPriceKind} from 'insales/lib/api/pricekind.js'

POST /admin/price_kinds.json

Examples:

 insales.createPriceKind({
   token: '1234567890',
   url: 'shop-test.myinsales.ru',
   pricekind: {
      'price_kind': {
        'title': 'name'
      }
   }
 }).then(output => {
   console.info(output.data);
 }).catch(err => {
   console.error(err);
 });

Output:

 {
   "id": 113,
   "price_index": 3,
   "show_in_lists": true,
   "title": "name",
   "variant_price_method_name": "price3"
 }

Params:

NameTypeAttributeDescription
options Object
options.token string

Required, access token for shop

options.url string

Required, shop url

options.pricekind object

Required, price kind

id Number | String

Required, app id

Return:

Promise

public createProduct(options: Object, id: Number | String): Promise source

import {createProduct} from 'insales/lib/api/product.js'

POST /admin/products.xml

Examples:

 insales.createProduct({
   token: '1234567890',
   url: 'shop-test.myinsales.ru',
   product: {
     'product': {
       'category-id': '1',
       'title': 'Product 1',
       'variants-attributes': {
         'variants-attribute': {
           'sku': '12345',
           'quantity': '1',
           'price': '100'
         }
       }
     }
   }
 }).then(output => {
   console.info(output.data);
 }).catch(err => {
   console.error(err);
 });

Output:

 { product:
   { archived: 'false',
     available: '',
     'canonical-url-collection-id': '',
     'category-id': '1',
     'created-at': '2011-11-11 11:11:11 +0300',
     id: '12345',
     'is-hidden': 'false',
     'sort-weight': '',
     unit: 'pcs',
     'updated-at': '2011-11-11 11:11:11 +0300',
     title: 'Product 1',
     'short-description': '',
     permalink: 'product-1',
     'html-title': '',
     'meta-keywords': '',
     'meta-description': '',
     'currency-code': 'RUR',
     'collections-ids': '',
     images: '',
     'option-names': '',
     properties: '',
     characteristics: '',
     'product-field-values': '',
     variants: { variant: [Object] },
     description: '' } }

Params:

NameTypeAttributeDescription
options Object
options.token string

Required, access token for shop

options.url string

Required, shop url

options.coupon object

Required, product

id Number | String

Required, app id

Return:

Promise

public createProductField(options: Object, id: Number | String): Promise source

import {createProductField} from 'insales/lib/api/productfield.js'

POST /admin/product_fields.json

Examples:

 insales.createProductField({
   token: '1234567890',
   url: 'shop-test.myinsales.ru',
   productfield: {
     "product_field": {
       "title": "Size",
       "handle": "size",
       "type": "ProductField::TextArea"
     }
   }
 }).then(response => {
   console.info(response.data);
 }).catch(err => {
   console.error(err);
 });

Output:

 {
   "id": 38,
   "handle": "size",
   "type": "ProductField::TextArea",
   "application_id": 1,
   "position": 3,
   "is_hidden": null,
   "is_indexed": null,
   "title": "Size",
   "application_title": "Цифровые товары"
 }

Params:

NameTypeAttributeDescription
options Object
options.token string

Required, access token for shop

options.url string

Required, shop url

options.productfield object

Required, product field id or handle

id Number | String

Required, app id

Return:

Promise

public createProductFieldValue(options: Object, id: Number | String): Promise source

import {createProductFieldValue} from 'insales/lib/api/productfieldvalue.js'

POST /admin/products/{product_id}/product_field_values.json

Examples:

 insales.createProductFieldValue({
   token: '1234567890',
   url: 'shop-test.myinsales.ru',
   productid: '1',
   fieldvalue: {
     "product_field_value": {
       "product_field_id": 2,
       "value": "test value"
     }
   }
 }).then(response => {
   console.info(response.data);
 }).catch(err => {
   console.error(err);
 });

Output:

 {
   "id": 121,
   "product_field_id": 2,
   "value": "test value"
 }

 insales.createProductFieldValue({
   token: '1234567890',
   url: 'shop-test.myinsales.ru',
   productid: '1',
   fieldvalue: {
     "product_field_value": {
       "product_field_handle": "handle2",
       "value": "test value"
     }
   }
 }).then(response => {
   console.info(response.data);
 }).catch(err => {
   console.error(err);
 });

Output:

 {
   "id": 123,
   "product_field_id": 2,
   "value": "test value"
 }

Params:

NameTypeAttributeDescription
options Object
options.token string

Required, access token for shop

options.url string

Required, shop url

options.productid number | string

Required, product id

options.fieldvalue object

Required, product field value id or field handle

id Number | String

Required, app id

Return:

Promise

public createProductImage(options: Object, id: Number | String): Promise source

import {createProductImage} from 'insales/lib/api/productimage.js'

POST /admin/products/{product_id}/images.json

Examples:

 insales.createProductImage({
   token: '1234567890',
   url: 'shop-test.myinsales.ru',
   productid: '1',
   productimage: {
     "image": {
       "src": "https://abc.myinsales.ru/images/no_image_compact.jpg"
     }
   }
 }).then(response => {
   console.info(response.data);
 }).catch(err => {
   console.error(err);
 });

Output:

 {
   "id": 4371,
   "product_id": 1,
   "external_id": null,
   "position": 1,
   "created_at": "2026-10-21T23:12:43.000+03:00",
   "image_processing": true,
   "title": null,
   "url": "/images/loading.gif",
   "original_url": "/images/loading.gif",
   "medium_url": "/images/loading.gif",
   "small_url": "/images/loading.gif",
   "thumb_url": "/images/loading.gif",
   "compact_url": "/images/loading.gif",
   "large_url": "/images/loading.gif",
   "filename": "no_image_compact.jpg",
   "has_bitmap_image": false,
   "image_content_type": "image/jpeg"
 }

 insales.createProductImage({
   token: '1234567890',
   url: 'shop-test.myinsales.ru',
   productid: '1',
   productimage: {
     "image": {
       "attachment": "/9j/4AAQSkZJRgABAQEASABIAAD//gA+Q1JFQVRPUjogZ2QtanBlZyB2MS4w\nICh1c2luZyBJSkcgSlBFRyB2NjIpLCBkZWZhdWx0IHF1YWxpdHkK/9sAQwAG\nBAUGBQQGBgUGBwcGCAoQCgoJCQoUDg8MEBcUGBgXFBYWGh0lHxobIxwWFiAs\nICMmJykqKRkfLTAtKDAlKCko/9sAQwEHBwcKCAoTCgoTKBoWGigoKCgoKCgo\nKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgo/8AA\nEQgAWQBkAwEiAAIRAQMRAf/EAB0AAAEEAwEBAAAAAAAAAAAAAAgABQYHAQME\nAgn/xABEEAABAwMBBAYHBgIHCQAAAAABAgMEAAURBgcSITEIE0FRYYEUIjJx\nkbHSIzd1lKGzFRg1QkNSYqLwJSYzY3KCksLT/8QAGQEAAgMBAAAAAAAAAAAA\nAAAAAAEDBAUC/8QAIxEAAgICAgIBBQAAAAAAAAAAAAECEQMEEjEhQVEFEyIz\ngf/aAAwDAQACEQMRAD8AKmlVT7Q9oF4sGqV223NxFthpC0hxoqUSQSeO8O6o\ncvbbd23ktO/w5LiuASWFDP8AmrlzivDY+LqwiaVDwNtl5KlpDUTeQMqHobvA\nfGtLm3G9IRvlFvCOPFUZwf8AtS+7D5EEbSoYv5g7qpwIaNqUonAHo7nP/wAq\n4pHSQujDq2nFWhLiCUqSqO5kEdntV1YBVUqEtfSXvGfVVZvy7n1VpV0mL7n1\nTZfyzn1UwC6pUIKukzqDs/gv5Zz661npM6j7DZfyrn10AGFSoOVdJnU39X+C\n/lXPrr2OkjqlxIDD1jW6R/wxDdz8SrFABh0qZ9IXB67aTs1xlhAkS4bL7m4M\nJ3lIBOB2DJpUAUNt3usew67NzmRm5LLbbSeqcGQSUKA4VV8rag2JoQxY7e2w\nocFdWARU86UPUpvxVKSpbG/F6xCTglPrZwe/FVDb1Q4Vyc9HjIQyyvAku4cc\nHHhugjdB8s+NUtnHjk7mrJY5JKPFPwXBZro07aWp98YMVCsKaQ4d31f76u4d\n3fXq/SrdfYhTYoMVx5KSClZwV45lIJ9Y+GKi1usV01pdWFMOmW2jGX3DlpA7\nCByJ9/Luq2bZpyBpiE21bCHZ6R68pwZDiu0b3+h4VhuEMfn38fBS2c1A26g0\n9qELUpNtdbaPFCkxktocHhkAg+BqIXiJJknfeZWiaBhSVJwXMdo7zRoL1XLa\nixw8A2p7rG+rdxlLiBk8+Y4jj41HZ1tsGso5D8CEuafW3mMNqV78cD7+Yra1\nc7nSaKq2+PaAxP61gc6tDa7oFenrupyGHHITw6xpxQ9bHahf+NJ4E9owarAg\npUQoYIrQaa7L+PIskeSMGsVk1ikdirts/wDSDfuPyNcVd1m/pFr3K+RoA+ke\nzj7vtM/hsb9tNKls4+77TP4ZG/bTSoAHXpTuFGonhkAbkfn7lVS1tdRMkIRI\nO6CrOeQzjl8R+tXJ0qsK1M8kkZ6uPgHtOFcKHp9L7LXpLCypkEJWlQzuE8s+\nBqOcFIGX7p2/Lstl/h0Wa20pWSpDDZPDwXgDPPlXbaZl1E1wpnOSG1J+xSXd\n5RPd61UDA1M5AblJVGYeL7WG1nILTg4BYAOMgZ+NXHscntahtsx6Y71a22/R\n9xtPsrUCAodw5ms2enxtmfsY3FOTHDVe0G4yFqhz7UhEtlCmGkqGVNk8CEnx\n8fGvOkhchFEiZPhxIyXApS1kNgAcgnHEnPj8a49QliU6lltaRLDhQCsZ3TnB\nxnxzjspnf07cusT10z0pCVb286d3cAPYOVa+th4pUis+LjXRONfzEaiaSxAl\nFXo32eFew6o4OFA9vcrvobr7C6mW6hbZQQo44csH/XCr2hT4iI4bQ2SFulMh\nwD1lgJGefLPLyrfd9A2fVbyZlnddW8GwpUb2G5I5ApdPAODGCOGR7q1J6jyQ\nuL8ljTuH4+gZyhQVu4416cZcax1ja0Z5bySM0Tlk0JFtqt17diKTzjxkBCz/\nANTisk+VP0pVsYgLju2mJMiKG643JCnQoeJJ/UcakX0ebjfLyauPG8nQINd1\nm4XFr3K+Rp013ZEWPUsyPGSRCU4Vx+OfszxAz4A48qa7QP8AaDXuPyNZE4OE\nnGXaOJRcW0z6R7OPu+0z+GRv200qxs3+73TP4ZG/bTSrkQMnS6WU6kfx2Nxj\n+iqoazXRCHermgLaWnq3N44C0nsPce0HvAq9el2f955A/wCVG+SqHAAUqsTV\nkkn6fUw6gAuuQnfWZkIRkY7j2Z7+NPemrmzoqUtReffYloCHWwNzkchQwSeH\nf41Cos6TFQUR5TzSFc0oWQD5V0tyWpI3JjqgvscPH40JemRyg5KpdFkS7/Gv\nOun7rBJXbmGUuvKVkJBCcqwO/IPGsW3XLc5b5fe6tTn9mTugDuHuFQiTcYkG\nxuW+3uF56Qft3sYSEZB3R3kkDJ7hTAOfCp1kcOiJa8ZLz/C/bJMt7cZW4hS2\nXVgLQlXnnOedTS33q0Wq2b8PcMxSjiO2AXFZ7cJz29tDZbwZMF9pXEhPWDvO\nOf6Zp30/f3LddIRjoyktqQnJxneBGM+PCtjX3opRjJUmSY8Siy29Rank3+0u\nzmS4xIiK3XUJO6efAntyKY7BPdvS3WH3kNvupIbcUopSF9mTngCe3srk01MQ\n9MTujMKYkpIxzJ4EK/xA8KYWUu225vRST1gWUj3d/wAKt5MzXGS66NrBDhT9\nGvarGdbbjCc04zNb3UuNuDCknBHH4cxwPMVBbUMTmz4H5GiCv7LGudGyLbIb\n37tAiqkQXwPX+zGS0T2pKQQO44qgrYAJbZ/vA4+FYW9+2yvvY3DJb9n0X2b/\nAHeaY/DI37aaVY2bfd5pj8Mj/tppVTKZXO1nZReNZarcuMN62iKpltvckqVv\nbyc8cBJHbUI/l2vh5uWH4r+iiiKgOZFa1Ptp9pYFAAvno6Xw/wBrYB5r+isK\n6Od8PJ7T/wDn+iidVPjJ5upFa1XWEkEqkIAHeaABhV0b7+cn0jT481/RVQX6\n3x9Napm2y4W9iWuBIUy8G/VQ4U88HAIHlmjan7SdKQypK7s24ocCGULc/UDF\nBptHuEe5671BOiq3o8ia442VDBKSeHA8qQmME+5W95SPQrOmGBnO4srKvjyx\nVmaJ2IXvV+l4F9t0i0MxZYUptt8rC07qinjhBHNJ7aqXeG9x3fKi02HbR9LW\nnZpY7Xc7mmLLYQ4FpW0vdBLqyPWAxyIpgiCJ6OerEexcrInjng66OPf7FeXO\njlq1a983KyFZ5qLzuT57lE9bL/arpFTIt1wjSWFcAtpYUM93vrsEtg8nUHzp\n2xgrN9HbWbSipq72hCsYymQ8DjyRWgdGvVSTlM6whQ5EOOf/ADosw82eS0/G\nvQWk/wBYUgfkadI2x6zaUs1slKbW/DhtR3FNklJUlABIzxxwpU77w7xSoA5J\nDTqgd2mSdbZzgPV/OpNSoArefp29O56v5moxetCajuEKRG31oQ8goKkLIIBG\nOBq76VKh2CC5sX2kwlbsGe3KYHshxeFAf9wPzrhlbDNYvhx56A6uUs7yt15r\nBPwozKVFCAgOwjXa1bqbKRx9pUlvj5U7RdiG0bqgyyiNDZHAbzyVEfBNGTSp\nhQO2z7ZNqjTLMkv3Bch+SpKnDvHdGBwwPPnVhwdN3xvHWOk+dWNSpUOyLw7T\nPbx1i8+dO7ER5A9ZQpxpUxGkNKA5ilW6lQB//9k=\n",
       "filename": "image.jpg"
     }
   }
 }).then(response => {
   console.info(response.data);
 }).catch(err => {
   console.error(err);
 });

Output:

 {
   "id": 4387,
   "product_id": 1,
   "external_id": null,
   "position": 1,
   "created_at": "2026-10-21T23:12:43.000+03:00",
   "image_processing": true,
   "title": null,
   "url": "/images/loading.gif",
   "original_url": "/images/loading.gif",
   "medium_url": "/images/loading.gif",
   "small_url": "/images/loading.gif",
   "thumb_url": "/images/loading.gif",
   "compact_url": "/images/loading.gif",
   "large_url": "/images/loading.gif",
   "filename": "image.jpg",
   "has_bitmap_image": false,
   "image_content_type": "image/jpeg"
 }

Params:

NameTypeAttributeDescription
options Object
options.token string

Required, access token for shop

options.url string

Required, shop url

options.productid number | string

Required, product id

options.productimage object

Required, product image

id Number | String

Required, app id

Return:

Promise

public createProperty(options: Object, id: Number | String): Promise source

import {createProperty} from 'insales/lib/api/property.js'

POST /admin/properties.json

Examples:

 insales.createProperty({
   token: '1234567890',
   url: 'shop-test.myinsales.ru',
   property: {
     "property": {
       "title": "Country",
       "permalink": "country",
       "backoffice": true,
       "is_navigational": true
     }
   }
 }).then(response => {
   console.info(response.data);
 }).catch(err => {
   console.error(err);
 });

Output:

 {
   "id": 35187361,
   "position": 104,
   "backoffice": true,
   "is_hidden": false,
   "is_navigational": true,
   "permalink": "country",
   "title": "Country"
 }

Params:

NameTypeAttributeDescription
options Object
options.token string

Required, access token for shop

options.url string

Required, shop url

options.property object

Required, property

id Number | String

Required, app id

Return:

Promise

public createProviderToken(options: Object, id: Number | String): Promise source

import {createProviderToken} from 'insales/lib/api/providertoken.js'

POST /admin/dialogs/provider_tokens.json

Examples:

 insales.createProviderToken({
   token: '1234567890',
   url: 'shop-test.myinsales.ru',
   providertoken: {
     "messenger_type": "sms"
   }
 }).then(response => {
   console.info(response.data);
 }).catch(err => {
   console.error(err);
 });

Output:

 {
   "api_token": "SOME_API_TOKEN",
   "webhook_token": "SOME_WEBHOOK_TOKEN"
 }

Params:

NameTypeAttributeDescription
options Object
options.token string

Required, access token for shop

options.url string

Required, shop url

options.providertoken object

Required, provider token

id Number | String

Required, app id

Return:

Promise

public createRecurring(options: Object, id: Number | String): Promise source

import {createRecurring} from 'insales/lib/api/recurringcharge.js'

POST /admin/recurring_application_charge.xml

Examples:

 insales.createRecurring({
   token: '1234567890',
   url: 'shop-test.myinsales.ru',
   price: 1000
 }).then(output => {
   console.info(output.data);
 }).catch(err => {
   console.error(err);
 });

Output:

 { 'recurring-application-charge':
   { blocked: 'false',
     'created-at': '2011-11-11T11:11:11+03:00',
     id: '12345',
     monthly: '1000.0',
     'paid-till': '2011-11-21',
     'trial-expired-at': '2011-12-11',
     'updated-at': '2011-11-11T11:11:11+03:00' } }

Params:

NameTypeAttributeDescription
options Object
options.token string

Required, access token for shop

options.url string

Required, shop url

options.price string | number

Required, price

id Number | String

Required, app id

Return:

Promise

public createRedirect(options: Object, id: Number | String): Promise source

import {createRedirect} from 'insales/lib/api/redirect.js'

POST /admin/redirects.json

Examples:

 insales.createRedirect({
   token: '1234567890',
   url: 'shop-test.myinsales.ru',
   redirect: {
     "redirect": {
       "old_url": "/old_url",
       "new_url": "/new_url"
     }
   }
 }).then(response => {
   console.info(response.data);
 }).catch(err => {
   console.error(err);
 });

Output:

 {
   "id": 12,
   "old_url": "/old_url",
   "new_url": "/new_url",
   "created_at": "2026-10-21T23:06:06.823+03:00"
 }

 insales.createRedirect({
   token: '1234567890',
   url: 'shop-test.myinsales.ru',
   redirect: {
     "redirect": {
       "old_url": "/like_new_url",
       "new_url": "/so_new_url",
       "remove_redirect_chains": 1
     }
   }
 }).then(response => {
   console.info(response.data);
 }).catch(err => {
   console.error(err);
 });

Output:

 {
   "id": 16,
   "old_url": "/like_new_url",
   "new_url": "/so_new_url",
   "created_at": "2026-10-21T23:06:07.317+03:00"
 }

Params:

NameTypeAttributeDescription
options Object
options.token string

Required, access token for shop

options.url string

Required, shop url

options.redirect object

Required, redirect

id Number | String

Required, app id

Return:

Promise

public createReview(options: Object, id: Number | String): Promise source

import {createReview} from 'insales/lib/api/review.js'

POST /admin/reviews.json

Examples:

 insales.createReview({
   token: '1234567890',
   url: 'shop-test.myinsales.ru',
   review: {
     "review": {
       "product_id": 1,
       "author": "Bob",
       "content": "Nice product! I'd like to buy it!",
       "email": "bob@gmail.com",
       "published": true,
       "rating": 7
     }
   }
 }).then(response => {
   console.info(response.data);
 }).catch(err => {
   console.error(err);
 });

Output:

 {
   "id": 33,
   "product_id": 1,
   "author": "Bob",
   "content": "Nice product! I'd like to buy it!",
   "email": "bob@gmail.com",
   "rating": 7,
   "manager_name": null,
   "published": true,
   "created_at": "2026-10-21T23:10:51.000+03:00",
   "updated_at": "2026-10-21T23:10:51.000+03:00",
   "manager_reply": null,
   "replied_at": null,
   "spam": false,
   "published_at": null,
   "replied_q": false,
   "title": "Cool t-shirt",
   "url": "/product/футболка",
   "first_image": {
     "id": null,
     "product_id": null,
     "external_id": null,
     "position": null,
     "created_at": null,
     "image_processing": null,
     "title": null,
     "url": "/images/no_image_thumb.jpg",
     "original_url": "/images/no_image_original.jpg",
     "medium_url": "/images/no_image_medium.jpg",
     "small_url": "/images/no_image_micro.jpg",
     "thumb_url": "/images/no_image_thumb.jpg",
     "compact_url": "/images/no_image_compact.jpg",
     "large_url": "/images/no_image_large.jpg",
     "filename": null,
     "has_bitmap_image": false,
     "image_content_type": null
   }
 }

Params:

NameTypeAttributeDescription
options Object
options.token string

Required, access token for shop

options.url string

Required, shop url

options.review object

Required, review

id Number | String

Required, app id

Return:

Promise

public createSalesChannel(options: Object, id: Number | String): Promise source

import {createSalesChannel} from 'insales/lib/api/saleschannel.js'

POST /admin/sales_channels.json

Examples:

 insales.createSalesChannel({
   token: '1234567890',
   url: 'shop-test.myinsales.ru',
   saleschannel: {
     "sales_channel": {
       "title": "sales channel title"
     }
   }
 }).then(response => {
   console.info(response.data);
 }).catch(err => {
   console.error(err);
 });

Output:

 {
   "id": 25,
   "title": "sales channel title",
   "state": null,
   "messages": [],
   "account_id": 1,
   "goods_setting_type": null,
   "goods_setting_id": null,
   "created_at": "2026-10-21T23:23:06.695+03:00",
   "updated_at": "2026-10-21T23:23:06.695+03:00",
   "application_id": 1,
   "last_rating_import_started_at": null,
   "last_feedbacks_import_started_at": null,
   "additional_fields": {},
   "auto_export_products": "disabled"
 }

Params:

NameTypeAttributeDescription
options Object
options.token string

Required, access token for shop

options.url string

Required, shop url

options.saleschannel object

Required, sales channel

id Number | String

Required, app id

Return:

Promise

public createSimilar(options: Object, id: Number | String): Promise source

import {createSimilar} from 'insales/lib/api/similar.js'

POST /admin/products/{product_id}/similars.json

Examples:

 insales.createSimilar({
   token: '1234567890',
   url: 'shop-test.myinsales.ru',
   productid: '1',
   similar: {
     "similar_ids": [
       2
     ]
   }
 }).then(response => {
   console.info(response.data);
 }).catch(err => {
   console.error(err);
 });

Output:

 {
   "status": "ok"
 }

Params:

NameTypeAttributeDescription
options Object
options.token string

Required, access token for shop

options.url string

Required, shop url

options.productid number | string

Required, product id

options.similar object

Required, similar

id Number | String

Required, app id

Return:

Promise

public createStockCurrency(options: Object, id: Number | String): Promise source

import {createStockCurrency} from 'insales/lib/api/stockcurrency.js'

POST /admin/stock_currencies.json

Examples:

 insales.createStockCurrency({
   token: '1234567890',
   url: 'shop-test.myinsales.ru',
   stockcurrency: {
     "stock_currency": {
       "code": "KZT",
       "exchange_rate_percent": 10
     }
   }
 }).then(response => {
   console.info(response.data);
 }).catch(err => {
   console.error(err);
 });

Output:

 {
   "id": 93,
   "is_default": false,
   "exchange_rate_use_cb": true,
   "exchange_rate_manual": null,
   "exchange_rate_percent": "10.0",
   "exchange_rate_round": true,
   "code": "KZT",
   "title": "Казахский тенге",
   "cb_rate": "0.21",
   "unit": "тг.",
   "exchange_rate": "0.231"
 }

Params:

NameTypeAttributeDescription
options Object
options.token string

Required, access token for shop

options.url string

Required, shop url

options.stockcurrency object

Required, stock currency

id Number | String

Required, app id

Return:

Promise

public createSupplementary(options: Object, id: Number | String): Promise source

import {createSupplementary} from 'insales/lib/api/supplementary.js'

POST /admin/products/{product_id}/supplementaries.json

Examples:

 insales.createSupplementary({
   token: '1234567890',
   url: 'shop-test.myinsales.ru',
   productid: '1',
   supplementary: {
     "supplementary_ids": [
       2,
       3
     ]
   }
 }).then(response => {
   console.info(response.data);
 }).catch(err => {
   console.error(err);
 });

Output:

 {
   "status": "ok"
 }

Params:

NameTypeAttributeDescription
options Object
options.token string

Required, access token for shop

options.url string

Required, shop url

options.productid number | string

Required, product id

options.supplementary object

Required, supplementary

id Number | String

Required, app id

Return:

Promise

public createUserTask(options: Object, id: Number | String): Promise source

import {createUserTask} from 'insales/lib/api/usertask.js'

POST /admin/user_tasks.json

Examples:

 insales.createUserTask({
   token: '1234567890',
   url: 'shop-test.myinsales.ru',
   usertask: {
     "user_task": {
       "title": "dispatch order N2",
       "description": "You should dispatch the order N2",
       "assignee_id": 1,
       "deadline_at": "2021-01-01",
       "order_id": 1
     }
   }
 }).then(response => {
   console.info(response.data);
 }).catch(err => {
   console.error(err);
 });

Output:

 {
   "id": 8,
   "complete": null,
   "order_id": 1,
   "assignee_id": 1,
   "title": "dispatch order N2",
   "description": "You should dispatch the order N2",
   "created_at": "2026-10-21T23:32:39.644+03:00",
   "updated_at": "2026-10-21T23:32:39.644+03:00",
   "deadline_at": "2021-01-01T00:00:00.000+03:00",
   "order": {
     "id": 1,
     "number": 1001
   }
 }

Params:

NameTypeAttributeDescription
options Object
options.token string

Required, access token for shop

options.url string

Required, shop url

options.usertask object

Required, user task

id Number | String

Required, app id

Return:

Promise

public createVariant(options: Object, id: Number | String): Promise source

import {createVariant} from 'insales/lib/api/variant.js'

POST /admin/products/{product_id}/variants.json

Examples:

 insales.createVariant({
   token: '1234567890',
   url: 'shop-test.myinsales.ru',
   productid: '1',
   variant: {
     "variant": {
       "price": 100,
       "quantity": 1,
       "options": [
         {
           "option_name_id": 1,
           "value": "Black"
         }
       ],
       "image_ids": [
         4451,
         4459,
         4467
       ],
       "variant_field_values_attributes": [
         {
           "handle": "handle",
           "value": 12345
         }
       ]
     }
   }
 }).then(response => {
   console.info(response.data);
 }).catch(err => {
   console.error(err);
 });

Output:

 {
   "id": 509945722,
   "title": "Black",
   "product_id": 1,
   "sku": null,
   "barcode": null,
   "dimensions": "10x20x30",
   "available": true,
   "image_ids": [
     4451,
     4459,
     4467
   ],
   "image_id": 4451,
   "weight": null,
   "created_at": "2026-10-21T23:12:50.000+03:00",
   "updated_at": "2026-10-21T23:12:50.000+03:00",
   "quantity": 1,
   "quantity_at_warehouse0": "1.0",
   "quantity_at_warehouse1": "0.0",
   "cost_price": null,
   "cost_price_in_site_currency": null,
   "price_in_site_currency": "3000.0",
   "base_price": "100.0",
   "old_price": null,
   "price2": null,
   "price": "100.0",
   "base_price_in_site_currency": "3000.0",
   "old_price_in_site_currency": null,
   "price2_in_site_currency": null,
   "prices": [],
   "prices_in_site_currency": [],
   "variant_field_values": [
     {
       "id": 93,
       "variant_field_id": 1,
       "value": "12345"
     }
   ],
   "option_values": [
     {
       "id": 21063490,
       "option_name_id": 1,
       "position": 21,
       "title": "Black",
       "image_url": null,
       "permalink": "black"
     }
   ]
 }

Params:

NameTypeAttributeDescription
options Object
options.token string

Required, access token for shop

options.url string

Required, shop url

options.productid number | string

Required, product id

options.variant object

Required, variant

id Number | String

Required, app id

Return:

Promise

public createVariantField(options: Object, id: Number | String): Promise source

import {createVariantField} from 'insales/lib/api/variantfield.js'

POST /admin/variant_fields.json

Examples:

 insales.createVariantField({
   token: '1234567890',
   url: 'shop-test.myinsales.ru',
   variantfield: {
     "variant_field": {
       "title": "Size",
       "handle": "size",
       "type": "VariantField::TextArea"
     }
   }
 }).then(response => {
   console.info(response.data);
 }).catch(err => {
   console.error(err);
 });

Output:

 {
   "id": 35,
   "handle": "size",
   "type": "VariantField::TextArea",
   "application_id": 1,
   "position": 3,
   "is_hidden": null,
   "title": "Size",
   "application_title": "Цифровые товары"
 }

Params:

NameTypeAttributeDescription
options Object
options.token string

Required, access token for shop

options.url string

Required, shop url

options.variantfield object

Required, variant field id or handle

id Number | String

Required, app id

Return:

Promise

public createVariantFieldValue(options: Object, id: Number | String): Promise source

import {createVariantFieldValue} from 'insales/lib/api/variantfieldvalue.js'

POST /admin/variants/{variant_id}/variant_field_values.json

Examples:

 insales.createVariantFieldValue({
   token: '1234567890',
   url: 'shop-test.myinsales.ru',
   variantid: '1',
   fieldvalue: {
     "variant_field_value": {
       "variant_field_id": 2,
       "value": "test value"
     }
   }
 }).then(response => {
   console.info(response.data);
 }).catch(err => {
   console.error(err);
 });

Output:

 {
   "id": 95,
   "variant_field_id": 2,
   "value": "test value"
 }

 insales.createVariantFieldValue({
   token: '1234567890',
   url: 'shop-test.myinsales.ru',
   variantid: '1',
   fieldvalue: {
     "variant_field_value": {
       "variant_field_handle": "handle2",
       "value": "test value"
     }
   }
 }).then(response => {
   console.info(response.data);
 }).catch(err => {
   console.error(err);
 });

Output:

 {
   "id": 97,
   "variant_field_id": 2,
   "value": "test value"
 }

Params:

NameTypeAttributeDescription
options Object
options.token string

Required, access token for shop

options.url string

Required, shop url

options.variantid number | string

Required, variant id

options.fieldvalue object

Required, variant field value id or field handle

id Number | String

Required, app id

Return:

Promise

public createWarehouse(options: Object, id: Number | String): Promise source

import {createWarehouse} from 'insales/lib/api/warehouse.js'

POST /admin/warehouses.json

Examples:

 insales.createWarehouse({
   token: '1234567890',
   url: 'shop-test.myinsales.ru',
   warehouse: {
     "warehouse": {
       "title": "secondary",
       "position": 2
     }
   }
 }).then(response => {
   console.info(response.data);
 }).catch(err => {
   console.error(err);
 });

Output:

 {
   "id": 43,
   "title": "secondary",
   "position": 2,
   "array_index": 2,
   "created_at": "2026-10-21T23:23:03.226+03:00",
   "updated_at": "2026-10-21T23:23:03.226+03:00",
   "status": "creating"
 }

Params:

NameTypeAttributeDescription
options Object
options.token string

Required, access token for shop

options.url string

Required, shop url

options.warehouse object

Required, warehouse

id Number | String

Required, app id

Return:

Promise

public createWebhook(options: Object, id: Number | String): Promise source

import {createWebhook} from 'insales/lib/api/webhook.js'

POST /admin/webhooks.json

Examples:

 insales.createWebhook({
   token: '1234567890',
   url: 'shop-test.myinsales.ru',
   webhook: {
     "webhook": {
       "address": "http://application.com/orders/create",
       "topic": "orders/create",
       "format_type": "json"
     }
   }
 }).then(response => {
   console.info(response.data);
 }).catch(err => {
   console.error(err);
 });

Output:

 {
   "address": "http://application.com/orders/create",
   "created_at": "2026-10-21T23:32:48.911+03:00",
   "id": 14,
   "topic": "orders/create",
   "format_type": "json",
   "warehouse_id": null,
   "sales_channel_id": null,
   "batch_size": null
 }

Params:

NameTypeAttributeDescription
options Object
options.token string

Required, access token for shop

options.url string

Required, shop url

options.webhook object

Required, webhook

id Number | String

Required, app id

Return:

Promise

public declineCharge(options: Object, id: Number | String): Promise source

import {declineCharge} from 'insales/lib/api/charge.js'

POST /admin/application_charges/{id}/decline.xml

Examples:

 insales.declineCharge({
   token: '1234567890',
   url: 'shop-test.myinsales.ru',
   chargeid: '12345'
 }).then(output => {
   console.info(output.response.statusCode);
 }).catch(err => {
   console.error(err);
 });

Output:

 { 'application-charge':
   { 'created-at': '2011-11-11T11:11:11+03:00',
     id: '1234',
     name: 'Купи слона',
     price: '180.0',
     'return-url': 'http://application.my/check_payment_url/%id_in_my_application',
     status: 'declined',
     test: '',
     'updated-at': '2011-11-11T11:11:11+03:00',
     'confirmation-url': 'http://shop-test.myinsales.ru/admin/invoices/123456' } }

Params:

NameTypeAttributeDescription
options Object
options.token string

Required, access token for shop

options.url string

Required, shop url

options.chargeid number | string

Required, charge id

id Number | String

Required, app id

Return:

Promise

public editAccessory(options: Object, id: Number | String): Promise source

import {editAccessory} from 'insales/lib/api/accessory.js'

PUT /admin/accessories/{accessory_id}.json

Examples:

 insales.editAccessory({
   token: '1234567890',
   url: 'shop-test.myinsales.ru',
   accessoryid: '72',
   accessory: {
     "accessory": {
       "name": "Опция 1",
       "max_count": 9,
       "min_count": 4,
       "permalink": "opcia-1"
     }
   }
 }).then(response => {
   console.info(response.data);
 }).catch(err => {
   console.error(err);
 });

Output:

 {
   "account_id": 1,
   "name": "Опция 1",
   "min_count": 4,
   "max_count": 9,
   "permalink": "opcia-1",
   "id": 72,
   "back_office_name": "Огромный Алюминиевый Компьютер",
   "name_translations": [
     "Опция 1"
   ],
   "created_at": "2026-10-21T23:15:58.027+03:00",
   "updated_at": "2026-10-21T23:15:58.141+03:00"
 }

Params:

NameTypeAttributeDescription
options Object
options.token string

Required, access token for shop

options.url string

Required, shop url

options.accessoryid number | string

Required, accessory id

options.accessory object

Required, accessory

id Number | String

Required, app id

Return:

Promise

public editAccessoryValue(options: Object, id: Number | String): Promise source

import {editAccessoryValue} from 'insales/lib/api/accessoryvalue.js'

PUT /admin/accessories/{accessory_id}/values/{accessory_value_id}.json

Examples:

 insales.editAccessoryValue({
   token: '1234567890',
   url: 'shop-test.myinsales.ru',
   accessoryid: '94',
   accessoryvalueid: '94',
   accessoryvalue: {
     "accessory_value": {
       "name": "Обновлённое значение опции",
       "price": 200,
       "accounting_variant_id": null
     }
   }
 }).then(response => {
   console.info(response.data);
 }).catch(err => {
   console.error(err);
 });

Output:

 {
   "accessory_id": 94,
   "name": "Обновлённое значение опции",
   "price": "200.0",
   "accounting_variant_id": null,
   "name_translations": [
     "Обновлённое значение опции"
   ],
   "id": 94,
   "account_id": 1,
   "created_at": "2026-10-21T23:16:00.357+03:00",
   "updated_at": "2026-10-21T23:16:00.508+03:00"
 }

Params:

NameTypeAttributeDescription
options Object
options.token string

Required, access token for shop

options.url string

Required, shop url

options.accessoryid number | string

Required, accessory id

options.accessoryvalueid number | string

Required, accessory value id

options.accessoryvalue object

Required, accessory value

id Number | String

Required, app id

Return:

Promise

public editAccount(options: Object, id: Number | String): Promise source

import {editAccount} from 'insales/lib/api/account.js'

PUT /admin/account.json

Examples:

 insales.editAccount({
   token: '1234567890',
   url: 'shop-test.myinsales.ru',
   account: {
     "account": {
       "client_cookies_whitelist": "my_cookie"
     }
   }
 }).then(response => {
   console.info(response.data);
 }).catch(err => {
   console.error(err);
 });

Output:

 {
   "status": "ok"
 }

Params:

NameTypeAttributeDescription
options Object
options.token string

Required, access token for shop

options.url string

Required, shop url

options.account object

Required, account

id Number | String

Required, app id

Return:

Promise

public editApplicationAction(options: Object, id: Number | String): Promise source

import {editApplicationAction} from 'insales/lib/api/applicationaction.js'

PUT /admin/application_actions/{application_action_id}.json

Examples:

 insales.editApplicationAction({
   token: '1234567890',
   url: 'shop-test.myinsales.ru',
   actionid: '1',
   applicationaction: {
     "application_action": {
       "title": "new  title",
       "handle": "new_unique_handle",
       "entity": "client",
       "url": "http://www.yandex.ru"
     }
   }
 }).then(response => {
   console.info(response.data);
 }).catch(err => {
   console.error(err);
 });

Output:

 {
   "id": 1,
   "title": "new  title",
   "url": "http://www.yandex.ru",
   "handle": "new_unique_handle",
   "entity": "client"
 }

Params:

NameTypeAttributeDescription
options Object
options.token string

Required, access token for shop

options.url string

Required, shop url

options.actionid number | string

Required, application action id

options.applicationaction object

Required, application action

id Number | String

Required, app id

Return:

Promise

public editApplicationWidget(options: Object, id: Number | String): Promise source

import {editApplicationWidget} from 'insales/lib/api/applicationwidget.js'

PUT /admin/application_widgets/{application_widget_id}.json

Examples:

 insales.editApplicationWidget({
   token: '1234567890',
   url: 'shop-test.myinsales.ru',
   widgetid: '73',
   applicationwidget: {
     "application_widget": {
       "code": "code changed",
       "height": 80,
       "page_type": "order"
     }
   }
 }).then(response => {
   console.info(response.data);
 }).catch(err => {
   console.error(err);
 });

Output:

 {
   "code": "code changed",
   "created_at": "2026-10-21T23:32:47.244+03:00",
   "id": 73,
   "height": 80,
   "page_type": "order"
 }

Params:

NameTypeAttributeDescription
options Object
options.token string

Required, access token for shop

options.url string

Required, shop url

options.widgetid number | string

Required, application widget id

options.applicationwidget object

Required, application widget

id Number | String

Required, app id

Return:

Promise

public editArticle(options: Object, id: Number | String): Promise source

import {editArticle} from 'insales/lib/api/article.js'

PUT /admin/blogs/{blog_id}/articles/{article_id}.json

Examples:

 insales.editArticle({
   token: '1234567890',
   url: 'shop-test.myinsales.ru',
   blogid: '1',
   articleid: '2',
   article: {
     "article": {
       "title": "new title",
       "image_attributes": {
         "src": "https://abc.myinsales.ru/images/no_image_compact.jpg"
       },
       "all_tags": [
         "test",
         "test3"
       ],
       "pinned": true
     }
   }
 }).then(response => {
   console.info(response.data);
 }).catch(err => {
   console.error(err);
 });

Output:

 {
   "id": 2,
   "created_at": "2026-10-20T12:13:53.000+03:00",
   "updated_at": "2026-10-21T23:05:55.000+03:00",
   "published_at": "2017-03-01T07:53:15.000+03:00",
   "pinned": true,
   "custom_template": null,
   "title": "new title",
   "author": "Ivan",
   "permalink": "statya-2",
   "html_title": null,
   "meta_keywords": null,
   "meta_description": null,
   "image": {
     "id": 33,
     "created_at": "2026-10-21T23:05:55.000+03:00",
     "original_url": "/images/loading.gif"
   },
   "tags": [
     {
       "title": "test"
     },
     {
       "title": "test3"
     }
   ],
   "related_products": [
     {
       "category_id": 1,
       "created_at": "2026-10-21T14:10:26.000+03:00",
       "updated_at": "2015-07-27T17:05:35.000+03:00",
       "is_hidden": false,
       "account_id": 1,
       "title_translations": [
         "Cool t-shirt"
       ],
       "available": false,
       "archived": false,
       "key": null,
       "price_min_cached": "10.0",
       "price_max_cached": "10.0",
       "price_min_available_cached": null,
       "price_max_available_cached": null,
       "canonical_url_collection_id": 1,
       "collections_id": [
         1,
         3,
         8
       ],
       "characteristics_id": [
         7,
         9,
         12,
         13
       ],
       "custom_layout": null,
       "custom_template": null,
       "old_price_min_cached": null,
       "old_price_max_cached": null,
       "old_price_min_available_cached": null,
       "old_price_max_available_cached": null,
       "permalink": "футболка",
       "unit": "pce",
       "deleted": false,
       "cost_price_min_cached": null,
       "cost_price_max_cached": null,
       "stock_currency_id": 1,
       "sort_weight": null,
       "bundle": null,
       "ignore_discounts": null,
       "vat": -1,
       "dimensions": "10x20x30",
       "fiscal_product_type": 1,
       "popularity": null,
       "available_at_warehouses": [],
       "auto_assign_bundle_price": null,
       "demo": null,
       "sales_channels_id": null,
       "demo_thematic": null,
       "reviews_average_rating_cached": null,
       "reviews_count_cached": null,
       "merge_product_id": null,
       "merge_group_product_id": null,
       "merge_group_hidden": null,
       "no_delivery": false,
       "id": 1,
       "main_image_id": null,
       "is_adult": false,
       "title": "Cool t-shirt"
     }
   ],
   "notice": "Второй анонс",
   "content": "Привет"
 }

Params:

NameTypeAttributeDescription
options Object
options.token string

Required, access token for shop

options.url string

Required, shop url

options.blogid number | string

Required, blog id

options.articleid number | string

Required, article id

options.article object

Required, article

id Number | String

Required, app id

Return:

Promise

public editAsset(options: Object, id: Number | String): Promise source

import {editAsset} from 'insales/lib/api/asset.js'

PUT /admin/themes/#{theme_id}/assets/#{id}.xml

Examples:

 insales.editAsset({
   token: '1234567890',
   url: 'shop-test.myinsales.ru',
   theme: '643879',
   assetId: '60423000',
   asset: {
     content: 'Amazing template for page {{product.title}}'
   }
 }).then(output => {
   console.info(output.response.statusCode);
 }).catch(err => {
   console.error(err);
 });

Output:

 { asset:
   { id: '60423000',
     'theme-id': '643879',
     type: 'Asset::Template',
     name: 'page.new_page.liquid',
     'content-type': 'text/x-liquid',
     'file-size': '52',
     'human-readable-name': 'Страница: new_page' } }

Params:

NameTypeAttributeDescription
options Object
options.token string

Required, access token for shop

options.url string

Required, shop url

options.asset Object

Required, asset content

options.theme Number | String

Required, theme id

options.assetId Number | String

Required, asset id

id Number | String

Required, app id

Return:

Promise

public editBlog(options: Object, id: Number | String): Promise source

import {editBlog} from 'insales/lib/api/blog.js'

PUT /admin/blogs/{blog_id}.json

Examples:

 insales.editBlog({
   token: '1234567890',
   url: 'shop-test.myinsales.ru',
   blogid: '1',
   blog: {
     "blog": {
       "title": "WowBlog",
       "notify_about_comment": false,
       "captcha_enabled": true,
       "disallow_links_in_comments": true,
       "commentable": "yes"
     }
   }
 }).then(response => {
   console.info(response.data);
 }).catch(err => {
   console.error(err);
 });

Output:

 {
   "id": 1,
   "commentable": "yes",
   "notify_about_comment": false,
   "captcha_enabled": true,
   "disallow_links_in_comments": true,
   "custom_template": null,
   "handle": "wowblog",
   "title": "WowBlog",
   "html_title": null,
   "meta_keywords": null,
   "meta_description": null,
   "tags": [
     {
       "title": "test"
     },
     {
       "title": "test2"
     }
   ]
 }

Params:

NameTypeAttributeDescription
options Object
options.token string

Required, access token for shop

options.url string

Required, shop url

options.blogid number | string

Required, blog id

options.blog object

Required, blog

id Number | String

Required, app id

Return:

Promise

public editCategory(options: Object, id: Number | String): Promise source

import {editCategory} from 'insales/lib/api/category.js'

PUT /admin/categories/{category_id}.json

Examples:

 insales.editCategory({
   token: '1234567890',
   url: 'shop-test.myinsales.ru',
   categoryid: '6',
   category: {
     "category": {
       "title": "Adidas"
     }
   }
 }).then(response => {
   console.info(response.data);
 }).catch(err => {
   console.error(err);
 });

Output:

 {
   "id": 6,
   "parent_id": 1,
   "title": "Adidas",
   "position": 0,
   "created_at": "2026-10-20T11:11:05.000+03:00",
   "updated_at": "2026-10-21T23:12:56.000+03:00"
 }

Params:

NameTypeAttributeDescription
options Object
options.token string

Required, access token for shop

options.url string

Required, shop url

options.categoryid number | string

Required, category id

options.category object

Required, category

id Number | String

Required, app id

Return:

Promise

public editCharacteristic(options: Object, id: Number | String): Promise source

import {editCharacteristic} from 'insales/lib/api/characteristic.js'

PUT /admin/properties/{property_id}/characteristics/{characteristic_id}.json

Examples:

 insales.editCharacteristic({
   token: '1234567890',
   url: 'shop-test.myinsales.ru',
   propertyid: '3',
   characteristicid: '7',
   characteristic: {
     "characteristic": {
       "title": "Adidas"
     }
   }
 }).then(response => {
   console.info(response.data);
 }).catch(err => {
   console.error(err);
 });

Output:

 {
   "id": 7,
   "property_id": 3,
   "position": 1,
   "title": "Adidas",
   "permalink": "nike"
 }

Params:

NameTypeAttributeDescription
options Object
options.token string

Required, access token for shop

options.url string

Required, shop url

options.propertyid number | string

Required, property id

options.characteristicid number | string

Required, characteristic id

options.characteristic object

Required, characteristic

id Number | String

Required, app id

Return:

Promise

public editClient(options: Object, id: Number | String): Promise source

import {editClient} from 'insales/lib/api/client.js'

PUT /admin/clients/{client_id}.json

Examples:

 insales.editClient({
   token: '1234567890',
   url: 'shop-test.myinsales.ru',
   clientid: '5',
   client: {
     "client": {
       "phone": "+7(911)111-11-11",
       "subscribe": false,
       "client_group_id": 2,
       "fields_values_attributes": [
         {
           "field_id": 1200,
           "value": "new value"
         }
       ]
     }
   }
 }).then(response => {
   console.info(response.data);
 }).catch(err => {
   console.error(err);
 });

Output:

 {
   "id": 5,
   "email": "john@smith.com",
   "name": "John Smith",
   "phone": "+79111111111",
   "created_at": "2009-04-30T04:37:32.000+04:00",
   "updated_at": "2026-10-21T23:29:35.000+03:00",
   "comment": null,
   "registered": true,
   "subscribe": false,
   "client_group_id": 2,
   "bonus_points": 1000,
   "type": "Client::Individual",
   "correspondent_account": null,
   "settlement_account": null,
   "consent_to_personal_data": null,
   "o_auth_provider": null,
   "messenger_subscription": null,
   "external_id": null,
   "external_service": null,
   "contact_name": "John Smith",
   "surname": null,
   "middlename": null,
   "progressive_discount": null,
   "group_discount": null,
   "ip_addr": "",
   "fields_values": [
     {
       "id": 907,
       "value": "new value",
       "created_at": "2026-10-21T23:29:35.063+03:00",
       "updated_at": "2026-10-21T23:29:35.217+03:00",
       "field_id": 1200,
       "type": "Текст",
       "name": "special",
       "handle": null
     }
   ],
   "default_address": null,
   "client_tags": [],
   "full_name": "John Smith"
 }

Params:

NameTypeAttributeDescription
options Object
options.token string

Required, access token for shop

options.url string

Required, shop url

options.clientid number | string

Required, client id

options.client object

Required, client

id Number | String

Required, app id

Return:

Promise

public editClientGroup(options: Object, id: Number | String): Promise source

import {editClientGroup} from 'insales/lib/api/clientgroup.js'

PUT /admin/client_groups/{client_group_id}.json

Examples:

 insales.editClientGroup({
   token: '1234567890',
   url: 'shop-test.myinsales.ru',
   clientgroupid: '1',
   clientgroup: {
     "client_group": {
       "title": "test group",
       "discount": 0.2,
       "discount_description": "test group discount",
       "is_default": false
     }
   }
 }).then(response => {
   console.info(response.data);
 }).catch(err => {
   console.error(err);
 });

Output:

 {
   "status": "ok"
 }

Params:

NameTypeAttributeDescription
options Object
options.token string

Required, access token for shop

options.url string

Required, shop url

options.clientgroupid number | string

Required, client group id

options.clientgroup object

Required, client group

id Number | String

Required, app id

Return:

Promise

public editCollect(options: Object, id: Number | String): Promise source

import {editCollect} from 'insales/lib/api/collect.js'

PUT /admin/collects/{collect_id}.json

Examples:

 insales.editCollect({
   token: '1234567890',
   url: 'shop-test.myinsales.ru',
   collectid: '2',
   collect: {
     "collect": {
       "position": 3
     }
   }
 }).then(response => {
   console.info(response.data);
 }).catch(err => {
   console.error(err);
 });

Output:

 {
   "id": 2,
   "collection_id": 1,
   "product_id": 2,
   "position": 3,
   "created_at": "2009-03-18T07:53:15.000+03:00"
 }

 insales.editCollect({
   token: '1234567890',
   url: 'shop-test.myinsales.ru',
   collectid: '2',
   collect: {
     "collect": {
       "collection_id": 3
     }
   }
 }).then(response => {
   console.info(response.data);
 }).catch(err => {
   console.error(err);
 });

Output:

 {
   "id": 2,
   "collection_id": 3,
   "product_id": 2,
   "position": 2,
   "created_at": "2009-03-18T07:53:15.000+03:00"
 }

Params:

NameTypeAttributeDescription
options Object
options.token string

Required, access token for shop

options.url string

Required, shop url

options.collectid number | string

Required, collect id

options.collect object

Required, collect

id Number | String

Required, app id

Return:

Promise

public editCollection(options: Object, id: Number | String): Promise source

import {editCollection} from 'insales/lib/api/collection.js'

PUT /admin/collections/{collection_id}.json

Examples:

 insales.editCollection({
   token: '1234567890',
   url: 'shop-test.myinsales.ru',
   collectionid: '6',
   collection: {
     "collection": {
       "title": "Books",
       "position": 2,
       "sort_type": 11,
       "description": "Description",
       "is_hidden": true,
       "field_values_attributes": [
         {
           "handle": "handle",
           "value": 12345
         }
       ]
     }
   }
 }).then(response => {
   console.info(response.data);
 }).catch(err => {
   console.error(err);
 });

Output:

 {
   "id": 6,
   "parent_id": 1,
   "is_hidden": true,
   "is_smart": null,
   "position": 2,
   "created_at": "2026-07-12T11:00:55.000+03:00",
   "updated_at": "2026-10-21T23:17:17.000+03:00",
   "recursive": null,
   "sort_type": 11,
   "custom_template": null,
   "title": "Books",
   "html_title": null,
   "meta_description": null,
   "meta_keywords": null,
   "permalink": "all",
   "url": "/collection/all",
   "field_values": [
     {
       "id": 554,
       "collection_field_id": 1,
       "value": "12345"
     }
   ],
   "description": "Description",
   "seo_description": null
 }

Params:

NameTypeAttributeDescription
options Object
options.token string

Required, access token for shop

options.url string

Required, shop url

options.collectionid number | string

Required, collection id

options.collection object

Required, collection

id Number | String

Required, app id

Return:

Promise

public editCollectionField(options: Object, id: Number | String): Promise source

import {editCollectionField} from 'insales/lib/api/collectionfield.js'

PUT /admin/collection_fields/{collection_field_id}.json

Examples:

 insales.editCollectionField({
   token: '1234567890',
   url: 'shop-test.myinsales.ru',
   fieldid: '2',
   collectionfield: {
     "collection_field": {
       "title": "Volume",
       "handle": "volume",
       "position": 2
     }
   }
 }).then(response => {
   console.info(response.data);
 }).catch(err => {
   console.error(err);
 });

Output:

 {
   "status": "ok"
 }

 insales.editCollectionField({
   token: '1234567890',
   url: 'shop-test.myinsales.ru',
   fieldid: 'handle2',
   collectionfield: {
     "collection_field": {
       "title": "Volume",
       "position": 2
     }
   }
 }).then(response => {
   console.info(response.data);
 }).catch(err => {
   console.error(err);
 });

Output:

 {
   "status": "ok"
 }

Params:

NameTypeAttributeDescription
options Object
options.token string

Required, access token for shop

options.url string

Required, shop url

options.fieldid number | string

Required, collection field id or handle

options.collectionfield object

Required, collection field

id Number | String

Required, app id

Return:

Promise

public editCollectionFieldValue(options: Object, id: Number | String): Promise source

import {editCollectionFieldValue} from 'insales/lib/api/collectionfieldvalue.js'

PUT /admin/collections/{collection_id}/collection_field_values/{field_id}.json

Examples:

 insales.editCollectionFieldValue({
   token: '1234567890',
   url: 'shop-test.myinsales.ru',
   collectionid: '1',
   fieldid: '2',
   fieldvalue: {
     "collection_field_value": {
       "value": "new test value of field"
     }
   }
 }).then(response => {
   console.info(response.data);
 }).catch(err => {
   console.error(err);
 });

Output:

 {
   "status": "ok"
 }

 insales.editCollectionFieldValue({
   token: '1234567890',
   url: 'shop-test.myinsales.ru',
   collectionid: '1',
   fieldid: 'handle2',
   fieldvalue: {
     "collection_field_value": {
       "value": "new test value of field"
     }
   }
 }).then(response => {
   console.info(response.data);
 }).catch(err => {
   console.error(err);
 });

Output:

 {
   "status": "ok"
 }

Params:

NameTypeAttributeDescription
options Object
options.token string

Required, access token for shop

options.url string

Required, shop url

options.collectionid number | string

Required, collection id

options.fieldid number | string

Required, collection field id or handle

options.fieldvalue object

Required, collection field value

id Number | String

Required, app id

Return:

Promise

public editCollectionFilter(options: Object, id: Number | String): Promise source

import {editCollectionFilter} from 'insales/lib/api/collectionfilter.js'

PUT /admin/collection_filters/{filter_id}.json

Examples:

 insales.editCollectionFilter({
   token: '1234567890',
   url: 'shop-test.myinsales.ru',
   filterid: '1',
   filter: {
     "filter": {
       "title": "new-seo-filter",
       "permalink": "new-seo-filter",
       "properties_attributes": [
         {
           "title": "first property",
           "value": "first prop value"
         },
         {
           "title": "second property",
           "value": "second property value"
         }
       ],
       "options_attributes": [
         {
           "title": "first option",
           "value": "first option value"
         },
         {
           "title": "second option",
           "value": "second option value"
         }
       ],
       "field_values_attributes": [
         {
           "handle": "handle",
           "value": 12345
         }
       ]
     }
   }
 }).then(response => {
   console.info(response.data);
 }).catch(err => {
   console.error(err);
 });

Output:

 {
   "id": 1,
   "collection_id": 1,
   "description": null,
   "seo_description": null,
   "title": "new-seo-filter",
   "permalink": "new-seo-filter",
   "html_title": null,
   "meta_keywords": null,
   "meta_description": null,
   "characteristis": [
     {
       "id": 898584383,
       "property_id": 35187368,
       "position": 1,
       "title": "first prop value",
       "permalink": "first-prop-value"
     },
     {
       "id": 898584391,
       "property_id": 35187369,
       "position": 1,
       "title": "second property value",
       "permalink": "second-property-value"
     }
   ],
   "option_values": [
     {
       "id": 21063499,
       "option_name_id": 2517873,
       "position": 1,
       "title": "first option value",
       "image_url": null,
       "permalink": "first-option-value"
     },
     {
       "id": 21063500,
       "option_name_id": 2517874,
       "position": 1,
       "title": "second option value",
       "image_url": null,
       "permalink": "second-option-value"
     }
   ]
 }

Params:

NameTypeAttributeDescription
options Object
options.token string

Required, access token for shop

options.url string

Required, shop url

options.filterid number | string

Required, collection filter id

options.filter object

Required, collection filter

id Number | String

Required, app id

Return:

Promise

public editCoupon(options: Object, id: Number | String): Promise source

import {editCoupon} from 'insales/lib/api/coupon.js'

PUT /admin/discount_codes/{id}.xml

Examples:

 insales.editCoupon({
   token: '1234567890',
   url: 'shop-test.myinsales.ru',
   couponid: '100000',
   coupon: {
     'discount_code': {
       'code': 'frandom3'
     }
   }
 }).then(output => {
   console.info(output.response.statusCode);
 }).catch(err => {
   console.error(err);
 });

Output:

 200

Params:

NameTypeAttributeDescription
options Object
options.token string

Required, access token for shop

options.url string

Required, shop url

options.couponid number | string

Required, coupon id

options.coupon object

Required, coupon

id Number | String

Required, app id

Return:

Promise

public editCustomStatus(options: Object, id: Number | String): Promise source

import {editCustomStatus} from 'insales/lib/api/customstatus.js'

PUT /admin/custom_statuses/{custom_status_permalink}.json

Examples:

 insales.editCustomStatus({
   token: '1234567890',
   url: 'shop-test.myinsales.ru',
   permalink: 'novyy',
   customstatus: {
     "custom_status": {
       "title": "New (ordered by website)"
     }
   }
 }).then(response => {
   console.info(response.data);
 }).catch(err => {
   console.error(err);
 });

Output:

 {
   "status": "ok"
 }

Params:

NameTypeAttributeDescription
options Object
options.token string

Required, access token for shop

options.url string

Required, shop url

options.permalink number | string

Required, custom status permalink

options.customstatus object

Required, custom status

id Number | String

Required, app id

Return:

Promise

public editDeliveryVariant(options: Object, id: Number | String): Promise source

import {editDeliveryVariant} from 'insales/lib/api/deliveryvariant.js'

PUT /admin/delivery_variants/{delivery_variant_id}.json

Examples:

 insales.editDeliveryVariant({
   token: '1234567890',
   url: 'shop-test.myinsales.ru',
   deliveryvariantid: '2',
   deliveryvariant: {
     "delivery_variant": {
       "title": "new title",
       "description": "new description",
       "position": 1,
       "charge_up_to": 2500,
       "payment_delivery_variants_attributes": [
         {
           "_destroy": 1,
           "id": 2
         },
         {
           "payment_gateway_id": 3
         }
       ],
       "pick_up_sources_attributes": [
         {
           "title": "My company",
           "pick_up_source_http_method": "POST",
           "url": "https://example.com/get_points",
           "point_info_url": "https://example.com/get_point_info"
         }
       ]
     }
   }
 }).then(response => {
   console.info(response.data);
 }).catch(err => {
   console.error(err);
 });

Output:

 {
   "id": 2,
   "position": 1,
   "updated_at": "2026-10-21T23:30:55.000+03:00",
   "created_at": "2009-03-30T04:37:32.000+04:00",
   "charge_up_to": "2500.0",
   "inverted": false,
   "show_zip_code": false,
   "title": "new title",
   "description": "new description",
   "type": "DeliveryVariant::PriceDepend",
   "min_order_sum": null,
   "show_calendar_in_checkout": null,
   "delivery_date_required": null,
   "forbid_weekends": null,
   "utc_from_address": null,
   "estimated_delivery_period": null,
   "order_time_is_later": null,
   "forbidden_days": null,
   "show_time_intervals_in_checkout": null,
   "time_intervals_required": null,
   "min_price": 200,
   "payment_delivery_variants": [
     {
       "id": 54,
       "payment_gateway_id": 3,
       "created_at": "2026-10-21T23:30:55.000+03:00"
     }
   ],
   "delivery_locations": [],
   "delivery_time_intervals": [],
   "rules": [
     {
       "id": 1,
       "order_price": 2000,
       "price": 600,
       "order_weight": 10
     },
     {
       "id": 2,
       "order_price": 2000,
       "price": 700,
       "order_weight": 20
     },
     {
       "id": 3,
       "order_price": 2000,
       "price": 800,
       "order_weight": null
     },
     {
       "id": 4,
       "order_price": 10000,
       "price": 300,
       "order_weight": 10
     },
     {
       "id": 5,
       "order_price": 10000,
       "price": 400,
       "order_weight": 20
     },
     {
       "id": 6,
       "order_price": 10000,
       "price": 500,
       "order_weight": null
     },
     {
       "id": 7,
       "order_price": null,
       "price": 0,
       "order_weight": 10
     },
     {
       "id": 8,
       "order_price": null,
       "price": 100,
       "order_weight": 20
     }
   ]
 }

Params:

NameTypeAttributeDescription
options Object
options.token string

Required, access token for shop

options.url string

Required, shop url

options.deliveryvariantid number | string

Required, delivery variant id

options.deliveryvariant object

Required, delivery variant

id Number | String

Required, app id

Return:

Promise

public editDomain(options: Object, id: Number | String): Promise source

import {editDomain} from 'insales/lib/api/domain.js'

PUT /admin/domains/{domain_id}.json

Examples:

 insales.editDomain({
   token: '1234567890',
   url: 'shop-test.myinsales.ru',
   domainid: '38',
   domain: {
     "domain": {
       "domain": "other-domain.ru"
     }
   }
 }).then(response => {
   console.info(response.data);
 }).catch(err => {
   console.error(err);
 });

Output:

 {
   "id": 38,
   "domain": "other-domain.ru",
   "created_at": "2026-10-21T23:32:37.000+03:00",
   "updated_at": "2026-10-21T23:32:37.000+03:00",
   "main": true
 }

Params:

NameTypeAttributeDescription
options Object
options.token string

Required, access token for shop

options.url string

Required, shop url

options.domainid number | string

Required, domain id

options.domain object

Required, domain

id Number | String

Required, app id

Return:

Promise

public editExternalDiscount(options: Object, id: Number | String): Promise source

import {editExternalDiscount} from 'insales/lib/api/externaldiscount.js'

PUT /admin/external_discounts/{external_discount_id}.json

Examples:

 insales.editExternalDiscount({
   token: '1234567890',
   url: 'shop-test.myinsales.ru',
   discountid: '73',
   discount: {
     "external_discount": {
       "url": "https://myservice.com/birthday_external_discount_v2"
     }
   }
 }).then(response => {
   console.info(response.data);
 }).catch(err => {
   console.error(err);
 });

Output:

 {
   "id": 73,
   "url": "https://myservice.com/birthday_external_discount_v2",
   "order_lines_depend": null,
   "active": true,
   "created_at": "2026-10-21T23:27:55.000+03:00",
   "updated_at": "2026-10-21T23:27:55.000+03:00",
   "description": "My External Discount",
   "observed_fields": []
 }

Params:

NameTypeAttributeDescription
options Object
options.token string

Required, access token for shop

options.url string

Required, shop url

options.discountid number | string

Required, external discount id

options.discount object

Required, external discount

id Number | String

Required, app id

Return:

Promise

public editField(options: Object, id: Number | String): Promise source

import {editField} from 'insales/lib/api/field.js'

PUT /admin/fields/{non_select_field_id}.json

Examples:

 insales.editField({
   token: '1234567890',
   url: 'shop-test.myinsales.ru',
   fieldid: '2',
   field: {
     "field": {
       "office_title": "state_code",
       "title": "State code",
       "active": true,
       "for_buyer": true,
       "obligatory": true,
       "show_in_result": true,
       "show_in_checkout": true,
       "position": 1,
       "handle": "my_awesome_field_2",
       "is_indexed": true,
       "hide_in_backoffice": true
     }
   }
 }).then(response => {
   console.info(response.data);
 }).catch(err => {
   console.error(err);
 });

Output:

 {
   "id": 2,
   "destiny": 1,
   "position": 1,
   "office_title": "state_code",
   "for_buyer": true,
   "obligatory": true,
   "active": true,
   "system_name": "state",
   "created_at": "2010-10-12T13:31:09.692+04:00",
   "updated_at": "2026-10-21T23:29:40.198+03:00",
   "show_in_result": true,
   "show_in_checkout": true,
   "is_indexed": true,
   "hide_in_backoffice": true,
   "handle": "my_awesome_field_2",
   "placeholder": null,
   "title": "State code",
   "example": null,
   "type": "Field::SystemTextField"
 }

 insales.editField({
   token: '1234567890',
   url: 'shop-test.myinsales.ru',
   fieldid: '23',
   field: {
     "field": {
       "office_title": "state_code",
       "title": "State code",
       "active": true,
       "for_buyer": true,
       "obligatory": true,
       "show_in_result": true,
       "show_in_checkout": true,
       "position": 2,
       "handle": "my_awesome_field_10",
       "is_indexed": true,
       "hide_in_backoffice": true,
       "field_options_attributes": [
         {
           "value": 10
         },
         {
           "id": 1,
           "value": 20
         }
       ]
     }
   }
 }).then(response => {
   console.info(response.data);
 }).catch(err => {
   console.error(err);
 });

Output:

 {
   "id": 23,
   "destiny": 2,
   "position": 2,
   "office_title": "state_code",
   "for_buyer": true,
   "obligatory": true,
   "active": true,
   "system_name": null,
   "created_at": "2010-10-12T13:31:09.692+04:00",
   "updated_at": "2026-10-21T23:29:41.317+03:00",
   "show_in_result": true,
   "show_in_checkout": true,
   "is_indexed": true,
   "hide_in_backoffice": true,
   "handle": "my_awesome_field_10",
   "placeholder": null,
   "title": "State code",
   "example": null,
   "type": "Field::Select",
   "field_options": [
     {
       "id": 1,
       "position": 1,
       "value": "20"
     },
     {
       "id": 2,
       "position": 2,
       "value": "Не передан"
     },
     {
       "id": 18,
       "position": 3,
       "value": "10"
     }
   ]
 }

Params:

NameTypeAttributeDescription
options Object
options.token string

Required, access token for shop

options.url string

Required, shop url

options.fieldid number | string

Required, field id

options.field object

Required, field

id Number | String

Required, app id

Return:

Promise

public editJsTag(options: Object, id: Number | String): Promise source

import {editJsTag} from 'insales/lib/api/jstag.js'

PUT /admin/js_tags/{js_tag_id}.json

Examples:

 insales.editJsTag({
   token: '1234567890',
   url: 'shop-test.myinsales.ru',
   jstagid: '105',
   jstag: {
     "js_tag": {
       "content": "http://code.jquery.com/jquery-2.2.4.min.js",
       "name": "jquery-2.2.4"
     }
   }
 }).then(response => {
   console.info(response.data);
 }).catch(err => {
   console.error(err);
 });

Output:

 {
   "content": "http://code.jquery.com/jquery-2.2.4.min.js",
   "id": 105,
   "name": "jquery-2.2.4",
   "created_at": "2026-10-21T23:10:50.000+03:00",
   "updated_at": "2026-10-21T23:10:50.000+03:00",
   "type": "JsTag::FileTag"
 }

Params:

NameTypeAttributeDescription
options Object
options.token string

Required, access token for shop

options.url string

Required, shop url

options.jstagid number | string

Required, js tag id

options.jstag object

Required, js tag

id Number | String

Required, app id

Return:

Promise

public editMarketplace(options: Object, id: Number | String): Promise source

import {editMarketplace} from 'insales/lib/api/marketplace.js'

PUT /admin/marketplaces/{ym_marketplace_id}.json

Examples:

 insales.editMarketplace({
   token: '1234567890',
   url: 'shop-test.myinsales.ru',
   marketplaceid: '89',
   marketplace: {
     "marketplace": {
       "name": "New YM",
       "vendor_id": 4,
       "collection_ids": [
         6,
         1,
         2,
         3,
         4,
         5,
         8
       ]
     }
   }
 }).then(response => {
   console.info(response.data);
 }).catch(err => {
   console.error(err);
 });

Output:

 {
   "id": 89,
   "name": "New YM",
   "type": "Marketplace::ModelYandexMarket",
   "created_at": "2026-10-21T23:32:42.498+03:00",
   "updated_at": "2026-10-21T23:32:42.600+03:00",
   "url": "https://quentin.insales.io:3003/marketplace/89.xml",
   "collection_ids": [
     6,
     1,
     2,
     3,
     4,
     5,
     8
   ],
   "delivery_price_kind": null,
   "description_type": 1,
   "local_delivery_cost": null,
   "sales_notes": null,
   "utm_label": null,
   "vendor_id": 4,
   "page_encoding": "windows-1251",
   "shop_company": "eBay",
   "shop_name": "eBay",
   "adult": false,
   "delivery": false,
   "delivery_new_style": false,
   "pickup": false,
   "store": false,
   "use_sku_as_vendor_code": false,
   "use_stock_currency": false,
   "use_variants": false
 }

 insales.editMarketplace({
   token: '1234567890',
   url: 'shop-test.myinsales.ru',
   marketplaceid: '105',
   marketplace: {
     "marketplace": {
       "name": "New GM",
       "description_type": 2,
       "adult": 0
     }
   }
 }).then(response => {
   console.info(response.data);
 }).catch(err => {
   console.error(err);
 });

Output:

 {
   "id": 105,
   "name": "New GM",
   "type": "Marketplace::GoogleMerchant",
   "created_at": "2026-10-21T23:32:42.876+03:00",
   "updated_at": "2026-10-21T23:32:42.961+03:00",
   "url": "https://quentin.insales.io:3003/marketplace/105.xml",
   "collection_ids": [],
   "description_type": 2,
   "local_delivery_cost": null,
   "utm_label": null,
   "adult": false,
   "delivery_new_style": false,
   "use_stock_currency": false,
   "use_variants": false
 }

 insales.editMarketplace({
   token: '1234567890',
   url: 'shop-test.myinsales.ru',
   marketplaceid: '137',
   marketplace: {
     "marketplace": {
       "name": "New LYM"
     }
   }
 }).then(response => {
   console.info(response.data);
 }).catch(err => {
   console.error(err);
 });

Output:

 {
   "id": 137,
   "name": "New LYM",
   "type": "Marketplace::LiquidYandexMarket",
   "created_at": "2026-10-21T23:32:43.800+03:00",
   "updated_at": "2026-10-21T23:32:43.937+03:00",
   "url": "https://quentin.insales.io:3003/marketplace/137.xml",
   "collection_ids": [],
   "local_delivery_cost": null,
   "vendor_id": null,
   "offer_liquid": "<offer>...</offer>",
   "page_encoding": "utf-8",
   "shop_company": "eBay",
   "shop_name": "eBay",
   "delivery_new_style": false,
   "use_stock_currency": false,
   "use_variants": false
 }

Params:

NameTypeAttributeDescription
options Object
options.token string

Required, access token for shop

options.url string

Required, shop url

options.marketplaceid number | string

Required, marketplace id

options.marketplace object

Required, marketplace

id Number | String

Required, app id

Return:

Promise

public editMenu(options: Object, id: Number | String): Promise source

import {editMenu} from 'insales/lib/api/menu.js'

PUT /admin/menus/{menu_id}.json

Examples:

 insales.editMenu({
   token: '1234567890',
   url: 'shop-test.myinsales.ru',
   menuid: '1',
   menu: {
     "menu": {
       "name": "Bottom menu"
     }
   }
 }).then(response => {
   console.info(response.data);
 }).catch(err => {
   console.error(err);
 });

Output:

 {
   "id": 1,
   "name": "Bottom menu",
   "handle": "main",
   "used_in_theme": false
 }

Params:

NameTypeAttributeDescription
options Object
options.token string

Required, access token for shop

options.url string

Required, shop url

options.menuid number | string

Required, menu id

options.menu object

Required, menu

id Number | String

Required, app id

Return:

Promise

public editMenuItem(options: Object, id: Number | String): Promise source

import {editMenuItem} from 'insales/lib/api/menuitem.js'

PUT /admin/menus/{menu_id}/items/{item_id}.json

Examples:

 insales.editMenuItem({
   token: '1234567890',
   url: 'shop-test.myinsales.ru',
   menuid: '1',
   itemid: '1',
   menuitem: {
     "menu_item": {
       "title": "last menu item",
       "position": 1000
     }
   }
 }).then(response => {
   console.info(response.data);
 }).catch(err => {
   console.error(err);
 });

Output:

 {
   "id": 1,
   "position": 1000,
   "title": "last menu item",
   "url": "/about",
   "related_object_id": "Page_0"
 }

Params:

NameTypeAttributeDescription
options Object
options.token string

Required, access token for shop

options.url string

Required, shop url

options.menuid number | string

Required, menu id

options.itemid number | string

Required, menu item id

options.menuitem object

Required, menu item

id Number | String

Required, app id

Return:

Promise

public editOAuthApp(options: Object, id: Number | String): Promise source

import {editOAuthApp} from 'insales/lib/api/oauthapp.js'

PUT /admin/o_auth_apps/{o_auth_app_id}.json

Examples:

 insales.editOAuthApp({
   token: '1234567890',
   url: 'shop-test.myinsales.ru',
   oauthappid: '10',
   oauthapp: {
     "o_auth_app": {
       "provider_handle": "new name provider"
     }
   }
 }).then(response => {
   console.info(response.data);
 }).catch(err => {
   console.error(err);
 });

Output:

 {
   "client_id": "953",
   "client_secret": "NdsaPd",
   "provider": "new name provider",
   "issuer": "/.well-known/openid-configuration",
   "id": 10,
   "enabled": true
 }

Params:

NameTypeAttributeDescription
options Object
options.token string

Required, access token for shop

options.url string

Required, shop url

options.oauthappid number | string

Required, oauth app id

options.oauthapp object

Required, oauth app

id Number | String

Required, app id

Return:

Promise

public editOptionName(options: Object, id: Number | String): Promise source

import {editOptionName} from 'insales/lib/api/optionname.js'

PUT /admin/option_names/{option_name_id}.json

Examples:

 insales.editOptionName({
   token: '1234567890',
   url: 'shop-test.myinsales.ru',
   optionnameid: '1',
   optionname: {
     "option_name": {
       "title": "Type",
       "position": 2,
       "navigational": false
     }
   }
 }).then(response => {
   console.info(response.data);
 }).catch(err => {
   console.error(err);
 });

Output:

 {
   "id": 1,
   "position": 2,
   "navigational": false,
   "permalink": "type",
   "title": "Type",
   "api_permalink": "o-type"
 }

Params:

NameTypeAttributeDescription
options Object
options.token string

Required, access token for shop

options.url string

Required, shop url

options.optionnameid number | string

Required, option name id

options.optionname object

Required, option name

id Number | String

Required, app id

Return:

Promise

public editOptionValue(options: Object, id: Number | String): Promise source

import {editOptionValue} from 'insales/lib/api/optionvalue.js'

PUT /admin/option_names/{option_name_id}/option_values/{option_value_id}.json

Examples:

 insales.editOptionValue({
   token: '1234567890',
   url: 'shop-test.myinsales.ru',
   optionnameid: '1',
   optionvalueid: '2',
   optionvalue: {
     "option_value": {
       "position": 3,
       "image": {
         "src": "https://abc.myinsales.ru/images/no_image_compact.jpg"
       }
     }
   }
 }).then(response => {
   console.info(response.data);
 }).catch(err => {
   console.error(err);
 });

Output:

 {
   "id": 2,
   "option_name_id": 1,
   "position": 3,
   "title": "Зеленый",
   "image_url": "http://minio.insales.io:9000/insales-test-sber/images/option_values/1/2/2/thumb/no_image_compact.jpg?1792613669",
   "permalink": "zelenyy"
 }

Params:

NameTypeAttributeDescription
options Object
options.token string

Required, access token for shop

options.url string

Required, shop url

options.optionnameid number | string

Required, option name id

options.optionvalueid number | string

Required, option value id

options.optionvalue object

Required, option value

id Number | String

Required, app id

Return:

Promise

public editOrder(options: Object, id: Number | String): Promise source

import {editOrder} from 'insales/lib/api/order.js'

PUT /admin/orders/{order_id}.json

Examples:

 insales.editOrder({
   token: '1234567890',
   url: 'shop-test.myinsales.ru',
   orderid: '1',
   order: {
     "order": {
       "client_attributes": {
         "id": 2,
         "name": "Ivan",
         "email": "ivan@example.com",
         "phone": "79111113344",
         "fields_values_attributes": [
           {
             "field_id": 800,
             "value": "new!"
           }
         ]
       },
       "delivery_variant_id": 4,
       "payment_gateway_id": 4,
       "coupon": "20% discount",
       "comment": "Please call from 9 to 18",
       "manager_comment": "New client",
       "financial_status": "paid",
       "fields_values_attributes": [
         {
           "handle": "my_awesome_field",
           "value": "new value"
         }
       ],
       "shipping_address_attributes": {
         "fields_values_attributes": [
           {
             "field_id": 808,
             "value": "new value!"
           }
         ]
       },
       "warehouse_id": 89
     }
   }
 }).then(response => {
   console.info(response.data);
 }).catch(err => {
   console.error(err);
 });

Output:

 {
   "fields_values": [
     {
       "id": 507,
       "value": "new value",
       "created_at": "2026-10-21T23:27:45.398+03:00",
       "updated_at": "2026-10-21T23:27:45.790+03:00",
       "field_id": 816,
       "type": "Текст",
       "name": "special",
       "handle": "my_awesome_field"
     }
   ],
   "order_lines": [
     {
       "id": 1,
       "order_id": 1,
       "sale_price": 300,
       "full_sale_price": 240,
       "total_price": 300,
       "full_total_price": 240,
       "discounts_amount": 60,
       "quantity": 1,
       "reserved_quantity": null,
       "weight": null,
       "dimensions": null,
       "variant_id": 1,
       "product_id": 1,
       "sku": "423",
       "barcode": null,
       "title": "Cool t-shirt",
       "unit": "pce",
       "comment": null,
       "updated_at": "2009-03-18T10:53:15.000+03:00",
       "created_at": "2009-03-18T10:53:14.000+03:00",
       "bundle_id": null,
       "vat": -1,
       "fiscal_product_type": 1,
       "requires_marking": null,
       "marking_codes": [
         "code1",
         "code2"
       ],
       "accessory_lines": [],
       "external_variant_id": null
     },
     {
       "id": 2,
       "order_id": 1,
       "sale_price": 600,
       "full_sale_price": 480,
       "total_price": 1200,
       "full_total_price": 960,
       "discounts_amount": 240,
       "quantity": 2,
       "reserved_quantity": null,
       "weight": "0.3",
       "dimensions": null,
       "variant_id": 2,
       "product_id": 2,
       "sku": "424",
       "barcode": null,
       "title": "shirt",
       "unit": "pce",
       "comment": null,
       "updated_at": "2009-03-18T10:53:15.000+03:00",
       "created_at": "2009-03-18T10:53:14.000+03:00",
       "bundle_id": null,
       "vat": 20,
       "fiscal_product_type": 1,
       "requires_marking": null,
       "marking_codes": null,
       "accessory_lines": [],
       "external_variant_id": null
     }
   ],
   "order_changes": [],
   "discount": {
     "id": 91,
     "description": "Скидка по купону 20% discount",
     "warning": null,
     "type_id": 1,
     "amount": 300,
     "full_amount": 300,
     "percent": "20.0",
     "discount": "20.0",
     "reference_id": 220,
     "reference_type": "DiscountCode",
     "discount_products_ids": [],
     "discount_order_lines_ids": [],
     "discount_code_id": 220,
     "created_at": "2026-10-21T23:27:45.000+03:00",
     "updated_at": "2026-10-21T23:27:45.000+03:00"
   },
   "shipping_address": {
     "id": 1,
     "fields_values": [
       {
         "id": 499,
         "value": "new value!",
         "created_at": "2026-10-21T23:27:45.356+03:00",
         "updated_at": "2026-10-21T23:27:45.799+03:00",
         "field_id": 808,
         "type": "Текст",
         "name": "special",
         "handle": null
       }
     ],
     "name": "Tom Dellay",
     "surname": null,
     "middlename": null,
     "phone": "+74952128506",
     "formatted_phone": "+7(495)212-85-06",
     "full_name": "Tom Dellay",
     "full_locality_name": "",
     "full_delivery_address": "123456, state, London, address, new value!",
     "address_for_gis": "123456, state, London, address",
     "location_valid": true,
     "recipient_fields": [
       {
         "id": 11,
         "destiny": 2,
         "position": 1,
         "office_title": "Имя",
         "for_buyer": true,
         "obligatory": true,
         "active": true,
         "system_name": "name",
         "created_at": "2010-10-12T13:31:09.692+04:00",
         "updated_at": "2010-10-12T13:31:09.692+04:00",
         "show_in_result": true,
         "show_in_checkout": true,
         "is_indexed": null,
         "hide_in_backoffice": null,
         "handle": null,
         "placeholder": null,
         "title": null,
         "example": null,
         "type": "Field::ObligatoryTextField"
       },
       {
         "id": 12,
         "destiny": 2,
         "position": 2,
         "office_title": "Телефон",
         "for_buyer": true,
         "obligatory": true,
         "active": true,
         "system_name": "phone",
         "created_at": "2010-10-12T13:31:09.692+04:00",
         "updated_at": "2010-10-12T13:31:09.692+04:00",
         "show_in_result": true,
         "show_in_checkout": true,
         "is_indexed": null,
         "hide_in_backoffice": null,
         "handle": null,
         "placeholder": null,
         "title": null,
         "example": null,
         "type": "Field::Phone"
       }
     ],
     "backoffice_fields": [
       {
         "id": 4,
         "destiny": 1,
         "position": 3,
         "office_title": "Адрес",
         "for_buyer": true,
         "obligatory": false,
         "active": true,
         "system_name": "address",
         "created_at": "2010-10-12T13:31:09.692+04:00",
         "updated_at": "2010-10-12T13:31:09.692+04:00",
         "show_in_result": true,
         "show_in_checkout": true,
         "is_indexed": null,
         "hide_in_backoffice": null,
         "handle": null,
         "placeholder": null,
         "title": null,
         "example": null,
         "type": "Field::SystemTextArea"
       },
       {
         "id": 808,
         "destiny": 1,
         "position": 22,
         "office_title": "special",
         "for_buyer": true,
         "obligatory": false,
         "active": true,
         "system_name": null,
         "created_at": "2026-10-21T23:27:45.344+03:00",
         "updated_at": "2026-10-21T23:27:45.344+03:00",
         "show_in_result": true,
         "show_in_checkout": true,
         "is_indexed": null,
         "hide_in_backoffice": null,
         "handle": null,
         "placeholder": null,
         "title": "special",
         "example": null,
         "type": "Field::TextField"
       },
       {
         "id": 1,
         "destiny": 1,
         "position": 0,
         "office_title": "Страна",
         "for_buyer": true,
         "obligatory": false,
         "active": false,
         "system_name": "country",
         "created_at": "2010-10-12T13:31:09.692+04:00",
         "updated_at": "2010-10-12T13:31:09.692+04:00",
         "show_in_result": true,
         "show_in_checkout": true,
         "is_indexed": null,
         "hide_in_backoffice": null,
         "handle": null,
         "placeholder": null,
         "title": null,
         "example": null,
         "type": "Field::Country"
       },
       {
         "id": 2,
         "destiny": 1,
         "position": 1,
         "office_title": "Регион",
         "for_buyer": true,
         "obligatory": false,
         "active": false,
         "system_name": "state",
         "created_at": "2010-10-12T13:31:09.692+04:00",
         "updated_at": "2010-10-12T13:31:09.692+04:00",
         "show_in_result": true,
         "show_in_checkout": true,
         "is_indexed": null,
         "hide_in_backoffice": null,
         "handle": null,
         "placeholder": null,
         "title": null,
         "example": null,
         "type": "Field::SystemTextField"
       },
       {
         "id": 3,
         "destiny": 1,
         "position": 2,
         "office_title": "Город",
         "for_buyer": true,
         "obligatory": false,
         "active": false,
         "system_name": "city",
         "created_at": "2010-10-12T13:31:09.692+04:00",
         "updated_at": "2010-10-12T13:31:09.692+04:00",
         "show_in_result": true,
         "show_in_checkout": true,
         "is_indexed": null,
         "hide_in_backoffice": null,
         "handle": null,
         "placeholder": null,
         "title": null,
         "example": null,
         "type": "Field::SystemTextField"
       },
       {
         "id": 5,
         "destiny": 1,
         "position": 4,
         "office_title": "Почтовый индекс",
         "for_buyer": true,
         "obligatory": false,
         "active": false,
         "system_name": "zip",
         "created_at": "2010-10-12T13:31:09.692+04:00",
         "updated_at": "2010-10-12T13:31:09.692+04:00",
         "show_in_result": true,
         "show_in_checkout": true,
         "is_indexed": null,
         "hide_in_backoffice": null,
         "handle": null,
         "placeholder": null,
         "title": null,
         "example": null,
         "type": "Field::SystemTextField"
       }
     ],
     "no_delivery": false,
     "kladr_autodetected_address": "",
     "country_options": [
       {
         "code": "RU",
         "title": "Россия",
         "selected": true
       }
     ],
     "address": "address",
     "country": "RU",
     "state": "state",
     "city": "London",
     "zip": "123456",
     "street": null,
     "house": null,
     "flat": null,
     "entrance": null,
     "doorphone": null,
     "floor": null,
     "comment": null,
     "kladr_json": null,
     "location": {
       "kladr_code": null,
       "zip": "123456",
       "kladr_zip": null,
       "region_zip": null,
       "country": "RU",
       "state": "state",
       "state_type": null,
       "area": null,
       "area_type": null,
       "city": "London",
       "city_type": null,
       "settlement": null,
       "settlement_type": null,
       "address": "address",
       "street": "address",
       "street_type": null,
       "house": null,
       "flat": null,
       "is_kladr": false,
       "latitude": null,
       "longitude": null,
       "autodetected": null
     }
   },
   "client": {
     "id": 2,
     "email": "ivan@example.com",
     "name": "Ivan",
     "phone": "79111113344",
     "created_at": "2009-03-30T04:37:32.000+04:00",
     "updated_at": "2026-10-21T23:27:45.000+03:00",
     "comment": null,
     "registered": false,
     "subscribe": true,
     "client_group_id": null,
     "bonus_points": 0,
     "type": "Client::Individual",
     "correspondent_account": null,
     "settlement_account": null,
     "consent_to_personal_data": null,
     "o_auth_provider": null,
     "messenger_subscription": null,
     "external_id": null,
     "external_service": null,
     "contact_name": "Ivan",
     "surname": null,
     "middlename": null,
     "progressive_discount": null,
     "group_discount": null,
     "ip_addr": "",
     "fields_values": [
       {
         "id": 491,
         "value": "new!",
         "created_at": "2026-10-21T23:27:45.326+03:00",
         "updated_at": "2026-10-21T23:27:45.700+03:00",
         "field_id": 800,
         "type": "Текст",
         "name": "special",
         "handle": null
       }
     ]
   },
   "discounts": [
     {
       "id": 91,
       "description": "Скидка по купону 20% discount",
       "warning": null,
       "type_id": 1,
       "amount": 300,
       "full_amount": 300,
       "percent": "20.0",
       "discount": "20.0",
       "reference_id": 220,
       "reference_type": "DiscountCode",
       "discount_products_ids": [],
       "discount_order_lines_ids": [],
       "discount_code_id": 220,
       "created_at": "2026-10-21T23:27:45.000+03:00",
       "updated_at": "2026-10-21T23:27:45.000+03:00"
     }
   ],
   "total_price": 1200,
   "paid_amount": 1500,
   "items_price": 1200,
   "id": 1,
   "key": "teest",
   "number": 1001,
   "comment": "Please call from 9 to 18",
   "archived": false,
   "delivery_title": "Внешний",
   "delivery_description": "Внешний (Внешний способ)",
   "delivery_price": 0,
   "full_delivery_price": 0,
   "payment_description": null,
   "payment_title": "Выставление счета для юр. лиц 2.",
   "first_referer": "http://google.com?q=my_query",
   "first_current_location": "/my_query",
   "first_query": null,
   "first_source_domain": null,
   "first_source": "Google",
   "referer": "http://yandex.ru/yandsearch?text=%D1%81%D0%BF%D0%B0%D0%BB%D1%8C%D0%BD%D1%8B%D0%B5+%D0%BC%D0%B5%D1%88%D0%BA%D0%B8&stpar2=%2Fh1%2Ftm7%2Fs1&stpar4=%2Fs1&stpar1=%2Fu1&stpar3=%2Fm3%2Ftc14%2Fnc1",
   "current_location": "/",
   "query": null,
   "source_domain": null,
   "source": "Прямой трафик",
   "fulfillment_status": "new",
   "custom_status": {
     "permalink": "new",
     "title": "Новый"
   },
   "delivered_at": null,
   "accepted_at": null,
   "created_at": "2009-03-18T10:53:14.000+03:00",
   "updated_at": "2026-10-21T23:27:45.000+03:00",
   "financial_status": "paid",
   "delivery_date": null,
   "delivery_from_hour": null,
   "delivery_from_minutes": null,
   "delivery_to_hour": null,
   "delivery_to_minutes": null,
   "delivery_time": "",
   "paid_at": "2026-10-21T23:27:45.000+03:00",
   "delivery_variant_id": 4,
   "payment_gateway_id": 4,
   "margin": "0.0",
   "margin_amount": "0.0",
   "client_transaction_id": 1,
   "yandex_metrika_client_id": null,
   "currency_code": "RUR",
   "cookies": null,
   "account_id": 1,
   "manager_comment": "New client",
   "locale": "ru",
   "delivery_info": {
     "delivery_variant_id": 4,
     "tariff_id": null,
     "title": null,
     "description": null,
     "price": 0,
     "shipping_company": null,
     "shipping_company_handle": null,
     "delivery_interval": {
       "min_days": null,
       "max_days": null,
       "description": ""
     },
     "errors": [],
     "warnings": [],
     "outlet": {
       "id": null,
       "external_id": null,
       "latitude": null,
       "longitude": null,
       "type": null,
       "title": null,
       "description": null,
       "address": null,
       "payment_method": [],
       "source_id": null
     },
     "not_available": null
   },
   "responsible_user_id": null,
   "total_profit": "1200.0",
   "warehouse_id": 89
 }

 insales.editOrder({
   token: '1234567890',
   url: 'shop-test.myinsales.ru',
   orderid: '1',
   order: {
     "order": {
       "custom_status_permalink": "v-obrabotke"
     }
   }
 }).then(response => {
   console.info(response.data);
 }).catch(err => {
   console.error(err);
 });

Output:

 {
   "fields_values": [
     {
       "id": 531,
       "value": "old value",
       "created_at": "2026-10-21T23:27:46.150+03:00",
       "updated_at": "2026-10-21T23:27:46.150+03:00",
       "field_id": 840,
       "type": "Текст",
       "name": "special",
       "handle": "my_awesome_field"
     }
   ],
   "order_lines": [
     {
       "id": 1,
       "order_id": 1,
       "sale_price": 300,
       "full_sale_price": 300,
       "total_price": 300,
       "full_total_price": 300,
       "discounts_amount": 0,
       "quantity": 1,
       "reserved_quantity": null,
       "weight": null,
       "dimensions": null,
       "variant_id": 1,
       "product_id": 1,
       "sku": "423",
       "barcode": null,
       "title": "Cool t-shirt",
       "unit": "pce",
       "comment": null,
       "updated_at": "2009-03-18T10:53:15.000+03:00",
       "created_at": "2009-03-18T10:53:14.000+03:00",
       "bundle_id": null,
       "vat": -1,
       "fiscal_product_type": 1,
       "requires_marking": null,
       "marking_codes": [
         "code1",
         "code2"
       ],
       "accessory_lines": [],
       "external_variant_id": null
     },
     {
       "id": 2,
       "order_id": 1,
       "sale_price": 600,
       "full_sale_price": 600,
       "total_price": 1200,
       "full_total_price": 1200,
       "discounts_amount": 0,
       "quantity": 2,
       "reserved_quantity": null,
       "weight": "0.3",
       "dimensions": null,
       "variant_id": 2,
       "product_id": 2,
       "sku": "424",
       "barcode": null,
       "title": "shirt",
       "unit": "pce",
       "comment": null,
       "updated_at": "2009-03-18T10:53:15.000+03:00",
       "created_at": "2009-03-18T10:53:14.000+03:00",
       "bundle_id": null,
       "vat": 20,
       "fiscal_product_type": 1,
       "requires_marking": null,
       "marking_codes": null,
       "accessory_lines": [],
       "external_variant_id": null
     }
   ],
   "order_changes": [],
   "discount": null,
   "shipping_address": {
     "id": 1,
     "fields_values": [
       {
         "id": 523,
         "value": "old value",
         "created_at": "2026-10-21T23:27:46.109+03:00",
         "updated_at": "2026-10-21T23:27:46.109+03:00",
         "field_id": 832,
         "type": "Текст",
         "name": "special",
         "handle": null
       }
     ],
     "name": "Tom Dellay",
     "surname": null,
     "middlename": null,
     "phone": "+7(495)212-85-06",
     "formatted_phone": "+7(495)212-85-06",
     "full_name": "Tom Dellay",
     "full_locality_name": null,
     "full_delivery_address": "123456, state, London, address, old value",
     "address_for_gis": "123456, state, London, address",
     "location_valid": true,
     "recipient_fields": [
       {
         "id": 11,
         "destiny": 2,
         "position": 1,
         "office_title": "Имя",
         "for_buyer": true,
         "obligatory": true,
         "active": true,
         "system_name": "name",
         "created_at": "2010-10-12T13:31:09.692+04:00",
         "updated_at": "2010-10-12T13:31:09.692+04:00",
         "show_in_result": true,
         "show_in_checkout": true,
         "is_indexed": null,
         "hide_in_backoffice": null,
         "handle": null,
         "placeholder": null,
         "title": null,
         "example": null,
         "type": "Field::ObligatoryTextField"
       },
       {
         "id": 12,
         "destiny": 2,
         "position": 2,
         "office_title": "Телефон",
         "for_buyer": true,
         "obligatory": true,
         "active": true,
         "system_name": "phone",
         "created_at": "2010-10-12T13:31:09.692+04:00",
         "updated_at": "2010-10-12T13:31:09.692+04:00",
         "show_in_result": true,
         "show_in_checkout": true,
         "is_indexed": null,
         "hide_in_backoffice": null,
         "handle": null,
         "placeholder": null,
         "title": null,
         "example": null,
         "type": "Field::Phone"
       }
     ],
     "backoffice_fields": [
       {
         "id": 4,
         "destiny": 1,
         "position": 3,
         "office_title": "Адрес",
         "for_buyer": true,
         "obligatory": false,
         "active": true,
         "system_name": "address",
         "created_at": "2010-10-12T13:31:09.692+04:00",
         "updated_at": "2010-10-12T13:31:09.692+04:00",
         "show_in_result": true,
         "show_in_checkout": true,
         "is_indexed": null,
         "hide_in_backoffice": null,
         "handle": null,
         "placeholder": null,
         "title": null,
         "example": null,
         "type": "Field::SystemTextArea"
       },
       {
         "id": 832,
         "destiny": 1,
         "position": 22,
         "office_title": "special",
         "for_buyer": true,
         "obligatory": false,
         "active": true,
         "system_name": null,
         "created_at": "2026-10-21T23:27:46.096+03:00",
         "updated_at": "2026-10-21T23:27:46.096+03:00",
         "show_in_result": true,
         "show_in_checkout": true,
         "is_indexed": null,
         "hide_in_backoffice": null,
         "handle": null,
         "placeholder": null,
         "title": "special",
         "example": null,
         "type": "Field::TextField"
       },
       {
         "id": 1,
         "destiny": 1,
         "position": 0,
         "office_title": "Страна",
         "for_buyer": true,
         "obligatory": false,
         "active": false,
         "system_name": "country",
         "created_at": "2010-10-12T13:31:09.692+04:00",
         "updated_at": "2010-10-12T13:31:09.692+04:00",
         "show_in_result": true,
         "show_in_checkout": true,
         "is_indexed": null,
         "hide_in_backoffice": null,
         "handle": null,
         "placeholder": null,
         "title": null,
         "example": null,
         "type": "Field::Country"
       },
       {
         "id": 2,
         "destiny": 1,
         "position": 1,
         "office_title": "Регион",
         "for_buyer": true,
         "obligatory": false,
         "active": false,
         "system_name": "state",
         "created_at": "2010-10-12T13:31:09.692+04:00",
         "updated_at": "2010-10-12T13:31:09.692+04:00",
         "show_in_result": true,
         "show_in_checkout": true,
         "is_indexed": null,
         "hide_in_backoffice": null,
         "handle": null,
         "placeholder": null,
         "title": null,
         "example": null,
         "type": "Field::SystemTextField"
       },
       {
         "id": 3,
         "destiny": 1,
         "position": 2,
         "office_title": "Город",
         "for_buyer": true,
         "obligatory": false,
         "active": false,
         "system_name": "city",
         "created_at": "2010-10-12T13:31:09.692+04:00",
         "updated_at": "2010-10-12T13:31:09.692+04:00",
         "show_in_result": true,
         "show_in_checkout": true,
         "is_indexed": null,
         "hide_in_backoffice": null,
         "handle": null,
         "placeholder": null,
         "title": null,
         "example": null,
         "type": "Field::SystemTextField"
       },
       {
         "id": 5,
         "destiny": 1,
         "position": 4,
         "office_title": "Почтовый индекс",
         "for_buyer": true,
         "obligatory": false,
         "active": false,
         "system_name": "zip",
         "created_at": "2010-10-12T13:31:09.692+04:00",
         "updated_at": "2010-10-12T13:31:09.692+04:00",
         "show_in_result": true,
         "show_in_checkout": true,
         "is_indexed": null,
         "hide_in_backoffice": null,
         "handle": null,
         "placeholder": null,
         "title": null,
         "example": null,
         "type": "Field::SystemTextField"
       }
     ],
     "no_delivery": false,
     "kladr_autodetected_address": "",
     "country_options": [
       {
         "code": "RU",
         "title": "Россия",
         "selected": true
       }
     ],
     "address": "address",
     "country": "RU",
     "state": "state",
     "city": "London",
     "zip": "123456",
     "street": null,
     "house": null,
     "flat": null,
     "entrance": null,
     "doorphone": null,
     "floor": null,
     "comment": null,
     "kladr_json": null,
     "location": {
       "kladr_code": null,
       "zip": "123456",
       "kladr_zip": null,
       "region_zip": null,
       "country": "RU",
       "state": "state",
       "state_type": null,
       "area": null,
       "area_type": null,
       "city": "London",
       "city_type": null,
       "settlement": null,
       "settlement_type": null,
       "address": "address",
       "street": "address",
       "street_type": null,
       "house": null,
       "flat": null,
       "is_kladr": false,
       "latitude": null,
       "longitude": null,
       "autodetected": null
     }
   },
   "client": {
     "id": 2,
     "email": "some-one@yandex.ru",
     "name": "Mortimer Hant",
     "phone": "+79162128506",
     "created_at": "2009-03-30T04:37:32.000+04:00",
     "updated_at": "2026-10-21T23:27:46.000+03:00",
     "comment": null,
     "registered": false,
     "subscribe": true,
     "client_group_id": null,
     "bonus_points": 0,
     "type": "Client::Individual",
     "correspondent_account": null,
     "settlement_account": null,
     "consent_to_personal_data": null,
     "o_auth_provider": null,
     "messenger_subscription": null,
     "external_id": null,
     "external_service": null,
     "contact_name": "Mortimer Hant",
     "surname": null,
     "middlename": null,
     "progressive_discount": null,
     "group_discount": null,
     "ip_addr": "",
     "fields_values": [
       {
         "id": 515,
         "value": "old value",
         "created_at": "2026-10-21T23:27:46.078+03:00",
         "updated_at": "2026-10-21T23:27:46.078+03:00",
         "field_id": 824,
         "type": "Текст",
         "name": "special",
         "handle": null
       }
     ]
   },
   "discounts": [],
   "total_price": 1600,
   "paid_amount": 0,
   "items_price": 1500,
   "id": 1,
   "key": "teest",
   "number": 1001,
   "comment": "comment",
   "archived": false,
   "delivery_title": "самовывоз",
   "delivery_description": "самовывоз",
   "delivery_price": 100,
   "full_delivery_price": 100,
   "payment_description": null,
   "payment_title": "наличными курьеру",
   "first_referer": "http://google.com?q=my_query",
   "first_current_location": "/my_query",
   "first_query": null,
   "first_source_domain": null,
   "first_source": "Google",
   "referer": "http://yandex.ru/yandsearch?text=%D1%81%D0%BF%D0%B0%D0%BB%D1%8C%D0%BD%D1%8B%D0%B5+%D0%BC%D0%B5%D1%88%D0%BA%D0%B8&stpar2=%2Fh1%2Ftm7%2Fs1&stpar4=%2Fs1&stpar1=%2Fu1&stpar3=%2Fm3%2Ftc14%2Fnc1",
   "current_location": "/",
   "query": null,
   "source_domain": null,
   "source": "Прямой трафик",
   "fulfillment_status": "accepted",
   "custom_status": {
     "permalink": "accepted",
     "title": "В обработке"
   },
   "delivered_at": null,
   "accepted_at": "2026-10-21T23:27:46.000+03:00",
   "created_at": "2009-03-18T10:53:14.000+03:00",
   "updated_at": "2026-10-21T23:27:46.000+03:00",
   "financial_status": "pending",
   "delivery_date": null,
   "delivery_from_hour": null,
   "delivery_from_minutes": null,
   "delivery_to_hour": null,
   "delivery_to_minutes": null,
   "delivery_time": "",
   "paid_at": null,
   "delivery_variant_id": 1,
   "payment_gateway_id": 1,
   "margin": "0.0",
   "margin_amount": "0.0",
   "client_transaction_id": 1,
   "yandex_metrika_client_id": null,
   "currency_code": "RUR",
   "cookies": null,
   "account_id": 1,
   "manager_comment": "manager comment1",
   "locale": "ru",
   "delivery_info": {
     "delivery_variant_id": null,
     "tariff_id": null,
     "title": null,
     "description": null,
     "price": null,
     "shipping_company": null,
     "shipping_company_handle": null,
     "delivery_interval": {
       "min_days": null,
       "max_days": null,
       "description": ""
     },
     "errors": [],
     "warnings": [],
     "outlet": {
       "id": null,
       "external_id": null,
       "latitude": null,
       "longitude": null,
       "type": null,
       "title": null,
       "description": null,
       "address": null,
       "payment_method": null,
       "source_id": null
     },
     "not_available": null
   },
   "responsible_user_id": null,
   "total_profit": "1500.0",
   "warehouse_id": null
 }

 insales.editOrder({
   token: '1234567890',
   url: 'shop-test.myinsales.ru',
   orderid: '1',
   order: {
     "order": {
       "order_lines_attributes": [
         {
           "variant_id": 1,
           "quantity": 1,
           "vat": -1
         }
       ]
     }
   }
 }).then(response => {
   console.info(response.data);
 }).catch(err => {
   console.error(err);
 });

Output:

 {
   "fields_values": [
     {
       "id": 555,
       "value": "old value",
       "created_at": "2026-10-21T23:27:46.747+03:00",
       "updated_at": "2026-10-21T23:27:46.747+03:00",
       "field_id": 864,
       "type": "Текст",
       "name": "special",
       "handle": "my_awesome_field"
     }
   ],
   "order_lines": [
     {
       "id": 39,
       "order_id": 1,
       "sale_price": 300,
       "full_sale_price": 300,
       "total_price": 300,
       "full_total_price": 300,
       "discounts_amount": 0,
       "quantity": 1,
       "reserved_quantity": null,
       "weight": null,
       "dimensions": "10x20x30",
       "variant_id": 1,
       "product_id": 1,
       "sku": "423",
       "barcode": null,
       "title": "Cool t-shirt (Red)",
       "unit": "pce",
       "comment": null,
       "updated_at": "2026-10-21T23:27:47.000+03:00",
       "created_at": "2026-10-21T23:27:47.000+03:00",
       "bundle_id": null,
       "vat": -1,
       "fiscal_product_type": 1,
       "requires_marking": null,
       "marking_codes": null,
       "accessory_lines": [],
       "external_variant_id": null
     }
   ],
   "order_changes": [],
   "discount": null,
   "shipping_address": {
     "id": 1,
     "fields_values": [
       {
         "id": 547,
         "value": "old value",
         "created_at": "2026-10-21T23:27:46.706+03:00",
         "updated_at": "2026-10-21T23:27:46.706+03:00",
         "field_id": 856,
         "type": "Текст",
         "name": "special",
         "handle": null
       }
     ],
     "name": "Tom Dellay",
     "surname": null,
     "middlename": null,
     "phone": "+7(495)212-85-06",
     "formatted_phone": "+7(495)212-85-06",
     "full_name": "Tom Dellay",
     "full_locality_name": null,
     "full_delivery_address": "123456, state, London, address, old value",
     "address_for_gis": "123456, state, London, address",
     "location_valid": true,
     "recipient_fields": [
       {
         "id": 11,
         "destiny": 2,
         "position": 1,
         "office_title": "Имя",
         "for_buyer": true,
         "obligatory": true,
         "active": true,
         "system_name": "name",
         "created_at": "2010-10-12T13:31:09.692+04:00",
         "updated_at": "2010-10-12T13:31:09.692+04:00",
         "show_in_result": true,
         "show_in_checkout": true,
         "is_indexed": null,
         "hide_in_backoffice": null,
         "handle": null,
         "placeholder": null,
         "title": null,
         "example": null,
         "type": "Field::ObligatoryTextField"
       },
       {
         "id": 12,
         "destiny": 2,
         "position": 2,
         "office_title": "Телефон",
         "for_buyer": true,
         "obligatory": true,
         "active": true,
         "system_name": "phone",
         "created_at": "2010-10-12T13:31:09.692+04:00",
         "updated_at": "2010-10-12T13:31:09.692+04:00",
         "show_in_result": true,
         "show_in_checkout": true,
         "is_indexed": null,
         "hide_in_backoffice": null,
         "handle": null,
         "placeholder": null,
         "title": null,
         "example": null,
         "type": "Field::Phone"
       }
     ],
     "backoffice_fields": [
       {
         "id": 4,
         "destiny": 1,
         "position": 3,
         "office_title": "Адрес",
         "for_buyer": true,
         "obligatory": false,
         "active": true,
         "system_name": "address",
         "created_at": "2010-10-12T13:31:09.692+04:00",
         "updated_at": "2010-10-12T13:31:09.692+04:00",
         "show_in_result": true,
         "show_in_checkout": true,
         "is_indexed": null,
         "hide_in_backoffice": null,
         "handle": null,
         "placeholder": null,
         "title": null,
         "example": null,
         "type": "Field::SystemTextArea"
       },
       {
         "id": 856,
         "destiny": 1,
         "position": 22,
         "office_title": "special",
         "for_buyer": true,
         "obligatory": false,
         "active": true,
         "system_name": null,
         "created_at": "2026-10-21T23:27:46.693+03:00",
         "updated_at": "2026-10-21T23:27:46.693+03:00",
         "show_in_result": true,
         "show_in_checkout": true,
         "is_indexed": null,
         "hide_in_backoffice": null,
         "handle": null,
         "placeholder": null,
         "title": "special",
         "example": null,
         "type": "Field::TextField"
       },
       {
         "id": 1,
         "destiny": 1,
         "position": 0,
         "office_title": "Страна",
         "for_buyer": true,
         "obligatory": false,
         "active": false,
         "system_name": "country",
         "created_at": "2010-10-12T13:31:09.692+04:00",
         "updated_at": "2010-10-12T13:31:09.692+04:00",
         "show_in_result": true,
         "show_in_checkout": true,
         "is_indexed": null,
         "hide_in_backoffice": null,
         "handle": null,
         "placeholder": null,
         "title": null,
         "example": null,
         "type": "Field::Country"
       },
       {
         "id": 2,
         "destiny": 1,
         "position": 1,
         "office_title": "Регион",
         "for_buyer": true,
         "obligatory": false,
         "active": false,
         "system_name": "state",
         "created_at": "2010-10-12T13:31:09.692+04:00",
         "updated_at": "2010-10-12T13:31:09.692+04:00",
         "show_in_result": true,
         "show_in_checkout": true,
         "is_indexed": null,
         "hide_in_backoffice": null,
         "handle": null,
         "placeholder": null,
         "title": null,
         "example": null,
         "type": "Field::SystemTextField"
       },
       {
         "id": 3,
         "destiny": 1,
         "position": 2,
         "office_title": "Город",
         "for_buyer": true,
         "obligatory": false,
         "active": false,
         "system_name": "city",
         "created_at": "2010-10-12T13:31:09.692+04:00",
         "updated_at": "2010-10-12T13:31:09.692+04:00",
         "show_in_result": true,
         "show_in_checkout": true,
         "is_indexed": null,
         "hide_in_backoffice": null,
         "handle": null,
         "placeholder": null,
         "title": null,
         "example": null,
         "type": "Field::SystemTextField"
       },
       {
         "id": 5,
         "destiny": 1,
         "position": 4,
         "office_title": "Почтовый индекс",
         "for_buyer": true,
         "obligatory": false,
         "active": false,
         "system_name": "zip",
         "created_at": "2010-10-12T13:31:09.692+04:00",
         "updated_at": "2010-10-12T13:31:09.692+04:00",
         "show_in_result": true,
         "show_in_checkout": true,
         "is_indexed": null,
         "hide_in_backoffice": null,
         "handle": null,
         "placeholder": null,
         "title": null,
         "example": null,
         "type": "Field::SystemTextField"
       }
     ],
     "no_delivery": false,
     "kladr_autodetected_address": "",
     "country_options": [
       {
         "code": "RU",
         "title": "Россия",
         "selected": true
       }
     ],
     "address": "address",
     "country": "RU",
     "state": "state",
     "city": "London",
     "zip": "123456",
     "street": null,
     "house": null,
     "flat": null,
     "entrance": null,
     "doorphone": null,
     "floor": null,
     "comment": null,
     "kladr_json": null,
     "location": {
       "kladr_code": null,
       "zip": "123456",
       "kladr_zip": null,
       "region_zip": null,
       "country": "RU",
       "state": "state",
       "state_type": null,
       "area": null,
       "area_type": null,
       "city": "London",
       "city_type": null,
       "settlement": null,
       "settlement_type": null,
       "address": "address",
       "street": "address",
       "street_type": null,
       "house": null,
       "flat": null,
       "is_kladr": false,
       "latitude": null,
       "longitude": null,
       "autodetected": null
     }
   },
   "client": {
     "id": 2,
     "email": "some-one@yandex.ru",
     "name": "Mortimer Hant",
     "phone": "+79162128506",
     "created_at": "2009-03-30T04:37:32.000+04:00",
     "updated_at": "2026-10-21T23:27:46.000+03:00",
     "comment": null,
     "registered": false,
     "subscribe": true,
     "client_group_id": null,
     "bonus_points": 0,
     "type": "Client::Individual",
     "correspondent_account": null,
     "settlement_account": null,
     "consent_to_personal_data": null,
     "o_auth_provider": null,
     "messenger_subscription": null,
     "external_id": null,
     "external_service": null,
     "contact_name": "Mortimer Hant",
     "surname": null,
     "middlename": null,
     "progressive_discount": null,
     "group_discount": null,
     "ip_addr": "",
     "fields_values": [
       {
         "id": 539,
         "value": "old value",
         "created_at": "2026-10-21T23:27:46.676+03:00",
         "updated_at": "2026-10-21T23:27:46.676+03:00",
         "field_id": 848,
         "type": "Текст",
         "name": "special",
         "handle": null
       }
     ]
   },
   "discounts": [],
   "total_price": 400,
   "paid_amount": 0,
   "items_price": 300,
   "id": 1,
   "key": "teest",
   "number": 1001,
   "comment": "comment",
   "archived": false,
   "delivery_title": "самовывоз",
   "delivery_description": "самовывоз",
   "delivery_price": 100,
   "full_delivery_price": 100,
   "payment_description": null,
   "payment_title": "наличными курьеру",
   "first_referer": "http://google.com?q=my_query",
   "first_current_location": "/my_query",
   "first_query": null,
   "first_source_domain": null,
   "first_source": "Google",
   "referer": "http://yandex.ru/yandsearch?text=%D1%81%D0%BF%D0%B0%D0%BB%D1%8C%D0%BD%D1%8B%D0%B5+%D0%BC%D0%B5%D1%88%D0%BA%D0%B8&stpar2=%2Fh1%2Ftm7%2Fs1&stpar4=%2Fs1&stpar1=%2Fu1&stpar3=%2Fm3%2Ftc14%2Fnc1",
   "current_location": "/",
   "query": null,
   "source_domain": null,
   "source": "Прямой трафик",
   "fulfillment_status": "new",
   "custom_status": {
     "permalink": "new",
     "title": "Новый"
   },
   "delivered_at": null,
   "accepted_at": null,
   "created_at": "2009-03-18T10:53:14.000+03:00",
   "updated_at": "2026-10-21T23:27:47.000+03:00",
   "financial_status": "pending",
   "delivery_date": null,
   "delivery_from_hour": null,
   "delivery_from_minutes": null,
   "delivery_to_hour": null,
   "delivery_to_minutes": null,
   "delivery_time": "",
   "paid_at": null,
   "delivery_variant_id": 1,
   "payment_gateway_id": 1,
   "margin": "0.0",
   "margin_amount": "0.0",
   "client_transaction_id": 1,
   "yandex_metrika_client_id": null,
   "currency_code": "RUR",
   "cookies": null,
   "account_id": 1,
   "manager_comment": "manager comment1",
   "locale": "ru",
   "delivery_info": {
     "delivery_variant_id": null,
     "tariff_id": null,
     "title": null,
     "description": null,
     "price": null,
     "shipping_company": null,
     "shipping_company_handle": null,
     "delivery_interval": {
       "min_days": null,
       "max_days": null,
       "description": ""
     },
     "errors": [],
     "warnings": [],
     "outlet": {
       "id": null,
       "external_id": null,
       "latitude": null,
       "longitude": null,
       "type": null,
       "title": null,
       "description": null,
       "address": null,
       "payment_method": null,
       "source_id": null
     },
     "not_available": null
   },
   "responsible_user_id": null,
   "total_profit": "210.0",
   "warehouse_id": null
 }

 insales.editOrder({
   token: '1234567890',
   url: 'shop-test.myinsales.ru',
   orderid: '1',
   order: {
     "order": {
       "order_lines_attributes": [
         {
           "product_id": 1,
           "quantity": 1,
           "vat": 22
         }
       ]
     }
   }
 }).then(response => {
   console.info(response.data);
 }).catch(err => {
   console.error(err);
 });

Output:

 {
   "fields_values": [
     {
       "id": 579,
       "value": "old value",
       "created_at": "2026-10-21T23:27:47.361+03:00",
       "updated_at": "2026-10-21T23:27:47.361+03:00",
       "field_id": 888,
       "type": "Текст",
       "name": "special",
       "handle": "my_awesome_field"
     }
   ],
   "order_lines": [
     {
       "id": 40,
       "order_id": 1,
       "sale_price": 300,
       "full_sale_price": 300,
       "total_price": 300,
       "full_total_price": 300,
       "discounts_amount": 0,
       "quantity": 1,
       "reserved_quantity": null,
       "weight": null,
       "dimensions": "10x20x30",
       "variant_id": 1,
       "product_id": 1,
       "sku": "423",
       "barcode": null,
       "title": "Cool t-shirt (Red)",
       "unit": "pce",
       "comment": null,
       "updated_at": "2026-10-21T23:27:47.000+03:00",
       "created_at": "2026-10-21T23:27:47.000+03:00",
       "bundle_id": null,
       "vat": 22,
       "fiscal_product_type": 1,
       "requires_marking": null,
       "marking_codes": null,
       "accessory_lines": [],
       "external_variant_id": null
     }
   ],
   "order_changes": [],
   "discount": null,
   "shipping_address": {
     "id": 1,
     "fields_values": [
       {
         "id": 571,
         "value": "old value",
         "created_at": "2026-10-21T23:27:47.318+03:00",
         "updated_at": "2026-10-21T23:27:47.318+03:00",
         "field_id": 880,
         "type": "Текст",
         "name": "special",
         "handle": null
       }
     ],
     "name": "Tom Dellay",
     "surname": null,
     "middlename": null,
     "phone": "+7(495)212-85-06",
     "formatted_phone": "+7(495)212-85-06",
     "full_name": "Tom Dellay",
     "full_locality_name": null,
     "full_delivery_address": "123456, state, London, address, old value",
     "address_for_gis": "123456, state, London, address",
     "location_valid": true,
     "recipient_fields": [
       {
         "id": 11,
         "destiny": 2,
         "position": 1,
         "office_title": "Имя",
         "for_buyer": true,
         "obligatory": true,
         "active": true,
         "system_name": "name",
         "created_at": "2010-10-12T13:31:09.692+04:00",
         "updated_at": "2010-10-12T13:31:09.692+04:00",
         "show_in_result": true,
         "show_in_checkout": true,
         "is_indexed": null,
         "hide_in_backoffice": null,
         "handle": null,
         "placeholder": null,
         "title": null,
         "example": null,
         "type": "Field::ObligatoryTextField"
       },
       {
         "id": 12,
         "destiny": 2,
         "position": 2,
         "office_title": "Телефон",
         "for_buyer": true,
         "obligatory": true,
         "active": true,
         "system_name": "phone",
         "created_at": "2010-10-12T13:31:09.692+04:00",
         "updated_at": "2010-10-12T13:31:09.692+04:00",
         "show_in_result": true,
         "show_in_checkout": true,
         "is_indexed": null,
         "hide_in_backoffice": null,
         "handle": null,
         "placeholder": null,
         "title": null,
         "example": null,
         "type": "Field::Phone"
       }
     ],
     "backoffice_fields": [
       {
         "id": 4,
         "destiny": 1,
         "position": 3,
         "office_title": "Адрес",
         "for_buyer": true,
         "obligatory": false,
         "active": true,
         "system_name": "address",
         "created_at": "2010-10-12T13:31:09.692+04:00",
         "updated_at": "2010-10-12T13:31:09.692+04:00",
         "show_in_result": true,
         "show_in_checkout": true,
         "is_indexed": null,
         "hide_in_backoffice": null,
         "handle": null,
         "placeholder": null,
         "title": null,
         "example": null,
         "type": "Field::SystemTextArea"
       },
       {
         "id": 880,
         "destiny": 1,
         "position": 22,
         "office_title": "special",
         "for_buyer": true,
         "obligatory": false,
         "active": true,
         "system_name": null,
         "created_at": "2026-10-21T23:27:47.304+03:00",
         "updated_at": "2026-10-21T23:27:47.304+03:00",
         "show_in_result": true,
         "show_in_checkout": true,
         "is_indexed": null,
         "hide_in_backoffice": null,
         "handle": null,
         "placeholder": null,
         "title": "special",
         "example": null,
         "type": "Field::TextField"
       },
       {
         "id": 1,
         "destiny": 1,
         "position": 0,
         "office_title": "Страна",
         "for_buyer": true,
         "obligatory": false,
         "active": false,
         "system_name": "country",
         "created_at": "2010-10-12T13:31:09.692+04:00",
         "updated_at": "2010-10-12T13:31:09.692+04:00",
         "show_in_result": true,
         "show_in_checkout": true,
         "is_indexed": null,
         "hide_in_backoffice": null,
         "handle": null,
         "placeholder": null,
         "title": null,
         "example": null,
         "type": "Field::Country"
       },
       {
         "id": 2,
         "destiny": 1,
         "position": 1,
         "office_title": "Регион",
         "for_buyer": true,
         "obligatory": false,
         "active": false,
         "system_name": "state",
         "created_at": "2010-10-12T13:31:09.692+04:00",
         "updated_at": "2010-10-12T13:31:09.692+04:00",
         "show_in_result": true,
         "show_in_checkout": true,
         "is_indexed": null,
         "hide_in_backoffice": null,
         "handle": null,
         "placeholder": null,
         "title": null,
         "example": null,
         "type": "Field::SystemTextField"
       },
       {
         "id": 3,
         "destiny": 1,
         "position": 2,
         "office_title": "Город",
         "for_buyer": true,
         "obligatory": false,
         "active": false,
         "system_name": "city",
         "created_at": "2010-10-12T13:31:09.692+04:00",
         "updated_at": "2010-10-12T13:31:09.692+04:00",
         "show_in_result": true,
         "show_in_checkout": true,
         "is_indexed": null,
         "hide_in_backoffice": null,
         "handle": null,
         "placeholder": null,
         "title": null,
         "example": null,
         "type": "Field::SystemTextField"
       },
       {
         "id": 5,
         "destiny": 1,
         "position": 4,
         "office_title": "Почтовый индекс",
         "for_buyer": true,
         "obligatory": false,
         "active": false,
         "system_name": "zip",
         "created_at": "2010-10-12T13:31:09.692+04:00",
         "updated_at": "2010-10-12T13:31:09.692+04:00",
         "show_in_result": true,
         "show_in_checkout": true,
         "is_indexed": null,
         "hide_in_backoffice": null,
         "handle": null,
         "placeholder": null,
         "title": null,
         "example": null,
         "type": "Field::SystemTextField"
       }
     ],
     "no_delivery": false,
     "kladr_autodetected_address": "",
     "country_options": [
       {
         "code": "RU",
         "title": "Россия",
         "selected": true
       }
     ],
     "address": "address",
     "country": "RU",
     "state": "state",
     "city": "London",
     "zip": "123456",
     "street": null,
     "house": null,
     "flat": null,
     "entrance": null,
     "doorphone": null,
     "floor": null,
     "comment": null,
     "kladr_json": null,
     "location": {
       "kladr_code": null,
       "zip": "123456",
       "kladr_zip": null,
       "region_zip": null,
       "country": "RU",
       "state": "state",
       "state_type": null,
       "area": null,
       "area_type": null,
       "city": "London",
       "city_type": null,
       "settlement": null,
       "settlement_type": null,
       "address": "address",
       "street": "address",
       "street_type": null,
       "house": null,
       "flat": null,
       "is_kladr": false,
       "latitude": null,
       "longitude": null,
       "autodetected": null
     }
   },
   "client": {
     "id": 2,
     "email": "some-one@yandex.ru",
     "name": "Mortimer Hant",
     "phone": "+79162128506",
     "created_at": "2009-03-30T04:37:32.000+04:00",
     "updated_at": "2026-10-21T23:27:47.000+03:00",
     "comment": null,
     "registered": false,
     "subscribe": true,
     "client_group_id": null,
     "bonus_points": 0,
     "type": "Client::Individual",
     "correspondent_account": null,
     "settlement_account": null,
     "consent_to_personal_data": null,
     "o_auth_provider": null,
     "messenger_subscription": null,
     "external_id": null,
     "external_service": null,
     "contact_name": "Mortimer Hant",
     "surname": null,
     "middlename": null,
     "progressive_discount": null,
     "group_discount": null,
     "ip_addr": "",
     "fields_values": [
       {
         "id": 563,
         "value": "old value",
         "created_at": "2026-10-21T23:27:47.288+03:00",
         "updated_at": "2026-10-21T23:27:47.288+03:00",
         "field_id": 872,
         "type": "Текст",
         "name": "special",
         "handle": null
       }
     ]
   },
   "discounts": [],
   "total_price": 400,
   "paid_amount": 0,
   "items_price": 300,
   "id": 1,
   "key": "teest",
   "number": 1001,
   "comment": "comment",
   "archived": false,
   "delivery_title": "самовывоз",
   "delivery_description": "самовывоз",
   "delivery_price": 100,
   "full_delivery_price": 100,
   "payment_description": null,
   "payment_title": "наличными курьеру",
   "first_referer": "http://google.com?q=my_query",
   "first_current_location": "/my_query",
   "first_query": null,
   "first_source_domain": null,
   "first_source": "Google",
   "referer": "http://yandex.ru/yandsearch?text=%D1%81%D0%BF%D0%B0%D0%BB%D1%8C%D0%BD%D1%8B%D0%B5+%D0%BC%D0%B5%D1%88%D0%BA%D0%B8&stpar2=%2Fh1%2Ftm7%2Fs1&stpar4=%2Fs1&stpar1=%2Fu1&stpar3=%2Fm3%2Ftc14%2Fnc1",
   "current_location": "/",
   "query": null,
   "source_domain": null,
   "source": "Прямой трафик",
   "fulfillment_status": "new",
   "custom_status": {
     "permalink": "new",
     "title": "Новый"
   },
   "delivered_at": null,
   "accepted_at": null,
   "created_at": "2009-03-18T10:53:14.000+03:00",
   "updated_at": "2026-10-21T23:27:47.000+03:00",
   "financial_status": "pending",
   "delivery_date": null,
   "delivery_from_hour": null,
   "delivery_from_minutes": null,
   "delivery_to_hour": null,
   "delivery_to_minutes": null,
   "delivery_time": "",
   "paid_at": null,
   "delivery_variant_id": 1,
   "payment_gateway_id": 1,
   "margin": "0.0",
   "margin_amount": "0.0",
   "client_transaction_id": 1,
   "yandex_metrika_client_id": null,
   "currency_code": "RUR",
   "cookies": null,
   "account_id": 1,
   "manager_comment": "manager comment1",
   "locale": "ru",
   "delivery_info": {
     "delivery_variant_id": null,
     "tariff_id": null,
     "title": null,
     "description": null,
     "price": null,
     "shipping_company": null,
     "shipping_company_handle": null,
     "delivery_interval": {
       "min_days": null,
       "max_days": null,
       "description": ""
     },
     "errors": [],
     "warnings": [],
     "outlet": {
       "id": null,
       "external_id": null,
       "latitude": null,
       "longitude": null,
       "type": null,
       "title": null,
       "description": null,
       "address": null,
       "payment_method": null,
       "source_id": null
     },
     "not_available": null
   },
   "responsible_user_id": null,
   "total_profit": "210.0",
   "warehouse_id": null
 }

 insales.editOrder({
   token: '1234567890',
   url: 'shop-test.myinsales.ru',
   orderid: '1',
   order: {
     "order": {
       "order_lines_attributes": [
         {
           "id": 1,
           "_destroy": true
         }
       ]
     }
   }
 }).then(response => {
   console.info(response.data);
 }).catch(err => {
   console.error(err);
 });

Output:

 {
   "fields_values": [
     {
       "id": 603,
       "value": "old value",
       "created_at": "2026-10-21T23:27:47.963+03:00",
       "updated_at": "2026-10-21T23:27:47.963+03:00",
       "field_id": 912,
       "type": "Текст",
       "name": "special",
       "handle": "my_awesome_field"
     }
   ],
   "order_lines": [
     {
       "id": 2,
       "order_id": 1,
       "sale_price": 600,
       "full_sale_price": 600,
       "total_price": 1200,
       "full_total_price": 1200,
       "discounts_amount": 0,
       "quantity": 2,
       "reserved_quantity": null,
       "weight": "0.3",
       "dimensions": null,
       "variant_id": 2,
       "product_id": 2,
       "sku": "424",
       "barcode": null,
       "title": "shirt",
       "unit": "pce",
       "comment": null,
       "updated_at": "2026-10-21T23:27:48.000+03:00",
       "created_at": "2009-03-18T10:53:14.000+03:00",
       "bundle_id": null,
       "vat": 20,
       "fiscal_product_type": 1,
       "requires_marking": null,
       "marking_codes": null,
       "accessory_lines": [],
       "external_variant_id": null
     }
   ],
   "order_changes": [],
   "discount": null,
   "shipping_address": {
     "id": 1,
     "fields_values": [
       {
         "id": 595,
         "value": "old value",
         "created_at": "2026-10-21T23:27:47.927+03:00",
         "updated_at": "2026-10-21T23:27:47.927+03:00",
         "field_id": 904,
         "type": "Текст",
         "name": "special",
         "handle": null
       }
     ],
     "name": "Tom Dellay",
     "surname": null,
     "middlename": null,
     "phone": "+7(495)212-85-06",
     "formatted_phone": "+7(495)212-85-06",
     "full_name": "Tom Dellay",
     "full_locality_name": null,
     "full_delivery_address": "123456, state, London, address, old value",
     "address_for_gis": "123456, state, London, address",
     "location_valid": true,
     "recipient_fields": [
       {
         "id": 11,
         "destiny": 2,
         "position": 1,
         "office_title": "Имя",
         "for_buyer": true,
         "obligatory": true,
         "active": true,
         "system_name": "name",
         "created_at": "2010-10-12T13:31:09.692+04:00",
         "updated_at": "2010-10-12T13:31:09.692+04:00",
         "show_in_result": true,
         "show_in_checkout": true,
         "is_indexed": null,
         "hide_in_backoffice": null,
         "handle": null,
         "placeholder": null,
         "title": null,
         "example": null,
         "type": "Field::ObligatoryTextField"
       },
       {
         "id": 12,
         "destiny": 2,
         "position": 2,
         "office_title": "Телефон",
         "for_buyer": true,
         "obligatory": true,
         "active": true,
         "system_name": "phone",
         "created_at": "2010-10-12T13:31:09.692+04:00",
         "updated_at": "2010-10-12T13:31:09.692+04:00",
         "show_in_result": true,
         "show_in_checkout": true,
         "is_indexed": null,
         "hide_in_backoffice": null,
         "handle": null,
         "placeholder": null,
         "title": null,
         "example": null,
         "type": "Field::Phone"
       }
     ],
     "backoffice_fields": [
       {
         "id": 4,
         "destiny": 1,
         "position": 3,
         "office_title": "Адрес",
         "for_buyer": true,
         "obligatory": false,
         "active": true,
         "system_name": "address",
         "created_at": "2010-10-12T13:31:09.692+04:00",
         "updated_at": "2010-10-12T13:31:09.692+04:00",
         "show_in_result": true,
         "show_in_checkout": true,
         "is_indexed": null,
         "hide_in_backoffice": null,
         "handle": null,
         "placeholder": null,
         "title": null,
         "example": null,
         "type": "Field::SystemTextArea"
       },
       {
         "id": 904,
         "destiny": 1,
         "position": 22,
         "office_title": "special",
         "for_buyer": true,
         "obligatory": false,
         "active": true,
         "system_name": null,
         "created_at": "2026-10-21T23:27:47.914+03:00",
         "updated_at": "2026-10-21T23:27:47.914+03:00",
         "show_in_result": true,
         "show_in_checkout": true,
         "is_indexed": null,
         "hide_in_backoffice": null,
         "handle": null,
         "placeholder": null,
         "title": "special",
         "example": null,
         "type": "Field::TextField"
       },
       {
         "id": 1,
         "destiny": 1,
         "position": 0,
         "office_title": "Страна",
         "for_buyer": true,
         "obligatory": false,
         "active": false,
         "system_name": "country",
         "created_at": "2010-10-12T13:31:09.692+04:00",
         "updated_at": "2010-10-12T13:31:09.692+04:00",
         "show_in_result": true,
         "show_in_checkout": true,
         "is_indexed": null,
         "hide_in_backoffice": null,
         "handle": null,
         "placeholder": null,
         "title": null,
         "example": null,
         "type": "Field::Country"
       },
       {
         "id": 2,
         "destiny": 1,
         "position": 1,
         "office_title": "Регион",
         "for_buyer": true,
         "obligatory": false,
         "active": false,
         "system_name": "state",
         "created_at": "2010-10-12T13:31:09.692+04:00",
         "updated_at": "2010-10-12T13:31:09.692+04:00",
         "show_in_result": true,
         "show_in_checkout": true,
         "is_indexed": null,
         "hide_in_backoffice": null,
         "handle": null,
         "placeholder": null,
         "title": null,
         "example": null,
         "type": "Field::SystemTextField"
       },
       {
         "id": 3,
         "destiny": 1,
         "position": 2,
         "office_title": "Город",
         "for_buyer": true,
         "obligatory": false,
         "active": false,
         "system_name": "city",
         "created_at": "2010-10-12T13:31:09.692+04:00",
         "updated_at": "2010-10-12T13:31:09.692+04:00",
         "show_in_result": true,
         "show_in_checkout": true,
         "is_indexed": null,
         "hide_in_backoffice": null,
         "handle": null,
         "placeholder": null,
         "title": null,
         "example": null,
         "type": "Field::SystemTextField"
       },
       {
         "id": 5,
         "destiny": 1,
         "position": 4,
         "office_title": "Почтовый индекс",
         "for_buyer": true,
         "obligatory": false,
         "active": false,
         "system_name": "zip",
         "created_at": "2010-10-12T13:31:09.692+04:00",
         "updated_at": "2010-10-12T13:31:09.692+04:00",
         "show_in_result": true,
         "show_in_checkout": true,
         "is_indexed": null,
         "hide_in_backoffice": null,
         "handle": null,
         "placeholder": null,
         "title": null,
         "example": null,
         "type": "Field::SystemTextField"
       }
     ],
     "no_delivery": false,
     "kladr_autodetected_address": "",
     "country_options": [
       {
         "code": "RU",
         "title": "Россия",
         "selected": true
       }
     ],
     "address": "address",
     "country": "RU",
     "state": "state",
     "city": "London",
     "zip": "123456",
     "street": null,
     "house": null,
     "flat": null,
     "entrance": null,
     "doorphone": null,
     "floor": null,
     "comment": null,
     "kladr_json": null,
     "location": {
       "kladr_code": null,
       "zip": "123456",
       "kladr_zip": null,
       "region_zip": null,
       "country": "RU",
       "state": "state",
       "state_type": null,
       "area": null,
       "area_type": null,
       "city": "London",
       "city_type": null,
       "settlement": null,
       "settlement_type": null,
       "address": "address",
       "street": "address",
       "street_type": null,
       "house": null,
       "flat": null,
       "is_kladr": false,
       "latitude": null,
       "longitude": null,
       "autodetected": null
     }
   },
   "client": {
     "id": 2,
     "email": "some-one@yandex.ru",
     "name": "Mortimer Hant",
     "phone": "+79162128506",
     "created_at": "2009-03-30T04:37:32.000+04:00",
     "updated_at": "2026-10-21T23:27:47.000+03:00",
     "comment": null,
     "registered": false,
     "subscribe": true,
     "client_group_id": null,
     "bonus_points": 0,
     "type": "Client::Individual",
     "correspondent_account": null,
     "settlement_account": null,
     "consent_to_personal_data": null,
     "o_auth_provider": null,
     "messenger_subscription": null,
     "external_id": null,
     "external_service": null,
     "contact_name": "Mortimer Hant",
     "surname": null,
     "middlename": null,
     "progressive_discount": null,
     "group_discount": null,
     "ip_addr": "",
     "fields_values": [
       {
         "id": 587,
         "value": "old value",
         "created_at": "2026-10-21T23:27:47.893+03:00",
         "updated_at": "2026-10-21T23:27:47.893+03:00",
         "field_id": 896,
         "type": "Текст",
         "name": "special",
         "handle": null
       }
     ]
   },
   "discounts": [],
   "total_price": 1300,
   "paid_amount": 0,
   "items_price": 1200,
   "id": 1,
   "key": "teest",
   "number": 1001,
   "comment": "comment",
   "archived": false,
   "delivery_title": "самовывоз",
   "delivery_description": "самовывоз",
   "delivery_price": 100,
   "full_delivery_price": 100,
   "payment_description": null,
   "payment_title": "наличными курьеру",
   "first_referer": "http://google.com?q=my_query",
   "first_current_location": "/my_query",
   "first_query": null,
   "first_source_domain": null,
   "first_source": "Google",
   "referer": "http://yandex.ru/yandsearch?text=%D1%81%D0%BF%D0%B0%D0%BB%D1%8C%D0%BD%D1%8B%D0%B5+%D0%BC%D0%B5%D1%88%D0%BA%D0%B8&stpar2=%2Fh1%2Ftm7%2Fs1&stpar4=%2Fs1&stpar1=%2Fu1&stpar3=%2Fm3%2Ftc14%2Fnc1",
   "current_location": "/",
   "query": null,
   "source_domain": null,
   "source": "Прямой трафик",
   "fulfillment_status": "new",
   "custom_status": {
     "permalink": "new",
     "title": "Новый"
   },
   "delivered_at": null,
   "accepted_at": null,
   "created_at": "2009-03-18T10:53:14.000+03:00",
   "updated_at": "2026-10-21T23:27:48.000+03:00",
   "financial_status": "pending",
   "delivery_date": null,
   "delivery_from_hour": null,
   "delivery_from_minutes": null,
   "delivery_to_hour": null,
   "delivery_to_minutes": null,
   "delivery_time": "",
   "paid_at": null,
   "delivery_variant_id": 1,
   "payment_gateway_id": 1,
   "margin": "0.0",
   "margin_amount": "0.0",
   "client_transaction_id": 1,
   "yandex_metrika_client_id": null,
   "currency_code": "RUR",
   "cookies": null,
   "account_id": 1,
   "manager_comment": "manager comment1",
   "locale": "ru",
   "delivery_info": {
     "delivery_variant_id": null,
     "tariff_id": null,
     "title": null,
     "description": null,
     "price": null,
     "shipping_company": null,
     "shipping_company_handle": null,
     "delivery_interval": {
       "min_days": null,
       "max_days": null,
       "description": ""
     },
     "errors": [],
     "warnings": [],
     "outlet": {
       "id": null,
       "external_id": null,
       "latitude": null,
       "longitude": null,
       "type": null,
       "title": null,
       "description": null,
       "address": null,
       "payment_method": null,
       "source_id": null
     },
     "not_available": null
   },
   "responsible_user_id": null,
   "total_profit": "1200.0",
   "warehouse_id": null
 }

 insales.editOrder({
   token: '1234567890',
   url: 'shop-test.myinsales.ru',
   orderid: '1',
   order: {
     "order": {
       "order_lines_attributes": [
         {
           "id": 1,
           "sale_price": 100,
           "quantity": 2,
           "comment": "New comment",
           "vat": 0,
           "marking_codes": [
             "931d10a7096421d8cced",
             "d5aa6dc515ad881b0117"
           ]
         }
       ]
     }
   }
 }).then(response => {
   console.info(response.data);
 }).catch(err => {
   console.error(err);
 });

Output:

 {
   "fields_values": [
     {
       "id": 627,
       "value": "old value",
       "created_at": "2026-10-21T23:27:48.406+03:00",
       "updated_at": "2026-10-21T23:27:48.406+03:00",
       "field_id": 936,
       "type": "Текст",
       "name": "special",
       "handle": "my_awesome_field"
     }
   ],
   "order_lines": [
     {
       "id": 1,
       "order_id": 1,
       "sale_price": 100,
       "full_sale_price": 100,
       "total_price": 200,
       "full_total_price": 200,
       "discounts_amount": 0,
       "quantity": 2,
       "reserved_quantity": null,
       "weight": null,
       "dimensions": null,
       "variant_id": 1,
       "product_id": 1,
       "sku": "423",
       "barcode": null,
       "title": "Cool t-shirt",
       "unit": "pce",
       "comment": "New comment",
       "updated_at": "2026-10-21T23:27:48.000+03:00",
       "created_at": "2009-03-18T10:53:14.000+03:00",
       "bundle_id": null,
       "vat": 0,
       "fiscal_product_type": 1,
       "requires_marking": true,
       "marking_codes": [
         "931d10a7096421d8cced",
         "d5aa6dc515ad881b0117"
       ],
       "accessory_lines": [],
       "external_variant_id": null
     },
     {
       "id": 2,
       "order_id": 1,
       "sale_price": 600,
       "full_sale_price": 600,
       "total_price": 1200,
       "full_total_price": 1200,
       "discounts_amount": 0,
       "quantity": 2,
       "reserved_quantity": null,
       "weight": "0.3",
       "dimensions": null,
       "variant_id": 2,
       "product_id": 2,
       "sku": "424",
       "barcode": null,
       "title": "shirt",
       "unit": "pce",
       "comment": null,
       "updated_at": "2026-10-21T23:27:48.000+03:00",
       "created_at": "2009-03-18T10:53:14.000+03:00",
       "bundle_id": null,
       "vat": 20,
       "fiscal_product_type": 1,
       "requires_marking": null,
       "marking_codes": null,
       "accessory_lines": [],
       "external_variant_id": null
     }
   ],
   "order_changes": [],
   "discount": null,
   "shipping_address": {
     "id": 1,
     "fields_values": [
       {
         "id": 619,
         "value": "old value",
         "created_at": "2026-10-21T23:27:48.365+03:00",
         "updated_at": "2026-10-21T23:27:48.365+03:00",
         "field_id": 928,
         "type": "Текст",
         "name": "special",
         "handle": null
       }
     ],
     "name": "Tom Dellay",
     "surname": null,
     "middlename": null,
     "phone": "+7(495)212-85-06",
     "formatted_phone": "+7(495)212-85-06",
     "full_name": "Tom Dellay",
     "full_locality_name": null,
     "full_delivery_address": "123456, state, London, address, old value",
     "address_for_gis": "123456, state, London, address",
     "location_valid": true,
     "recipient_fields": [
       {
         "id": 11,
         "destiny": 2,
         "position": 1,
         "office_title": "Имя",
         "for_buyer": true,
         "obligatory": true,
         "active": true,
         "system_name": "name",
         "created_at": "2010-10-12T13:31:09.692+04:00",
         "updated_at": "2010-10-12T13:31:09.692+04:00",
         "show_in_result": true,
         "show_in_checkout": true,
         "is_indexed": null,
         "hide_in_backoffice": null,
         "handle": null,
         "placeholder": null,
         "title": null,
         "example": null,
         "type": "Field::ObligatoryTextField"
       },
       {
         "id": 12,
         "destiny": 2,
         "position": 2,
         "office_title": "Телефон",
         "for_buyer": true,
         "obligatory": true,
         "active": true,
         "system_name": "phone",
         "created_at": "2010-10-12T13:31:09.692+04:00",
         "updated_at": "2010-10-12T13:31:09.692+04:00",
         "show_in_result": true,
         "show_in_checkout": true,
         "is_indexed": null,
         "hide_in_backoffice": null,
         "handle": null,
         "placeholder": null,
         "title": null,
         "example": null,
         "type": "Field::Phone"
       }
     ],
     "backoffice_fields": [
       {
         "id": 4,
         "destiny": 1,
         "position": 3,
         "office_title": "Адрес",
         "for_buyer": true,
         "obligatory": false,
         "active": true,
         "system_name": "address",
         "created_at": "2010-10-12T13:31:09.692+04:00",
         "updated_at": "2010-10-12T13:31:09.692+04:00",
         "show_in_result": true,
         "show_in_checkout": true,
         "is_indexed": null,
         "hide_in_backoffice": null,
         "handle": null,
         "placeholder": null,
         "title": null,
         "example": null,
         "type": "Field::SystemTextArea"
       },
       {
         "id": 928,
         "destiny": 1,
         "position": 22,
         "office_title": "special",
         "for_buyer": true,
         "obligatory": false,
         "active": true,
         "system_name": null,
         "created_at": "2026-10-21T23:27:48.351+03:00",
         "updated_at": "2026-10-21T23:27:48.351+03:00",
         "show_in_result": true,
         "show_in_checkout": true,
         "is_indexed": null,
         "hide_in_backoffice": null,
         "handle": null,
         "placeholder": null,
         "title": "special",
         "example": null,
         "type": "Field::TextField"
       },
       {
         "id": 1,
         "destiny": 1,
         "position": 0,
         "office_title": "Страна",
         "for_buyer": true,
         "obligatory": false,
         "active": false,
         "system_name": "country",
         "created_at": "2010-10-12T13:31:09.692+04:00",
         "updated_at": "2010-10-12T13:31:09.692+04:00",
         "show_in_result": true,
         "show_in_checkout": true,
         "is_indexed": null,
         "hide_in_backoffice": null,
         "handle": null,
         "placeholder": null,
         "title": null,
         "example": null,
         "type": "Field::Country"
       },
       {
         "id": 2,
         "destiny": 1,
         "position": 1,
         "office_title": "Регион",
         "for_buyer": true,
         "obligatory": false,
         "active": false,
         "system_name": "state",
         "created_at": "2010-10-12T13:31:09.692+04:00",
         "updated_at": "2010-10-12T13:31:09.692+04:00",
         "show_in_result": true,
         "show_in_checkout": true,
         "is_indexed": null,
         "hide_in_backoffice": null,
         "handle": null,
         "placeholder": null,
         "title": null,
         "example": null,
         "type": "Field::SystemTextField"
       },
       {
         "id": 3,
         "destiny": 1,
         "position": 2,
         "office_title": "Город",
         "for_buyer": true,
         "obligatory": false,
         "active": false,
         "system_name": "city",
         "created_at": "2010-10-12T13:31:09.692+04:00",
         "updated_at": "2010-10-12T13:31:09.692+04:00",
         "show_in_result": true,
         "show_in_checkout": true,
         "is_indexed": null,
         "hide_in_backoffice": null,
         "handle": null,
         "placeholder": null,
         "title": null,
         "example": null,
         "type": "Field::SystemTextField"
       },
       {
         "id": 5,
         "destiny": 1,
         "position": 4,
         "office_title": "Почтовый индекс",
         "for_buyer": true,
         "obligatory": false,
         "active": false,
         "system_name": "zip",
         "created_at": "2010-10-12T13:31:09.692+04:00",
         "updated_at": "2010-10-12T13:31:09.692+04:00",
         "show_in_result": true,
         "show_in_checkout": true,
         "is_indexed": null,
         "hide_in_backoffice": null,
         "handle": null,
         "placeholder": null,
         "title": null,
         "example": null,
         "type": "Field::SystemTextField"
       }
     ],
     "no_delivery": false,
     "kladr_autodetected_address": "",
     "country_options": [
       {
         "code": "RU",
         "title": "Россия",
         "selected": true
       }
     ],
     "address": "address",
     "country": "RU",
     "state": "state",
     "city": "London",
     "zip": "123456",
     "street": null,
     "house": null,
     "flat": null,
     "entrance": null,
     "doorphone": null,
     "floor": null,
     "comment": null,
     "kladr_json": null,
     "location": {
       "kladr_code": null,
       "zip": "123456",
       "kladr_zip": null,
       "region_zip": null,
       "country": "RU",
       "state": "state",
       "state_type": null,
       "area": null,
       "area_type": null,
       "city": "London",
       "city_type": null,
       "settlement": null,
       "settlement_type": null,
       "address": "address",
       "street": "address",
       "street_type": null,
       "house": null,
       "flat": null,
       "is_kladr": false,
       "latitude": null,
       "longitude": null,
       "autodetected": null
     }
   },
   "client": {
     "id": 2,
     "email": "some-one@yandex.ru",
     "name": "Mortimer Hant",
     "phone": "+79162128506",
     "created_at": "2009-03-30T04:37:32.000+04:00",
     "updated_at": "2026-10-21T23:27:48.000+03:00",
     "comment": null,
     "registered": false,
     "subscribe": true,
     "client_group_id": null,
     "bonus_points": 0,
     "type": "Client::Individual",
     "correspondent_account": null,
     "settlement_account": null,
     "consent_to_personal_data": null,
     "o_auth_provider": null,
     "messenger_subscription": null,
     "external_id": null,
     "external_service": null,
     "contact_name": "Mortimer Hant",
     "surname": null,
     "middlename": null,
     "progressive_discount": null,
     "group_discount": null,
     "ip_addr": "",
     "fields_values": [
       {
         "id": 611,
         "value": "old value",
         "created_at": "2026-10-21T23:27:48.334+03:00",
         "updated_at": "2026-10-21T23:27:48.334+03:00",
         "field_id": 920,
         "type": "Текст",
         "name": "special",
         "handle": null
       }
     ]
   },
   "discounts": [],
   "total_price": 1500,
   "paid_amount": 0,
   "items_price": 1400,
   "id": 1,
   "key": "teest",
   "number": 1001,
   "comment": "comment",
   "archived": false,
   "delivery_title": "самовывоз",
   "delivery_description": "самовывоз",
   "delivery_price": 100,
   "full_delivery_price": 100,
   "payment_description": null,
   "payment_title": "наличными курьеру",
   "first_referer": "http://google.com?q=my_query",
   "first_current_location": "/my_query",
   "first_query": null,
   "first_source_domain": null,
   "first_source": "Google",
   "referer": "http://yandex.ru/yandsearch?text=%D1%81%D0%BF%D0%B0%D0%BB%D1%8C%D0%BD%D1%8B%D0%B5+%D0%BC%D0%B5%D1%88%D0%BA%D0%B8&stpar2=%2Fh1%2Ftm7%2Fs1&stpar4=%2Fs1&stpar1=%2Fu1&stpar3=%2Fm3%2Ftc14%2Fnc1",
   "current_location": "/",
   "query": null,
   "source_domain": null,
   "source": "Прямой трафик",
   "fulfillment_status": "new",
   "custom_status": {
     "permalink": "new",
     "title": "Новый"
   },
   "delivered_at": null,
   "accepted_at": null,
   "created_at": "2009-03-18T10:53:14.000+03:00",
   "updated_at": "2026-10-21T23:27:48.000+03:00",
   "financial_status": "pending",
   "delivery_date": null,
   "delivery_from_hour": null,
   "delivery_from_minutes": null,
   "delivery_to_hour": null,
   "delivery_to_minutes": null,
   "delivery_time": "",
   "paid_at": null,
   "delivery_variant_id": 1,
   "payment_gateway_id": 1,
   "margin": "0.0",
   "margin_amount": "0.0",
   "client_transaction_id": 1,
   "yandex_metrika_client_id": null,
   "currency_code": "RUR",
   "cookies": null,
   "account_id": 1,
   "manager_comment": "manager comment1",
   "locale": "ru",
   "delivery_info": {
     "delivery_variant_id": null,
     "tariff_id": null,
     "title": null,
     "description": null,
     "price": null,
     "shipping_company": null,
     "shipping_company_handle": null,
     "delivery_interval": {
       "min_days": null,
       "max_days": null,
       "description": ""
     },
     "errors": [],
     "warnings": [],
     "outlet": {
       "id": null,
       "external_id": null,
       "latitude": null,
       "longitude": null,
       "type": null,
       "title": null,
       "description": null,
       "address": null,
       "payment_method": null,
       "source_id": null
     },
     "not_available": null
   },
   "responsible_user_id": null,
   "total_profit": "1400.0",
   "warehouse_id": null
 }

 insales.editOrder({
   token: '1234567890',
   url: 'shop-test.myinsales.ru',
   orderid: '1',
   order: {
     "order": {
       "discounts_attributes": [
         {
           "discount": 100,
           "type_id": 2,
           "description": "-100 (absolute)"
         },
         {
           "discount": 10,
           "description": "10% only for first order line",
           "discount_order_lines_ids": [
             41
           ]
         }
       ]
     }
   }
 }).then(response => {
   console.info(response.data);
 }).catch(err => {
   console.error(err);
 });

Output:

 {
   "fields_values": [
     {
       "id": 651,
       "value": "old value",
       "created_at": "2026-10-21T23:27:48.886+03:00",
       "updated_at": "2026-10-21T23:27:48.886+03:00",
       "field_id": 960,
       "type": "Текст",
       "name": "special",
       "handle": "my_awesome_field"
     }
   ],
   "order_lines": [
     {
       "id": 41,
       "order_id": 1,
       "sale_price": 100,
       "full_sale_price": 55.72,
       "total_price": 200,
       "full_total_price": 111.43,
       "discounts_amount": 88.57,
       "quantity": 2,
       "reserved_quantity": null,
       "weight": null,
       "dimensions": "10x20x30",
       "variant_id": 1,
       "product_id": 1,
       "sku": "423",
       "barcode": null,
       "title": "Cool t-shirt (Red)",
       "unit": "pce",
       "comment": null,
       "updated_at": "2026-10-21T23:27:49.000+03:00",
       "created_at": "2026-10-21T23:27:49.000+03:00",
       "bundle_id": null,
       "vat": -1,
       "fiscal_product_type": 1,
       "requires_marking": null,
       "marking_codes": null,
       "accessory_lines": [],
       "external_variant_id": null
     },
     {
       "id": 42,
       "order_id": 1,
       "sale_price": 150,
       "full_sale_price": 98.57,
       "total_price": 150,
       "full_total_price": 98.57,
       "discounts_amount": 51.43,
       "quantity": 1,
       "reserved_quantity": null,
       "weight": "0.3",
       "dimensions": null,
       "variant_id": 2,
       "product_id": 2,
       "sku": "424",
       "barcode": null,
       "title": "shirt (Зеленый / Синий)",
       "unit": "pce",
       "comment": null,
       "updated_at": "2026-10-21T23:27:49.000+03:00",
       "created_at": "2026-10-21T23:27:49.000+03:00",
       "bundle_id": null,
       "vat": -1,
       "fiscal_product_type": 1,
       "requires_marking": null,
       "marking_codes": null,
       "accessory_lines": [],
       "external_variant_id": null
     }
   ],
   "order_changes": [],
   "discount": {
     "id": 99,
     "description": "-20 (absolute)",
     "warning": null,
     "type_id": 2,
     "amount": 20,
     "full_amount": 20,
     "percent": null,
     "discount": "20.0",
     "reference_id": null,
     "reference_type": null,
     "discount_products_ids": [],
     "discount_order_lines_ids": [],
     "discount_code_id": null,
     "created_at": "2026-10-21T23:27:49.000+03:00",
     "updated_at": "2026-10-21T23:27:49.000+03:00"
   },
   "shipping_address": {
     "id": 1,
     "fields_values": [
       {
         "id": 643,
         "value": "old value",
         "created_at": "2026-10-21T23:27:48.848+03:00",
         "updated_at": "2026-10-21T23:27:48.848+03:00",
         "field_id": 952,
         "type": "Текст",
         "name": "special",
         "handle": null
       }
     ],
     "name": "Tom Dellay",
     "surname": null,
     "middlename": null,
     "phone": "+7(495)212-85-06",
     "formatted_phone": "+7(495)212-85-06",
     "full_name": "Tom Dellay",
     "full_locality_name": null,
     "full_delivery_address": "123456, state, London, address, old value",
     "address_for_gis": "123456, state, London, address",
     "location_valid": true,
     "recipient_fields": [
       {
         "id": 11,
         "destiny": 2,
         "position": 1,
         "office_title": "Имя",
         "for_buyer": true,
         "obligatory": true,
         "active": true,
         "system_name": "name",
         "created_at": "2010-10-12T13:31:09.692+04:00",
         "updated_at": "2010-10-12T13:31:09.692+04:00",
         "show_in_result": true,
         "show_in_checkout": true,
         "is_indexed": null,
         "hide_in_backoffice": null,
         "handle": null,
         "placeholder": null,
         "title": null,
         "example": null,
         "type": "Field::ObligatoryTextField"
       },
       {
         "id": 12,
         "destiny": 2,
         "position": 2,
         "office_title": "Телефон",
         "for_buyer": true,
         "obligatory": true,
         "active": true,
         "system_name": "phone",
         "created_at": "2010-10-12T13:31:09.692+04:00",
         "updated_at": "2010-10-12T13:31:09.692+04:00",
         "show_in_result": true,
         "show_in_checkout": true,
         "is_indexed": null,
         "hide_in_backoffice": null,
         "handle": null,
         "placeholder": null,
         "title": null,
         "example": null,
         "type": "Field::Phone"
       }
     ],
     "backoffice_fields": [
       {
         "id": 4,
         "destiny": 1,
         "position": 3,
         "office_title": "Адрес",
         "for_buyer": true,
         "obligatory": false,
         "active": true,
         "system_name": "address",
         "created_at": "2010-10-12T13:31:09.692+04:00",
         "updated_at": "2010-10-12T13:31:09.692+04:00",
         "show_in_result": true,
         "show_in_checkout": true,
         "is_indexed": null,
         "hide_in_backoffice": null,
         "handle": null,
         "placeholder": null,
         "title": null,
         "example": null,
         "type": "Field::SystemTextArea"
       },
       {
         "id": 952,
         "destiny": 1,
         "position": 22,
         "office_title": "special",
         "for_buyer": true,
         "obligatory": false,
         "active": true,
         "system_name": null,
         "created_at": "2026-10-21T23:27:48.835+03:00",
         "updated_at": "2026-10-21T23:27:48.835+03:00",
         "show_in_result": true,
         "show_in_checkout": true,
         "is_indexed": null,
         "hide_in_backoffice": null,
         "handle": null,
         "placeholder": null,
         "title": "special",
         "example": null,
         "type": "Field::TextField"
       },
       {
         "id": 1,
         "destiny": 1,
         "position": 0,
         "office_title": "Страна",
         "for_buyer": true,
         "obligatory": false,
         "active": false,
         "system_name": "country",
         "created_at": "2010-10-12T13:31:09.692+04:00",
         "updated_at": "2010-10-12T13:31:09.692+04:00",
         "show_in_result": true,
         "show_in_checkout": true,
         "is_indexed": null,
         "hide_in_backoffice": null,
         "handle": null,
         "placeholder": null,
         "title": null,
         "example": null,
         "type": "Field::Country"
       },
       {
         "id": 2,
         "destiny": 1,
         "position": 1,
         "office_title": "Регион",
         "for_buyer": true,
         "obligatory": false,
         "active": false,
         "system_name": "state",
         "created_at": "2010-10-12T13:31:09.692+04:00",
         "updated_at": "2010-10-12T13:31:09.692+04:00",
         "show_in_result": true,
         "show_in_checkout": true,
         "is_indexed": null,
         "hide_in_backoffice": null,
         "handle": null,
         "placeholder": null,
         "title": null,
         "example": null,
         "type": "Field::SystemTextField"
       },
       {
         "id": 3,
         "destiny": 1,
         "position": 2,
         "office_title": "Город",
         "for_buyer": true,
         "obligatory": false,
         "active": false,
         "system_name": "city",
         "created_at": "2010-10-12T13:31:09.692+04:00",
         "updated_at": "2010-10-12T13:31:09.692+04:00",
         "show_in_result": true,
         "show_in_checkout": true,
         "is_indexed": null,
         "hide_in_backoffice": null,
         "handle": null,
         "placeholder": null,
         "title": null,
         "example": null,
         "type": "Field::SystemTextField"
       },
       {
         "id": 5,
         "destiny": 1,
         "position": 4,
         "office_title": "Почтовый индекс",
         "for_buyer": true,
         "obligatory": false,
         "active": false,
         "system_name": "zip",
         "created_at": "2010-10-12T13:31:09.692+04:00",
         "updated_at": "2010-10-12T13:31:09.692+04:00",
         "show_in_result": true,
         "show_in_checkout": true,
         "is_indexed": null,
         "hide_in_backoffice": null,
         "handle": null,
         "placeholder": null,
         "title": null,
         "example": null,
         "type": "Field::SystemTextField"
       }
     ],
     "no_delivery": false,
     "kladr_autodetected_address": "",
     "country_options": [
       {
         "code": "RU",
         "title": "Россия",
         "selected": true
       }
     ],
     "address": "address",
     "country": "RU",
     "state": "state",
     "city": "London",
     "zip": "123456",
     "street": null,
     "house": null,
     "flat": null,
     "entrance": null,
     "doorphone": null,
     "floor": null,
     "comment": null,
     "kladr_json": null,
     "location": {
       "kladr_code": null,
       "zip": "123456",
       "kladr_zip": null,
       "region_zip": null,
       "country": "RU",
       "state": "state",
       "state_type": null,
       "area": null,
       "area_type": null,
       "city": "London",
       "city_type": null,
       "settlement": null,
       "settlement_type": null,
       "address": "address",
       "street": "address",
       "street_type": null,
       "house": null,
       "flat": null,
       "is_kladr": false,
       "latitude": null,
       "longitude": null,
       "autodetected": null
     }
   },
   "client": {
     "id": 2,
     "email": "some-one@yandex.ru",
     "name": "Mortimer Hant",
     "phone": "+79162128506",
     "created_at": "2009-03-30T04:37:32.000+04:00",
     "updated_at": "2026-10-21T23:27:48.000+03:00",
     "comment": null,
     "registered": false,
     "subscribe": true,
     "client_group_id": null,
     "bonus_points": 0,
     "type": "Client::Individual",
     "correspondent_account": null,
     "settlement_account": null,
     "consent_to_personal_data": null,
     "o_auth_provider": null,
     "messenger_subscription": null,
     "external_id": null,
     "external_service": null,
     "contact_name": "Mortimer Hant",
     "surname": null,
     "middlename": null,
     "progressive_discount": null,
     "group_discount": null,
     "ip_addr": "",
     "fields_values": [
       {
         "id": 635,
         "value": "old value",
         "created_at": "2026-10-21T23:27:48.820+03:00",
         "updated_at": "2026-10-21T23:27:48.820+03:00",
         "field_id": 944,
         "type": "Текст",
         "name": "special",
         "handle": null
       }
     ]
   },
   "discounts": [
     {
       "id": 99,
       "description": "-20 (absolute)",
       "warning": null,
       "type_id": 2,
       "amount": 20,
       "full_amount": 20,
       "percent": null,
       "discount": "20.0",
       "reference_id": null,
       "reference_type": null,
       "discount_products_ids": [],
       "discount_order_lines_ids": [],
       "discount_code_id": null,
       "created_at": "2026-10-21T23:27:49.000+03:00",
       "updated_at": "2026-10-21T23:27:49.000+03:00"
     },
     {
       "id": 107,
       "description": "-100 (absolute)",
       "warning": null,
       "type_id": 2,
       "amount": 100,
       "full_amount": 100,
       "percent": null,
       "discount": "100.0",
       "reference_id": null,
       "reference_type": null,
       "discount_products_ids": [],
       "discount_order_lines_ids": [],
       "discount_code_id": null,
       "created_at": "2026-10-21T23:27:49.000+03:00",
       "updated_at": "2026-10-21T23:27:49.000+03:00"
     },
     {
       "id": 115,
       "description": "10% only for first order line",
       "warning": null,
       "type_id": 1,
       "amount": 20,
       "full_amount": 20,
       "percent": "10.0",
       "discount": "10.0",
       "reference_id": null,
       "reference_type": null,
       "discount_products_ids": [
         1
       ],
       "discount_order_lines_ids": [
         41
       ],
       "discount_code_id": null,
       "created_at": "2026-10-21T23:27:49.000+03:00",
       "updated_at": "2026-10-21T23:27:49.000+03:00"
     }
   ],
   "total_price": 310,
   "paid_amount": 0,
   "items_price": 210,
   "id": 1,
   "key": "teest",
   "number": 1001,
   "comment": "comment",
   "archived": false,
   "delivery_title": "самовывоз",
   "delivery_description": "самовывоз",
   "delivery_price": 100,
   "full_delivery_price": 100,
   "payment_description": null,
   "payment_title": "наличными курьеру",
   "first_referer": "http://google.com?q=my_query",
   "first_current_location": "/my_query",
   "first_query": null,
   "first_source_domain": null,
   "first_source": "Google",
   "referer": "http://yandex.ru/yandsearch?text=%D1%81%D0%BF%D0%B0%D0%BB%D1%8C%D0%BD%D1%8B%D0%B5+%D0%BC%D0%B5%D1%88%D0%BA%D0%B8&stpar2=%2Fh1%2Ftm7%2Fs1&stpar4=%2Fs1&stpar1=%2Fu1&stpar3=%2Fm3%2Ftc14%2Fnc1",
   "current_location": "/",
   "query": null,
   "source_domain": null,
   "source": "Прямой трафик",
   "fulfillment_status": "new",
   "custom_status": {
     "permalink": "new",
     "title": "Новый"
   },
   "delivered_at": null,
   "accepted_at": null,
   "created_at": "2009-03-18T10:53:14.000+03:00",
   "updated_at": "2026-10-21T23:27:49.000+03:00",
   "financial_status": "pending",
   "delivery_date": null,
   "delivery_from_hour": null,
   "delivery_from_minutes": null,
   "delivery_to_hour": null,
   "delivery_to_minutes": null,
   "delivery_time": "",
   "paid_at": null,
   "delivery_variant_id": 1,
   "payment_gateway_id": 1,
   "margin": "0.0",
   "margin_amount": "0.0",
   "client_transaction_id": 1,
   "yandex_metrika_client_id": null,
   "currency_code": "RUR",
   "cookies": null,
   "account_id": 1,
   "manager_comment": "manager comment1",
   "locale": "ru",
   "delivery_info": {
     "delivery_variant_id": null,
     "tariff_id": null,
     "title": null,
     "description": null,
     "price": null,
     "shipping_company": null,
     "shipping_company_handle": null,
     "delivery_interval": {
       "min_days": null,
       "max_days": null,
       "description": ""
     },
     "errors": [],
     "warnings": [],
     "outlet": {
       "id": null,
       "external_id": null,
       "latitude": null,
       "longitude": null,
       "type": null,
       "title": null,
       "description": null,
       "address": null,
       "payment_method": null,
       "source_id": null
     },
     "not_available": null
   },
   "responsible_user_id": null,
   "total_profit": "30.0",
   "warehouse_id": null
 }

 insales.editOrder({
   token: '1234567890',
   url: 'shop-test.myinsales.ru',
   orderid: '1',
   order: {
     "order": {
       "discounts_attributes": [
         {
           "id": 123,
           "_destroy": true
         }
       ]
     }
   }
 }).then(response => {
   console.info(response.data);
 }).catch(err => {
   console.error(err);
 });

Output:

 {
   "fields_values": [
     {
       "id": 675,
       "value": "old value",
       "created_at": "2026-10-21T23:27:49.772+03:00",
       "updated_at": "2026-10-21T23:27:49.772+03:00",
       "field_id": 984,
       "type": "Текст",
       "name": "special",
       "handle": "my_awesome_field"
     }
   ],
   "order_lines": [
     {
       "id": 43,
       "order_id": 1,
       "sale_price": 100,
       "full_sale_price": 100,
       "total_price": 200,
       "full_total_price": 200,
       "discounts_amount": 0,
       "quantity": 2,
       "reserved_quantity": null,
       "weight": null,
       "dimensions": "10x20x30",
       "variant_id": 1,
       "product_id": 1,
       "sku": "423",
       "barcode": null,
       "title": "Cool t-shirt (Red)",
       "unit": "pce",
       "comment": null,
       "updated_at": "2026-10-21T23:27:50.000+03:00",
       "created_at": "2026-10-21T23:27:49.000+03:00",
       "bundle_id": null,
       "vat": -1,
       "fiscal_product_type": 1,
       "requires_marking": null,
       "marking_codes": null,
       "accessory_lines": [],
       "external_variant_id": null
     },
     {
       "id": 44,
       "order_id": 1,
       "sale_price": 150,
       "full_sale_price": 150,
       "total_price": 150,
       "full_total_price": 150,
       "discounts_amount": 0,
       "quantity": 1,
       "reserved_quantity": null,
       "weight": "0.3",
       "dimensions": null,
       "variant_id": 2,
       "product_id": 2,
       "sku": "424",
       "barcode": null,
       "title": "shirt (Зеленый / Синий)",
       "unit": "pce",
       "comment": null,
       "updated_at": "2026-10-21T23:27:50.000+03:00",
       "created_at": "2026-10-21T23:27:50.000+03:00",
       "bundle_id": null,
       "vat": -1,
       "fiscal_product_type": 1,
       "requires_marking": null,
       "marking_codes": null,
       "accessory_lines": [],
       "external_variant_id": null
     }
   ],
   "order_changes": [],
   "discount": null,
   "shipping_address": {
     "id": 1,
     "fields_values": [
       {
         "id": 667,
         "value": "old value",
         "created_at": "2026-10-21T23:27:49.733+03:00",
         "updated_at": "2026-10-21T23:27:49.733+03:00",
         "field_id": 976,
         "type": "Текст",
         "name": "special",
         "handle": null
       }
     ],
     "name": "Tom Dellay",
     "surname": null,
     "middlename": null,
     "phone": "+7(495)212-85-06",
     "formatted_phone": "+7(495)212-85-06",
     "full_name": "Tom Dellay",
     "full_locality_name": null,
     "full_delivery_address": "123456, state, London, address, old value",
     "address_for_gis": "123456, state, London, address",
     "location_valid": true,
     "recipient_fields": [
       {
         "id": 11,
         "destiny": 2,
         "position": 1,
         "office_title": "Имя",
         "for_buyer": true,
         "obligatory": true,
         "active": true,
         "system_name": "name",
         "created_at": "2010-10-12T13:31:09.692+04:00",
         "updated_at": "2010-10-12T13:31:09.692+04:00",
         "show_in_result": true,
         "show_in_checkout": true,
         "is_indexed": null,
         "hide_in_backoffice": null,
         "handle": null,
         "placeholder": null,
         "title": null,
         "example": null,
         "type": "Field::ObligatoryTextField"
       },
       {
         "id": 12,
         "destiny": 2,
         "position": 2,
         "office_title": "Телефон",
         "for_buyer": true,
         "obligatory": true,
         "active": true,
         "system_name": "phone",
         "created_at": "2010-10-12T13:31:09.692+04:00",
         "updated_at": "2010-10-12T13:31:09.692+04:00",
         "show_in_result": true,
         "show_in_checkout": true,
         "is_indexed": null,
         "hide_in_backoffice": null,
         "handle": null,
         "placeholder": null,
         "title": null,
         "example": null,
         "type": "Field::Phone"
       }
     ],
     "backoffice_fields": [
       {
         "id": 4,
         "destiny": 1,
         "position": 3,
         "office_title": "Адрес",
         "for_buyer": true,
         "obligatory": false,
         "active": true,
         "system_name": "address",
         "created_at": "2010-10-12T13:31:09.692+04:00",
         "updated_at": "2010-10-12T13:31:09.692+04:00",
         "show_in_result": true,
         "show_in_checkout": true,
         "is_indexed": null,
         "hide_in_backoffice": null,
         "handle": null,
         "placeholder": null,
         "title": null,
         "example": null,
         "type": "Field::SystemTextArea"
       },
       {
         "id": 976,
         "destiny": 1,
         "position": 22,
         "office_title": "special",
         "for_buyer": true,
         "obligatory": false,
         "active": true,
         "system_name": null,
         "created_at": "2026-10-21T23:27:49.720+03:00",
         "updated_at": "2026-10-21T23:27:49.720+03:00",
         "show_in_result": true,
         "show_in_checkout": true,
         "is_indexed": null,
         "hide_in_backoffice": null,
         "handle": null,
         "placeholder": null,
         "title": "special",
         "example": null,
         "type": "Field::TextField"
       },
       {
         "id": 1,
         "destiny": 1,
         "position": 0,
         "office_title": "Страна",
         "for_buyer": true,
         "obligatory": false,
         "active": false,
         "system_name": "country",
         "created_at": "2010-10-12T13:31:09.692+04:00",
         "updated_at": "2010-10-12T13:31:09.692+04:00",
         "show_in_result": true,
         "show_in_checkout": true,
         "is_indexed": null,
         "hide_in_backoffice": null,
         "handle": null,
         "placeholder": null,
         "title": null,
         "example": null,
         "type": "Field::Country"
       },
       {
         "id": 2,
         "destiny": 1,
         "position": 1,
         "office_title": "Регион",
         "for_buyer": true,
         "obligatory": false,
         "active": false,
         "system_name": "state",
         "created_at": "2010-10-12T13:31:09.692+04:00",
         "updated_at": "2010-10-12T13:31:09.692+04:00",
         "show_in_result": true,
         "show_in_checkout": true,
         "is_indexed": null,
         "hide_in_backoffice": null,
         "handle": null,
         "placeholder": null,
         "title": null,
         "example": null,
         "type": "Field::SystemTextField"
       },
       {
         "id": 3,
         "destiny": 1,
         "position": 2,
         "office_title": "Город",
         "for_buyer": true,
         "obligatory": false,
         "active": false,
         "system_name": "city",
         "created_at": "2010-10-12T13:31:09.692+04:00",
         "updated_at": "2010-10-12T13:31:09.692+04:00",
         "show_in_result": true,
         "show_in_checkout": true,
         "is_indexed": null,
         "hide_in_backoffice": null,
         "handle": null,
         "placeholder": null,
         "title": null,
         "example": null,
         "type": "Field::SystemTextField"
       },
       {
         "id": 5,
         "destiny": 1,
         "position": 4,
         "office_title": "Почтовый индекс",
         "for_buyer": true,
         "obligatory": false,
         "active": false,
         "system_name": "zip",
         "created_at": "2010-10-12T13:31:09.692+04:00",
         "updated_at": "2010-10-12T13:31:09.692+04:00",
         "show_in_result": true,
         "show_in_checkout": true,
         "is_indexed": null,
         "hide_in_backoffice": null,
         "handle": null,
         "placeholder": null,
         "title": null,
         "example": null,
         "type": "Field::SystemTextField"
       }
     ],
     "no_delivery": false,
     "kladr_autodetected_address": "",
     "country_options": [
       {
         "code": "RU",
         "title": "Россия",
         "selected": true
       }
     ],
     "address": "address",
     "country": "RU",
     "state": "state",
     "city": "London",
     "zip": "123456",
     "street": null,
     "house": null,
     "flat": null,
     "entrance": null,
     "doorphone": null,
     "floor": null,
     "comment": null,
     "kladr_json": null,
     "location": {
       "kladr_code": null,
       "zip": "123456",
       "kladr_zip": null,
       "region_zip": null,
       "country": "RU",
       "state": "state",
       "state_type": null,
       "area": null,
       "area_type": null,
       "city": "London",
       "city_type": null,
       "settlement": null,
       "settlement_type": null,
       "address": "address",
       "street": "address",
       "street_type": null,
       "house": null,
       "flat": null,
       "is_kladr": false,
       "latitude": null,
       "longitude": null,
       "autodetected": null
     }
   },
   "client": {
     "id": 2,
     "email": "some-one@yandex.ru",
     "name": "Mortimer Hant",
     "phone": "+79162128506",
     "created_at": "2009-03-30T04:37:32.000+04:00",
     "updated_at": "2026-10-21T23:27:49.000+03:00",
     "comment": null,
     "registered": false,
     "subscribe": true,
     "client_group_id": null,
     "bonus_points": 0,
     "type": "Client::Individual",
     "correspondent_account": null,
     "settlement_account": null,
     "consent_to_personal_data": null,
     "o_auth_provider": null,
     "messenger_subscription": null,
     "external_id": null,
     "external_service": null,
     "contact_name": "Mortimer Hant",
     "surname": null,
     "middlename": null,
     "progressive_discount": null,
     "group_discount": null,
     "ip_addr": "",
     "fields_values": [
       {
         "id": 659,
         "value": "old value",
         "created_at": "2026-10-21T23:27:49.704+03:00",
         "updated_at": "2026-10-21T23:27:49.704+03:00",
         "field_id": 968,
         "type": "Текст",
         "name": "special",
         "handle": null
       }
     ]
   },
   "discounts": [],
   "total_price": 450,
   "paid_amount": 0,
   "items_price": 350,
   "id": 1,
   "key": "teest",
   "number": 1001,
   "comment": "comment",
   "archived": false,
   "delivery_title": "самовывоз",
   "delivery_description": "самовывоз",
   "delivery_price": 100,
   "full_delivery_price": 100,
   "payment_description": null,
   "payment_title": "наличными курьеру",
   "first_referer": "http://google.com?q=my_query",
   "first_current_location": "/my_query",
   "first_query": null,
   "first_source_domain": null,
   "first_source": "Google",
   "referer": "http://yandex.ru/yandsearch?text=%D1%81%D0%BF%D0%B0%D0%BB%D1%8C%D0%BD%D1%8B%D0%B5+%D0%BC%D0%B5%D1%88%D0%BA%D0%B8&stpar2=%2Fh1%2Ftm7%2Fs1&stpar4=%2Fs1&stpar1=%2Fu1&stpar3=%2Fm3%2Ftc14%2Fnc1",
   "current_location": "/",
   "query": null,
   "source_domain": null,
   "source": "Прямой трафик",
   "fulfillment_status": "new",
   "custom_status": {
     "permalink": "new",
     "title": "Новый"
   },
   "delivered_at": null,
   "accepted_at": null,
   "created_at": "2009-03-18T10:53:14.000+03:00",
   "updated_at": "2026-10-21T23:27:50.000+03:00",
   "financial_status": "pending",
   "delivery_date": null,
   "delivery_from_hour": null,
   "delivery_from_minutes": null,
   "delivery_to_hour": null,
   "delivery_to_minutes": null,
   "delivery_time": "",
   "paid_at": null,
   "delivery_variant_id": 1,
   "payment_gateway_id": 1,
   "margin": "0.0",
   "margin_amount": "0.0",
   "client_transaction_id": 1,
   "yandex_metrika_client_id": null,
   "currency_code": "RUR",
   "cookies": null,
   "account_id": 1,
   "manager_comment": "manager comment1",
   "locale": "ru",
   "delivery_info": {
     "delivery_variant_id": null,
     "tariff_id": null,
     "title": null,
     "description": null,
     "price": null,
     "shipping_company": null,
     "shipping_company_handle": null,
     "delivery_interval": {
       "min_days": null,
       "max_days": null,
       "description": ""
     },
     "errors": [],
     "warnings": [],
     "outlet": {
       "id": null,
       "external_id": null,
       "latitude": null,
       "longitude": null,
       "type": null,
       "title": null,
       "description": null,
       "address": null,
       "payment_method": null,
       "source_id": null
     },
     "not_available": null
   },
   "responsible_user_id": null,
   "total_profit": "170.0",
   "warehouse_id": null
 }

 insales.editOrder({
   token: '1234567890',
   url: 'shop-test.myinsales.ru',
   orderid: '1',
   order: {
     "order": {
       "discounts_attributes": {
         "1": {
           "id": 139,
           "discount_order_lines_ids": [
             47
           ]
         }
       }
     }
   }
 }).then(response => {
   console.info(response.data);
 }).catch(err => {
   console.error(err);
 });

Output:

 {
   "fields_values": [
     {
       "id": 723,
       "value": "old value",
       "created_at": "2026-10-21T23:27:51.399+03:00",
       "updated_at": "2026-10-21T23:27:51.399+03:00",
       "field_id": 1032,
       "type": "Текст",
       "name": "special",
       "handle": "my_awesome_field"
     }
   ],
   "order_lines": [
     {
       "id": 47,
       "order_id": 1,
       "sale_price": 100,
       "full_sale_price": 90,
       "total_price": 200,
       "full_total_price": 180,
       "discounts_amount": 20,
       "quantity": 2,
       "reserved_quantity": null,
       "weight": null,
       "dimensions": "10x20x30",
       "variant_id": 1,
       "product_id": 1,
       "sku": "423",
       "barcode": null,
       "title": "Cool t-shirt (Red)",
       "unit": "pce",
       "comment": null,
       "updated_at": "2026-10-21T23:27:51.000+03:00",
       "created_at": "2026-10-21T23:27:51.000+03:00",
       "bundle_id": null,
       "vat": -1,
       "fiscal_product_type": 1,
       "requires_marking": null,
       "marking_codes": null,
       "accessory_lines": [],
       "external_variant_id": null
     },
     {
       "id": 48,
       "order_id": 1,
       "sale_price": 150,
       "full_sale_price": 150,
       "total_price": 150,
       "full_total_price": 150,
       "discounts_amount": 0,
       "quantity": 1,
       "reserved_quantity": null,
       "weight": "0.3",
       "dimensions": null,
       "variant_id": 2,
       "product_id": 2,
       "sku": "424",
       "barcode": null,
       "title": "shirt (Зеленый / Синий)",
       "unit": "pce",
       "comment": null,
       "updated_at": "2026-10-21T23:27:51.000+03:00",
       "created_at": "2026-10-21T23:27:51.000+03:00",
       "bundle_id": null,
       "vat": -1,
       "fiscal_product_type": 1,
       "requires_marking": null,
       "marking_codes": null,
       "accessory_lines": [],
       "external_variant_id": null
     }
   ],
   "order_changes": [],
   "discount": {
     "id": 139,
     "description": "-20 (absolute)",
     "warning": null,
     "type_id": 2,
     "amount": 20,
     "full_amount": 20,
     "percent": null,
     "discount": "20.0",
     "reference_id": null,
     "reference_type": null,
     "discount_products_ids": [
       1
     ],
     "discount_order_lines_ids": [
       47
     ],
     "discount_code_id": null,
     "created_at": "2026-10-21T23:27:51.000+03:00",
     "updated_at": "2026-10-21T23:27:51.000+03:00"
   },
   "shipping_address": {
     "id": 1,
     "fields_values": [
       {
         "id": 715,
         "value": "old value",
         "created_at": "2026-10-21T23:27:51.361+03:00",
         "updated_at": "2026-10-21T23:27:51.361+03:00",
         "field_id": 1024,
         "type": "Текст",
         "name": "special",
         "handle": null
       }
     ],
     "name": "Tom Dellay",
     "surname": null,
     "middlename": null,
     "phone": "+7(495)212-85-06",
     "formatted_phone": "+7(495)212-85-06",
     "full_name": "Tom Dellay",
     "full_locality_name": null,
     "full_delivery_address": "123456, state, London, address, old value",
     "address_for_gis": "123456, state, London, address",
     "location_valid": true,
     "recipient_fields": [
       {
         "id": 11,
         "destiny": 2,
         "position": 1,
         "office_title": "Имя",
         "for_buyer": true,
         "obligatory": true,
         "active": true,
         "system_name": "name",
         "created_at": "2010-10-12T13:31:09.692+04:00",
         "updated_at": "2010-10-12T13:31:09.692+04:00",
         "show_in_result": true,
         "show_in_checkout": true,
         "is_indexed": null,
         "hide_in_backoffice": null,
         "handle": null,
         "placeholder": null,
         "title": null,
         "example": null,
         "type": "Field::ObligatoryTextField"
       },
       {
         "id": 12,
         "destiny": 2,
         "position": 2,
         "office_title": "Телефон",
         "for_buyer": true,
         "obligatory": true,
         "active": true,
         "system_name": "phone",
         "created_at": "2010-10-12T13:31:09.692+04:00",
         "updated_at": "2010-10-12T13:31:09.692+04:00",
         "show_in_result": true,
         "show_in_checkout": true,
         "is_indexed": null,
         "hide_in_backoffice": null,
         "handle": null,
         "placeholder": null,
         "title": null,
         "example": null,
         "type": "Field::Phone"
       }
     ],
     "backoffice_fields": [
       {
         "id": 4,
         "destiny": 1,
         "position": 3,
         "office_title": "Адрес",
         "for_buyer": true,
         "obligatory": false,
         "active": true,
         "system_name": "address",
         "created_at": "2010-10-12T13:31:09.692+04:00",
         "updated_at": "2010-10-12T13:31:09.692+04:00",
         "show_in_result": true,
         "show_in_checkout": true,
         "is_indexed": null,
         "hide_in_backoffice": null,
         "handle": null,
         "placeholder": null,
         "title": null,
         "example": null,
         "type": "Field::SystemTextArea"
       },
       {
         "id": 1024,
         "destiny": 1,
         "position": 22,
         "office_title": "special",
         "for_buyer": true,
         "obligatory": false,
         "active": true,
         "system_name": null,
         "created_at": "2026-10-21T23:27:51.349+03:00",
         "updated_at": "2026-10-21T23:27:51.349+03:00",
         "show_in_result": true,
         "show_in_checkout": true,
         "is_indexed": null,
         "hide_in_backoffice": null,
         "handle": null,
         "placeholder": null,
         "title": "special",
         "example": null,
         "type": "Field::TextField"
       },
       {
         "id": 1,
         "destiny": 1,
         "position": 0,
         "office_title": "Страна",
         "for_buyer": true,
         "obligatory": false,
         "active": false,
         "system_name": "country",
         "created_at": "2010-10-12T13:31:09.692+04:00",
         "updated_at": "2010-10-12T13:31:09.692+04:00",
         "show_in_result": true,
         "show_in_checkout": true,
         "is_indexed": null,
         "hide_in_backoffice": null,
         "handle": null,
         "placeholder": null,
         "title": null,
         "example": null,
         "type": "Field::Country"
       },
       {
         "id": 2,
         "destiny": 1,
         "position": 1,
         "office_title": "Регион",
         "for_buyer": true,
         "obligatory": false,
         "active": false,
         "system_name": "state",
         "created_at": "2010-10-12T13:31:09.692+04:00",
         "updated_at": "2010-10-12T13:31:09.692+04:00",
         "show_in_result": true,
         "show_in_checkout": true,
         "is_indexed": null,
         "hide_in_backoffice": null,
         "handle": null,
         "placeholder": null,
         "title": null,
         "example": null,
         "type": "Field::SystemTextField"
       },
       {
         "id": 3,
         "destiny": 1,
         "position": 2,
         "office_title": "Город",
         "for_buyer": true,
         "obligatory": false,
         "active": false,
         "system_name": "city",
         "created_at": "2010-10-12T13:31:09.692+04:00",
         "updated_at": "2010-10-12T13:31:09.692+04:00",
         "show_in_result": true,
         "show_in_checkout": true,
         "is_indexed": null,
         "hide_in_backoffice": null,
         "handle": null,
         "placeholder": null,
         "title": null,
         "example": null,
         "type": "Field::SystemTextField"
       },
       {
         "id": 5,
         "destiny": 1,
         "position": 4,
         "office_title": "Почтовый индекс",
         "for_buyer": true,
         "obligatory": false,
         "active": false,
         "system_name": "zip",
         "created_at": "2010-10-12T13:31:09.692+04:00",
         "updated_at": "2010-10-12T13:31:09.692+04:00",
         "show_in_result": true,
         "show_in_checkout": true,
         "is_indexed": null,
         "hide_in_backoffice": null,
         "handle": null,
         "placeholder": null,
         "title": null,
         "example": null,
         "type": "Field::SystemTextField"
       }
     ],
     "no_delivery": false,
     "kladr_autodetected_address": "",
     "country_options": [
       {
         "code": "RU",
         "title": "Россия",
         "selected": true
       }
     ],
     "address": "address",
     "country": "RU",
     "state": "state",
     "city": "London",
     "zip": "123456",
     "street": null,
     "house": null,
     "flat": null,
     "entrance": null,
     "doorphone": null,
     "floor": null,
     "comment": null,
     "kladr_json": null,
     "location": {
       "kladr_code": null,
       "zip": "123456",
       "kladr_zip": null,
       "region_zip": null,
       "country": "RU",
       "state": "state",
       "state_type": null,
       "area": null,
       "area_type": null,
       "city": "London",
       "city_type": null,
       "settlement": null,
       "settlement_type": null,
       "address": "address",
       "street": "address",
       "street_type": null,
       "house": null,
       "flat": null,
       "is_kladr": false,
       "latitude": null,
       "longitude": null,
       "autodetected": null
     }
   },
   "client": {
     "id": 2,
     "email": "some-one@yandex.ru",
     "name": "Mortimer Hant",
     "phone": "+79162128506",
     "created_at": "2009-03-30T04:37:32.000+04:00",
     "updated_at": "2026-10-21T23:27:51.000+03:00",
     "comment": null,
     "registered": false,
     "subscribe": true,
     "client_group_id": null,
     "bonus_points": 0,
     "type": "Client::Individual",
     "correspondent_account": null,
     "settlement_account": null,
     "consent_to_personal_data": null,
     "o_auth_provider": null,
     "messenger_subscription": null,
     "external_id": null,
     "external_service": null,
     "contact_name": "Mortimer Hant",
     "surname": null,
     "middlename": null,
     "progressive_discount": null,
     "group_discount": null,
     "ip_addr": "",
     "fields_values": [
       {
         "id": 707,
         "value": "old value",
         "created_at": "2026-10-21T23:27:51.334+03:00",
         "updated_at": "2026-10-21T23:27:51.334+03:00",
         "field_id": 1016,
         "type": "Текст",
         "name": "special",
         "handle": null
       }
     ]
   },
   "discounts": [
     {
       "id": 139,
       "description": "-20 (absolute)",
       "warning": null,
       "type_id": 2,
       "amount": 20,
       "full_amount": 20,
       "percent": null,
       "discount": "20.0",
       "reference_id": null,
       "reference_type": null,
       "discount_products_ids": [
         1
       ],
       "discount_order_lines_ids": [
         47
       ],
       "discount_code_id": null,
       "created_at": "2026-10-21T23:27:51.000+03:00",
       "updated_at": "2026-10-21T23:27:51.000+03:00"
     }
   ],
   "total_price": 430,
   "paid_amount": 0,
   "items_price": 330,
   "id": 1,
   "key": "teest",
   "number": 1001,
   "comment": "comment",
   "archived": false,
   "delivery_title": "самовывоз",
   "delivery_description": "самовывоз",
   "delivery_price": 100,
   "full_delivery_price": 100,
   "payment_description": null,
   "payment_title": "наличными курьеру",
   "first_referer": "http://google.com?q=my_query",
   "first_current_location": "/my_query",
   "first_query": null,
   "first_source_domain": null,
   "first_source": "Google",
   "referer": "http://yandex.ru/yandsearch?text=%D1%81%D0%BF%D0%B0%D0%BB%D1%8C%D0%BD%D1%8B%D0%B5+%D0%BC%D0%B5%D1%88%D0%BA%D0%B8&stpar2=%2Fh1%2Ftm7%2Fs1&stpar4=%2Fs1&stpar1=%2Fu1&stpar3=%2Fm3%2Ftc14%2Fnc1",
   "current_location": "/",
   "query": null,
   "source_domain": null,
   "source": "Прямой трафик",
   "fulfillment_status": "new",
   "custom_status": {
     "permalink": "new",
     "title": "Новый"
   },
   "delivered_at": null,
   "accepted_at": null,
   "created_at": "2009-03-18T10:53:14.000+03:00",
   "updated_at": "2026-10-21T23:27:51.000+03:00",
   "financial_status": "pending",
   "delivery_date": null,
   "delivery_from_hour": null,
   "delivery_from_minutes": null,
   "delivery_to_hour": null,
   "delivery_to_minutes": null,
   "delivery_time": "",
   "paid_at": null,
   "delivery_variant_id": 1,
   "payment_gateway_id": 1,
   "margin": "0.0",
   "margin_amount": "0.0",
   "client_transaction_id": 1,
   "yandex_metrika_client_id": null,
   "currency_code": "RUR",
   "cookies": null,
   "account_id": 1,
   "manager_comment": "manager comment1",
   "locale": "ru",
   "delivery_info": {
     "delivery_variant_id": null,
     "tariff_id": null,
     "title": null,
     "description": null,
     "price": null,
     "shipping_company": null,
     "shipping_company_handle": null,
     "delivery_interval": {
       "min_days": null,
       "max_days": null,
       "description": ""
     },
     "errors": [],
     "warnings": [],
     "outlet": {
       "id": null,
       "external_id": null,
       "latitude": null,
       "longitude": null,
       "type": null,
       "title": null,
       "description": null,
       "address": null,
       "payment_method": null,
       "source_id": null
     },
     "not_available": null
   },
   "responsible_user_id": null,
   "total_profit": "150.0",
   "warehouse_id": null
 }

 insales.editOrder({
   token: '1234567890',
   url: 'shop-test.myinsales.ru',
   orderid: '1',
   order: {
     "order": {
       "shipping_address_attributes": {
         "address": "Moscow, Znamenka 12"
       }
     }
   }
 }).then(response => {
   console.info(response.data);
 }).catch(err => {
   console.error(err);
 });

Output:

 {
   "fields_values": [
     {
       "id": 747,
       "value": "old value",
       "created_at": "2026-10-21T23:27:52.167+03:00",
       "updated_at": "2026-10-21T23:27:52.167+03:00",
       "field_id": 1056,
       "type": "Текст",
       "name": "special",
       "handle": "my_awesome_field"
     }
   ],
   "order_lines": [
     {
       "id": 1,
       "order_id": 1,
       "sale_price": 300,
       "full_sale_price": 300,
       "total_price": 300,
       "full_total_price": 300,
       "discounts_amount": 0,
       "quantity": 1,
       "reserved_quantity": null,
       "weight": null,
       "dimensions": null,
       "variant_id": 1,
       "product_id": 1,
       "sku": "423",
       "barcode": null,
       "title": "Cool t-shirt",
       "unit": "pce",
       "comment": null,
       "updated_at": "2009-03-18T10:53:15.000+03:00",
       "created_at": "2009-03-18T10:53:14.000+03:00",
       "bundle_id": null,
       "vat": -1,
       "fiscal_product_type": 1,
       "requires_marking": null,
       "marking_codes": [
         "code1",
         "code2"
       ],
       "accessory_lines": [],
       "external_variant_id": null
     },
     {
       "id": 2,
       "order_id": 1,
       "sale_price": 600,
       "full_sale_price": 600,
       "total_price": 1200,
       "full_total_price": 1200,
       "discounts_amount": 0,
       "quantity": 2,
       "reserved_quantity": null,
       "weight": "0.3",
       "dimensions": null,
       "variant_id": 2,
       "product_id": 2,
       "sku": "424",
       "barcode": null,
       "title": "shirt",
       "unit": "pce",
       "comment": null,
       "updated_at": "2009-03-18T10:53:15.000+03:00",
       "created_at": "2009-03-18T10:53:14.000+03:00",
       "bundle_id": null,
       "vat": 20,
       "fiscal_product_type": 1,
       "requires_marking": null,
       "marking_codes": null,
       "accessory_lines": [],
       "external_variant_id": null
     }
   ],
   "order_changes": [],
   "discount": null,
   "shipping_address": {
     "id": 1,
     "fields_values": [
       {
         "id": 739,
         "value": "old value",
         "created_at": "2026-10-21T23:27:52.131+03:00",
         "updated_at": "2026-10-21T23:27:52.131+03:00",
         "field_id": 1048,
         "type": "Текст",
         "name": "special",
         "handle": null
       }
     ],
     "name": "Tom Dellay",
     "surname": null,
     "middlename": null,
     "phone": "+74952128506",
     "formatted_phone": "+7(495)212-85-06",
     "full_name": "Tom Dellay",
     "full_locality_name": "",
     "full_delivery_address": "123456, state, London, Moscow, Znamenka 12, old value",
     "address_for_gis": "123456, state, London, Moscow, Znamenka 12",
     "location_valid": true,
     "recipient_fields": [
       {
         "id": 11,
         "destiny": 2,
         "position": 1,
         "office_title": "Имя",
         "for_buyer": true,
         "obligatory": true,
         "active": true,
         "system_name": "name",
         "created_at": "2010-10-12T13:31:09.692+04:00",
         "updated_at": "2010-10-12T13:31:09.692+04:00",
         "show_in_result": true,
         "show_in_checkout": true,
         "is_indexed": null,
         "hide_in_backoffice": null,
         "handle": null,
         "placeholder": null,
         "title": null,
         "example": null,
         "type": "Field::ObligatoryTextField"
       },
       {
         "id": 12,
         "destiny": 2,
         "position": 2,
         "office_title": "Телефон",
         "for_buyer": true,
         "obligatory": true,
         "active": true,
         "system_name": "phone",
         "created_at": "2010-10-12T13:31:09.692+04:00",
         "updated_at": "2010-10-12T13:31:09.692+04:00",
         "show_in_result": true,
         "show_in_checkout": true,
         "is_indexed": null,
         "hide_in_backoffice": null,
         "handle": null,
         "placeholder": null,
         "title": null,
         "example": null,
         "type": "Field::Phone"
       }
     ],
     "backoffice_fields": [
       {
         "id": 4,
         "destiny": 1,
         "position": 3,
         "office_title": "Адрес",
         "for_buyer": true,
         "obligatory": false,
         "active": true,
         "system_name": "address",
         "created_at": "2010-10-12T13:31:09.692+04:00",
         "updated_at": "2010-10-12T13:31:09.692+04:00",
         "show_in_result": true,
         "show_in_checkout": true,
         "is_indexed": null,
         "hide_in_backoffice": null,
         "handle": null,
         "placeholder": null,
         "title": null,
         "example": null,
         "type": "Field::SystemTextArea"
       },
       {
         "id": 1048,
         "destiny": 1,
         "position": 22,
         "office_title": "special",
         "for_buyer": true,
         "obligatory": false,
         "active": true,
         "system_name": null,
         "created_at": "2026-10-21T23:27:52.120+03:00",
         "updated_at": "2026-10-21T23:27:52.120+03:00",
         "show_in_result": true,
         "show_in_checkout": true,
         "is_indexed": null,
         "hide_in_backoffice": null,
         "handle": null,
         "placeholder": null,
         "title": "special",
         "example": null,
         "type": "Field::TextField"
       },
       {
         "id": 1,
         "destiny": 1,
         "position": 0,
         "office_title": "Страна",
         "for_buyer": true,
         "obligatory": false,
         "active": false,
         "system_name": "country",
         "created_at": "2010-10-12T13:31:09.692+04:00",
         "updated_at": "2010-10-12T13:31:09.692+04:00",
         "show_in_result": true,
         "show_in_checkout": true,
         "is_indexed": null,
         "hide_in_backoffice": null,
         "handle": null,
         "placeholder": null,
         "title": null,
         "example": null,
         "type": "Field::Country"
       },
       {
         "id": 2,
         "destiny": 1,
         "position": 1,
         "office_title": "Регион",
         "for_buyer": true,
         "obligatory": false,
         "active": false,
         "system_name": "state",
         "created_at": "2010-10-12T13:31:09.692+04:00",
         "updated_at": "2010-10-12T13:31:09.692+04:00",
         "show_in_result": true,
         "show_in_checkout": true,
         "is_indexed": null,
         "hide_in_backoffice": null,
         "handle": null,
         "placeholder": null,
         "title": null,
         "example": null,
         "type": "Field::SystemTextField"
       },
       {
         "id": 3,
         "destiny": 1,
         "position": 2,
         "office_title": "Город",
         "for_buyer": true,
         "obligatory": false,
         "active": false,
         "system_name": "city",
         "created_at": "2010-10-12T13:31:09.692+04:00",
         "updated_at": "2010-10-12T13:31:09.692+04:00",
         "show_in_result": true,
         "show_in_checkout": true,
         "is_indexed": null,
         "hide_in_backoffice": null,
         "handle": null,
         "placeholder": null,
         "title": null,
         "example": null,
         "type": "Field::SystemTextField"
       },
       {
         "id": 5,
         "destiny": 1,
         "position": 4,
         "office_title": "Почтовый индекс",
         "for_buyer": true,
         "obligatory": false,
         "active": false,
         "system_name": "zip",
         "created_at": "2010-10-12T13:31:09.692+04:00",
         "updated_at": "2010-10-12T13:31:09.692+04:00",
         "show_in_result": true,
         "show_in_checkout": true,
         "is_indexed": null,
         "hide_in_backoffice": null,
         "handle": null,
         "placeholder": null,
         "title": null,
         "example": null,
         "type": "Field::SystemTextField"
       }
     ],
     "no_delivery": false,
     "kladr_autodetected_address": "",
     "country_options": [
       {
         "code": "RU",
         "title": "Россия",
         "selected": true
       }
     ],
     "address": "Moscow, Znamenka 12",
     "country": "RU",
     "state": "state",
     "city": "London",
     "zip": "123456",
     "street": null,
     "house": null,
     "flat": null,
     "entrance": null,
     "doorphone": null,
     "floor": null,
     "comment": null,
     "kladr_json": null,
     "location": {
       "kladr_code": null,
       "zip": "123456",
       "kladr_zip": null,
       "region_zip": null,
       "country": "RU",
       "state": "state",
       "state_type": null,
       "area": null,
       "area_type": null,
       "city": "London",
       "city_type": null,
       "settlement": null,
       "settlement_type": null,
       "address": "Moscow, Znamenka 12",
       "street": "Moscow",
       "street_type": null,
       "house": "Znamenka 12",
       "flat": null,
       "is_kladr": false,
       "latitude": null,
       "longitude": null,
       "autodetected": null
     }
   },
   "client": {
     "id": 2,
     "email": "some-one@yandex.ru",
     "name": "Mortimer Hant",
     "phone": "+79162128506",
     "created_at": "2009-03-30T04:37:32.000+04:00",
     "updated_at": "2026-10-21T23:27:52.000+03:00",
     "comment": null,
     "registered": false,
     "subscribe": true,
     "client_group_id": null,
     "bonus_points": 0,
     "type": "Client::Individual",
     "correspondent_account": null,
     "settlement_account": null,
     "consent_to_personal_data": null,
     "o_auth_provider": null,
     "messenger_subscription": null,
     "external_id": null,
     "external_service": null,
     "contact_name": "Mortimer Hant",
     "surname": null,
     "middlename": null,
     "progressive_discount": null,
     "group_discount": null,
     "ip_addr": "",
     "fields_values": [
       {
         "id": 731,
         "value": "old value",
         "created_at": "2026-10-21T23:27:52.106+03:00",
         "updated_at": "2026-10-21T23:27:52.106+03:00",
         "field_id": 1040,
         "type": "Текст",
         "name": "special",
         "handle": null
       }
     ]
   },
   "discounts": [],
   "total_price": 1600,
   "paid_amount": 0,
   "items_price": 1500,
   "id": 1,
   "key": "teest",
   "number": 1001,
   "comment": "comment",
   "archived": false,
   "delivery_title": "самовывоз",
   "delivery_description": "самовывоз",
   "delivery_price": 100,
   "full_delivery_price": 100,
   "payment_description": null,
   "payment_title": "наличными курьеру",
   "first_referer": "http://google.com?q=my_query",
   "first_current_location": "/my_query",
   "first_query": null,
   "first_source_domain": null,
   "first_source": "Google",
   "referer": "http://yandex.ru/yandsearch?text=%D1%81%D0%BF%D0%B0%D0%BB%D1%8C%D0%BD%D1%8B%D0%B5+%D0%BC%D0%B5%D1%88%D0%BA%D0%B8&stpar2=%2Fh1%2Ftm7%2Fs1&stpar4=%2Fs1&stpar1=%2Fu1&stpar3=%2Fm3%2Ftc14%2Fnc1",
   "current_location": "/",
   "query": null,
   "source_domain": null,
   "source": "Прямой трафик",
   "fulfillment_status": "new",
   "custom_status": {
     "permalink": "new",
     "title": "Новый"
   },
   "delivered_at": null,
   "accepted_at": null,
   "created_at": "2009-03-18T10:53:14.000+03:00",
   "updated_at": "2026-10-21T23:27:52.000+03:00",
   "financial_status": "pending",
   "delivery_date": null,
   "delivery_from_hour": null,
   "delivery_from_minutes": null,
   "delivery_to_hour": null,
   "delivery_to_minutes": null,
   "delivery_time": "",
   "paid_at": null,
   "delivery_variant_id": 1,
   "payment_gateway_id": 1,
   "margin": "0.0",
   "margin_amount": "0.0",
   "client_transaction_id": 1,
   "yandex_metrika_client_id": null,
   "currency_code": "RUR",
   "cookies": null,
   "account_id": 1,
   "manager_comment": "manager comment1",
   "locale": "ru",
   "delivery_info": {
     "delivery_variant_id": null,
     "tariff_id": null,
     "title": null,
     "description": null,
     "price": null,
     "shipping_company": null,
     "shipping_company_handle": null,
     "delivery_interval": {
       "min_days": null,
       "max_days": null,
       "description": ""
     },
     "errors": [],
     "warnings": [],
     "outlet": {
       "id": null,
       "external_id": null,
       "latitude": null,
       "longitude": null,
       "type": null,
       "title": null,
       "description": null,
       "address": null,
       "payment_method": null,
       "source_id": null
     },
     "not_available": null
   },
   "responsible_user_id": null,
   "total_profit": "1500.0",
   "warehouse_id": null
 }

Params:

NameTypeAttributeDescription
options Object
options.token string

Required, access token for shop

options.url string

Required, shop url

options.orderid number | string

Required, order id

options.order object

Required, order

id Number | String

Required, app id

Return:

Promise

public editOutlet(options: Object, id: Number | String): Promise source

import {editOutlet} from 'insales/lib/api/outlet.js'

PUT /admin/outlets/{outlet_id}.json

Examples:

 insales.editOutlet({
   token: '1234567890',
   url: 'shop-test.myinsales.ru',
   outletid: '10',
   outlet: {
     "outlet": {
       "title": "New point title",
       "description": "New point description",
       "address": "some new address",
       "price": 300,
       "latitude": 55.7558,
       "longitude": 37.6173
     }
   }
 }).then(response => {
   console.info(response.data);
 }).catch(err => {
   console.error(err);
 });

Output:

 {
   "delivery_variant_id": 257,
   "title": "New point title",
   "description": "New point description",
   "address": "some new address",
   "price": "300.0",
   "latitude": "55.7558",
   "longitude": "37.6173",
   "title_translations": [
     "New point title"
   ],
   "description_translations": [
     "New point description"
   ],
   "id": 10,
   "account_id": 1,
   "created_at": "2026-10-21T23:31:00.235+03:00",
   "updated_at": "2026-10-21T23:31:00.324+03:00"
 }

Params:

NameTypeAttributeDescription
options Object
options.token string

Required, access token for shop

options.url string

Required, shop url

options.outletid number | string

Required, outlet id

options.outlet object

Required, outlet

id Number | String

Required, app id

Return:

Promise

public editPage(options: Object, id: Number | String): Promise source

import {editPage} from 'insales/lib/api/page.js'

PUT /admin/pages/{page_id}.json

Examples:

 insales.editPage({
   token: '1234567890',
   url: 'shop-test.myinsales.ru',
   pageid: '1',
   page: {
     "page": {
       "title": "new title"
     }
   }
 }).then(response => {
   console.info(response.data);
 }).catch(err => {
   console.error(err);
 });

Output:

 {
   "status": "ok"
 }

Params:

NameTypeAttributeDescription
options Object
options.token string

Required, access token for shop

options.url string

Required, shop url

options.pageid number | string

Required, page id

options.page object

Required, page

id Number | String

Required, app id

Return:

Promise

public editPaymentGateway(options: Object, id: Number | String): Promise source

import {editPaymentGateway} from 'insales/lib/api/paymentgateway.js'

PUT /admin/payment_gateways/{payment_gateway_id_1}.json

Examples:

 insales.editPaymentGateway({
   token: '1234567890',
   url: 'shop-test.myinsales.ru',
   gatewayid: '1',
   paymentgateway: {
     "payment_gateway": {
       "title": "cash",
       "margin": 10,
       "description": "description",
       "payment_delivery_variants_attributes": [
         {
           "_destroy": 1,
           "id": 2
         },
         {
           "delivery_variant_id": 2
         }
       ]
     }
   }
 }).then(response => {
   console.info(response.data);
 }).catch(err => {
   console.error(err);
 });

Output:

 {
   "id": 1,
   "type": "PaymentGateway::Cod",
   "position": 1,
   "created_at": "2009-03-30T04:37:32.000+04:00",
   "updated_at": "2026-10-21T23:30:58.000+03:00",
   "margin": "10.0",
   "available_for_individual_clients": true,
   "available_for_juridical_clients": true,
   "title": "cash",
   "description": "description",
   "payment_delivery_variants": [
     {
       "created_at": "2026-10-19T22:28:42.000+03:00",
       "delivery_variant_id": 1,
       "id": 1
     },
     {
       "created_at": "2026-10-19T22:28:42.000+03:00",
       "delivery_variant_id": 2,
       "id": 2
     }
   ]
 }

Params:

NameTypeAttributeDescription
options Object
options.token string

Required, access token for shop

options.url string

Required, shop url

options.gatewayid number | string

Required, payment gateway id

options.paymentgateway object

Required, payment gateway

id Number | String

Required, app id

Return:

Promise

public editPriceKind(options: Object, id: Number | String): Promise source

import {editPriceKind} from 'insales/lib/api/pricekind.js'

PUT /admin/price_kinds/{id}.xml

Examples:

 insales.editPriceKind({
   token: '1234567890',
   url: 'shop-test.myinsales.ru',
   id: '111',
   pricekind: {
      'price_kind': {
        'title': 'name123'
      }
   }
 }).then(output => {
   console.info(output.data);
 }).catch(err => {
   console.error(err);
 });

Output:

 {
   "id": 111,
   "price_index": 3,
   "show_in_lists": true,
   "title": "name123",
   "variant_price_method_name": "price3"
 }

Params:

NameTypeAttributeDescription
options Object
options.token string

Required, access token for shop

options.url string

Required, shop url

options.id number | string

Required, price kind id

options.pricekind object

Required, price kind

id Number | String

Required, app id

Return:

Promise

public editProduct(options: Object, id: Number | String): Promise source

import {editProduct} from 'insales/lib/api/product.js'

PUT /admin/products/{id}.xml

Examples:

 insales.editProduct({
   token: '1234567890',
   url: 'shop-test.myinsales.ru',
   productid: '12345',
   product: {
     'product': {
       'title': 'Product 2',
     }
   }
 }).then(output => {
   console.info(output.data);
 }).catch(err => {
   console.error(err);
 });

Output:

 { product:
   { archived: 'false',
     available: '',
     'canonical-url-collection-id': '',
     'category-id': '1',
     'created-at': '2011-11-11 11:11:11 +0300',
     id: '12345',
     'is-hidden': 'false',
     'sort-weight': '',
     unit: 'pcs',
     'updated-at': '2011-11-11 11:11:11 +0300',
     title: 'Product 2',
     'short-description': '',
     permalink: 'product-1',
     'html-title': '',
     'meta-keywords': '',
     'meta-description': '',
     'currency-code': 'RUR',
     'collections-ids': '',
     images: '',
     'option-names': '',
     properties: '',
     characteristics: '',
     'product-field-values': '',
     variants: { variant: [Object] },
     description: '' } }

Params:

NameTypeAttributeDescription
options Object
options.token string

Required, access token for shop

options.url string

Required, shop url

options.productid number | string

Required, product id

options.product object

Required, product

id Number | String

Required, app id

Return:

Promise

public editProductField(options: Object, id: Number | String): Promise source

import {editProductField} from 'insales/lib/api/productfield.js'

PUT /admin/product_fields/{product_field_id}.json

Examples:

 insales.editProductField({
   token: '1234567890',
   url: 'shop-test.myinsales.ru',
   fieldid: '2',
   productfield: {
     "product_field": {
       "title": "Volume",
       "handle": "volume",
       "position": 2
     }
   }
 }).then(response => {
   console.info(response.data);
 }).catch(err => {
   console.error(err);
 });

Output:

 {
   "id": 2,
   "handle": "volume",
   "type": "ProductField::TextArea",
   "application_id": 1,
   "position": 2,
   "is_hidden": null,
   "is_indexed": null,
   "title": "Volume",
   "application_title": "Цифровые товары"
 }

 insales.editProductField({
   token: '1234567890',
   url: 'shop-test.myinsales.ru',
   fieldid: 'handle2',
   productfield: {
     "product_field": {
       "title": "Volume",
       "position": 2
     }
   }
 }).then(response => {
   console.info(response.data);
 }).catch(err => {
   console.error(err);
 });

Output:

 {
   "id": 2,
   "handle": "handle2",
   "type": "ProductField::TextArea",
   "application_id": 1,
   "position": 2,
   "is_hidden": null,
   "is_indexed": null,
   "title": "Volume",
   "application_title": "Цифровые товары"
 }

Params:

NameTypeAttributeDescription
options Object
options.token string

Required, access token for shop

options.url string

Required, shop url

options.fieldid number | string

Required, product field id or handle

options.productfield object

Required, product field id or handle

id Number | String

Required, app id

Return:

Promise

public editProductFieldValue(options: Object, id: Number | String): Promise source

import {editProductFieldValue} from 'insales/lib/api/productfieldvalue.js'

PUT /admin/products/{product_id}/product_field_values/{product_field_value_id}.json

Examples:

 insales.editProductFieldValue({
   token: '1234567890',
   url: 'shop-test.myinsales.ru',
   productid: '1',
   valueid: '1',
   fieldvalue: {
     "product_field_value": {
       "value": "new value"
     }
   }
 }).then(response => {
   console.info(response.data);
 }).catch(err => {
   console.error(err);
 });

Output:

 {
   "id": 1,
   "product_field_id": 1,
   "value": "new value"
 }

 insales.editProductFieldValue({
   token: '1234567890',
   url: 'shop-test.myinsales.ru',
   productid: '1',
   valueid: 'handle',
   fieldvalue: {
     "product_field_value": {
       "value": "new value"
     }
   }
 }).then(response => {
   console.info(response.data);
 }).catch(err => {
   console.error(err);
 });

Output:

 {
   "id": 1,
   "product_field_id": 1,
   "value": "new value"
 }

Params:

NameTypeAttributeDescription
options Object
options.token string

Required, access token for shop

options.url string

Required, shop url

options.productid number | string

Required, product id

options.valueid number | string

Required, product field value id or field handle

options.fieldvalue object

Required, product field value id or field handle

id Number | String

Required, app id

Return:

Promise

public editProductImage(options: Object, id: Number | String): Promise source

import {editProductImage} from 'insales/lib/api/productimage.js'

PUT /admin/products/{product_id}/images/{image_id}.json

Examples:

 insales.editProductImage({
   token: '1234567890',
   url: 'shop-test.myinsales.ru',
   productid: '1',
   productimageid: '4403',
   productimage: {
     "image": {
       "position": 5,
       "title": "myimage"
     }
   }
 }).then(response => {
   console.info(response.data);
 }).catch(err => {
   console.error(err);
 });

Output:

 {
   "id": 4403,
   "product_id": 1,
   "external_id": null,
   "position": 5,
   "created_at": "2026-10-21T23:12:44.000+03:00",
   "image_processing": true,
   "title": "myimage",
   "url": "/images/loading.gif",
   "original_url": "/images/loading.gif",
   "medium_url": "/images/loading.gif",
   "small_url": "/images/loading.gif",
   "thumb_url": "/images/loading.gif",
   "compact_url": "/images/loading.gif",
   "large_url": "/images/loading.gif",
   "filename": "image.jpg",
   "has_bitmap_image": false,
   "image_content_type": "image/jpeg"
 }

Params:

NameTypeAttributeDescription
options Object
options.token string

Required, access token for shop

options.url string

Required, shop url

options.productid number | string

Required, product id

options.productimageid number | string

Required, product image id

options.productimage object

Required, product image

id Number | String

Required, app id

Return:

Promise

public editProperty(options: Object, id: Number | String): Promise source

import {editProperty} from 'insales/lib/api/property.js'

PUT /admin/properties/{property_id}.json

Examples:

 insales.editProperty({
   token: '1234567890',
   url: 'shop-test.myinsales.ru',
   propertyid: '1',
   property: {
     "property": {
       "title": "Brand country"
     }
   }
 }).then(response => {
   console.info(response.data);
 }).catch(err => {
   console.error(err);
 });

Output:

 {
   "id": 1,
   "position": 8,
   "backoffice": false,
   "is_hidden": false,
   "is_navigational": true,
   "permalink": "producer",
   "title": "Brand country"
 }

Params:

NameTypeAttributeDescription
options Object
options.token string

Required, access token for shop

options.url string

Required, shop url

options.propertyid number | string

Required, property id

options.property object

Required, property

id Number | String

Required, app id

Return:

Promise

public editReview(options: Object, id: Number | String): Promise source

import {editReview} from 'insales/lib/api/review.js'

PUT /admin/reviews/{review_id}.json

Examples:

 insales.editReview({
   token: '1234567890',
   url: 'shop-test.myinsales.ru',
   reviewid: '1',
   review: {
     "review": {
       "content": "Sweet product!"
     }
   }
 }).then(response => {
   console.info(response.data);
 }).catch(err => {
   console.error(err);
 });

Output:

 {
   "id": 1,
   "product_id": 1,
   "author": "Автор 1",
   "content": "Sweet product!",
   "email": "email1@example.com",
   "rating": 5,
   "manager_name": null,
   "published": true,
   "created_at": "2023-09-01T13:00:00.000+03:00",
   "updated_at": "2026-10-21T23:10:52.000+03:00",
   "manager_reply": "nil",
   "replied_at": null,
   "spam": false,
   "published_at": null,
   "replied_q": false,
   "title": "Cool t-shirt",
   "url": "/product/футболка",
   "first_image": {
     "id": null,
     "product_id": null,
     "external_id": null,
     "position": null,
     "created_at": null,
     "image_processing": null,
     "title": null,
     "url": "/images/no_image_thumb.jpg",
     "original_url": "/images/no_image_original.jpg",
     "medium_url": "/images/no_image_medium.jpg",
     "small_url": "/images/no_image_micro.jpg",
     "thumb_url": "/images/no_image_thumb.jpg",
     "compact_url": "/images/no_image_compact.jpg",
     "large_url": "/images/no_image_large.jpg",
     "filename": null,
     "has_bitmap_image": false,
     "image_content_type": null
   },
   "image": {
     "id": 1,
     "created_at": "2023-09-01T13:00:00.000+03:00",
     "original_url": "http://minio.insales.io:9000/insales-test-sber/images/reviews/1/1/1/image_1.jpg",
     "medium_url": "http://minio.insales.io:9000/insales-test-sber/images/reviews/1/1/1/medium_image_1.jpg",
     "small_url": "http://minio.insales.io:9000/insales-test-sber/images/reviews/1/1/1/micro_image_1.jpg",
     "thumb_url": "http://minio.insales.io:9000/insales-test-sber/images/reviews/1/1/1/thumb_image_1.jpg",
     "compact_url": "http://minio.insales.io:9000/insales-test-sber/images/reviews/1/1/1/compact_image_1.jpg",
     "large_url": "http://minio.insales.io:9000/insales-test-sber/images/reviews/1/1/1/large_image_1.jpg",
     "image_content_type": "image/jpeg"
   }
 }

Params:

NameTypeAttributeDescription
options Object
options.token string

Required, access token for shop

options.url string

Required, shop url

options.reviewid number | string

Required, review id

options.review object

Required, review

id Number | String

Required, app id

Return:

Promise

public editStockCurrency(options: Object, id: Number | String): Promise source

import {editStockCurrency} from 'insales/lib/api/stockcurrency.js'

PUT /admin/stock_currencies/{stock_currency_id}.json

Examples:

 insales.editStockCurrency({
   token: '1234567890',
   url: 'shop-test.myinsales.ru',
   currencyid: '1',
   stockcurrency: {
     "stock_currency": {
       "code": "UAH",
       "is_default": true,
       "exchange_rate_use_cb": false,
       "exchange_rate_manual": 40,
       "exchange_rate_percent": 0
     }
   }
 }).then(response => {
   console.info(response.data);
 }).catch(err => {
   console.error(err);
 });

Output:

 {
   "id": 1,
   "is_default": true,
   "exchange_rate_use_cb": false,
   "exchange_rate_manual": "40.0",
   "exchange_rate_percent": "0.0",
   "exchange_rate_round": true,
   "code": "UAH",
   "title": "Украинская гривна",
   "cb_rate": "5.0",
   "unit": "грн.",
   "exchange_rate": "40.0"
 }

Params:

NameTypeAttributeDescription
options Object
options.token string

Required, access token for shop

options.url string

Required, shop url

options.currencyid number | string

Required, stock currency id

options.stockcurrency object

Required, stock currency

id Number | String

Required, app id

Return:

Promise

public editUserTask(options: Object, id: Number | String): Promise source

import {editUserTask} from 'insales/lib/api/usertask.js'

PUT /admin/user_tasks/{user_task_id}.json

Examples:

 insales.editUserTask({
   token: '1234567890',
   url: 'shop-test.myinsales.ru',
   taskid: '10',
   usertask: {
     "user_task": {
       "title": "new title",
       "description": "new description",
       "complete": true
     }
   }
 }).then(response => {
   console.info(response.data);
 }).catch(err => {
   console.error(err);
 });

Output:

 {
   "id": 10,
   "complete": true,
   "order_id": null,
   "assignee_id": 1,
   "title": "new title",
   "description": "new description",
   "created_at": "2026-10-21T23:32:39.874+03:00",
   "updated_at": "2026-10-21T23:32:39.972+03:00",
   "deadline_at": "2021-01-01T00:00:00.000+03:00"
 }

Params:

NameTypeAttributeDescription
options Object
options.token string

Required, access token for shop

options.url string

Required, shop url

options.taskid number | string

Required, user task id

options.usertask object

Required, user task

id Number | String

Required, app id

Return:

Promise

public editVariant(options: Object, id: Number | String): Promise source

import {editVariant} from 'insales/lib/api/variant.js'

PUT /admin/products/{product_id}/variants/{variant_id}.json

Examples:

 insales.editVariant({
   token: '1234567890',
   url: 'shop-test.myinsales.ru',
   productid: '1',
   variantid: '1',
   variant: {
     "variant": {
       "price": 150,
       "quantity_at_warehouse0": 50,
       "variant_field_values_attributes": [
         {
           "handle": "handle",
           "value": 12345
         }
       ]
     }
   }
 }).then(response => {
   console.info(response.data);
 }).catch(err => {
   console.error(err);
 });

Output:

 {
   "id": 1,
   "title": "Red",
   "product_id": 1,
   "sku": "423",
   "barcode": null,
   "dimensions": "10x20x30",
   "available": true,
   "image_ids": [],
   "image_id": null,
   "weight": null,
   "created_at": "2009-03-18T10:53:14.000+03:00",
   "updated_at": "2026-10-21T23:12:51.000+03:00",
   "quantity": 50,
   "quantity_at_warehouse0": "50.0",
   "quantity_at_warehouse1": "0.0",
   "cost_price": "3.0",
   "cost_price_in_site_currency": "90.0",
   "price_in_site_currency": "4500.0",
   "base_price": "150.0",
   "old_price": null,
   "price2": 12,
   "price": "150.0",
   "base_price_in_site_currency": "4500.0",
   "old_price_in_site_currency": null,
   "price2_in_site_currency": "360.0",
   "prices": [
     12
   ],
   "prices_in_site_currency": [
     "360.0"
   ],
   "variant_field_values": [
     {
       "id": 1,
       "variant_field_id": 1,
       "value": "12345"
     }
   ],
   "option_values": [
     {
       "id": 1,
       "option_name_id": 1,
       "position": 1,
       "title": "Red",
       "image_url": null,
       "permalink": null
     }
   ]
 }

Params:

NameTypeAttributeDescription
options Object
options.token string

Required, access token for shop

options.url string

Required, shop url

options.productid number | string

Required, product id

options.variantid number | string

Required, variant id

options.variant object

Required, variant

id Number | String

Required, app id

Return:

Promise

public editVariantField(options: Object, id: Number | String): Promise source

import {editVariantField} from 'insales/lib/api/variantfield.js'

PUT /admin/variant_fields/{variant_field_id}.json

Examples:

 insales.editVariantField({
   token: '1234567890',
   url: 'shop-test.myinsales.ru',
   fieldid: '2',
   variantfield: {
     "variant_field": {
       "title": "Volume",
       "handle": "volume",
       "position": 2
     }
   }
 }).then(response => {
   console.info(response.data);
 }).catch(err => {
   console.error(err);
 });

Output:

 {
   "id": 2,
   "handle": "volume",
   "type": "VariantField::TextArea",
   "application_id": 1,
   "position": 2,
   "is_hidden": null,
   "title": "Volume",
   "application_title": "Цифровые товары"
 }

 insales.editVariantField({
   token: '1234567890',
   url: 'shop-test.myinsales.ru',
   fieldid: 'handle2',
   variantfield: {
     "variant_field": {
       "title": "Volume",
       "position": 2
     }
   }
 }).then(response => {
   console.info(response.data);
 }).catch(err => {
   console.error(err);
 });

Output:

 {
   "id": 2,
   "handle": "handle2",
   "type": "VariantField::TextArea",
   "application_id": 1,
   "position": 2,
   "is_hidden": null,
   "title": "Volume",
   "application_title": "Цифровые товары"
 }

Params:

NameTypeAttributeDescription
options Object
options.token string

Required, access token for shop

options.url string

Required, shop url

options.fieldid number | string

Required, variant field id or handle

options.variantfield object

Required, variant field id or handle

id Number | String

Required, app id

Return:

Promise

public editVariantFieldValue(options: Object, id: Number | String): Promise source

import {editVariantFieldValue} from 'insales/lib/api/variantfieldvalue.js'

PUT /admin/variants/{variant_id}/variant_field_values/{variant_field_value_id}.json

Examples:

 insales.editVariantFieldValue({
   token: '1234567890',
   url: 'shop-test.myinsales.ru',
   variantid: '1',
   valueid: '1',
   fieldvalue: {
     "variant_field_value": {
       "value": "new value"
     }
   }
 }).then(response => {
   console.info(response.data);
 }).catch(err => {
   console.error(err);
 });

Output:

 {
   "id": 1,
   "variant_field_id": 1,
   "value": "new value"
 }

 insales.editVariantFieldValue({
   token: '1234567890',
   url: 'shop-test.myinsales.ru',
   variantid: '1',
   valueid: 'handle',
   fieldvalue: {
     "variant_field_value": {
       "value": "new value"
     }
   }
 }).then(response => {
   console.info(response.data);
 }).catch(err => {
   console.error(err);
 });

Output:

 {
   "id": 1,
   "variant_field_id": 1,
   "value": "new value"
 }

Params:

NameTypeAttributeDescription
options Object
options.token string

Required, access token for shop

options.url string

Required, shop url

options.variantid number | string

Required, variant id

options.valueid number | string

Required, variant field value id or field handle

options.fieldvalue object

Required, variant field value id or field handle

id Number | String

Required, app id

Return:

Promise

public editVariantGroup(options: Object, id: Number | String): Promise source

import {editVariantGroup} from 'insales/lib/api/variant.js'

PUT /admin/products/variants_group_update.json

Examples:

 insales.editVariantGroup({
   token: '1234567890',
   url: 'shop-test.myinsales.ru',
   variants: {
     "variants": [
       {
         "id": 1,
         "price": 100,
         "quantity_at_warehouse0": 3
       }
     ]
   }
 }).then(response => {
   console.info(response.data);
 }).catch(err => {
   console.error(err);
 });

Output:

 []

 insales.editVariantGroup({
   token: '1234567890',
   url: 'shop-test.myinsales.ru',
   variants: {
     "variants": [
       {
         "id": 1,
         "price": 100,
         "quantity_at_warehouse0": 3,
         "quantity_at_warehouses": [
           5,
           2
         ]
       }
     ]
   }
 }).then(response => {
   console.info(response.data);
 }).catch(err => {
   console.error(err);
 });

Output:

 []

Params:

NameTypeAttributeDescription
options Object
options.token string

Required, access token for shop

options.url string

Required, shop url

options.variants object

Required, variants group

id Number | String

Required, app id

Return:

Promise

public editWarehouse(options: Object, id: Number | String): Promise source

import {editWarehouse} from 'insales/lib/api/warehouse.js'

PUT /admin/warehouses/{warehouse_id}.json

Examples:

 insales.editWarehouse({
   token: '1234567890',
   url: 'shop-test.myinsales.ru',
   warehouseid: '45',
   warehouse: {
     "warehouse": {
       "title": "new title",
       "position": 2
     }
   }
 }).then(response => {
   console.info(response.data);
 }).catch(err => {
   console.error(err);
 });

Output:

 {
   "id": 45,
   "title": "new title",
   "position": 2,
   "array_index": 1,
   "created_at": "2026-10-21T23:23:03.523+03:00",
   "updated_at": "2026-10-21T23:23:03.657+03:00",
   "status": "creating"
 }

Params:

NameTypeAttributeDescription
options Object
options.token string

Required, access token for shop

options.url string

Required, shop url

options.warehouseid number | string

Required, warehouse id

options.warehouse object

Required, warehouse

id Number | String

Required, app id

Return:

Promise

public editWebhook(options: Object, id: Number | String): Promise source

import {editWebhook} from 'insales/lib/api/webhook.js'

PUT /admin/webhooks/{webhook_id}.json

Examples:

 insales.editWebhook({
   token: '1234567890',
   url: 'shop-test.myinsales.ru',
   webhookid: '16',
   webhook: {
     "webhook": {
       "format_type": "xml"
     }
   }
 }).then(response => {
   console.info(response.data);
 }).catch(err => {
   console.error(err);
 });

Output:

 {
   "address": "http://app.ru/orders/create",
   "created_at": "2026-10-21T23:32:49.126+03:00",
   "id": 16,
   "topic": "orders/create",
   "format_type": "xml",
   "warehouse_id": null,
   "sales_channel_id": null,
   "batch_size": null
 }

Params:

NameTypeAttributeDescription
options Object
options.token string

Required, access token for shop

options.url string

Required, shop url

options.webhookid number | string

Required, webhook id

options.webhook object

Required, webhook

id Number | String

Required, app id

Return:

Promise

public editWidgetType(options: Object, id: Number | String): Promise source

import {editWidgetType} from 'insales/lib/api/widget_types.js'

PUT /admin/themes/#{theme_id}/widget_types/#{id}.xml

Examples:

 insales.editWidgetType({
   token: '1234567890',
   url: 'shop-test.myinsales.ru',
   theme: '643879',
   widgetId: '60423000',
   data: {
     'snippet_content': 'New text'
   }
 }).then(output => {
   console.info(output.response.statusCode);
 }).catch(err => {
   console.error(err);
 });

Output:

 {

'type': 'BlockListWidgetType', 'handle': 'widget_type_2', 'name': 'WidgetType 2', 'snippet_content': 'New text' 'widget_category_handle': 'drugie', 'page_kinds': ['all'], 'widget_list_kinds': ['content'], 'block_template_handle': 'system-title-and-content' }

Params:

NameTypeAttributeDescription
options Object
options.token string

Required, access token for shop

options.url string

Required, shop url

options.data Object

Required, widget content

options.theme Number | String

Required, theme id

options.widgetId Number | String

Required, widget id

id Number | String

Required, app id

Return:

Promise

public error(response: Object): Object source

import error from 'insales/lib/error.js'

Output Request-Promise error, used to create Promise reject

Params:

NameTypeAttributeDescription
response Object

Required, full response data

Return:

Object

Return Properties:

NameTypeAttributeDescription
type String

Name of error

url String

Url where error happen

method String

Http method

msg String

Error message

response Object

Full response

statusCode Number

Status code

public get(conn: Object): Promise source

import {get} from 'insales/lib/methods/get.js'

GET request

Params:

NameTypeAttributeDescription
conn Object
conn.id string

Required, app id

conn.token string

Required, token to access shop

conn.url string

Required, shop url

conn.api string

Required, api endpoint

conn.query object
  • optional

URL query string

Return:

Promise

public getAccessory(options: Object, id: Number | String): Promise source

import {getAccessory} from 'insales/lib/api/accessory.js'

GET /admin/accessories/{accessory_id}.json

Examples:

 insales.getAccessory({
   token: '1234567890',
   url: 'shop-test.myinsales.ru',
   accessoryid: '44'
 }).then(response => {
   console.info(response.data);
 }).catch(err => {
   console.error(err);
 });

Output:

 {
   "id": 44,
   "account_id": 1,
   "name_translations": [
     "Интеллектуальный Резиновый Нож"
   ],
   "min_count": 4,
   "max_count": 6,
   "created_at": "2026-10-21T23:15:57.058+03:00",
   "updated_at": "2026-10-21T23:15:57.058+03:00",
   "back_office_name": "Интеллектуальный Пластиковый Часы",
   "permalink": "eum_perferendis",
   "name": "Интеллектуальный Резиновый Нож"
 }

Params:

NameTypeAttributeDescription
options Object
options.token string

Required, access token for shop

options.url string

Required, shop url

options.accessoryid number | string

Required, accessory id

id Number | String

Required, app id

Return:

Promise

public getAccessoryValue(options: Object, id: Number | String): Promise source

import {getAccessoryValue} from 'insales/lib/api/accessoryvalue.js'

GET /admin/accessories/{accessory_id}/values/{accessory_value_id}.json

Examples:

 insales.getAccessoryValue({
   token: '1234567890',
   url: 'shop-test.myinsales.ru',
   accessoryid: '90',
   accessoryvalueid: '64'
 }).then(response => {
   console.info(response.data);
 }).catch(err => {
   console.error(err);
 });

Output:

 {
   "id": 64,
   "account_id": 1,
   "accessory_id": 90,
   "name_translations": [
     "Значение опции"
   ],
   "price": "2.57",
   "created_at": "2026-10-21T23:15:59.533+03:00",
   "updated_at": "2026-10-21T23:15:59.533+03:00",
   "accounting_variant_id": null,
   "name": "Значение опции"
 }

Params:

NameTypeAttributeDescription
options Object
options.token string

Required, access token for shop

options.url string

Required, shop url

options.accessoryid number | string

Required, accessory id

options.accessoryvalueid number | string

Required, accessory value id

id Number | String

Required, app id

Return:

Promise

public getAccount(options: Object, id: number | string): Promise source

import {getAccount} from 'insales/lib/api/account.js'

GET /admin/account.xml

Examples:

 insales.getAccount({
   token: '1234567890',
   url: 'shop-test.myinsales.ru'
 }).then(response => {
   console.info(response.data);
 }).catch(err => {
   console.error(err);
 });

Output:

 { account:
    { blocked: 'false',
      city: 'Москва',
      'contact-phone': '',
      country: 'RU',
      'enable-cart-discounts': 'true',
      'enable-client-discounts': 'false',
      'enable-group-discounts': 'true',
      'enable-order-discounts': 'false',
      'hide-items-out-of-stock': 'false',
      id: '12345',
      'notification-email': '',
      organization: '',
      'sms-notification-phone': '',
      state: 'г Москва',
      subdomain: 'shop-test',
      email: 'mail@mail.ru',
      icq: '',
      phone: '+71234567890',
      title: 'Название магазина',
      'minimum-items-price': '',
      'stock-currency-exchange-rate': '1.0',
      'client-cookies-whitelist': '',
      'main-host': 'shop-test.myinsales.ru',
      'next-order-number': '1040',
      'time-zone': 'Moscow',
      owner:
       { 'created-at': '2011-11-11 11:11:11 +0400',
         email: 'mail@mail.ru',
         id: '12345',
          name: 'Имя' } } }

Params:

NameTypeAttributeDescription
options Object
options.token string

Required, access token for shop

options.url string

Required, shop url

id number | string

Required, app id

Return:

Promise

public getApplicationAction(options: Object, id: Number | String): Promise source

import {getApplicationAction} from 'insales/lib/api/applicationaction.js'

GET /admin/application_actions/{application_action_id}.json

Examples:

 insales.getApplicationAction({
   token: '1234567890',
   url: 'shop-test.myinsales.ru',
   actionid: '1'
 }).then(response => {
   console.info(response.data);
 }).catch(err => {
   console.error(err);
 });

Output:

 {
   "id": 1,
   "title": "test",
   "url": "http://www.google.ru",
   "handle": "test",
   "entity": "order"
 }

Params:

NameTypeAttributeDescription
options Object
options.token string

Required, access token for shop

options.url string

Required, shop url

options.actionid number | string

Required, application action id

id Number | String

Required, app id

Return:

Promise

public getApplicationWidget(options: Object, id: Number | String): Promise source

import {getApplicationWidget} from 'insales/lib/api/applicationwidget.js'

GET /admin/application_widgets/{application_widget_id}.json

Examples:

 insales.getApplicationWidget({
   token: '1234567890',
   url: 'shop-test.myinsales.ru',
   widgetid: '25'
 }).then(response => {
   console.info(response.data);
 }).catch(err => {
   console.error(err);
 });

Output:

 {
   "code": "html/js code",
   "created_at": "2026-10-21T23:32:46.605+03:00",
   "id": 25,
   "height": 50,
   "page_type": "product"
 }

Params:

NameTypeAttributeDescription
options Object
options.token string

Required, access token for shop

options.url string

Required, shop url

options.widgetid number | string

Required, application widget id

id Number | String

Required, app id

Return:

Promise

public getArticle(options: Object, id: Number | String): Promise source

import {getArticle} from 'insales/lib/api/article.js'

GET /admin/blogs/{blog_id}/articles/{article_id}.json

Examples:

 insales.getArticle({
   token: '1234567890',
   url: 'shop-test.myinsales.ru',
   blogid: '1',
   articleid: '2'
 }).then(response => {
   console.info(response.data);
 }).catch(err => {
   console.error(err);
 });

Output:

 {
   "id": 2,
   "created_at": "2026-10-20T12:13:53.000+03:00",
   "updated_at": "2026-10-21T23:05:52.000+03:00",
   "published_at": "2017-03-01T07:53:15.000+03:00",
   "pinned": false,
   "custom_template": null,
   "title": "Второая Статья",
   "author": "Ivan",
   "permalink": "statya-2",
   "html_title": null,
   "meta_keywords": null,
   "meta_description": null,
   "image": {
     "id": 1,
     "created_at": "2026-10-19T22:28:42.000+03:00",
     "original_url": "http://minio.insales.io:9000/insales-test-sber/images/articles/1/1/1/article_image_1.jpg"
   },
   "tags": [
     {
       "title": "test"
     },
     {
       "title": "test2"
     }
   ],
   "related_products": [
     {
       "category_id": 1,
       "created_at": "2026-10-21T14:10:26.000+03:00",
       "updated_at": "2015-07-27T17:05:35.000+03:00",
       "is_hidden": false,
       "account_id": 1,
       "title_translations": [
         "Cool t-shirt"
       ],
       "available": false,
       "archived": false,
       "key": null,
       "price_min_cached": "10.0",
       "price_max_cached": "10.0",
       "price_min_available_cached": null,
       "price_max_available_cached": null,
       "canonical_url_collection_id": 1,
       "collections_id": [
         1,
         3,
         8
       ],
       "characteristics_id": [
         7,
         9,
         12,
         13
       ],
       "custom_layout": null,
       "custom_template": null,
       "old_price_min_cached": null,
       "old_price_max_cached": null,
       "old_price_min_available_cached": null,
       "old_price_max_available_cached": null,
       "permalink": "футболка",
       "unit": "pce",
       "deleted": false,
       "cost_price_min_cached": null,
       "cost_price_max_cached": null,
       "stock_currency_id": 1,
       "sort_weight": null,
       "bundle": null,
       "ignore_discounts": null,
       "vat": -1,
       "dimensions": "10x20x30",
       "fiscal_product_type": 1,
       "popularity": null,
       "available_at_warehouses": [],
       "auto_assign_bundle_price": null,
       "demo": null,
       "sales_channels_id": null,
       "demo_thematic": null,
       "reviews_average_rating_cached": null,
       "reviews_count_cached": null,
       "merge_product_id": null,
       "merge_group_product_id": null,
       "merge_group_hidden": null,
       "no_delivery": false,
       "id": 1,
       "main_image_id": null,
       "is_adult": false,
       "title": "Cool t-shirt"
     }
   ],
   "notice": "Второй анонс",
   "content": "Привет"
 }

Params:

NameTypeAttributeDescription
options Object
options.token string

Required, access token for shop

options.url string

Required, shop url

options.blogid number | string

Required, blog id

options.articleid number | string

Required, article id

id Number | String

Required, app id

Return:

Promise

public getAsset(options: Object, id: Number | String): Promise source

import {getAsset} from 'insales/lib/api/asset.js'

GET /admin/themes/#{theme_id}/assets/#{id}.xml

Examples:

 insales.getAsset({
   token: '1234567890',
   url: 'shop-test.myinsales.ru',
   theme: '643879',
   assetId: '60423000'
 }).then(response => {
   console.info(response.data);
 }).catch(err => {
   console.error(err);
 });

Output:

 {{ asset:
    { id: '60423000',
      'theme-id': '643879',
      type: 'Asset::Template',
      name: 'page.new_page.liquid',
      'content-type': 'text/x-liquid',
      'file-size': '0',
      'human-readable-name': 'Страница: new_page',
      content: 'new page {{ page.title }}' } }

Params:

NameTypeAttributeDescription
options Object
options.token string

Required, access token for shop

options.url string

Required, shop url

options.theme Number | String

Required, theme id

options.assetId Number | String

Required, asset id

id Number | String

Required, app id

Return:

Promise

public getAssetRaw(options: Object, id: Number | String): Promise source

import {getAssetRaw} from 'insales/lib/api/asset.js'

GET /admin/themes/#{theme_id}/assets/#{id}/raw.xml

Examples:

 insales.getAssetRaw({
   token: '1234567890',
   url: 'shop-test.myinsales.ru',
   theme: '643879',
   assetId: '60423000'
 }).then(response => {
   console.info(response.data);
 }).catch(err => {
   console.error(err);
 });

Output:

 // Исходный код ассета

Params:

NameTypeAttributeDescription
options Object
options.token string

Required, access token for shop

options.url string

Required, shop url

options.theme Number | String

Required, theme id

options.assetId Number | String

Required, asset id

id Number | String

Required, app id

Return:

Promise

public getBlog(options: Object, id: Number | String): Promise source

import {getBlog} from 'insales/lib/api/blog.js'

GET /admin/blogs/{blog_id}.json

Examples:

 insales.getBlog({
   token: '1234567890',
   url: 'shop-test.myinsales.ru',
   blogid: '1'
 }).then(response => {
   console.info(response.data);
 }).catch(err => {
   console.error(err);
 });

Output:

 {
   "id": 1,
   "commentable": "no",
   "notify_about_comment": true,
   "captcha_enabled": false,
   "disallow_links_in_comments": false,
   "custom_template": null,
   "handle": null,
   "title": "Блог",
   "html_title": null,
   "meta_keywords": null,
   "meta_description": null,
   "tags": [
     {
       "title": "test"
     },
     {
       "title": "test2"
     }
   ]
 }

Params:

NameTypeAttributeDescription
options Object
options.token string

Required, access token for shop

options.url string

Required, shop url

options.blogid number | string

Required, blog id

id Number | String

Required, app id

Return:

Promise

public getBonusTransaction(options: Object, id: Number | String): Promise source

import {getBonusTransaction} from 'insales/lib/api/bonustransaction.js'

GET /admin/bonus_system_transactions/{bst_id}.json

Examples:

 insales.getBonusTransaction({
   token: '1234567890',
   url: 'shop-test.myinsales.ru',
   transactionid: '89'
 }).then(response => {
   console.info(response.data);
 }).catch(err => {
   console.error(err);
 });

Output:

 {
   "id": 89,
   "bonus_points": 100,
   "client_id": 2,
   "bonus_system_id": 1,
   "initiator_type": "Order",
   "initiator_id": 1,
   "description": "test",
   "status": "charged",
   "created_at": "2026-10-21T23:29:38.422+03:00",
   "updated_at": "2026-10-21T23:29:38.422+03:00"
 }

Params:

NameTypeAttributeDescription
options Object
options.token string

Required, access token for shop

options.url string

Required, shop url

options.transactionid number | string

Required, bonus transaction id

id Number | String

Required, app id

Return:

Promise

public getCategory(options: Object, id: Number | String): Promise source

import {getCategory} from 'insales/lib/api/category.js'

GET /admin/categories/{category_id}.json

Examples:

 insales.getCategory({
   token: '1234567890',
   url: 'shop-test.myinsales.ru',
   categoryid: '6'
 }).then(response => {
   console.info(response.data);
 }).catch(err => {
   console.error(err);
 });

Output:

 {
   "id": 6,
   "parent_id": 1,
   "title": "T-shirts",
   "position": 0,
   "created_at": "2026-10-20T11:11:05.000+03:00",
   "updated_at": "2026-10-20T11:11:05.000+03:00"
 }

Params:

NameTypeAttributeDescription
options Object
options.token string

Required, access token for shop

options.url string

Required, shop url

options.categoryid number | string

Required, category id

id Number | String

Required, app id

Return:

Promise

public getCharacteristic(options: Object, id: Number | String): Promise source

import {getCharacteristic} from 'insales/lib/api/characteristic.js'

GET /admin/properties/{property_id}/characteristics/{characteristic_id}.json

Examples:

 insales.getCharacteristic({
   token: '1234567890',
   url: 'shop-test.myinsales.ru',
   propertyid: '3',
   characteristicid: '7'
 }).then(response => {
   console.info(response.data);
 }).catch(err => {
   console.error(err);
 });

Output:

 {
   "id": 7,
   "property_id": 3,
   "position": 1,
   "title": "Nike",
   "permalink": "nike"
 }

Params:

NameTypeAttributeDescription
options Object
options.token string

Required, access token for shop

options.url string

Required, shop url

options.propertyid number | string

Required, property id

options.characteristicid number | string

Required, characteristic id

id Number | String

Required, app id

Return:

Promise

public getCharge(options: Object, id: Number | String): Promise source

import {getCharge} from 'insales/lib/api/charge.js'

GET /admin/application_charges/{id}.xml

Examples:

 insales.getCharge({
   token: '1234567890',
   url: 'shop-test.myinsales.ru',
   chargeid: '12345'
 }).then(output => {
   console.info(output.response.statusCode);
 }).catch(err => {
   console.error(err);
 });

Output:

 { 'application-charge':
   { 'created-at': '2011-11-11T11:11:11+03:00',
     id: '1234',
     name: 'Купи слона',
     price: '180.0',
     'return-url': 'http://application.my/check_payment_url/%id_in_my_application',
     status: 'pending',
     test: '',
     'updated-at': '2011-11-11T11:11:11+03:00',
     'confirmation-url': 'http://shop-test.myinsales.ru/admin/invoices/123456' } }

Params:

NameTypeAttributeDescription
options Object
options.token string

Required, access token for shop

options.url string

Required, shop url

options.chargeid number | string

Required, charge id

id Number | String

Required, app id

Return:

Promise

public getClient(options: Object, id: Number | String): Promise source

import {getClient} from 'insales/lib/api/client.js'

GET /admin/clients/{client_id}.json

Examples:

 insales.getClient({
   token: '1234567890',
   url: 'shop-test.myinsales.ru',
   clientid: '5'
 }).then(response => {
   console.info(response.data);
 }).catch(err => {
   console.error(err);
 });

Output:

 {
   "id": 5,
   "email": "john@smith.com",
   "name": "John Smith",
   "phone": "+7(926)111-11-11",
   "created_at": "2009-04-30T04:37:32.000+04:00",
   "updated_at": "2026-10-21T23:29:32.000+03:00",
   "comment": null,
   "registered": true,
   "subscribe": true,
   "client_group_id": null,
   "bonus_points": 1000,
   "type": "Client::Individual",
   "correspondent_account": null,
   "settlement_account": null,
   "consent_to_personal_data": null,
   "o_auth_provider": null,
   "messenger_subscription": null,
   "external_id": null,
   "external_service": null,
   "contact_name": "John Smith",
   "surname": null,
   "middlename": null,
   "progressive_discount": null,
   "group_discount": null,
   "ip_addr": "",
   "fields_values": [
     {
       "id": 827,
       "value": "old value",
       "created_at": "2026-10-21T23:29:32.876+03:00",
       "updated_at": "2026-10-21T23:29:32.876+03:00",
       "field_id": 1136,
       "type": "Текст",
       "name": "special",
       "handle": null
     }
   ],
   "default_address": null,
   "client_tags": [],
   "full_name": "John Smith"
 }

Params:

NameTypeAttributeDescription
options Object
options.token string

Required, access token for shop

options.url string

Required, shop url

options.clientid number | string

Required, client id

id Number | String

Required, app id

Return:

Promise

public getClientGroup(options: Object, id: Number | String): Promise source

import {getClientGroup} from 'insales/lib/api/clientgroup.js'

GET /admin/client_groups/{client_group_id}.json

Examples:

 insales.getClientGroup({
   token: '1234567890',
   url: 'shop-test.myinsales.ru',
   clientgroupid: '1'
 }).then(response => {
   console.info(response.data);
 }).catch(err => {
   console.error(err);
 });

Output:

 {
   "id": 1,
   "title": "vip",
   "discount": "25.0",
   "discount_description": null,
   "is_default": true,
   "b2b": false,
   "created_at": "2026-07-11T22:28:41.000+03:00",
   "updated_at": "2026-10-19T22:28:42.495+03:00"
 }

Params:

NameTypeAttributeDescription
options Object
options.token string

Required, access token for shop

options.url string

Required, shop url

options.clientgroupid number | string

Required, client group id

id Number | String

Required, app id

Return:

Promise

public getCollection(options: Object, id: Number | String): Promise source

import {getCollection} from 'insales/lib/api/collection.js'

GET /admin/collections/{id}.xml

Examples:

 insales.getCollection({
   token: '1234567890',
   url: 'shop-test.myinsales.ru',
   collectionid: '11111'
 }).then(response => {
   console.info(response.data);
 }).catch(err => {
   console.error(err);
 });

Output:

 { collection:
   { 'created-at': '2011-11-11 11:11:11 +0300',
     id: '1234567',
     'is-hidden': 'true',
     'parent-id': '22222',
     position: '1',
     recursive: '',
     'updated-at': '2011-11-11 11:11:11 +0300',
     title: 'Name 1',
     description: '',
     'html-title': '',
     'meta-description': '',
     'meta-keywords': '',
     permalink: 'name1',
     url: '/collection/name1',
     'seo-description': '' } }

Params:

NameTypeAttributeDescription
options Object
options.token string

Required, access token for shop

options.url string

Required, shop url

options.collectionid. number | string

Required, collection id

id Number | String

Required, app id

Return:

Promise

public getCollectionField(options: Object, id: Number | String): Promise source

import {getCollectionField} from 'insales/lib/api/collectionfield.js'

GET /admin/collection_fields/{collection_field_id}.json

Examples:

 insales.getCollectionField({
   token: '1234567890',
   url: 'shop-test.myinsales.ru',
   fieldid: '2'
 }).then(response => {
   console.info(response.data);
 }).catch(err => {
   console.error(err);
 });

Output:

 {
   "id": 2,
   "handle": "handle2",
   "type": "CollectionField::TextArea",
   "application_id": 1,
   "position": 2,
   "is_hidden": null,
   "title": "title2",
   "application_title": "Цифровые товары"
 }

 insales.getCollectionField({
   token: '1234567890',
   url: 'shop-test.myinsales.ru',
   fieldid: 'handle2'
 }).then(response => {
   console.info(response.data);
 }).catch(err => {
   console.error(err);
 });

Output:

 {
   "id": 2,
   "handle": "handle2",
   "type": "CollectionField::TextArea",
   "application_id": 1,
   "position": 2,
   "is_hidden": null,
   "title": "title2",
   "application_title": "Цифровые товары"
 }

Params:

NameTypeAttributeDescription
options Object
options.token string

Required, access token for shop

options.url string

Required, shop url

options.fieldid number | string

Required, collection field id or handle

id Number | String

Required, app id

Return:

Promise

public getCollectionFieldValue(options: Object, id: Number | String): Promise source

import {getCollectionFieldValue} from 'insales/lib/api/collectionfieldvalue.js'

GET /admin/collections/{collection_id}/collection_field_values/{field_id}.json

Examples:

 insales.getCollectionFieldValue({
   token: '1234567890',
   url: 'shop-test.myinsales.ru',
   collectionid: '1',
   fieldid: '2'
 }).then(response => {
   console.info(response.data);
 }).catch(err => {
   console.error(err);
 });

Output:

 {
   "id": 2,
   "collection_field_id": 2,
   "value": "some collection field value"
 }

 insales.getCollectionFieldValue({
   token: '1234567890',
   url: 'shop-test.myinsales.ru',
   collectionid: '1',
   fieldid: 'handle2'
 }).then(response => {
   console.info(response.data);
 }).catch(err => {
   console.error(err);
 });

Output:

 {
   "id": 2,
   "collection_field_id": 2,
   "value": "some collection field value"
 }

Params:

NameTypeAttributeDescription
options Object
options.token string

Required, access token for shop

options.url string

Required, shop url

options.collectionid number | string

Required, collection id

options.fieldid number | string

Required, collection field id or handle

id Number | String

Required, app id

Return:

Promise

public getCollectionFilter(options: Object, id: Number | String): Promise source

import {getCollectionFilter} from 'insales/lib/api/collectionfilter.js'

GET /admin/collection_filters/{filter_id}.json

Examples:

 insales.getCollectionFilter({
   token: '1234567890',
   url: 'shop-test.myinsales.ru',
   filterid: '1'
 }).then(response => {
   console.info(response.data);
 }).catch(err => {
   console.error(err);
 });

Output:

 {
   "id": 1,
   "collection_id": 1,
   "description": null,
   "seo_description": null,
   "title": "seo filter",
   "permalink": "foobar",
   "html_title": null,
   "meta_keywords": null,
   "meta_description": null,
   "characteristis": [
     {
       "id": 1,
       "property_id": 1,
       "position": 1,
       "title": "Japan",
       "permalink": "japan"
     },
     {
       "id": 2,
       "property_id": 2,
       "position": 1,
       "title": "Germany",
       "permalink": "germany"
     }
   ],
   "option_values": []
 }

Params:

NameTypeAttributeDescription
options Object
options.token string

Required, access token for shop

options.url string

Required, shop url

options.filterid number | string

Required, collection filter id

id Number | String

Required, app id

Return:

Promise

public getCoupon(options: Object, id: Number | String): Promise source

import {getCoupon} from 'insales/lib/api/coupon.js'

GET /admin/discount_codes/{id}.xml

Examples:

 insales.getCoupon({
   token: '1234567890',
   url: 'shop-test.myinsales.ru',
   couponid: '1076619'
 }).then(response => {
   console.info(response.data);
 }).catch(err => {
   console.error(err);
 });

Output:

 { 'discount-code':
    { 'act-once': 'false',
      'act-once-for-client': 'false',
      code: 'WWWWWW',
      'created-at': '2011-11-11T11:11:11+03:00',
      description: '',
      disabled: 'false',
      discount: '10.0',
      'expired-at': '2011-11-11',
      id: '1111111',
      'min-price': '0.0',
      'type-id': '1',
      'updated-at': '2011-11-11T11:11:11+03:00',
      worked: 'true',
      'discount-collections': '' } }

Params:

NameTypeAttributeDescription
options Object
options.token string

Required, access token for shop

options.url string

Required, shop url

options.couponid number | string

Required, coupon id

id Number | String

Required, app id

Return:

Promise

public getCustomStatus(options: Object, id: Number | String): Promise source

import {getCustomStatus} from 'insales/lib/api/customstatus.js'

GET /admin/custom_statuses/{custom_status_permalink}.json

Examples:

 insales.getCustomStatus({
   token: '1234567890',
   url: 'shop-test.myinsales.ru',
   permalink: 'novyy'
 }).then(response => {
   console.info(response.data);
 }).catch(err => {
   console.error(err);
 });

Output:

 {
   "id": 41,
   "system_status": "new",
   "permalink": "novyy",
   "position": 1,
   "is_default": true,
   "created_at": "2026-10-21T23:27:53.516+03:00",
   "updated_at": "2026-10-21T23:27:53.516+03:00",
   "title": "Новый",
   "color": "#DC5F59"
 }

Params:

NameTypeAttributeDescription
options Object
options.token string

Required, access token for shop

options.url string

Required, shop url

options.permalink number | string

Required, custom status permalink

id Number | String

Required, app id

Return:

Promise

public getDeliveryVariant(options: Object, id: Number | String): Promise source

import {getDeliveryVariant} from 'insales/lib/api/deliveryvariant.js'

GET /admin/delivery_variants/{delivery_variant_id}.json

Examples:

 insales.getDeliveryVariant({
   token: '1234567890',
   url: 'shop-test.myinsales.ru',
   deliveryvariantid: '2'
 }).then(response => {
   console.info(response.data);
 }).catch(err => {
   console.error(err);
 });

Output:

 {
   "id": 2,
   "position": 2,
   "updated_at": "2009-03-31T12:20:34.000+04:00",
   "created_at": "2009-03-30T04:37:32.000+04:00",
   "charge_up_to": null,
   "inverted": false,
   "show_zip_code": false,
   "title": "курьер",
   "description": "",
   "type": "DeliveryVariant::PriceDepend",
   "min_order_sum": null,
   "show_calendar_in_checkout": null,
   "delivery_date_required": null,
   "forbid_weekends": null,
   "utc_from_address": null,
   "estimated_delivery_period": null,
   "order_time_is_later": null,
   "forbidden_days": null,
   "show_time_intervals_in_checkout": null,
   "time_intervals_required": null,
   "min_price": 200,
   "payment_delivery_variants": [
     {
       "id": 2,
       "payment_gateway_id": 1,
       "created_at": "2026-10-19T22:28:42.000+03:00"
     }
   ],
   "delivery_locations": [],
   "delivery_time_intervals": [],
   "rules": [
     {
       "id": 1,
       "order_price": 2000,
       "price": 600,
       "order_weight": 10
     },
     {
       "id": 2,
       "order_price": 2000,
       "price": 700,
       "order_weight": 20
     },
     {
       "id": 3,
       "order_price": 2000,
       "price": 800,
       "order_weight": null
     },
     {
       "id": 4,
       "order_price": 10000,
       "price": 300,
       "order_weight": 10
     },
     {
       "id": 5,
       "order_price": 10000,
       "price": 400,
       "order_weight": 20
     },
     {
       "id": 6,
       "order_price": 10000,
       "price": 500,
       "order_weight": null
     },
     {
       "id": 7,
       "order_price": null,
       "price": 0,
       "order_weight": 10
     },
     {
       "id": 8,
       "order_price": null,
       "price": 100,
       "order_weight": 20
     }
   ]
 }

Params:

NameTypeAttributeDescription
options Object
options.token string

Required, access token for shop

options.url string

Required, shop url

options.deliveryvariantid number | string

Required, delivery variant id

id Number | String

Required, app id

Return:

Promise

public getDomain(options: Object, id: Number | String): Promise source

import {getDomain} from 'insales/lib/api/domain.js'

GET /admin/domains/{domain_id}.json

Examples:

 insales.getDomain({
   token: '1234567890',
   url: 'shop-test.myinsales.ru',
   domainid: '32'
 }).then(response => {
   console.info(response.data);
 }).catch(err => {
   console.error(err);
 });

Output:

 {
   "id": 32,
   "domain": "some-domain.ru",
   "created_at": "2026-10-21T23:32:36.000+03:00",
   "updated_at": "2026-10-21T23:32:36.000+03:00",
   "main": true
 }

Params:

NameTypeAttributeDescription
options Object
options.token string

Required, access token for shop

options.url string

Required, shop url

options.domainid number | string

Required, domain id

id Number | String

Required, app id

Return:

Promise

public getExternalDiscount(options: Object, id: Number | String): Promise source

import {getExternalDiscount} from 'insales/lib/api/externaldiscount.js'

GET /admin/external_discounts/{external_discount_id}.json

Examples:

 insales.getExternalDiscount({
   token: '1234567890',
   url: 'shop-test.myinsales.ru',
   discountid: '25'
 }).then(response => {
   console.info(response.data);
 }).catch(err => {
   console.error(err);
 });

Output:

 {
   "id": 25,
   "url": "https://myservice.com/external_discount",
   "order_lines_depend": null,
   "active": true,
   "created_at": "2026-10-21T23:27:55.000+03:00",
   "updated_at": "2026-10-21T23:27:55.000+03:00",
   "description": "My External Discount",
   "observed_fields": []
 }

Params:

NameTypeAttributeDescription
options Object
options.token string

Required, access token for shop

options.url string

Required, shop url

options.discountid number | string

Required, external discount id

id Number | String

Required, app id

Return:

Promise

public getField(options: Object, id: Number | String): Promise source

import {getField} from 'insales/lib/api/field.js'

GET /admin/fields/{field_id}.json

Examples:

 insales.getField({
   token: '1234567890',
   url: 'shop-test.myinsales.ru',
   fieldid: '23'
 }).then(response => {
   console.info(response.data);
 }).catch(err => {
   console.error(err);
 });

Output:

 {
   "id": 23,
   "destiny": 2,
   "position": 6,
   "office_title": "Селект",
   "for_buyer": true,
   "obligatory": false,
   "active": false,
   "system_name": null,
   "created_at": "2010-10-12T13:31:09.692+04:00",
   "updated_at": "2010-10-12T13:31:09.692+04:00",
   "show_in_result": true,
   "show_in_checkout": true,
   "is_indexed": null,
   "hide_in_backoffice": null,
   "handle": null,
   "placeholder": null,
   "title": "Селект",
   "example": null,
   "type": "Field::Select",
   "field_options": [
     {
       "id": 1,
       "position": 1,
       "value": "Передан"
     },
     {
       "id": 2,
       "position": 2,
       "value": "Не передан"
     }
   ]
 }

Params:

NameTypeAttributeDescription
options Object
options.token string

Required, access token for shop

options.url string

Required, shop url

options.fieldid number | string

Required, field id

id Number | String

Required, app id

Return:

Promise

public getFile(options: Object, id: Number | String): Promise source

import {getFile} from 'insales/lib/api/file.js'

GET /admin/files/{account_file_id}.json

Examples:

 insales.getFile({
   token: '1234567890',
   url: 'shop-test.myinsales.ru',
   fileid: '1'
 }).then(response => {
   console.info(response.data);
 }).catch(err => {
   console.error(err);
 });

Output:

 {
   "id": 1,
   "created_at": "2009-03-18T07:53:15.000+03:00",
   "absolute_url": "http://minio.insales.io:9000/insales-test-sber/files/1/original/thumb_prayerbeads.jpg"
 }

Params:

NameTypeAttributeDescription
options Object
options.token string

Required, access token for shop

options.url string

Required, shop url

options.fileid number | string

Required, file id

id Number | String

Required, app id

Return:

Promise

public getJsTag(options: Object, id: Number | String): Promise source

import {getJsTag} from 'insales/lib/api/jstag.js'

GET /admin/js_tags/{js_tag_id}.json

Examples:

 insales.getJsTag({
   token: '1234567890',
   url: 'shop-test.myinsales.ru',
   jstagid: '25'
 }).then(response => {
   console.info(response.data);
 }).catch(err => {
   console.error(err);
 });

Output:

 {
   "content": "http://code.jquery.com/jquery-1.9.1.min.js",
   "id": 25,
   "name": "jquery1.9.1",
   "created_at": "2026-10-21T23:10:49.000+03:00",
   "updated_at": "2026-10-21T23:10:49.000+03:00",
   "type": "JsTag::FileTag"
 }

Params:

NameTypeAttributeDescription
options Object
options.token string

Required, access token for shop

options.url string

Required, shop url

options.jstagid number | string

Required, js tag id

id Number | String

Required, app id

Return:

Promise

public getMarketplace(options: Object, id: Number | String): Promise source

import {getMarketplace} from 'insales/lib/api/marketplace.js'

GET /admin/marketplaces/{ym_marketplace_id}.json

Examples:

 insales.getMarketplace({
   token: '1234567890',
   url: 'shop-test.myinsales.ru',
   marketplaceid: '41'
 }).then(response => {
   console.info(response.data);
 }).catch(err => {
   console.error(err);
 });

Output:

 {
   "id": 41,
   "name": "Yandex Model",
   "type": "Marketplace::ModelYandexMarket",
   "created_at": "2026-10-21T23:32:41.293+03:00",
   "updated_at": "2026-10-21T23:32:41.293+03:00",
   "url": "https://quentin.insales.io:3003/marketplace/41.xml",
   "collection_ids": [],
   "delivery_price_kind": null,
   "description_type": 1,
   "local_delivery_cost": null,
   "sales_notes": null,
   "utm_label": null,
   "vendor_id": 6,
   "page_encoding": "windows-1251",
   "shop_company": "eBay",
   "shop_name": "eBay",
   "adult": false,
   "delivery": false,
   "delivery_new_style": false,
   "pickup": false,
   "store": false,
   "use_sku_as_vendor_code": false,
   "use_stock_currency": false,
   "use_variants": false
 }

Params:

NameTypeAttributeDescription
options Object
options.token string

Required, access token for shop

options.url string

Required, shop url

options.marketplaceid number | string

Required, marketplace id

id Number | String

Required, app id

Return:

Promise

public getMenu(options: Object, id: Number | String): Promise source

import {getMenu} from 'insales/lib/api/menu.js'

GET /admin/menus/{menu_id}.json

Examples:

 insales.getMenu({
   token: '1234567890',
   url: 'shop-test.myinsales.ru',
   menuid: '1'
 }).then(response => {
   console.info(response.data);
 }).catch(err => {
   console.error(err);
 });

Output:

 {
   "id": 1,
   "name": "Main menu",
   "handle": "main",
   "used_in_theme": false
 }

Params:

NameTypeAttributeDescription
options Object
options.token string

Required, access token for shop

options.url string

Required, shop url

options.menuid number | string

Required, menu id

id Number | String

Required, app id

Return:

Promise

public getMenuItem(options: Object, id: Number | String): Promise source

import {getMenuItem} from 'insales/lib/api/menuitem.js'

GET /admin/menus/{menu_id}/items/{item_id}.json

Examples:

 insales.getMenuItem({
   token: '1234567890',
   url: 'shop-test.myinsales.ru',
   menuid: '1',
   itemid: '1'
 }).then(response => {
   console.info(response.data);
 }).catch(err => {
   console.error(err);
 });

Output:

 {
   "id": 1,
   "position": 1,
   "title": "About",
   "url": "/about",
   "related_object_id": "Page_0"
 }

Params:

NameTypeAttributeDescription
options Object
options.token string

Required, access token for shop

options.url string

Required, shop url

options.menuid number | string

Required, menu id

options.itemid number | string

Required, menu item id

id Number | String

Required, app id

Return:

Promise

public getOAuthApp(options: Object, id: Number | String): Promise source

import {getOAuthApp} from 'insales/lib/api/oauthapp.js'

GET /admin/o_auth_apps/{o_auth_app_id}.json

Examples:

 insales.getOAuthApp({
   token: '1234567890',
   url: 'shop-test.myinsales.ru',
   oauthappid: '4'
 }).then(response => {
   console.info(response.data);
 }).catch(err => {
   console.error(err);
 });

Output:

 {
   "client_id": "953",
   "client_secret": "NdsaPd",
   "provider": "new_provider",
   "issuer": "/.well-known/openid-configuration",
   "id": 4,
   "enabled": true
 }

Params:

NameTypeAttributeDescription
options Object
options.token string

Required, access token for shop

options.url string

Required, shop url

options.oauthappid number | string

Required, oauth app id

id Number | String

Required, app id

Return:

Promise

public getOptionName(options: Object, id: Number | String): Promise source

import {getOptionName} from 'insales/lib/api/optionname.js'

GET /admin/option_names/{option_name_id}.json

Examples:

 insales.getOptionName({
   token: '1234567890',
   url: 'shop-test.myinsales.ru',
   optionnameid: '1'
 }).then(response => {
   console.info(response.data);
 }).catch(err => {
   console.error(err);
 });

Output:

 {
   "id": 1,
   "position": 1,
   "navigational": true,
   "permalink": null,
   "title": "Вариант",
   "api_permalink": null
 }

Params:

NameTypeAttributeDescription
options Object
options.token string

Required, access token for shop

options.url string

Required, shop url

options.optionnameid number | string

Required, option name id

id Number | String

Required, app id

Return:

Promise

public getOptionValue(options: Object, id: Number | String): Promise source

import {getOptionValue} from 'insales/lib/api/optionvalue.js'

GET /admin/option_names/{option_name_id}/option_values/{option_value_id}.json

Examples:

 insales.getOptionValue({
   token: '1234567890',
   url: 'shop-test.myinsales.ru',
   optionnameid: '1',
   optionvalueid: '2'
 }).then(response => {
   console.info(response.data);
 }).catch(err => {
   console.error(err);
 });

Output:

 {
   "id": 2,
   "option_name_id": 1,
   "position": 2,
   "title": "Зеленый",
   "image_url": null,
   "permalink": null
 }

Params:

NameTypeAttributeDescription
options Object
options.token string

Required, access token for shop

options.url string

Required, shop url

options.optionnameid number | string

Required, option name id

options.optionvalueid number | string

Required, option value id

id Number | String

Required, app id

Return:

Promise

public getOptionValueDestroyStatus(options: Object, id: Number | String): Promise source

import {getOptionValueDestroyStatus} from 'insales/lib/api/optionvalue.js'

GET /admin/option_names/{option_name_id}/option_values/{option_value_id}/destroy_status.json

Examples:

 insales.getOptionValueDestroyStatus({
   token: '1234567890',
   url: 'shop-test.myinsales.ru',
   optionnameid: '1',
   optionvalueid: '20'
 }).then(response => {
   console.info(response.data);
 }).catch(err => {
   console.error(err);
 });

Output:

 {
   "status": "error",
   "error": "Not deleted"
 }

Params:

NameTypeAttributeDescription
options Object
options.token string

Required, access token for shop

options.url string

Required, shop url

options.optionnameid number | string

Required, option name id

options.optionvalueid number | string

Required, option value id

id Number | String

Required, app id

Return:

Promise

public getOrder(options: Object, id: Number | String): Promise source

import {getOrder} from 'insales/lib/api/order.js'

GET /admin/orders/{order_id}.json

Examples:

 insales.getOrder({
   token: '1234567890',
   url: 'shop-test.myinsales.ru',
   orderid: '1'
 }).then(response => {
   console.info(response.data);
 }).catch(err => {
   console.error(err);
 });

Output:

 {
   "fields_values": [
     {
       "id": 51,
       "value": "old value",
       "created_at": "2026-10-21T23:27:31.069+03:00",
       "updated_at": "2026-10-21T23:27:31.069+03:00",
       "field_id": 360,
       "type": "Текст",
       "name": "special",
       "handle": "my_awesome_field"
     }
   ],
   "order_lines": [
     {
       "id": 1,
       "order_id": 1,
       "sale_price": 300,
       "full_sale_price": 300,
       "total_price": 300,
       "full_total_price": 300,
       "discounts_amount": 0,
       "quantity": 1,
       "reserved_quantity": null,
       "weight": null,
       "dimensions": null,
       "variant_id": 1,
       "product_id": 1,
       "sku": "423",
       "barcode": null,
       "title": "Cool t-shirt",
       "unit": "pce",
       "comment": null,
       "updated_at": "2009-03-18T10:53:15.000+03:00",
       "created_at": "2009-03-18T10:53:14.000+03:00",
       "bundle_id": null,
       "vat": -1,
       "fiscal_product_type": 1,
       "requires_marking": null,
       "marking_codes": [
         "code1",
         "code2"
       ],
       "accessory_lines": [],
       "external_variant_id": null
     },
     {
       "id": 2,
       "order_id": 1,
       "sale_price": 600,
       "full_sale_price": 600,
       "total_price": 1200,
       "full_total_price": 1200,
       "discounts_amount": 0,
       "quantity": 2,
       "reserved_quantity": null,
       "weight": "0.3",
       "dimensions": null,
       "variant_id": 2,
       "product_id": 2,
       "sku": "424",
       "barcode": null,
       "title": "shirt",
       "unit": "pce",
       "comment": null,
       "updated_at": "2009-03-18T10:53:15.000+03:00",
       "created_at": "2009-03-18T10:53:14.000+03:00",
       "bundle_id": null,
       "vat": 20,
       "fiscal_product_type": 1,
       "requires_marking": null,
       "marking_codes": null,
       "accessory_lines": [],
       "external_variant_id": null
     }
   ],
   "order_changes": [],
   "discount": null,
   "shipping_address": {
     "id": 1,
     "fields_values": [
       {
         "id": 43,
         "value": "old value",
         "created_at": "2026-10-21T23:27:30.994+03:00",
         "updated_at": "2026-10-21T23:27:30.994+03:00",
         "field_id": 352,
         "type": "Текст",
         "name": "special",
         "handle": null
       }
     ],
     "name": "Tom Dellay",
     "surname": null,
     "middlename": null,
     "phone": "+7(495)212-85-06",
     "formatted_phone": "+7(495)212-85-06",
     "full_name": "Tom Dellay",
     "full_locality_name": null,
     "full_delivery_address": "123456, state, London, address, old value",
     "address_for_gis": "123456, state, London, address",
     "location_valid": true,
     "recipient_fields": [
       {
         "id": 11,
         "destiny": 2,
         "position": 1,
         "office_title": "Имя",
         "for_buyer": true,
         "obligatory": true,
         "active": true,
         "system_name": "name",
         "created_at": "2010-10-12T13:31:09.692+04:00",
         "updated_at": "2010-10-12T13:31:09.692+04:00",
         "show_in_result": true,
         "show_in_checkout": true,
         "is_indexed": null,
         "hide_in_backoffice": null,
         "handle": null,
         "placeholder": null,
         "title": null,
         "example": null,
         "type": "Field::ObligatoryTextField"
       },
       {
         "id": 12,
         "destiny": 2,
         "position": 2,
         "office_title": "Телефон",
         "for_buyer": true,
         "obligatory": true,
         "active": true,
         "system_name": "phone",
         "created_at": "2010-10-12T13:31:09.692+04:00",
         "updated_at": "2010-10-12T13:31:09.692+04:00",
         "show_in_result": true,
         "show_in_checkout": true,
         "is_indexed": null,
         "hide_in_backoffice": null,
         "handle": null,
         "placeholder": null,
         "title": null,
         "example": null,
         "type": "Field::Phone"
       }
     ],
     "backoffice_fields": [
       {
         "id": 4,
         "destiny": 1,
         "position": 3,
         "office_title": "Адрес",
         "for_buyer": true,
         "obligatory": false,
         "active": true,
         "system_name": "address",
         "created_at": "2010-10-12T13:31:09.692+04:00",
         "updated_at": "2010-10-12T13:31:09.692+04:00",
         "show_in_result": true,
         "show_in_checkout": true,
         "is_indexed": null,
         "hide_in_backoffice": null,
         "handle": null,
         "placeholder": null,
         "title": null,
         "example": null,
         "type": "Field::SystemTextArea"
       },
       {
         "id": 352,
         "destiny": 1,
         "position": 22,
         "office_title": "special",
         "for_buyer": true,
         "obligatory": false,
         "active": true,
         "system_name": null,
         "created_at": "2026-10-21T23:27:30.973+03:00",
         "updated_at": "2026-10-21T23:27:30.973+03:00",
         "show_in_result": true,
         "show_in_checkout": true,
         "is_indexed": null,
         "hide_in_backoffice": null,
         "handle": null,
         "placeholder": null,
         "title": "special",
         "example": null,
         "type": "Field::TextField"
       },
       {
         "id": 1,
         "destiny": 1,
         "position": 0,
         "office_title": "Страна",
         "for_buyer": true,
         "obligatory": false,
         "active": false,
         "system_name": "country",
         "created_at": "2010-10-12T13:31:09.692+04:00",
         "updated_at": "2010-10-12T13:31:09.692+04:00",
         "show_in_result": true,
         "show_in_checkout": true,
         "is_indexed": null,
         "hide_in_backoffice": null,
         "handle": null,
         "placeholder": null,
         "title": null,
         "example": null,
         "type": "Field::Country"
       },
       {
         "id": 2,
         "destiny": 1,
         "position": 1,
         "office_title": "Регион",
         "for_buyer": true,
         "obligatory": false,
         "active": false,
         "system_name": "state",
         "created_at": "2010-10-12T13:31:09.692+04:00",
         "updated_at": "2010-10-12T13:31:09.692+04:00",
         "show_in_result": true,
         "show_in_checkout": true,
         "is_indexed": null,
         "hide_in_backoffice": null,
         "handle": null,
         "placeholder": null,
         "title": null,
         "example": null,
         "type": "Field::SystemTextField"
       },
       {
         "id": 3,
         "destiny": 1,
         "position": 2,
         "office_title": "Город",
         "for_buyer": true,
         "obligatory": false,
         "active": false,
         "system_name": "city",
         "created_at": "2010-10-12T13:31:09.692+04:00",
         "updated_at": "2010-10-12T13:31:09.692+04:00",
         "show_in_result": true,
         "show_in_checkout": true,
         "is_indexed": null,
         "hide_in_backoffice": null,
         "handle": null,
         "placeholder": null,
         "title": null,
         "example": null,
         "type": "Field::SystemTextField"
       },
       {
         "id": 5,
         "destiny": 1,
         "position": 4,
         "office_title": "Почтовый индекс",
         "for_buyer": true,
         "obligatory": false,
         "active": false,
         "system_name": "zip",
         "created_at": "2010-10-12T13:31:09.692+04:00",
         "updated_at": "2010-10-12T13:31:09.692+04:00",
         "show_in_result": true,
         "show_in_checkout": true,
         "is_indexed": null,
         "hide_in_backoffice": null,
         "handle": null,
         "placeholder": null,
         "title": null,
         "example": null,
         "type": "Field::SystemTextField"
       }
     ],
     "no_delivery": false,
     "kladr_autodetected_address": "",
     "country_options": [
       {
         "code": "RU",
         "title": "Россия",
         "selected": true
       }
     ],
     "address": "address",
     "country": "RU",
     "state": "state",
     "city": "London",
     "zip": "123456",
     "street": null,
     "house": null,
     "flat": null,
     "entrance": null,
     "doorphone": null,
     "floor": null,
     "comment": null,
     "kladr_json": null,
     "location": {
       "kladr_code": null,
       "zip": "123456",
       "kladr_zip": null,
       "region_zip": null,
       "country": "RU",
       "state": "state",
       "state_type": null,
       "area": null,
       "area_type": null,
       "city": "London",
       "city_type": null,
       "settlement": null,
       "settlement_type": null,
       "address": "address",
       "street": "address",
       "street_type": null,
       "house": null,
       "flat": null,
       "is_kladr": false,
       "latitude": null,
       "longitude": null,
       "autodetected": null
     }
   },
   "client": {
     "id": 2,
     "email": "some-one@yandex.ru",
     "name": "Mortimer Hant",
     "phone": "+79162128506",
     "created_at": "2009-03-30T04:37:32.000+04:00",
     "updated_at": "2026-10-21T23:27:30.000+03:00",
     "comment": null,
     "registered": false,
     "subscribe": true,
     "client_group_id": null,
     "bonus_points": 0,
     "type": "Client::Individual",
     "correspondent_account": null,
     "settlement_account": null,
     "consent_to_personal_data": null,
     "o_auth_provider": null,
     "messenger_subscription": null,
     "external_id": null,
     "external_service": null,
     "contact_name": "Mortimer Hant",
     "surname": null,
     "middlename": null,
     "progressive_discount": null,
     "group_discount": null,
     "ip_addr": "",
     "fields_values": [
       {
         "id": 35,
         "value": "old value",
         "created_at": "2026-10-21T23:27:30.943+03:00",
         "updated_at": "2026-10-21T23:27:30.943+03:00",
         "field_id": 344,
         "type": "Текст",
         "name": "special",
         "handle": null
       }
     ]
   },
   "discounts": [],
   "total_price": 1600,
   "paid_amount": 0,
   "items_price": 1500,
   "id": 1,
   "key": "teest",
   "number": 1001,
   "comment": "comment",
   "archived": false,
   "delivery_title": "самовывоз",
   "delivery_description": "самовывоз",
   "delivery_price": 100,
   "full_delivery_price": 100,
   "payment_description": null,
   "payment_title": "наличными курьеру",
   "first_referer": "http://google.com?q=my_query",
   "first_current_location": "/my_query",
   "first_query": null,
   "first_source_domain": null,
   "first_source": "Google",
   "referer": "http://yandex.ru/yandsearch?text=%D1%81%D0%BF%D0%B0%D0%BB%D1%8C%D0%BD%D1%8B%D0%B5+%D0%BC%D0%B5%D1%88%D0%BA%D0%B8&stpar2=%2Fh1%2Ftm7%2Fs1&stpar4=%2Fs1&stpar1=%2Fu1&stpar3=%2Fm3%2Ftc14%2Fnc1",
   "current_location": "/",
   "query": null,
   "source_domain": null,
   "source": "Прямой трафик",
   "fulfillment_status": "new",
   "custom_status": {
     "permalink": "new",
     "title": "Новый"
   },
   "delivered_at": null,
   "accepted_at": null,
   "created_at": "2009-03-18T10:53:14.000+03:00",
   "updated_at": "2026-10-21T23:27:31.000+03:00",
   "financial_status": "pending",
   "delivery_date": null,
   "delivery_from_hour": null,
   "delivery_from_minutes": null,
   "delivery_to_hour": null,
   "delivery_to_minutes": null,
   "delivery_time": "",
   "paid_at": null,
   "delivery_variant_id": 1,
   "payment_gateway_id": 1,
   "margin": "0.0",
   "margin_amount": "0.0",
   "client_transaction_id": 1,
   "yandex_metrika_client_id": null,
   "currency_code": "RUR",
   "cookies": null,
   "account_id": 1,
   "manager_comment": "manager comment1",
   "locale": "ru",
   "delivery_info": {
     "delivery_variant_id": null,
     "tariff_id": null,
     "title": null,
     "description": null,
     "price": null,
     "shipping_company": null,
     "shipping_company_handle": null,
     "delivery_interval": {
       "min_days": null,
       "max_days": null,
       "description": ""
     },
     "errors": [],
     "warnings": [],
     "outlet": {
       "id": null,
       "external_id": null,
       "latitude": null,
       "longitude": null,
       "type": null,
       "title": null,
       "description": null,
       "address": null,
       "payment_method": null,
       "source_id": null
     },
     "not_available": null
   },
   "responsible_user_id": null,
   "total_profit": "1500.0",
   "warehouse_id": null
 }

Params:

NameTypeAttributeDescription
options Object
options.token string

Required, access token for shop

options.url string

Required, shop url

options.orderid number | string

Required, order id

id Number | String

Required, app id

Return:

Promise

public getOutlet(options: Object, id: Number | String): Promise source

import {getOutlet} from 'insales/lib/api/outlet.js'

GET /admin/outlets/{outlet_id}.json

Examples:

 insales.getOutlet({
   token: '1234567890',
   url: 'shop-test.myinsales.ru',
   outletid: '4'
 }).then(response => {
   console.info(response.data);
 }).catch(err => {
   console.error(err);
 });

Output:

 {
   "id": 4,
   "account_id": 1,
   "delivery_variant_id": 225,
   "price": "100.0",
   "title_translations": [
     "Самовывоз от метро"
   ],
   "description_translations": [
     "Вход через арку во двор"
   ],
   "address": "ул Хмурого д1",
   "latitude": "55.7558",
   "longitude": "37.6173",
   "created_at": "2026-10-21T23:30:59.449+03:00",
   "updated_at": "2026-10-21T23:30:59.449+03:00",
   "title": "Самовывоз от метро",
   "description": "Вход через арку во двор"
 }

Params:

NameTypeAttributeDescription
options Object
options.token string

Required, access token for shop

options.url string

Required, shop url

options.outletid number | string

Required, outlet id

id Number | String

Required, app id

Return:

Promise

public getPage(options: Object, id: Number | String): Promise source

import {getPage} from 'insales/lib/api/page.js'

GET /admin/pages/{page_id}.json

Examples:

 insales.getPage({
   token: '1234567890',
   url: 'shop-test.myinsales.ru',
   pageid: '1'
 }).then(response => {
   console.info(response.data);
 }).catch(err => {
   console.error(err);
 });

Output:

 {
   "id": 1,
   "meta_keywords": "meta keywords",
   "meta_description": "meta description",
   "is_hidden": false,
   "kind": "only_page",
   "permalink": "страница",
   "custom_template": null,
   "created_at": "2026-10-19T22:28:42.000+03:00",
   "updated_at": "2009-03-18T10:55:15.000+03:00",
   "is_main": true,
   "title": "any_url",
   "html_title": "html title",
   "content": "abc"
 }

Params:

NameTypeAttributeDescription
options Object
options.token string

Required, access token for shop

options.url string

Required, shop url

options.pageid number | string

Required, page id

id Number | String

Required, app id

Return:

Promise

public getPaymentGateway(options: Object, id: Number | String): Promise source

import {getPaymentGateway} from 'insales/lib/api/paymentgateway.js'

GET /admin/payment_gateways/{payment_gateway_id_1}.json

Examples:

 insales.getPaymentGateway({
   token: '1234567890',
   url: 'shop-test.myinsales.ru',
   gatewayid: '1'
 }).then(response => {
   console.info(response.data);
 }).catch(err => {
   console.error(err);
 });

Output:

 {
   "id": 1,
   "type": "PaymentGateway::Cod",
   "position": 1,
   "created_at": "2009-03-30T04:37:32.000+04:00",
   "updated_at": "2009-03-31T12:20:34.000+04:00",
   "margin": "0.0",
   "available_for_individual_clients": true,
   "available_for_juridical_clients": true,
   "title": "Наличными курьеру",
   "description": "",
   "payment_delivery_variants": [
     {
       "created_at": "2026-10-19T22:28:42.000+03:00",
       "delivery_variant_id": 1,
       "id": 1
     },
     {
       "created_at": "2026-10-19T22:28:42.000+03:00",
       "delivery_variant_id": 2,
       "id": 2
     }
   ]
 }

Params:

NameTypeAttributeDescription
options Object
options.token string

Required, access token for shop

options.url string

Required, shop url

options.gatewayid number | string

Required, payment gateway id

id Number | String

Required, app id

Return:

Promise

public getPriceKind(options: Object, id: Number | String): Promise source

import {getPriceKind} from 'insales/lib/api/pricekind.js'

GET /admin/price_kinds/{id}.json

Examples:

 insales.getPriceKind({
   token: '1234567890',
   url: 'shop-test.myinsales.ru',
   id: '111'
 }).then(response => {
   console.info(response.data);
 }).catch(err => {
   console.error(err);
 });

Output: { "id": 111, "price_index": 1, "show_in_lists": true, "title": "тест 1", "variant_price_method_name": "price2" }

Params:

NameTypeAttributeDescription
options Object
options.token string

Required, access token for shop

options.url string

Required, shop url

options.id number | string

Required, price kind id

id Number | String

Required, app id

Return:

Promise

public getProduct(options: Object, id: Number | String): Promise source

import {getProduct} from 'insales/lib/api/product.js'

GET /admin/products/{id}.xml

Examples:

 insales.getProduct({
   token: '1234567890',
   url: 'shop-test.myinsales.ru',
   productid: '12345'
 }).then(response => {
   console.info(response.data);
 }).catch(err => {
   console.error(err);
 });

Output:

 { product:
   { archived: 'false',
     available: 'true',
     'canonical-url-collection-id': '',
     'category-id': '1',
     'created-at': '2011-11-11 11:11:11 +0300',
     id: '12345',
     'is-hidden': 'false',
     'sort-weight': '',
     unit: 'pcs',
     'updated-at': '2011-11-11 11:11:11 +0300',
     title: 'Product 1',
     'short-description': '',
     permalink: 'product-1',
     'html-title': '',
     'meta-keywords': '',
     'meta-description': '',
     'currency-code': 'RUR',
     'collections-ids': '',
     images: '',
     'option-names': '',
     properties: '',
     characteristics: '',
     'product-field-values': '',
     variants: { variant: [Object] },
     description: '' } }

Params:

NameTypeAttributeDescription
options Object
options.token string

Required, access token for shop

options.url string

Required, shop url

options.productid number | string

Required, product id

id Number | String

Required, app id

Return:

Promise

public getProductField(options: Object, id: Number | String): Promise source

import {getProductField} from 'insales/lib/api/productfield.js'

GET /admin/product_fields/{product_field_id}.json

Examples:

 insales.getProductField({
   token: '1234567890',
   url: 'shop-test.myinsales.ru',
   fieldid: '2'
 }).then(response => {
   console.info(response.data);
 }).catch(err => {
   console.error(err);
 });

Output:

 {
   "id": 2,
   "handle": "handle2",
   "type": "ProductField::TextArea",
   "application_id": 1,
   "position": 2,
   "is_hidden": null,
   "is_indexed": null,
   "title": "title2",
   "application_title": "Цифровые товары"
 }

 insales.getProductField({
   token: '1234567890',
   url: 'shop-test.myinsales.ru',
   fieldid: 'handle2'
 }).then(response => {
   console.info(response.data);
 }).catch(err => {
   console.error(err);
 });

Output:

 {
   "id": 2,
   "handle": "handle2",
   "type": "ProductField::TextArea",
   "application_id": 1,
   "position": 2,
   "is_hidden": null,
   "is_indexed": null,
   "title": "title2",
   "application_title": "Цифровые товары"
 }

Params:

NameTypeAttributeDescription
options Object
options.token string

Required, access token for shop

options.url string

Required, shop url

options.fieldid number | string

Required, product field id or handle

id Number | String

Required, app id

Return:

Promise

public getProductFieldValue(options: Object, id: Number | String): Promise source

import {getProductFieldValue} from 'insales/lib/api/productfieldvalue.js'

GET /admin/products/{product_id}/product_field_values/{product_field_value_id}.json

Examples:

 insales.getProductFieldValue({
   token: '1234567890',
   url: 'shop-test.myinsales.ru',
   productid: '1',
   valueid: '1'
 }).then(response => {
   console.info(response.data);
 }).catch(err => {
   console.error(err);
 });

Output:

 {
   "id": 1,
   "product_field_id": 1,
   "value": "some product field value"
 }

 insales.getProductFieldValue({
   token: '1234567890',
   url: 'shop-test.myinsales.ru',
   productid: '1',
   valueid: 'handle'
 }).then(response => {
   console.info(response.data);
 }).catch(err => {
   console.error(err);
 });

Output:

 {
   "id": 1,
   "product_field_id": 1,
   "value": "some product field value"
 }

Params:

NameTypeAttributeDescription
options Object
options.token string

Required, access token for shop

options.url string

Required, shop url

options.productid number | string

Required, product id

options.valueid number | string

Required, product field value id or field handle

id Number | String

Required, app id

Return:

Promise

public getProductImage(options: Object, id: Number | String): Promise source

import {getProductImage} from 'insales/lib/api/productimage.js'

GET /admin/products/{product_id}/images/{image_id}.json

Examples:

 insales.getProductImage({
   token: '1234567890',
   url: 'shop-test.myinsales.ru',
   productid: '1',
   productimageid: '4355'
 }).then(response => {
   console.info(response.data);
 }).catch(err => {
   console.error(err);
 });

Output:

 {
   "id": 4355,
   "product_id": 1,
   "external_id": null,
   "position": 1,
   "created_at": "2026-10-21T23:12:42.000+03:00",
   "image_processing": true,
   "title": null,
   "url": "/images/loading.gif",
   "original_url": "/images/loading.gif",
   "medium_url": "/images/loading.gif",
   "small_url": "/images/loading.gif",
   "thumb_url": "/images/loading.gif",
   "compact_url": "/images/loading.gif",
   "large_url": "/images/loading.gif",
   "filename": "image.jpg",
   "has_bitmap_image": false,
   "image_content_type": "image/jpeg"
 }

Params:

NameTypeAttributeDescription
options Object
options.token string

Required, access token for shop

options.url string

Required, shop url

options.productid number | string

Required, product id

options.productimageid number | string

Required, product image id

id Number | String

Required, app id

Return:

Promise

public getProperty(options: Object, id: Number | String): Promise source

import {getProperty} from 'insales/lib/api/property.js'

GET /admin/properties/{property_id}.json

Examples:

 insales.getProperty({
   token: '1234567890',
   url: 'shop-test.myinsales.ru',
   propertyid: '1'
 }).then(response => {
   console.info(response.data);
 }).catch(err => {
   console.error(err);
 });

Output:

 {
   "id": 1,
   "position": 8,
   "backoffice": false,
   "is_hidden": false,
   "is_navigational": true,
   "permalink": "producer",
   "title": "Producer"
 }

Params:

NameTypeAttributeDescription
options Object
options.token string

Required, access token for shop

options.url string

Required, shop url

options.propertyid number | string

Required, property id

id Number | String

Required, app id

Return:

Promise

public getRecurring(options: Object, id: Number | String): Promise source

import {getRecurring} from 'insales/lib/api/recurringcharge.js'

GET /admin/recurring_application_charge.xml

Examples:

 insales.getRecurring({
   token: '1234567890',
   url: 'shop-test.myinsales.ru'
 }).then(output => {
   console.info(output.data);
 }).catch(err => {
   console.error(err);
 });

Output:

 { 'recurring-application-charge':
   { blocked: 'false',
     'created-at': '2011-11-11T11:11:11+03:00',
     id: '12345',
     monthly: '1000.0',
     'paid-till': '2011-11-21',
     'trial-expired-at': '2011-12-11',
     'updated-at': '2011-11-11T11:11:11+03:00' } }

Params:

NameTypeAttributeDescription
options Object
options.token string

Required, access token for shop

options.url string

Required, shop url

id Number | String

Required, app id

Return:

Promise

public getRedirect(options: Object, id: Number | String): Promise source

import {getRedirect} from 'insales/lib/api/redirect.js'

GET /admin/redirects/{redirect_id}.json

Examples:

 insales.getRedirect({
   token: '1234567890',
   url: 'shop-test.myinsales.ru',
   redirectid: '8'
 }).then(response => {
   console.info(response.data);
 }).catch(err => {
   console.error(err);
 });

Output:

 {
   "id": 8,
   "old_url": "/so_old_url",
   "new_url": "/like_new_url",
   "created_at": "2026-10-21T23:06:06.268+03:00"
 }

Params:

NameTypeAttributeDescription
options Object
options.token string

Required, access token for shop

options.url string

Required, shop url

options.redirectid number | string

Required, redirect id

id Number | String

Required, app id

Return:

Promise

public getReview(options: Object, id: Number | String): Promise source

import {getReview} from 'insales/lib/api/review.js'

GET /admin/reviews/{review_id}.json

Examples:

 insales.getReview({
   token: '1234567890',
   url: 'shop-test.myinsales.ru',
   reviewid: '1'
 }).then(response => {
   console.info(response.data);
 }).catch(err => {
   console.error(err);
 });

Output:

 {
   "id": 1,
   "product_id": 1,
   "author": "Автор 1",
   "content": "Отличный продукт!",
   "email": "email1@example.com",
   "rating": 5,
   "manager_name": null,
   "published": true,
   "created_at": "2023-09-01T13:00:00.000+03:00",
   "updated_at": "2023-09-01T13:00:00.000+03:00",
   "manager_reply": "nil",
   "replied_at": null,
   "spam": false,
   "published_at": null,
   "replied_q": false,
   "title": "Cool t-shirt",
   "url": "/product/футболка",
   "first_image": {
     "id": null,
     "product_id": null,
     "external_id": null,
     "position": null,
     "created_at": null,
     "image_processing": null,
     "title": null,
     "url": "/images/no_image_thumb.jpg",
     "original_url": "/images/no_image_original.jpg",
     "medium_url": "/images/no_image_medium.jpg",
     "small_url": "/images/no_image_micro.jpg",
     "thumb_url": "/images/no_image_thumb.jpg",
     "compact_url": "/images/no_image_compact.jpg",
     "large_url": "/images/no_image_large.jpg",
     "filename": null,
     "has_bitmap_image": false,
     "image_content_type": null
   },
   "image": {
     "id": 1,
     "created_at": "2023-09-01T13:00:00.000+03:00",
     "original_url": "http://minio.insales.io:9000/insales-test-sber/images/reviews/1/1/1/image_1.jpg",
     "medium_url": "http://minio.insales.io:9000/insales-test-sber/images/reviews/1/1/1/medium_image_1.jpg",
     "small_url": "http://minio.insales.io:9000/insales-test-sber/images/reviews/1/1/1/micro_image_1.jpg",
     "thumb_url": "http://minio.insales.io:9000/insales-test-sber/images/reviews/1/1/1/thumb_image_1.jpg",
     "compact_url": "http://minio.insales.io:9000/insales-test-sber/images/reviews/1/1/1/compact_image_1.jpg",
     "large_url": "http://minio.insales.io:9000/insales-test-sber/images/reviews/1/1/1/large_image_1.jpg",
     "image_content_type": "image/jpeg"
   }
 }

Params:

NameTypeAttributeDescription
options Object
options.token string

Required, access token for shop

options.url string

Required, shop url

options.reviewid number | string

Required, review id

id Number | String

Required, app id

Return:

Promise

public getSalesChannel(options: Object, id: Number | String): Promise source

import {getSalesChannel} from 'insales/lib/api/saleschannel.js'

GET /admin/sales_channels/{sales_channel_id}.json

Examples:

 insales.getSalesChannel({
   token: '1234567890',
   url: 'shop-test.myinsales.ru',
   saleschannelid: '3'
 }).then(response => {
   console.info(response.data);
 }).catch(err => {
   console.error(err);
 });

Output:

 {
   "id": 3,
   "title": "test title",
   "state": null,
   "messages": [],
   "account_id": 1,
   "goods_setting_type": null,
   "goods_setting_id": null,
   "created_at": "2009-03-18T10:53:14.000+03:00",
   "updated_at": "2009-03-18T10:53:14.000+03:00",
   "application_id": 1,
   "last_rating_import_started_at": null,
   "last_feedbacks_import_started_at": null,
   "additional_fields": {},
   "auto_export_products": "disabled"
 }

Params:

NameTypeAttributeDescription
options Object
options.token string

Required, access token for shop

options.url string

Required, shop url

options.saleschannelid number | string

Required, sales channel id

id Number | String

Required, app id

Return:

Promise

public getStockCurrency(options: Object, id: Number | String): Promise source

import {getStockCurrency} from 'insales/lib/api/stockcurrency.js'

GET /admin/stock_currencies/{stock_currency_id}.json

Examples:

 insales.getStockCurrency({
   token: '1234567890',
   url: 'shop-test.myinsales.ru',
   currencyid: '1'
 }).then(response => {
   console.info(response.data);
 }).catch(err => {
   console.error(err);
 });

Output:

 {
   "id": 1,
   "is_default": true,
   "exchange_rate_use_cb": false,
   "exchange_rate_manual": "30.0",
   "exchange_rate_percent": "0.0",
   "exchange_rate_round": true,
   "code": "LVL",
   "title": "Латвийский лат",
   "cb_rate": "30.0",
   "unit": "Ls",
   "exchange_rate": "30.0"
 }

Params:

NameTypeAttributeDescription
options Object
options.token string

Required, access token for shop

options.url string

Required, shop url

options.currencyid number | string

Required, stock currency id

id Number | String

Required, app id

Return:

Promise

public getUserTask(options: Object, id: Number | String): Promise source

import {getUserTask} from 'insales/lib/api/usertask.js'

GET /admin/user_tasks/{user_task_id}.json

Examples:

 insales.getUserTask({
   token: '1234567890',
   url: 'shop-test.myinsales.ru',
   taskid: '4'
 }).then(response => {
   console.info(response.data);
 }).catch(err => {
   console.error(err);
 });

Output:

 {
   "id": 4,
   "complete": null,
   "order_id": null,
   "assignee_id": 1,
   "title": "dispatch order N1",
   "description": "You should dispatch the order N1 till noon",
   "created_at": "2026-10-21T23:32:39.095+03:00",
   "updated_at": "2026-10-21T23:32:39.095+03:00",
   "deadline_at": "2021-01-01T00:00:00.000+03:00"
 }

Params:

NameTypeAttributeDescription
options Object
options.token string

Required, access token for shop

options.url string

Required, shop url

options.taskid number | string

Required, user task id

id Number | String

Required, app id

Return:

Promise

public getVariant(options: Object, id: Number | String): Promise source

import {getVariant} from 'insales/lib/api/variant.js'

GET /admin/products/{product_id}/variants/{variant_id}.json

Examples:

 insales.getVariant({
   token: '1234567890',
   url: 'shop-test.myinsales.ru',
   productid: '1',
   variantid: '1'
 }).then(response => {
   console.info(response.data);
 }).catch(err => {
   console.error(err);
 });

Output:

 {
   "id": 1,
   "title": "Red",
   "product_id": 1,
   "sku": "423",
   "barcode": null,
   "dimensions": "10x20x30",
   "available": false,
   "image_ids": [],
   "image_id": null,
   "weight": null,
   "created_at": "2009-03-18T10:53:14.000+03:00",
   "updated_at": "2009-03-18T10:53:14.000+03:00",
   "quantity": 0,
   "quantity_at_warehouse0": "0.0",
   "quantity_at_warehouse1": "0.0",
   "cost_price": "3.0",
   "cost_price_in_site_currency": "90.0",
   "price_in_site_currency": "300.0",
   "base_price": "10.0",
   "old_price": null,
   "price2": 12,
   "price": "10.0",
   "base_price_in_site_currency": "300.0",
   "old_price_in_site_currency": null,
   "price2_in_site_currency": "360.0",
   "prices": [
     12
   ],
   "prices_in_site_currency": [
     "360.0"
   ],
   "variant_field_values": [
     {
       "id": 1,
       "variant_field_id": 1,
       "value": "some variant field value"
     }
   ],
   "option_values": [
     {
       "id": 1,
       "option_name_id": 1,
       "position": 1,
       "title": "Red",
       "image_url": null,
       "permalink": null
     }
   ]
 }

Params:

NameTypeAttributeDescription
options Object
options.token string

Required, access token for shop

options.url string

Required, shop url

options.productid number | string

Required, product id

options.variantid number | string

Required, variant id

id Number | String

Required, app id

Return:

Promise

public getVariantField(options: Object, id: Number | String): Promise source

import {getVariantField} from 'insales/lib/api/variantfield.js'

GET /admin/variant_fields/{variant_field_id}.json

Examples:

 insales.getVariantField({
   token: '1234567890',
   url: 'shop-test.myinsales.ru',
   fieldid: '2'
 }).then(response => {
   console.info(response.data);
 }).catch(err => {
   console.error(err);
 });

Output:

 {
   "id": 2,
   "handle": "handle2",
   "type": "VariantField::TextArea",
   "application_id": 1,
   "position": 2,
   "is_hidden": null,
   "title": "title2",
   "application_title": "Цифровые товары"
 }

 insales.getVariantField({
   token: '1234567890',
   url: 'shop-test.myinsales.ru',
   fieldid: 'handle2'
 }).then(response => {
   console.info(response.data);
 }).catch(err => {
   console.error(err);
 });

Output:

 {
   "id": 2,
   "handle": "handle2",
   "type": "VariantField::TextArea",
   "application_id": 1,
   "position": 2,
   "is_hidden": null,
   "title": "title2",
   "application_title": "Цифровые товары"
 }

Params:

NameTypeAttributeDescription
options Object
options.token string

Required, access token for shop

options.url string

Required, shop url

options.fieldid number | string

Required, variant field id or handle

id Number | String

Required, app id

Return:

Promise

public getVariantFieldValue(options: Object, id: Number | String): Promise source

import {getVariantFieldValue} from 'insales/lib/api/variantfieldvalue.js'

GET /admin/variants/{variant_id}/variant_field_values/{variant_field_value_id}.json

Examples:

 insales.getVariantFieldValue({
   token: '1234567890',
   url: 'shop-test.myinsales.ru',
   variantid: '1',
   valueid: '1'
 }).then(response => {
   console.info(response.data);
 }).catch(err => {
   console.error(err);
 });

Output:

 {
   "id": 1,
   "variant_field_id": 1,
   "value": "some variant field value"
 }

 insales.getVariantFieldValue({
   token: '1234567890',
   url: 'shop-test.myinsales.ru',
   variantid: '1',
   valueid: 'handle'
 }).then(response => {
   console.info(response.data);
 }).catch(err => {
   console.error(err);
 });

Output:

 {
   "id": 1,
   "variant_field_id": 1,
   "value": "some variant field value"
 }

Params:

NameTypeAttributeDescription
options Object
options.token string

Required, access token for shop

options.url string

Required, shop url

options.variantid number | string

Required, variant id

options.valueid number | string

Required, variant field value id or field handle

id Number | String

Required, app id

Return:

Promise

public getWarehouse(options: Object, id: Number | String): Promise source

import {getWarehouse} from 'insales/lib/api/warehouse.js'

GET /admin/warehouses/{warehouse_id}.json

Examples:

 insales.getWarehouse({
   token: '1234567890',
   url: 'shop-test.myinsales.ru',
   warehouseid: '39'
 }).then(response => {
   console.info(response.data);
 }).catch(err => {
   console.error(err);
 });

Output:

 {
   "id": 39,
   "title": "main",
   "position": 2,
   "array_index": 1,
   "created_at": "2026-10-21T23:23:02.607+03:00",
   "updated_at": "2026-10-21T23:23:02.607+03:00",
   "status": "creating"
 }

Params:

NameTypeAttributeDescription
options Object
options.token string

Required, access token for shop

options.url string

Required, shop url

options.warehouseid number | string

Required, warehouse id

id Number | String

Required, app id

Return:

Promise

public getWebhook(options: Object, id: Number | String): Promise source

import {getWebhook} from 'insales/lib/api/webhook.js'

GET /admin/webhooks/{webhook_id}.json

Examples:

 insales.getWebhook({
   token: '1234567890',
   url: 'shop-test.myinsales.ru',
   webhookid: '10'
 }).then(response => {
   console.info(response.data);
 }).catch(err => {
   console.error(err);
 });

Output:

 {
   "address": "http://app.ru/orders/create",
   "created_at": "2026-10-21T23:32:48.529+03:00",
   "id": 10,
   "topic": "orders/create",
   "format_type": "xml",
   "warehouse_id": null,
   "sales_channel_id": null,
   "batch_size": null
 }

Params:

NameTypeAttributeDescription
options Object
options.token string

Required, access token for shop

options.url string

Required, shop url

options.webhookid number | string

Required, webhook id

id Number | String

Required, app id

Return:

Promise

public getWidgetType(options: Object, id: Number | String): Promise source

import {getWidgetType} from 'insales/lib/api/widget_types.js'

GET /admin/themes/#{theme_id}/widget_types/#{id}.xml

Examples:

 insales.getWidgetType({
   token: '1234567890',
   url: 'shop-test.myinsales.ru',
   theme: '643879',
   widgetId: '60423000'
 }).then(response => {
   console.info(response.data);
 }).catch(err => {
   console.error(err);
 });

Output:

 {

'type': 'BlockListWidgetType', 'handle': 'widget_type_2', 'name': 'WidgetType 2', 'snippet_content': 'New text' 'widget_category_handle': 'drugie', 'page_kinds': ['all'], 'widget_list_kinds': ['content'], 'block_template_handle': 'system-title-and-content' }

Params:

NameTypeAttributeDescription
options Object
options.token string

Required, access token for shop

options.url string

Required, shop url

options.theme Number | String

Required, theme id

options.widgetId Number | String

Required, widget id

id Number | String

Required, app id

Return:

Promise

public listAccessory(options: Object, id: Number | String): Promise source

import {listAccessory} from 'insales/lib/api/accessory.js'

GET /admin/accessories.json

Examples:

 insales.listAccessory({
   token: '1234567890',
   url: 'shop-test.myinsales.ru'
 }).then(response => {
   console.info(response.data);
 }).catch(err => {
   console.error(err);
 });

Output:

 [
   {
     "id": 25,
     "account_id": 1,
     "name_translations": [
       "Опция 0"
     ],
     "min_count": 1,
     "max_count": 8,
     "created_at": "2026-10-21T23:15:56.455+03:00",
     "updated_at": "2026-10-21T23:15:56.455+03:00",
     "back_office_name": "Удовлетворительный Бронзовый Стол",
     "permalink": "ut_nesciunt",
     "name": "Опция 0"
   },
   {
     "id": 26,
     "account_id": 1,
     "name_translations": [
       "Опция 1"
     ],
     "min_count": 4,
     "max_count": 4,
     "created_at": "2026-10-21T23:15:56.476+03:00",
     "updated_at": "2026-10-21T23:15:56.476+03:00",
     "back_office_name": "Лоснящийся Пластиковый Бутылка",
     "permalink": "sit_modi",
     "name": "Опция 1"
   },
   {
     "id": 27,
     "account_id": 1,
     "name_translations": [
       "Опция 2"
     ],
     "min_count": 4,
     "max_count": 9,
     "created_at": "2026-10-21T23:15:56.495+03:00",
     "updated_at": "2026-10-21T23:15:56.495+03:00",
     "back_office_name": "Потрясающий Стальной Свитер",
     "permalink": "quisquam_saepe",
     "name": "Опция 2"
   },
   {
     "id": 28,
     "account_id": 1,
     "name_translations": [
       "Опция 0"
     ],
     "min_count": 2,
     "max_count": 3,
     "created_at": "2026-10-21T23:15:56.510+03:00",
     "updated_at": "2026-10-21T23:15:56.510+03:00",
     "back_office_name": "Аэродинамический Льняной Лампа",
     "permalink": "beatae_autem",
     "name": "Опция 0"
   },
   {
     "id": 29,
     "account_id": 1,
     "name_translations": [
       "Опция 1"
     ],
     "min_count": 2,
     "max_count": 9,
     "created_at": "2026-10-21T23:15:56.524+03:00",
     "updated_at": "2026-10-21T23:15:56.524+03:00",
     "back_office_name": "Удовлетворительный Деревянный Сумка",
     "permalink": "consequatur_atque",
     "name": "Опция 1"
   },
   {
     "id": 30,
     "account_id": 1,
     "name_translations": [
       "Опция 2"
     ],
     "min_count": 2,
     "max_count": 7,
     "created_at": "2026-10-21T23:15:56.541+03:00",
     "updated_at": "2026-10-21T23:15:56.541+03:00",
     "back_office_name": "Интеллектуальный Алюминиевый Лампа",
     "permalink": "pariatur_ducimus",
     "name": "Опция 2"
   }
 ]

Params:

NameTypeAttributeDescription
options Object
options.token string

Required, access token for shop

options.url string

Required, shop url

id Number | String

Required, app id

Return:

Promise
import {listAccessoryLink} from 'insales/lib/api/accessoryvalue.js'

GET /admin/products/{product_id}/product_accessory_links.json

Examples:

 insales.listAccessoryLink({
   token: '1234567890',
   url: 'shop-test.myinsales.ru',
   productid: '293978481'
 }).then(response => {
   console.info(response.data);
 }).catch(err => {
   console.error(err);
 });

Output:

 []

Params:

NameTypeAttributeDescription
options Object
options.token string

Required, access token for shop

options.url string

Required, shop url

options.productid number | string

Required, product id

id Number | String

Required, app id

Return:

Promise

public listAccessoryValue(options: Object, id: Number | String): Promise source

import {listAccessoryValue} from 'insales/lib/api/accessoryvalue.js'

GET /admin/accessories/{accessory_id}/values.json

Examples:

 insales.listAccessoryValue({
   token: '1234567890',
   url: 'shop-test.myinsales.ru',
   accessoryid: '88'
 }).then(response => {
   console.info(response.data);
 }).catch(err => {
   console.error(err);
 });

Output:

 [
   {
     "id": 50,
     "account_id": 1,
     "accessory_id": 88,
     "name_translations": [
       "Значение опции"
     ],
     "price": "2.93",
     "created_at": "2026-10-21T23:15:59.087+03:00",
     "updated_at": "2026-10-21T23:15:59.087+03:00",
     "accounting_variant_id": null,
     "name": "Значение опции"
   },
   {
     "id": 51,
     "account_id": 1,
     "accessory_id": 88,
     "name_translations": [
       "Значение опции 0"
     ],
     "price": "6.77",
     "created_at": "2026-10-21T23:15:59.100+03:00",
     "updated_at": "2026-10-21T23:15:59.100+03:00",
     "accounting_variant_id": null,
     "name": "Значение опции 0"
   },
   {
     "id": 52,
     "account_id": 1,
     "accessory_id": 88,
     "name_translations": [
       "Значение опции 1"
     ],
     "price": "3.94",
     "created_at": "2026-10-21T23:15:59.110+03:00",
     "updated_at": "2026-10-21T23:15:59.110+03:00",
     "accounting_variant_id": null,
     "name": "Значение опции 1"
   },
   {
     "id": 53,
     "account_id": 1,
     "accessory_id": 88,
     "name_translations": [
       "Значение опции 2"
     ],
     "price": "9.04",
     "created_at": "2026-10-21T23:15:59.124+03:00",
     "updated_at": "2026-10-21T23:15:59.124+03:00",
     "accounting_variant_id": null,
     "name": "Значение опции 2"
   },
   {
     "id": 54,
     "account_id": 1,
     "accessory_id": 88,
     "name_translations": [
       "Значение опции 0"
     ],
     "price": "9.43",
     "created_at": "2026-10-21T23:15:59.132+03:00",
     "updated_at": "2026-10-21T23:15:59.132+03:00",
     "accounting_variant_id": null,
     "name": "Значение опции 0"
   },
   {
     "id": 55,
     "account_id": 1,
     "accessory_id": 88,
     "name_translations": [
       "Значение опции 1"
     ],
     "price": "8.18",
     "created_at": "2026-10-21T23:15:59.140+03:00",
     "updated_at": "2026-10-21T23:15:59.140+03:00",
     "accounting_variant_id": null,
     "name": "Значение опции 1"
   },
   {
     "id": 56,
     "account_id": 1,
     "accessory_id": 88,
     "name_translations": [
       "Значение опции 2"
     ],
     "price": "9.95",
     "created_at": "2026-10-21T23:15:59.148+03:00",
     "updated_at": "2026-10-21T23:15:59.148+03:00",
     "accounting_variant_id": null,
     "name": "Значение опции 2"
   }
 ]

Params:

NameTypeAttributeDescription
options Object
options.token string

Required, access token for shop

options.url string

Required, shop url

options.accessoryid number | string

Required, accessory id

id Number | String

Required, app id

Return:

Promise

public listAllOptionValue(options: Object, id: Number | String): Promise source

import {listAllOptionValue} from 'insales/lib/api/optionvalue.js'

GET /admin/option_values.json

Examples:

 insales.listAllOptionValue({
   token: '1234567890',
   url: 'shop-test.myinsales.ru'
 }).then(response => {
   console.info(response.data);
 }).catch(err => {
   console.error(err);
 });

Output:

 [
   {
     "id": 1,
     "option_name_id": 1,
     "position": 1,
     "title": "Red",
     "image_url": null,
     "permalink": null
   },
   {
     "id": 2,
     "option_name_id": 1,
     "position": 2,
     "title": "Зеленый",
     "image_url": null,
     "permalink": null
   },
   {
     "id": 3,
     "option_name_id": 1,
     "position": 3,
     "title": "Базовая",
     "image_url": null,
     "permalink": null
   },
   {
     "id": 4,
     "option_name_id": 3,
     "position": 1,
     "title": "Синий",
     "image_url": null,
     "permalink": null
   },
   {
     "id": 20,
     "option_name_id": 1,
     "position": 20,
     "title": "Синий-10",
     "image_url": null,
     "permalink": null
   }
 ]

Params:

NameTypeAttributeDescription
options Object
options.token string

Required, access token for shop

options.url string

Required, shop url

id Number | String

Required, app id

Return:

Promise

public listApplicationAction(options: Object, id: Number | String): Promise source

import {listApplicationAction} from 'insales/lib/api/applicationaction.js'

GET /admin/application_actions.json

Examples:

 insales.listApplicationAction({
   token: '1234567890',
   url: 'shop-test.myinsales.ru'
 }).then(response => {
   console.info(response.data);
 }).catch(err => {
   console.error(err);
 });

Output:

 [
   {
     "id": 1,
     "title": "test",
     "url": "http://www.google.ru",
     "handle": "test",
     "entity": "order"
   }
 ]

Params:

NameTypeAttributeDescription
options Object
options.token string

Required, access token for shop

options.url string

Required, shop url

id Number | String

Required, app id

Return:

Promise

public listApplicationWidget(options: Object, id: Number | String): Promise source

import {listApplicationWidget} from 'insales/lib/api/applicationwidget.js'

GET /admin/application_widgets.json

Examples:

 insales.listApplicationWidget({
   token: '1234567890',
   url: 'shop-test.myinsales.ru'
 }).then(response => {
   console.info(response.data);
 }).catch(err => {
   console.error(err);
 });

Output:

 [
   {
     "code": "html/js code",
     "created_at": "2026-10-21T23:32:46.260+03:00",
     "id": 9,
     "height": 50,
     "page_type": "product"
   }
 ]

Params:

NameTypeAttributeDescription
options Object
options.token string

Required, access token for shop

options.url string

Required, shop url

id Number | String

Required, app id

Return:

Promise

public listArticle(options: Object, id: Number | String): Promise source

import {listArticle} from 'insales/lib/api/article.js'

GET /admin/blogs/{blog_id}/articles.json

Examples:

 insales.listArticle({
   token: '1234567890',
   url: 'shop-test.myinsales.ru',
   blogid: '1'
 }).then(response => {
   console.info(response.data);
 }).catch(err => {
   console.error(err);
 });

Output:

 [
   {
     "id": 2,
     "created_at": "2026-10-20T12:13:53.000+03:00",
     "updated_at": "2026-10-21T23:05:50.000+03:00",
     "published_at": "2017-03-01T07:53:15.000+03:00",
     "pinned": false,
     "custom_template": null,
     "title": "Второая Статья",
     "author": "Ivan",
     "permalink": "statya-2",
     "html_title": null,
     "meta_keywords": null,
     "meta_description": null,
     "image": {
       "id": 1,
       "created_at": "2026-10-19T22:28:42.000+03:00",
       "original_url": "http://minio.insales.io:9000/insales-test-sber/images/articles/1/1/1/article_image_1.jpg"
     },
     "tags": [
       {
         "title": "test"
       },
       {
         "title": "test2"
       }
     ],
     "related_products": [
       {
         "category_id": 1,
         "created_at": "2026-10-21T14:10:26.000+03:00",
         "updated_at": "2015-07-27T17:05:35.000+03:00",
         "is_hidden": false,
         "account_id": 1,
         "title_translations": [
           "Cool t-shirt"
         ],
         "available": false,
         "archived": false,
         "key": null,
         "price_min_cached": "10.0",
         "price_max_cached": "10.0",
         "price_min_available_cached": null,
         "price_max_available_cached": null,
         "canonical_url_collection_id": 1,
         "collections_id": [
           1,
           3,
           8
         ],
         "characteristics_id": [
           7,
           9,
           12,
           13
         ],
         "custom_layout": null,
         "custom_template": null,
         "old_price_min_cached": null,
         "old_price_max_cached": null,
         "old_price_min_available_cached": null,
         "old_price_max_available_cached": null,
         "permalink": "футболка",
         "unit": "pce",
         "deleted": false,
         "cost_price_min_cached": null,
         "cost_price_max_cached": null,
         "stock_currency_id": 1,
         "sort_weight": null,
         "bundle": null,
         "ignore_discounts": null,
         "vat": -1,
         "dimensions": "10x20x30",
         "fiscal_product_type": 1,
         "popularity": null,
         "available_at_warehouses": [],
         "auto_assign_bundle_price": null,
         "demo": null,
         "sales_channels_id": null,
         "demo_thematic": null,
         "reviews_average_rating_cached": null,
         "reviews_count_cached": null,
         "merge_product_id": null,
         "merge_group_product_id": null,
         "merge_group_hidden": null,
         "no_delivery": false,
         "id": 1,
         "main_image_id": null,
         "is_adult": false,
         "title": "Cool t-shirt"
       }
     ],
     "notice": "Второй анонс",
     "content": "Привет"
   },
   {
     "id": 1,
     "created_at": "2026-10-20T12:13:53.000+03:00",
     "updated_at": "2026-10-20T12:13:53.000+03:00",
     "published_at": "2009-03-18T07:53:15.000+03:00",
     "pinned": false,
     "custom_template": null,
     "title": "Статья",
     "author": "Ivan",
     "permalink": "statya",
     "html_title": null,
     "meta_keywords": null,
     "meta_description": null,
     "tags": [],
     "related_products": [],
     "notice": "Первый анонс",
     "content": "Первая статья"
   }
 ]

Params:

NameTypeAttributeDescription
options Object
options.token string

Required, access token for shop

options.url string

Required, shop url

options.blogid number | string

Required, blog id

id Number | String

Required, app id

Return:

Promise

public listAsset(options: Object, id: Number | String): Promise source

import {listAsset} from 'insales/lib/api/asset.js'

GET /admin/themes/#{theme_id}/assets.xml

Examples:

 insales.listAsset({
   token: '1234567890',
   url: 'shop-test.myinsales.ru',
   theme: '643879'
 }).then(response => {
   console.info(response.data);
 }).catch(err => {
   console.error(err);
 });

Output:

 { 'assets':
    { 'asset':
       [ { id: '60410193',
           'theme-id': '643879',
           type: 'Asset::Template',
           name: 'order.liquid',
           'content-type': 'text/x-liquid',
           'file-size': '5125',
           'human-readable-name': 'Карточка заказа' }
        ]}};

Params:

NameTypeAttributeDescription
options Object
options.token string

Required, access token for shop

options.url string

Required, shop url

options.theme Number | String

Required, theme id

id Number | String

Required, app id

Return:

Promise

public listBlog(options: Object, id: Number | String): Promise source

import {listBlog} from 'insales/lib/api/blog.js'

GET /admin/blogs.json

Examples:

 insales.listBlog({
   token: '1234567890',
   url: 'shop-test.myinsales.ru'
 }).then(response => {
   console.info(response.data);
 }).catch(err => {
   console.error(err);
 });

Output:

 [
   {
     "id": 1,
     "commentable": "no",
     "notify_about_comment": true,
     "captcha_enabled": false,
     "disallow_links_in_comments": false,
     "custom_template": null,
     "handle": null,
     "title": "Блог",
     "html_title": null,
     "meta_keywords": null,
     "meta_description": null,
     "tags": [
       {
         "title": "test"
       },
       {
         "title": "test2"
       }
     ]
   },
   {
     "id": 2,
     "commentable": "no",
     "notify_about_comment": true,
     "captcha_enabled": false,
     "disallow_links_in_comments": false,
     "custom_template": null,
     "handle": "second_blog",
     "title": "Second blog",
     "html_title": null,
     "meta_keywords": null,
     "meta_description": null,
     "tags": []
   }
 ]

Params:

NameTypeAttributeDescription
options Object
options.token string

Required, access token for shop

options.url string

Required, shop url

id Number | String

Required, app id

Return:

Promise

public listBonusTransaction(options: Object, id: Number | String): Promise source

import {listBonusTransaction} from 'insales/lib/api/bonustransaction.js'

GET /admin/bonus_system_transactions.json

Examples:

 insales.listBonusTransaction({
   token: '1234567890',
   url: 'shop-test.myinsales.ru',
   updated_since: '2009-01-04 14:44:43 +0300'
 }).then(response => {
   console.info(response.data);
 }).catch(err => {
   console.error(err);
 });

Output:

 [
   {
     "id": 1,
     "bonus_points": 100,
     "client_id": 7,
     "bonus_system_id": 1,
     "initiator_type": "User",
     "initiator_id": 1,
     "description": "Бонус за регистрацию",
     "status": "charged",
     "created_at": "2011-03-18T10:53:14.000+03:00",
     "updated_at": "2011-03-18T10:53:15.000+03:00"
   },
   {
     "id": 25,
     "bonus_points": 100,
     "client_id": 2,
     "bonus_system_id": 1,
     "initiator_type": "Order",
     "initiator_id": 1,
     "description": "test",
     "status": "charged",
     "created_at": "2026-10-21T23:29:37.776+03:00",
     "updated_at": "2026-10-21T23:29:37.776+03:00"
   },
   {
     "id": 33,
     "bonus_points": 100,
     "client_id": 2,
     "bonus_system_id": 1,
     "initiator_type": "User",
     "initiator_id": 1,
     "description": "test",
     "status": "charged",
     "created_at": "2026-10-21T23:29:37.789+03:00",
     "updated_at": "2026-10-21T23:29:37.789+03:00"
   }
 ]

Params:

NameTypeAttributeDescription
options Object
options.token string

Required, access token for shop

options.url string

Required, shop url

options.updated_since string
  • optional

Transactions updated since

options.from_id number | string
  • optional

Transactions starting from this id

options.per_page number | string
  • optional

Transactions per page

id Number | String

Required, app id

Return:

Promise

public listCategory(options: Object, id: Number | String): Promise source

import {listCategory} from 'insales/lib/api/category.js'

GET /admin/categories.json

Examples:

 insales.listCategory({
   token: '1234567890',
   url: 'shop-test.myinsales.ru'
 }).then(response => {
   console.info(response.data);
 }).catch(err => {
   console.error(err);
 });

Output:

 [
   {
     "id": 6,
     "parent_id": 1,
     "title": "T-shirts",
     "position": 0,
     "created_at": "2026-10-20T11:11:05.000+03:00",
     "updated_at": "2026-10-20T11:11:05.000+03:00"
   },
   {
     "id": 2,
     "parent_id": 1,
     "title": "Trousers",
     "position": 1,
     "created_at": "2026-10-20T11:11:05.000+03:00",
     "updated_at": "2026-10-20T11:11:05.000+03:00"
   },
   {
     "id": 3,
     "parent_id": 1,
     "title": "Shirts",
     "position": 2,
     "created_at": "2026-10-20T11:11:05.000+03:00",
     "updated_at": "2026-10-20T11:11:05.000+03:00"
   },
   {
     "id": 4,
     "parent_id": 1,
     "title": "Socks",
     "position": 3,
     "created_at": "2026-10-20T11:11:05.000+03:00",
     "updated_at": "2026-10-20T11:11:05.000+03:00"
   },
   {
     "id": 5,
     "parent_id": 1,
     "title": "Hats",
     "position": 4,
     "created_at": "2026-10-20T11:11:05.000+03:00",
     "updated_at": "2026-10-20T11:11:05.000+03:00"
   },
   {
     "id": 8,
     "parent_id": 5,
     "title": "Top Hat",
     "position": 1,
     "created_at": "2026-10-20T11:11:05.000+03:00",
     "updated_at": "2026-10-20T11:11:05.000+03:00"
   },
   {
     "id": 1,
     "parent_id": null,
     "title": "Склад",
     "position": 0,
     "created_at": "2026-10-20T11:11:05.000+03:00",
     "updated_at": "2026-10-20T11:11:05.000+03:00"
   }
 ]

Params:

NameTypeAttributeDescription
options Object
options.token string

Required, access token for shop

options.url string

Required, shop url

id Number | String

Required, app id

Return:

Promise

public listCharacteristic(options: Object, id: Number | String): Promise source

import {listCharacteristic} from 'insales/lib/api/characteristic.js'

GET /admin/properties/{property_id}/characteristics.json

Examples:

 insales.listCharacteristic({
   token: '1234567890',
   url: 'shop-test.myinsales.ru',
   propertyid: '3'
 }).then(response => {
   console.info(response.data);
 }).catch(err => {
   console.error(err);
 });

Output:

 [
   {
     "id": 7,
     "property_id": 3,
     "position": 1,
     "title": "Nike",
     "permalink": "nike"
   },
   {
     "id": 8,
     "property_id": 3,
     "position": 2,
     "title": "Puma",
     "permalink": "puma"
   }
 ]

Params:

NameTypeAttributeDescription
options Object
options.token string

Required, access token for shop

options.url string

Required, shop url

options.propertyid number | string

Required, property id

id Number | String

Required, app id

Return:

Promise

public listCharge(options: Object, id: Number | String): Promise source

import {listCharge} from 'insales/lib/api/charge.js'

GET /admin/application_charges.xml

Examples:

 insales.listCharge({
   token: '1234567890',
   url: 'shop-test.myinsales.ru'
 }).then(output => {
   console.info(output.response.statusCode);
 }).catch(err => {
   console.error(err);
 });

Output:

 { 'application-charges':
   { 'application-charge':
      { 'created-at': '2011-11-11T11:11:11+03:00',
        id: '1234',
        name: 'Купи слона',
        price: '180.0',
        'return-url': 'http://application.my/check_payment_url/%id_in_my_application',
        status: 'pending',
        test: '',
        'updated-at': '2011-11-11T11:11:11+03:00',
        'confirmation-url': 'http://shop-test.myinsales.ru/admin/invoices/123456' } } }

Params:

NameTypeAttributeDescription
options Object
options.token string

Required, access token for shop

options.url string

Required, shop url

id Number | String

Required, app id

Return:

Promise

public listClient(options: Object, id: Number | String): Promise source

import {listClient} from 'insales/lib/api/client.js'

GET /admin/clients.json

Examples:

 insales.listClient({
   token: '1234567890',
   url: 'shop-test.myinsales.ru',
   updated_since: '2009-01-04 14:44:43 +0300'
 }).then(response => {
   console.info(response.data);
 }).catch(err => {
   console.error(err);
 });

Output:

 [
   {
     "id": 2,
     "email": "some-one@yandex.ru",
     "name": "Mortimer Hant",
     "phone": "+79162128506",
     "created_at": "2009-03-30T04:37:32.000+04:00",
     "updated_at": "2009-03-31T12:20:34.000+04:00",
     "comment": null,
     "registered": false,
     "subscribe": true,
     "client_group_id": null,
     "bonus_points": 0,
     "type": "Client::Individual",
     "correspondent_account": null,
     "settlement_account": null,
     "consent_to_personal_data": null,
     "o_auth_provider": null,
     "messenger_subscription": null,
     "external_id": null,
     "external_service": null,
     "contact_name": "Mortimer Hant",
     "surname": null,
     "middlename": null,
     "progressive_discount": null,
     "group_discount": null,
     "ip_addr": "",
     "fields_values": [],
     "default_address": null,
     "client_tags": [],
     "full_name": "Mortimer Hant"
   },
   {
     "id": 3,
     "email": "some-one2@yandex.ru",
     "name": "Just Man",
     "phone": "+7(926)111-22-33",
     "created_at": "2009-04-30T04:37:32.000+04:00",
     "updated_at": "2009-04-30T12:20:34.000+04:00",
     "comment": null,
     "registered": false,
     "subscribe": true,
     "client_group_id": 1,
     "bonus_points": 0,
     "type": "Client::Individual",
     "correspondent_account": null,
     "settlement_account": null,
     "consent_to_personal_data": null,
     "o_auth_provider": null,
     "messenger_subscription": null,
     "external_id": null,
     "external_service": null,
     "contact_name": "Just Man",
     "surname": null,
     "middlename": null,
     "progressive_discount": "25.0",
     "group_discount": "25.0",
     "ip_addr": "",
     "fields_values": [],
     "default_address": null,
     "client_tags": [],
     "full_name": "Just Man"
   },
   {
     "id": 5,
     "email": "john@smith.com",
     "name": "John Smith",
     "phone": "+7(926)111-11-11",
     "created_at": "2009-04-30T04:37:32.000+04:00",
     "updated_at": "2026-10-21T23:29:32.000+03:00",
     "comment": null,
     "registered": true,
     "subscribe": true,
     "client_group_id": null,
     "bonus_points": 1000,
     "type": "Client::Individual",
     "correspondent_account": null,
     "settlement_account": null,
     "consent_to_personal_data": null,
     "o_auth_provider": null,
     "messenger_subscription": null,
     "external_id": null,
     "external_service": null,
     "contact_name": "John Smith",
     "surname": null,
     "middlename": null,
     "progressive_discount": null,
     "group_discount": null,
     "ip_addr": "",
     "fields_values": [
       {
         "id": 811,
         "value": "old value",
         "created_at": "2026-10-21T23:29:32.199+03:00",
         "updated_at": "2026-10-21T23:29:32.199+03:00",
         "field_id": 1120,
         "type": "Текст",
         "name": "special",
         "handle": null
       }
     ],
     "default_address": null,
     "client_tags": [],
     "full_name": "John Smith"
   }
 ]

Params:

NameTypeAttributeDescription
options Object
options.token string

Required, access token for shop

options.url string

Required, shop url

options.updated_since string
  • optional

Clients updated since

options.from_id number | string
  • optional

Clients starting from this id

options.per_page number | string
  • optional

Clients per page

options.q string
  • optional

Search by name, surname, middlename, phone or email

options.phone string
  • optional

Exact phone

options.email string
  • optional

Exact email

options.registered string
  • optional

Registration status: yes or no

options.subscribe string
  • optional

Subscription permission: yes or no

options.rfm_group string | string[]
  • optional

RFM group or array of groups

id Number | String

Required, app id

Return:

Promise

public listClientBonusTransaction(options: Object, id: Number | String): Promise source

import {listClientBonusTransaction} from 'insales/lib/api/bonustransaction.js'

GET /admin/clients/{client_id}/bonus_system_transactions.json

Examples:

 insales.listClientBonusTransaction({
   token: '1234567890',
   url: 'shop-test.myinsales.ru',
   clientid: '2'
 }).then(response => {
   console.info(response.data);
 }).catch(err => {
   console.error(err);
 });

Output:

 [
   {
     "id": 57,
     "bonus_points": 100,
     "client_id": 2,
     "bonus_system_id": 1,
     "initiator_type": "Order",
     "initiator_id": 1,
     "description": "test",
     "status": "charged",
     "created_at": "2026-10-21T23:29:38.117+03:00",
     "updated_at": "2026-10-21T23:29:38.117+03:00"
   },
   {
     "id": 65,
     "bonus_points": 100,
     "client_id": 2,
     "bonus_system_id": 1,
     "initiator_type": "User",
     "initiator_id": 1,
     "description": "test",
     "status": "charged",
     "created_at": "2026-10-21T23:29:38.130+03:00",
     "updated_at": "2026-10-21T23:29:38.130+03:00"
   }
 ]

Params:

NameTypeAttributeDescription
options Object
options.token string

Required, access token for shop

options.url string

Required, shop url

options.clientid number | string

Required, client id

id Number | String

Required, app id

Return:

Promise

public listClientGroup(options: Object, id: Number | String): Promise source

import {listClientGroup} from 'insales/lib/api/clientgroup.js'

GET /admin/client_groups.json

Examples:

 insales.listClientGroup({
   token: '1234567890',
   url: 'shop-test.myinsales.ru'
 }).then(response => {
   console.info(response.data);
 }).catch(err => {
   console.error(err);
 });

Output:

 [
   {
     "id": 1,
     "title": "vip",
     "discount": "25.0",
     "discount_description": null,
     "is_default": true,
     "b2b": false,
     "created_at": "2026-07-11T22:28:41.000+03:00",
     "updated_at": "2026-10-19T22:28:42.495+03:00"
   }
 ]

Params:

NameTypeAttributeDescription
options Object
options.token string

Required, access token for shop

options.url string

Required, shop url

id Number | String

Required, app id

Return:

Promise

public listCollect(options: Object, id: Number | String): Promise source

import {listCollect} from 'insales/lib/api/collect.js'

GET /admin/collects.json

Examples:

 insales.listCollect({
   token: '1234567890',
   url: 'shop-test.myinsales.ru'
 }).then(response => {
   console.info(response.data);
 }).catch(err => {
   console.error(err);
 });

Output:

 [
   {
     "id": 1,
     "collection_id": 1,
     "product_id": 1,
     "position": 1,
     "created_at": "2009-03-18T07:53:15.000+03:00"
   },
   {
     "id": 2,
     "collection_id": 1,
     "product_id": 2,
     "position": 2,
     "created_at": "2009-03-18T07:53:15.000+03:00"
   },
   {
     "id": 3,
     "collection_id": 3,
     "product_id": 1,
     "position": 3,
     "created_at": "2009-03-18T07:53:15.000+03:00"
   },
   {
     "id": 4,
     "collection_id": 8,
     "product_id": 1,
     "position": 1,
     "created_at": "2009-03-18T07:53:15.000+03:00"
   },
   {
     "id": 5,
     "collection_id": 8,
     "product_id": 2,
     "position": 2,
     "created_at": "2009-03-18T07:53:15.000+03:00"
   },
   {
     "id": 6,
     "collection_id": 8,
     "product_id": 3,
     "position": 3,
     "created_at": "2009-03-18T07:53:15.000+03:00"
   }
 ]

 insales.listCollect({
   token: '1234567890',
   url: 'shop-test.myinsales.ru',
   productid: '1'
 }).then(response => {
   console.info(response.data);
 }).catch(err => {
   console.error(err);
 });

Output:

 [
   {
     "id": 1,
     "collection_id": 1,
     "product_id": 1,
     "position": 1,
     "created_at": "2009-03-18T07:53:15.000+03:00"
   },
   {
     "id": 3,
     "collection_id": 3,
     "product_id": 1,
     "position": 3,
     "created_at": "2009-03-18T07:53:15.000+03:00"
   },
   {
     "id": 4,
     "collection_id": 8,
     "product_id": 1,
     "position": 1,
     "created_at": "2009-03-18T07:53:15.000+03:00"
   }
 ]

 insales.listCollect({
   token: '1234567890',
   url: 'shop-test.myinsales.ru',
   collectionid: '1'
 }).then(response => {
   console.info(response.data);
 }).catch(err => {
   console.error(err);
 });

Output:

 [
   {
     "id": 1,
     "collection_id": 1,
     "product_id": 1,
     "position": 1,
     "created_at": "2009-03-18T07:53:15.000+03:00"
   },
   {
     "id": 2,
     "collection_id": 1,
     "product_id": 2,
     "position": 2,
     "created_at": "2009-03-18T07:53:15.000+03:00"
   }
 ]

Params:

NameTypeAttributeDescription
options Object
options.token string

Required, access token for shop

options.url string

Required, shop url

options.productid number | string
  • optional

Collections of this product

options.collectionid number | string
  • optional

Products of this collection

id Number | String

Required, app id

Return:

Promise

public listCollection(options: Object, id: Number | String): Promise source

import {listCollection} from 'insales/lib/api/collection.js'

GET /admin/collections.xml

Examples:

 insales.listCollection({
   token: '1234567890',
   url: 'shop-test.myinsales.ru',
 }).then(response => {
   console.info(response.data);
 }).catch(err => {
   console.error(err);
 });

Output:

 { 'collections':
    { 'collection':
       [{ 'created-at': '2011-11-11 11:11:11 +0300',
         id: '1234567',
         'is-hidden': 'true',
         'parent-id': '11111',
         position: '1',
         recursive: '',
         'updated-at': '2011-11-11 11:11:11 +0300',
         title: 'Name 1',
         description: '',
         'html-title': '',
         'meta-description': '',
         'meta-keywords': '',
         permalink: 'name1',
         url: '/collection/name1',
         'seo-description': '' },
        {'created-at': '2011-11-11 11:11:11 +0300',
          id: '12345678',
          'is-hidden': 'true',
          'parent-id': '11111',
          position: '2',
          recursive: '',
          'updated-at': '2011-11-11 11:11:11 +0300',
          title: 'Name 2',
          description: '',
          'html-title': '',
          'meta-description': '',
          'meta-keywords': '',
          permalink: 'name2',
          url: '/collection/name2',
          'seo-description': ''}]}}

Params:

NameTypeAttributeDescription
options Object
options.token string

Required, access token for shop

options.url string

Required, shop url

id Number | String

Required, app id

Return:

Promise

public listCollectionField(options: Object, id: Number | String): Promise source

import {listCollectionField} from 'insales/lib/api/collectionfield.js'

GET /admin/collection_fields.json

Examples:

 insales.listCollectionField({
   token: '1234567890',
   url: 'shop-test.myinsales.ru'
 }).then(response => {
   console.info(response.data);
 }).catch(err => {
   console.error(err);
 });

Output:

 [
   {
     "id": 1,
     "handle": "handle",
     "type": "CollectionField::TextField",
     "application_id": null,
     "position": 1,
     "is_hidden": null,
     "title": "title",
     "application_title": null
   },
   {
     "id": 2,
     "handle": "handle2",
     "type": "CollectionField::TextArea",
     "application_id": 1,
     "position": 2,
     "is_hidden": null,
     "title": "title2",
     "application_title": "Цифровые товары"
   }
 ]

Params:

NameTypeAttributeDescription
options Object
options.token string

Required, access token for shop

options.url string

Required, shop url

id Number | String

Required, app id

Return:

Promise

public listCollectionFieldValue(options: Object, id: Number | String): Promise source

import {listCollectionFieldValue} from 'insales/lib/api/collectionfieldvalue.js'

GET /admin/collections/{collection_id}/collection_field_values.json

Examples:

 insales.listCollectionFieldValue({
   token: '1234567890',
   url: 'shop-test.myinsales.ru',
   collectionid: '1'
 }).then(response => {
   console.info(response.data);
 }).catch(err => {
   console.error(err);
 });

Output:

 [
   {
     "id": 1,
     "collection_field_id": 1,
     "value": "some collection field value"
   },
   {
     "id": 2,
     "collection_field_id": 2,
     "value": "some collection field value"
   }
 ]

Params:

NameTypeAttributeDescription
options Object
options.token string

Required, access token for shop

options.url string

Required, shop url

options.collectionid number | string

Required, collection id

id Number | String

Required, app id

Return:

Promise

public listCollectionFilter(options: Object, id: Number | String): Promise source

import {listCollectionFilter} from 'insales/lib/api/collectionfilter.js'

GET /admin/collection_filters.json?collection_id={collection_id}

Examples:

 insales.listCollectionFilter({
   token: '1234567890',
   url: 'shop-test.myinsales.ru',
   collectionid: '1'
 }).then(response => {
   console.info(response.data);
 }).catch(err => {
   console.error(err);
 });

Output:

 [
   {
     "id": 1,
     "collection_id": 1,
     "description": null,
     "seo_description": null,
     "title": "seo filter",
     "permalink": "foobar",
     "html_title": null,
     "meta_keywords": null,
     "meta_description": null,
     "characteristis": [
       {
         "id": 1,
         "property_id": 1,
         "position": 1,
         "title": "Japan",
         "permalink": "japan"
       },
       {
         "id": 2,
         "property_id": 2,
         "position": 1,
         "title": "Germany",
         "permalink": "germany"
       }
     ],
     "option_values": []
   },
   {
     "id": 2,
     "collection_id": 1,
     "description": null,
     "seo_description": null,
     "title": "seo filter 2",
     "permalink": "barfoo",
     "html_title": null,
     "meta_keywords": null,
     "meta_description": null,
     "characteristis": [],
     "option_values": [
       {
         "id": 1,
         "option_name_id": 1,
         "position": 1,
         "title": "Red",
         "image_url": null,
         "permalink": null
       },
       {
         "id": 2,
         "option_name_id": 1,
         "position": 2,
         "title": "Зеленый",
         "image_url": null,
         "permalink": null
       }
     ]
   }
 ]

Params:

NameTypeAttributeDescription
options Object
options.token string

Required, access token for shop

options.url string

Required, shop url

options.collectionid number | string

Required, collection id

id Number | String

Required, app id

Return:

Promise

public listCoupon(options: Object, id: Number | String): Promise source

import {listCoupon} from 'insales/lib/api/coupon.js'

GET /admin/discount_codes.xml

Examples:

 insales.listCoupon({
   token: '1234567890',
   url: 'shop-test.myinsales.ru',
 }).then(response => {
   console.info(response.data);
 }).catch(err => {
   console.error(err);
 });

Output:

 { 'discount-codes':
    { 'discount-code':
       [{ 'act-once': 'false',
         'act-once-for-client': 'false',
         code: 'WWWWWW',
         'created-at': '2011-11-11T11:11:11+03:00',
         description: '',
         disabled: 'false',
         discount: '10.0',
         'expired-at': '2011-11-11',
         id: '1111111',
         'min-price': '0.0',
         'type-id': '1',
         'updated-at': '2011-11-11T11:11:11+03:00',
         worked: 'true',
         'discount-collections': '' },
       { 'act-once': 'false',
         'act-once-for-client': 'false',
         code: 'WWWWWY',
         'created-at': '2011-11-11T11:11:11+03:00',
         description: '',
         disabled: 'false',
         discount: '10.0',
         'expired-at': '2011-11-11',
         id: '1111112',
         'min-price': '0.0',
         'type-id': '1',
         'updated-at': '2011-11-11T11:11:11+03:00',
         worked: 'true',
         'discount-collections': '' }]}}

Params:

NameTypeAttributeDescription
options Object
options.token string

Required, access token for shop

options.url string

Required, shop url

options.page number | string
  • optional
  • default: 1

Page

options.per_page number | string
  • optional
  • default: 250

Coupons per page

options.updated_since string
  • optional

Coupons updated since. Format YYYY-MM-DD

options.deleted boolean
  • optional

Deleted coupons

id Number | String

Required, app id

Return:

Promise

public listCustomStatus(options: Object, id: Number | String): Promise source

import {listCustomStatus} from 'insales/lib/api/customstatus.js'

GET /admin/custom_statuses.json

Examples:

 insales.listCustomStatus({
   token: '1234567890',
   url: 'shop-test.myinsales.ru'
 }).then(response => {
   console.info(response.data);
 }).catch(err => {
   console.error(err);
 });

Output:

 [
   {
     "id": null,
     "system_status": "new",
     "permalink": "new",
     "position": null,
     "is_default": true,
     "created_at": null,
     "updated_at": null,
     "title": "Новый",
     "color": "#DC5F59"
   },
   {
     "id": null,
     "system_status": "accepted",
     "permalink": "accepted",
     "position": null,
     "is_default": true,
     "created_at": null,
     "updated_at": null,
     "title": "В обработке",
     "color": "#85C5E0"
   },
   {
     "id": null,
     "system_status": "approved",
     "permalink": "approved",
     "position": null,
     "is_default": true,
     "created_at": null,
     "updated_at": null,
     "title": "Согласован",
     "color": "#86AA60"
   },
   {
     "id": null,
     "system_status": "dispatched",
     "permalink": "dispatched",
     "position": null,
     "is_default": true,
     "created_at": null,
     "updated_at": null,
     "title": "Отгружен",
     "color": "#3A9FC9"
   },
   {
     "id": null,
     "system_status": "delivered",
     "permalink": "delivered",
     "position": null,
     "is_default": true,
     "created_at": null,
     "updated_at": null,
     "title": "Доставлен",
     "color": "#249641"
   },
   {
     "id": null,
     "system_status": "returning",
     "permalink": "returning",
     "position": null,
     "is_default": true,
     "created_at": null,
     "updated_at": null,
     "title": "В процессе возврата",
     "color": "#686A69"
   },
   {
     "id": null,
     "system_status": "declined",
     "permalink": "declined",
     "position": null,
     "is_default": true,
     "created_at": null,
     "updated_at": null,
     "title": "Отменен",
     "color": "#929594"
   },
   {
     "id": null,
     "system_status": "returned",
     "permalink": "returned",
     "position": null,
     "is_default": true,
     "created_at": null,
     "updated_at": null,
     "title": "Возврат",
     "color": "#A69196"
   }
 ]

Params:

NameTypeAttributeDescription
options Object
options.token string

Required, access token for shop

options.url string

Required, shop url

id Number | String

Required, app id

Return:

Promise

public listDeliveryVariant(options: Object, id: Number | String): Promise source

import {listDeliveryVariant} from 'insales/lib/api/deliveryvariant.js'

GET /admin/delivery_variants.json

Examples:

 insales.listDeliveryVariant({
   token: '1234567890',
   url: 'shop-test.myinsales.ru'
 }).then(response => {
   console.info(response.data);
 }).catch(err => {
   console.error(err);
 });

Output:

 [
   {
     "id": 1,
     "position": 1,
     "updated_at": "2009-03-31T12:20:34.000+04:00",
     "created_at": "2009-03-30T04:37:32.000+04:00",
     "charge_up_to": null,
     "inverted": false,
     "show_zip_code": false,
     "title": "самовывоз",
     "description": "самовывоз из офиса",
     "type": "DeliveryVariant::Fixed",
     "min_order_sum": null,
     "show_calendar_in_checkout": null,
     "delivery_date_required": null,
     "forbid_weekends": null,
     "utc_from_address": null,
     "estimated_delivery_period": null,
     "order_time_is_later": null,
     "forbidden_days": null,
     "show_time_intervals_in_checkout": null,
     "time_intervals_required": null,
     "price": 100,
     "javascript": null,
     "payment_delivery_variants": [
       {
         "id": 1,
         "payment_gateway_id": 1,
         "created_at": "2026-10-19T22:28:42.000+03:00"
       }
     ],
     "delivery_locations": [],
     "delivery_time_intervals": []
   },
   {
     "id": 2,
     "position": 2,
     "updated_at": "2009-03-31T12:20:34.000+04:00",
     "created_at": "2009-03-30T04:37:32.000+04:00",
     "charge_up_to": null,
     "inverted": false,
     "show_zip_code": false,
     "title": "курьер",
     "description": "",
     "type": "DeliveryVariant::PriceDepend",
     "min_order_sum": null,
     "show_calendar_in_checkout": null,
     "delivery_date_required": null,
     "forbid_weekends": null,
     "utc_from_address": null,
     "estimated_delivery_period": null,
     "order_time_is_later": null,
     "forbidden_days": null,
     "show_time_intervals_in_checkout": null,
     "time_intervals_required": null,
     "min_price": 200,
     "payment_delivery_variants": [
       {
         "id": 2,
         "payment_gateway_id": 1,
         "created_at": "2026-10-19T22:28:42.000+03:00"
       }
     ],
     "delivery_locations": [],
     "delivery_time_intervals": [],
     "rules": [
       {
         "id": 1,
         "order_price": 2000,
         "price": 600,
         "order_weight": 10
       },
       {
         "id": 2,
         "order_price": 2000,
         "price": 700,
         "order_weight": 20
       },
       {
         "id": 3,
         "order_price": 2000,
         "price": 800,
         "order_weight": null
       },
       {
         "id": 4,
         "order_price": 10000,
         "price": 300,
         "order_weight": 10
       },
       {
         "id": 5,
         "order_price": 10000,
         "price": 400,
         "order_weight": 20
       },
       {
         "id": 6,
         "order_price": 10000,
         "price": 500,
         "order_weight": null
       },
       {
         "id": 7,
         "order_price": null,
         "price": 0,
         "order_weight": 10
       },
       {
         "id": 8,
         "order_price": null,
         "price": 100,
         "order_weight": 20
       }
     ]
   },
   {
     "id": 3,
     "position": 3,
     "updated_at": "2009-03-31T12:20:34.000+04:00",
     "created_at": "2009-03-30T04:37:32.000+04:00",
     "charge_up_to": null,
     "inverted": false,
     "show_zip_code": false,
     "title": "Внешний",
     "description": "Внешний способ",
     "type": "DeliveryVariant::External",
     "min_order_sum": null,
     "show_calendar_in_checkout": null,
     "delivery_date_required": null,
     "forbid_weekends": null,
     "utc_from_address": null,
     "estimated_delivery_period": null,
     "order_time_is_later": null,
     "forbidden_days": null,
     "show_time_intervals_in_checkout": null,
     "time_intervals_required": null,
     "url": "url",
     "javascript": null,
     "customer_pickup": false,
     "payment_delivery_variants": [],
     "delivery_locations": [],
     "delivery_time_intervals": []
   },
   {
     "id": 4,
     "position": 4,
     "updated_at": "2009-03-31T12:20:34.000+04:00",
     "created_at": "2009-03-30T04:37:32.000+04:00",
     "charge_up_to": null,
     "inverted": false,
     "show_zip_code": false,
     "title": "Внешний",
     "description": "Внешний способ",
     "type": "DeliveryVariant::MapZoneDelivery",
     "min_order_sum": null,
     "show_calendar_in_checkout": null,
     "delivery_date_required": null,
     "forbid_weekends": null,
     "utc_from_address": null,
     "estimated_delivery_period": null,
     "order_time_is_later": null,
     "forbidden_days": null,
     "show_time_intervals_in_checkout": null,
     "time_intervals_required": null,
     "payment_delivery_variants": [],
     "delivery_locations": [],
     "delivery_time_intervals": []
   }
 ]

Params:

NameTypeAttributeDescription
options Object
options.token string

Required, access token for shop

options.url string

Required, shop url

id Number | String

Required, app id

Return:

Promise

public listDomain(options: Object, id: Number | String): Promise source

import {listDomain} from 'insales/lib/api/domain.js'

GET /admin/domains.json

Examples:

 insales.listDomain({
   token: '1234567890',
   url: 'shop-test.myinsales.ru'
 }).then(response => {
   console.info(response.data);
 }).catch(err => {
   console.error(err);
 });

Output:

 [
   {
     "id": 30,
     "domain": "some-domain.ru",
     "created_at": "2026-10-21T23:32:36.000+03:00",
     "updated_at": "2026-10-21T23:32:36.000+03:00",
     "main": true
   }
 ]

Params:

NameTypeAttributeDescription
options Object
options.token string

Required, access token for shop

options.url string

Required, shop url

id Number | String

Required, app id

Return:

Promise

public listExternalDiscount(options: Object, id: Number | String): Promise source

import {listExternalDiscount} from 'insales/lib/api/externaldiscount.js'

GET /admin/external_discounts.json

Examples:

 insales.listExternalDiscount({
   token: '1234567890',
   url: 'shop-test.myinsales.ru'
 }).then(response => {
   console.info(response.data);
 }).catch(err => {
   console.error(err);
 });

Output:

 [
   {
     "id": 9,
     "url": "https://myservice.com/external_discount",
     "order_lines_depend": null,
     "active": true,
     "created_at": "2026-10-21T23:27:55.000+03:00",
     "updated_at": "2026-10-21T23:27:55.000+03:00",
     "description": "My External Discount",
     "observed_fields": []
   }
 ]

Params:

NameTypeAttributeDescription
options Object
options.token string

Required, access token for shop

options.url string

Required, shop url

id Number | String

Required, app id

Return:

Promise

public listField(options: Object, id: Number | String): Promise source

import {listField} from 'insales/lib/api/field.js'

GET /admin/fields.json

Examples:

 insales.listField({
   token: '1234567890',
   url: 'shop-test.myinsales.ru'
 }).then(response => {
   console.info(response.data);
 }).catch(err => {
   console.error(err);
 });

Output:

 [
   {
     "id": 1,
     "destiny": 1,
     "position": 0,
     "office_title": "Страна",
     "for_buyer": true,
     "obligatory": false,
     "active": false,
     "system_name": "country",
     "created_at": "2010-10-12T13:31:09.692+04:00",
     "updated_at": "2010-10-12T13:31:09.692+04:00",
     "show_in_result": true,
     "show_in_checkout": true,
     "is_indexed": null,
     "hide_in_backoffice": null,
     "handle": null,
     "placeholder": null,
     "title": null,
     "example": null,
     "type": "Field::Country"
   },
   {
     "id": 11,
     "destiny": 2,
     "position": 1,
     "office_title": "Имя",
     "for_buyer": true,
     "obligatory": true,
     "active": true,
     "system_name": "name",
     "created_at": "2010-10-12T13:31:09.692+04:00",
     "updated_at": "2010-10-12T13:31:09.692+04:00",
     "show_in_result": true,
     "show_in_checkout": true,
     "is_indexed": null,
     "hide_in_backoffice": null,
     "handle": null,
     "placeholder": null,
     "title": null,
     "example": null,
     "type": "Field::ObligatoryTextField"
   },
   {
     "id": 2,
     "destiny": 1,
     "position": 1,
     "office_title": "Регион",
     "for_buyer": true,
     "obligatory": false,
     "active": false,
     "system_name": "state",
     "created_at": "2010-10-12T13:31:09.692+04:00",
     "updated_at": "2010-10-12T13:31:09.692+04:00",
     "show_in_result": true,
     "show_in_checkout": true,
     "is_indexed": null,
     "hide_in_backoffice": null,
     "handle": null,
     "placeholder": null,
     "title": null,
     "example": null,
     "type": "Field::SystemTextField"
   },
   {
     "id": 12,
     "destiny": 2,
     "position": 2,
     "office_title": "Телефон",
     "for_buyer": true,
     "obligatory": true,
     "active": true,
     "system_name": "phone",
     "created_at": "2010-10-12T13:31:09.692+04:00",
     "updated_at": "2010-10-12T13:31:09.692+04:00",
     "show_in_result": true,
     "show_in_checkout": true,
     "is_indexed": null,
     "hide_in_backoffice": null,
     "handle": null,
     "placeholder": null,
     "title": null,
     "example": null,
     "type": "Field::Phone"
   },
   {
     "id": 3,
     "destiny": 1,
     "position": 2,
     "office_title": "Город",
     "for_buyer": true,
     "obligatory": false,
     "active": false,
     "system_name": "city",
     "created_at": "2010-10-12T13:31:09.692+04:00",
     "updated_at": "2010-10-12T13:31:09.692+04:00",
     "show_in_result": true,
     "show_in_checkout": true,
     "is_indexed": null,
     "hide_in_backoffice": null,
     "handle": null,
     "placeholder": null,
     "title": null,
     "example": null,
     "type": "Field::SystemTextField"
   },
   {
     "id": 4,
     "destiny": 1,
     "position": 3,
     "office_title": "Адрес",
     "for_buyer": true,
     "obligatory": false,
     "active": true,
     "system_name": "address",
     "created_at": "2010-10-12T13:31:09.692+04:00",
     "updated_at": "2010-10-12T13:31:09.692+04:00",
     "show_in_result": true,
     "show_in_checkout": true,
     "is_indexed": null,
     "hide_in_backoffice": null,
     "handle": null,
     "placeholder": null,
     "title": null,
     "example": null,
     "type": "Field::SystemTextArea"
   },
   {
     "id": 13,
     "destiny": 2,
     "position": 3,
     "office_title": "E-mail",
     "for_buyer": true,
     "obligatory": true,
     "active": true,
     "system_name": "email",
     "created_at": "2010-10-12T13:31:09.692+04:00",
     "updated_at": "2010-10-12T13:31:09.692+04:00",
     "show_in_result": true,
     "show_in_checkout": true,
     "is_indexed": null,
     "hide_in_backoffice": null,
     "handle": null,
     "placeholder": null,
     "title": null,
     "example": null,
     "type": "Field::SystemTextField"
   },
   {
     "id": 14,
     "destiny": 2,
     "position": 4,
     "office_title": "Подтверждение e-mail",
     "for_buyer": true,
     "obligatory": true,
     "active": false,
     "system_name": "email_confirmation",
     "created_at": "2010-10-12T13:31:09.692+04:00",
     "updated_at": "2010-10-12T13:31:09.692+04:00",
     "show_in_result": true,
     "show_in_checkout": true,
     "is_indexed": null,
     "hide_in_backoffice": null,
     "handle": null,
     "placeholder": null,
     "title": null,
     "example": null,
     "type": "Field::SystemTextField"
   },
   {
     "id": 5,
     "destiny": 1,
     "position": 4,
     "office_title": "Почтовый индекс",
     "for_buyer": true,
     "obligatory": false,
     "active": false,
     "system_name": "zip",
     "created_at": "2010-10-12T13:31:09.692+04:00",
     "updated_at": "2010-10-12T13:31:09.692+04:00",
     "show_in_result": true,
     "show_in_checkout": true,
     "is_indexed": null,
     "hide_in_backoffice": null,
     "handle": null,
     "placeholder": null,
     "title": null,
     "example": null,
     "type": "Field::SystemTextField"
   },
   {
     "id": 21,
     "destiny": 2,
     "position": 4,
     "office_title": "Фамилия",
     "for_buyer": true,
     "obligatory": false,
     "active": false,
     "system_name": "surname",
     "created_at": "2010-10-12T13:31:09.692+04:00",
     "updated_at": "2010-10-12T13:31:09.692+04:00",
     "show_in_result": true,
     "show_in_checkout": true,
     "is_indexed": null,
     "hide_in_backoffice": null,
     "handle": null,
     "placeholder": null,
     "title": null,
     "example": null,
     "type": "Field::SystemTextField"
   },
   {
     "id": 22,
     "destiny": 2,
     "position": 5,
     "office_title": "Отчество",
     "for_buyer": true,
     "obligatory": false,
     "active": false,
     "system_name": "middlename",
     "created_at": "2010-10-12T13:31:09.692+04:00",
     "updated_at": "2010-10-12T13:31:09.692+04:00",
     "show_in_result": true,
     "show_in_checkout": true,
     "is_indexed": null,
     "hide_in_backoffice": null,
     "handle": null,
     "placeholder": null,
     "title": null,
     "example": null,
     "type": "Field::SystemTextField"
   },
   {
     "id": 23,
     "destiny": 2,
     "position": 6,
     "office_title": "Селект",
     "for_buyer": true,
     "obligatory": false,
     "active": false,
     "system_name": null,
     "created_at": "2010-10-12T13:31:09.692+04:00",
     "updated_at": "2010-10-12T13:31:09.692+04:00",
     "show_in_result": true,
     "show_in_checkout": true,
     "is_indexed": null,
     "hide_in_backoffice": null,
     "handle": null,
     "placeholder": null,
     "title": "Селект",
     "example": null,
     "type": "Field::Select",
     "field_options": [
       {
         "id": 1,
         "position": 1,
         "value": "Передан"
       },
       {
         "id": 2,
         "position": 2,
         "value": "Не передан"
       }
     ]
   },
   {
     "id": 172,
     "destiny": 2,
     "position": 18,
     "office_title": "Согласие на обработку персональных данных",
     "for_buyer": true,
     "obligatory": true,
     "active": false,
     "system_name": "consent_to_personal_data",
     "created_at": "2026-10-19T22:28:42.676+03:00",
     "updated_at": "2026-10-19T22:28:42.676+03:00",
     "show_in_result": true,
     "show_in_checkout": true,
     "is_indexed": null,
     "hide_in_backoffice": null,
     "handle": null,
     "placeholder": null,
     "title": null,
     "example": null,
     "type": "Field::SystemCheckbox"
   },
   {
     "id": 106,
     "destiny": 1,
     "position": 19,
     "office_title": "Улица",
     "for_buyer": true,
     "obligatory": false,
     "active": false,
     "system_name": "street",
     "created_at": "2010-10-12T13:31:09.692+04:00",
     "updated_at": "2010-10-12T13:31:09.692+04:00",
     "show_in_result": true,
     "show_in_checkout": true,
     "is_indexed": null,
     "hide_in_backoffice": null,
     "handle": null,
     "placeholder": null,
     "title": null,
     "example": null,
     "type": "Field::SystemTextField"
   },
   {
     "id": 107,
     "destiny": 1,
     "position": 20,
     "office_title": "Дом",
     "for_buyer": true,
     "obligatory": false,
     "active": false,
     "system_name": "house",
     "created_at": "2010-10-12T13:31:09.692+04:00",
     "updated_at": "2010-10-12T13:31:09.692+04:00",
     "show_in_result": true,
     "show_in_checkout": true,
     "is_indexed": null,
     "hide_in_backoffice": null,
     "handle": null,
     "placeholder": null,
     "title": null,
     "example": null,
     "type": "Field::SystemTextField"
   },
   {
     "id": 108,
     "destiny": 1,
     "position": 21,
     "office_title": "Квартира",
     "for_buyer": true,
     "obligatory": false,
     "active": false,
     "system_name": "flat",
     "created_at": "2010-10-12T13:31:09.692+04:00",
     "updated_at": "2010-10-12T13:31:09.692+04:00",
     "show_in_result": true,
     "show_in_checkout": true,
     "is_indexed": null,
     "hide_in_backoffice": null,
     "handle": null,
     "placeholder": null,
     "title": null,
     "example": null,
     "type": "Field::SystemTextField"
   },
   {
     "id": 174,
     "destiny": 3,
     "position": 22,
     "office_title": "АКС айди отгрузки",
     "for_buyer": true,
     "obligatory": true,
     "active": false,
     "system_name": null,
     "created_at": "2026-10-19T22:28:42.676+03:00",
     "updated_at": "2026-10-19T22:28:42.676+03:00",
     "show_in_result": true,
     "show_in_checkout": true,
     "is_indexed": null,
     "hide_in_backoffice": null,
     "handle": "aks_shipment_id",
     "placeholder": null,
     "title": null,
     "example": null,
     "type": "Field::TextField"
   }
 ]

Params:

NameTypeAttributeDescription
options Object
options.token string

Required, access token for shop

options.url string

Required, shop url

id Number | String

Required, app id

Return:

Promise

public listFile(options: Object, id: Number | String): Promise source

import {listFile} from 'insales/lib/api/file.js'

GET /admin/files.xml

Examples:

 insales.listFile({
   token: '1234567890',
   url: 'shop-test.myinsales.ru',
 }).then(response => {
   console.info(response.data);
 }).catch(err => {
   console.error(err);
 });

Output:

 { 'files':
    { 'file':
       [{ 'created-at': '2011-11-11T11:11:11+03:00',
         id: '11111',
         'absolute-url': 'http://static2.insales.ru/files/1/6050/194466/original/1.gif' },
        { 'created-at': '2011-11-11T11:11:11+03:00',
         id: '11112',
         'absolute-url': 'http://static2.insales.ru/files/1/6050/194466/original/1.gif' }]}}

Params:

NameTypeAttributeDescription
options Object
options.token string

Required, access token for shop

options.url string

Required, shop url

options.page number | string
  • optional
  • default: 1

Page

options.per_page number | string
  • optional
  • default: 250

Files per page

id Number | String

Required, app id

Return:

Promise

public listJsTag(options: Object, id: Number | String): Promise source

import {listJsTag} from 'insales/lib/api/jstag.js'

GET /admin/js_tags.json

Examples:

 insales.listJsTag({
   token: '1234567890',
   url: 'shop-test.myinsales.ru'
 }).then(response => {
   console.info(response.data);
 }).catch(err => {
   console.error(err);
 });

Output:

 [
   {
     "content": "http://code.jquery.com/jquery-1.9.1.min.js",
     "id": 9,
     "name": "jquery1.9.1",
     "created_at": "2026-10-21T23:10:48.000+03:00",
     "updated_at": "2026-10-21T23:10:48.000+03:00",
     "type": "JsTag::FileTag"
   }
 ]

Params:

NameTypeAttributeDescription
options Object
options.token string

Required, access token for shop

options.url string

Required, shop url

id Number | String

Required, app id

Return:

Promise

public listMarketplace(options: Object, id: Number | String): Promise source

import {listMarketplace} from 'insales/lib/api/marketplace.js'

GET /admin/marketplaces.json

Examples:

 insales.listMarketplace({
   token: '1234567890',
   url: 'shop-test.myinsales.ru'
 }).then(response => {
   console.info(response.data);
 }).catch(err => {
   console.error(err);
 });

Output:

 [
   {
     "id": 17,
     "name": "Yandex Model",
     "type": "Marketplace::LiquidYandexMarket",
     "created_at": "2026-10-21T23:32:40.781+03:00",
     "updated_at": "2026-10-21T23:32:40.781+03:00",
     "url": "https://quentin.insales.io:3003/marketplace/17.xml",
     "collection_ids": [],
     "local_delivery_cost": null,
     "vendor_id": null,
     "offer_liquid": "<offer>...</offer>",
     "page_encoding": "utf-8",
     "shop_company": "eBay",
     "shop_name": "eBay",
     "delivery_new_style": false,
     "use_stock_currency": false,
     "use_variants": false
   },
   {
     "id": 25,
     "name": "Google Model",
     "type": "Marketplace::GoogleMerchant",
     "created_at": "2026-10-21T23:32:40.793+03:00",
     "updated_at": "2026-10-21T23:32:40.793+03:00",
     "url": "https://quentin.insales.io:3003/marketplace/25.xml",
     "collection_ids": [],
     "description_type": null,
     "local_delivery_cost": null,
     "utm_label": null,
     "adult": false,
     "delivery_new_style": false,
     "use_stock_currency": false,
     "use_variants": false
   }
 ]

Params:

NameTypeAttributeDescription
options Object
options.token string

Required, access token for shop

options.url string

Required, shop url

id Number | String

Required, app id

Return:

Promise

public listMenu(options: Object, id: Number | String): Promise source

import {listMenu} from 'insales/lib/api/menu.js'

GET /admin/menus.json

Examples:

 insales.listMenu({
   token: '1234567890',
   url: 'shop-test.myinsales.ru'
 }).then(response => {
   console.info(response.data);
 }).catch(err => {
   console.error(err);
 });

Output:

 [
   {
     "id": 1,
     "name": "Main menu",
     "handle": "main",
     "used_in_theme": false
   },
   {
     "id": 2,
     "name": "Secondary menu",
     "handle": "second",
     "used_in_theme": false
   }
 ]

Params:

NameTypeAttributeDescription
options Object
options.token string

Required, access token for shop

options.url string

Required, shop url

id Number | String

Required, app id

Return:

Promise

public listMenuItem(options: Object, id: Number | String): Promise source

import {listMenuItem} from 'insales/lib/api/menuitem.js'

GET /admin/menus/{menu_id}/items.json

Examples:

 insales.listMenuItem({
   token: '1234567890',
   url: 'shop-test.myinsales.ru',
   menuid: '1'
 }).then(response => {
   console.info(response.data);
 }).catch(err => {
   console.error(err);
 });

Output:

 [
   {
     "id": 1,
     "position": 1,
     "title": "About",
     "url": "/about",
     "related_object_id": "Page_0"
   },
   {
     "id": 2,
     "position": 2,
     "title": "Доставка",
     "url": "/delivery",
     "related_object_id": "Page_0"
   },
   {
     "id": 3,
     "position": 3,
     "title": "Страница",
     "url": "/",
     "related_object_id": "Page_1"
   },
   {
     "id": 4,
     "position": 4,
     "title": "Категория",
     "url": "/collection/футболка",
     "related_object_id": "Collection_1"
   }
 ]

Params:

NameTypeAttributeDescription
options Object
options.token string

Required, access token for shop

options.url string

Required, shop url

options.menuid number | string

Required, menu id

id Number | String

Required, app id

Return:

Promise

public listOAuthApp(options: Object, id: Number | String): Promise source

import {listOAuthApp} from 'insales/lib/api/oauthapp.js'

GET /admin/o_auth_apps.json

Examples:

 insales.listOAuthApp({
   token: '1234567890',
   url: 'shop-test.myinsales.ru'
 }).then(response => {
   console.info(response.data);
 }).catch(err => {
   console.error(err);
 });

Output:

 [
   {
     "client_id": "953",
     "client_secret": "NdsaPd",
     "provider": "new_provider",
     "issuer": "/.well-known/openid-configuration",
     "id": 2,
     "enabled": true
   }
 ]

Params:

NameTypeAttributeDescription
options Object
options.token string

Required, access token for shop

options.url string

Required, shop url

id Number | String

Required, app id

Return:

Promise

public listOptionName(options: Object, id: Number | String): Promise source

import {listOptionName} from 'insales/lib/api/optionname.js'

GET /admin/option_names.json

Examples:

 insales.listOptionName({
   token: '1234567890',
   url: 'shop-test.myinsales.ru'
 }).then(response => {
   console.info(response.data);
 }).catch(err => {
   console.error(err);
 });

Output:

 [
   {
     "id": 1,
     "position": 1,
     "navigational": true,
     "permalink": null,
     "title": "Вариант",
     "api_permalink": null
   },
   {
     "id": 3,
     "position": 2,
     "navigational": true,
     "permalink": null,
     "title": "Цвет",
     "api_permalink": null
   }
 ]

Params:

NameTypeAttributeDescription
options Object
options.token string

Required, access token for shop

options.url string

Required, shop url

id Number | String

Required, app id

Return:

Promise

public listOptionValue(options: Object, id: Number | String): Promise source

import {listOptionValue} from 'insales/lib/api/optionvalue.js'

GET /admin/option_names/{option_name_id}/option_values.json

Examples:

 insales.listOptionValue({
   token: '1234567890',
   url: 'shop-test.myinsales.ru',
   optionnameid: '1'
 }).then(response => {
   console.info(response.data);
 }).catch(err => {
   console.error(err);
 });

Output:

 [
   {
     "id": 1,
     "option_name_id": 1,
     "position": 1,
     "title": "Red",
     "image_url": null,
     "permalink": null
   },
   {
     "id": 2,
     "option_name_id": 1,
     "position": 2,
     "title": "Зеленый",
     "image_url": null,
     "permalink": null
   },
   {
     "id": 3,
     "option_name_id": 1,
     "position": 3,
     "title": "Базовая",
     "image_url": null,
     "permalink": null
   },
   {
     "id": 20,
     "option_name_id": 1,
     "position": 20,
     "title": "Синий-10",
     "image_url": null,
     "permalink": null
   }
 ]

Params:

NameTypeAttributeDescription
options Object
options.token string

Required, access token for shop

options.url string

Required, shop url

options.optionnameid number | string

Required, option name id

id Number | String

Required, app id

Return:

Promise

public listOrder(options: Object, id: Number | String): Promise source

import {listOrder} from 'insales/lib/api/order.js'

GET /admin/orders.json

Examples:

 insales.listOrder({
   token: '1234567890',
   url: 'shop-test.myinsales.ru',
   fulfillment_status: ["new","delivered"],
   delivery_variant: ["1","2"],
   payment_gateway_id: ["1","3"]
 }).then(response => {
   console.info(response.data);
 }).catch(err => {
   console.error(err);
 });

Output:

 [
   {
     "fields_values": [],
     "order_lines": [],
     "order_changes": [],
     "discount": null,
     "shipping_address": {
       "id": 9,
       "fields_values": [],
       "name": "Name Name",
       "surname": null,
       "middlename": null,
       "phone": "+7(495)888-99-06",
       "formatted_phone": "+7(495)888-99-06",
       "full_name": "Name Name",
       "full_locality_name": null,
       "full_delivery_address": "567887, state, Manchester, address",
       "address_for_gis": "567887, state, Manchester, address",
       "location_valid": true,
       "recipient_fields": [
         {
           "id": 11,
           "destiny": 2,
           "position": 1,
           "office_title": "Имя",
           "for_buyer": true,
           "obligatory": true,
           "active": true,
           "system_name": "name",
           "created_at": "2010-10-12T13:31:09.692+04:00",
           "updated_at": "2010-10-12T13:31:09.692+04:00",
           "show_in_result": true,
           "show_in_checkout": true,
           "is_indexed": null,
           "hide_in_backoffice": null,
           "handle": null,
           "placeholder": null,
           "title": null,
           "example": null,
           "type": "Field::ObligatoryTextField"
         },
         {
           "id": 12,
           "destiny": 2,
           "position": 2,
           "office_title": "Телефон",
           "for_buyer": true,
           "obligatory": true,
           "active": true,
           "system_name": "phone",
           "created_at": "2010-10-12T13:31:09.692+04:00",
           "updated_at": "2010-10-12T13:31:09.692+04:00",
           "show_in_result": true,
           "show_in_checkout": true,
           "is_indexed": null,
           "hide_in_backoffice": null,
           "handle": null,
           "placeholder": null,
           "title": null,
           "example": null,
           "type": "Field::Phone"
         }
       ],
       "backoffice_fields": [
         {
           "id": 4,
           "destiny": 1,
           "position": 3,
           "office_title": "Адрес",
           "for_buyer": true,
           "obligatory": false,
           "active": true,
           "system_name": "address",
           "created_at": "2010-10-12T13:31:09.692+04:00",
           "updated_at": "2010-10-12T13:31:09.692+04:00",
           "show_in_result": true,
           "show_in_checkout": true,
           "is_indexed": null,
           "hide_in_backoffice": null,
           "handle": null,
           "placeholder": null,
           "title": null,
           "example": null,
           "type": "Field::SystemTextArea"
         },
         {
           "id": 448,
           "destiny": 1,
           "position": 22,
           "office_title": "special",
           "for_buyer": true,
           "obligatory": false,
           "active": true,
           "system_name": null,
           "created_at": "2026-10-21T23:27:33.258+03:00",
           "updated_at": "2026-10-21T23:27:33.258+03:00",
           "show_in_result": true,
           "show_in_checkout": true,
           "is_indexed": null,
           "hide_in_backoffice": null,
           "handle": null,
           "placeholder": null,
           "title": "special",
           "example": null,
           "type": "Field::TextField"
         },
         {
           "id": 1,
           "destiny": 1,
           "position": 0,
           "office_title": "Страна",
           "for_buyer": true,
           "obligatory": false,
           "active": false,
           "system_name": "country",
           "created_at": "2010-10-12T13:31:09.692+04:00",
           "updated_at": "2010-10-12T13:31:09.692+04:00",
           "show_in_result": true,
           "show_in_checkout": true,
           "is_indexed": null,
           "hide_in_backoffice": null,
           "handle": null,
           "placeholder": null,
           "title": null,
           "example": null,
           "type": "Field::Country"
         },
         {
           "id": 2,
           "destiny": 1,
           "position": 1,
           "office_title": "Регион",
           "for_buyer": true,
           "obligatory": false,
           "active": false,
           "system_name": "state",
           "created_at": "2010-10-12T13:31:09.692+04:00",
           "updated_at": "2010-10-12T13:31:09.692+04:00",
           "show_in_result": true,
           "show_in_checkout": true,
           "is_indexed": null,
           "hide_in_backoffice": null,
           "handle": null,
           "placeholder": null,
           "title": null,
           "example": null,
           "type": "Field::SystemTextField"
         },
         {
           "id": 3,
           "destiny": 1,
           "position": 2,
           "office_title": "Город",
           "for_buyer": true,
           "obligatory": false,
           "active": false,
           "system_name": "city",
           "created_at": "2010-10-12T13:31:09.692+04:00",
           "updated_at": "2010-10-12T13:31:09.692+04:00",
           "show_in_result": true,
           "show_in_checkout": true,
           "is_indexed": null,
           "hide_in_backoffice": null,
           "handle": null,
           "placeholder": null,
           "title": null,
           "example": null,
           "type": "Field::SystemTextField"
         },
         {
           "id": 5,
           "destiny": 1,
           "position": 4,
           "office_title": "Почтовый индекс",
           "for_buyer": true,
           "obligatory": false,
           "active": false,
           "system_name": "zip",
           "created_at": "2010-10-12T13:31:09.692+04:00",
           "updated_at": "2010-10-12T13:31:09.692+04:00",
           "show_in_result": true,
           "show_in_checkout": true,
           "is_indexed": null,
           "hide_in_backoffice": null,
           "handle": null,
           "placeholder": null,
           "title": null,
           "example": null,
           "type": "Field::SystemTextField"
         }
       ],
       "no_delivery": false,
       "kladr_autodetected_address": "",
       "country_options": [
         {
           "code": "RU",
           "title": "Россия",
           "selected": true
         }
       ],
       "address": "address",
       "country": "RU",
       "state": "state",
       "city": "Manchester",
       "zip": "567887",
       "street": null,
       "house": null,
       "flat": null,
       "entrance": null,
       "doorphone": null,
       "floor": null,
       "comment": null,
       "kladr_json": null,
       "location": {
         "kladr_code": null,
         "zip": "567887",
         "kladr_zip": null,
         "region_zip": null,
         "country": "RU",
         "state": "state",
         "state_type": null,
         "area": null,
         "area_type": null,
         "city": "Manchester",
         "city_type": null,
         "settlement": null,
         "settlement_type": null,
         "address": "address",
         "street": "address",
         "street_type": null,
         "house": null,
         "flat": null,
         "is_kladr": false,
         "latitude": null,
         "longitude": null,
         "autodetected": null
       }
     },
     "client": {
       "id": 3,
       "email": "some-one2@yandex.ru",
       "name": "Just Man",
       "phone": "+7(926)111-22-33",
       "created_at": "2009-04-30T04:37:32.000+04:00",
       "updated_at": "2009-04-30T12:20:34.000+04:00",
       "comment": null,
       "registered": false,
       "subscribe": true,
       "client_group_id": 1,
       "bonus_points": 0,
       "type": "Client::Individual",
       "correspondent_account": null,
       "settlement_account": null,
       "consent_to_personal_data": null,
       "o_auth_provider": null,
       "messenger_subscription": null,
       "external_id": null,
       "external_service": null,
       "contact_name": "Just Man",
       "surname": null,
       "middlename": null,
       "progressive_discount": "25.0",
       "group_discount": "25.0",
       "ip_addr": "",
       "fields_values": []
     },
     "discounts": [],
     "total_price": 0,
     "paid_amount": 0,
     "items_price": 0,
     "id": 8,
     "key": null,
     "number": 1008,
     "comment": "comment",
     "archived": false,
     "delivery_title": "самовывоз",
     "delivery_description": "самовывоз",
     "delivery_price": 0,
     "full_delivery_price": 0,
     "payment_description": null,
     "payment_title": "наличными курьеру",
     "first_referer": null,
     "first_current_location": null,
     "first_query": null,
     "first_source_domain": null,
     "first_source": "",
     "referer": "http://yandex.ru/yandsearch?text=%D1%81%D0%BF%D0%B0%D0%BB%D1%8C%D0%BD%D1%8B%D0%B5+%D0%BC%D0%B5%D1%88%D0%BA%D0%B8&stpar2=%2Fh1%2Ftm7%2Fs1&stpar4=%2Fs1&stpar1=%2Fu1&stpar3=%2Fm3%2Ftc14%2Fnc1",
     "current_location": null,
     "query": null,
     "source_domain": null,
     "source": "",
     "fulfillment_status": "new",
     "custom_status": {
       "permalink": "new",
       "title": "Новый"
     },
     "delivered_at": null,
     "accepted_at": null,
     "created_at": "2011-03-18T10:53:14.000+03:00",
     "updated_at": "2011-03-18T10:53:15.000+03:00",
     "financial_status": "paid",
     "delivery_date": null,
     "delivery_from_hour": null,
     "delivery_from_minutes": null,
     "delivery_to_hour": null,
     "delivery_to_minutes": null,
     "delivery_time": "",
     "paid_at": null,
     "delivery_variant_id": 1,
     "payment_gateway_id": 3,
     "margin": "0.0",
     "margin_amount": "0.0",
     "client_transaction_id": null,
     "yandex_metrika_client_id": null,
     "currency_code": "RUR",
     "cookies": null,
     "account_id": 1,
     "manager_comment": null,
     "locale": "ru",
     "delivery_info": {
       "delivery_variant_id": null,
       "tariff_id": null,
       "title": null,
       "description": null,
       "price": null,
       "shipping_company": null,
       "shipping_company_handle": null,
       "delivery_interval": {
         "min_days": null,
         "max_days": null,
         "description": ""
       },
       "errors": [],
       "warnings": [],
       "outlet": {
         "id": null,
         "external_id": null,
         "latitude": null,
         "longitude": null,
         "type": null,
         "title": null,
         "description": null,
         "address": null,
         "payment_method": null,
         "source_id": null
       },
       "not_available": null
     },
     "responsible_user_id": null,
     "total_profit": "0.0",
     "warehouse_id": null
   },
   {
     "fields_values": [],
     "order_lines": [],
     "order_changes": [],
     "discount": null,
     "shipping_address": {
       "id": 2,
       "fields_values": [],
       "name": "JD",
       "surname": null,
       "middlename": null,
       "phone": "+7(495)111-11-11",
       "formatted_phone": "+7(495)111-11-11",
       "full_name": "JD",
       "full_locality_name": null,
       "full_delivery_address": "123456, Moscow, address",
       "address_for_gis": "123456, Moscow, address",
       "location_valid": true,
       "recipient_fields": [
         {
           "id": 11,
           "destiny": 2,
           "position": 1,
           "office_title": "Имя",
           "for_buyer": true,
           "obligatory": true,
           "active": true,
           "system_name": "name",
           "created_at": "2010-10-12T13:31:09.692+04:00",
           "updated_at": "2010-10-12T13:31:09.692+04:00",
           "show_in_result": true,
           "show_in_checkout": true,
           "is_indexed": null,
           "hide_in_backoffice": null,
           "handle": null,
           "placeholder": null,
           "title": null,
           "example": null,
           "type": "Field::ObligatoryTextField"
         },
         {
           "id": 12,
           "destiny": 2,
           "position": 2,
           "office_title": "Телефон",
           "for_buyer": true,
           "obligatory": true,
           "active": true,
           "system_name": "phone",
           "created_at": "2010-10-12T13:31:09.692+04:00",
           "updated_at": "2010-10-12T13:31:09.692+04:00",
           "show_in_result": true,
           "show_in_checkout": true,
           "is_indexed": null,
           "hide_in_backoffice": null,
           "handle": null,
           "placeholder": null,
           "title": null,
           "example": null,
           "type": "Field::Phone"
         }
       ],
       "backoffice_fields": [
         {
           "id": 4,
           "destiny": 1,
           "position": 3,
           "office_title": "Адрес",
           "for_buyer": true,
           "obligatory": false,
           "active": true,
           "system_name": "address",
           "created_at": "2010-10-12T13:31:09.692+04:00",
           "updated_at": "2010-10-12T13:31:09.692+04:00",
           "show_in_result": true,
           "show_in_checkout": true,
           "is_indexed": null,
           "hide_in_backoffice": null,
           "handle": null,
           "placeholder": null,
           "title": null,
           "example": null,
           "type": "Field::SystemTextArea"
         },
         {
           "id": 448,
           "destiny": 1,
           "position": 22,
           "office_title": "special",
           "for_buyer": true,
           "obligatory": false,
           "active": true,
           "system_name": null,
           "created_at": "2026-10-21T23:27:33.258+03:00",
           "updated_at": "2026-10-21T23:27:33.258+03:00",
           "show_in_result": true,
           "show_in_checkout": true,
           "is_indexed": null,
           "hide_in_backoffice": null,
           "handle": null,
           "placeholder": null,
           "title": "special",
           "example": null,
           "type": "Field::TextField"
         },
         {
           "id": 1,
           "destiny": 1,
           "position": 0,
           "office_title": "Страна",
           "for_buyer": true,
           "obligatory": false,
           "active": false,
           "system_name": "country",
           "created_at": "2010-10-12T13:31:09.692+04:00",
           "updated_at": "2010-10-12T13:31:09.692+04:00",
           "show_in_result": true,
           "show_in_checkout": true,
           "is_indexed": null,
           "hide_in_backoffice": null,
           "handle": null,
           "placeholder": null,
           "title": null,
           "example": null,
           "type": "Field::Country"
         },
         {
           "id": 2,
           "destiny": 1,
           "position": 1,
           "office_title": "Регион",
           "for_buyer": true,
           "obligatory": false,
           "active": false,
           "system_name": "state",
           "created_at": "2010-10-12T13:31:09.692+04:00",
           "updated_at": "2010-10-12T13:31:09.692+04:00",
           "show_in_result": true,
           "show_in_checkout": true,
           "is_indexed": null,
           "hide_in_backoffice": null,
           "handle": null,
           "placeholder": null,
           "title": null,
           "example": null,
           "type": "Field::SystemTextField"
         },
         {
           "id": 3,
           "destiny": 1,
           "position": 2,
           "office_title": "Город",
           "for_buyer": true,
           "obligatory": false,
           "active": false,
           "system_name": "city",
           "created_at": "2010-10-12T13:31:09.692+04:00",
           "updated_at": "2010-10-12T13:31:09.692+04:00",
           "show_in_result": true,
           "show_in_checkout": true,
           "is_indexed": null,
           "hide_in_backoffice": null,
           "handle": null,
           "placeholder": null,
           "title": null,
           "example": null,
           "type": "Field::SystemTextField"
         },
         {
           "id": 5,
           "destiny": 1,
           "position": 4,
           "office_title": "Почтовый индекс",
           "for_buyer": true,
           "obligatory": false,
           "active": false,
           "system_name": "zip",
           "created_at": "2010-10-12T13:31:09.692+04:00",
           "updated_at": "2010-10-12T13:31:09.692+04:00",
           "show_in_result": true,
           "show_in_checkout": true,
           "is_indexed": null,
           "hide_in_backoffice": null,
           "handle": null,
           "placeholder": null,
           "title": null,
           "example": null,
           "type": "Field::SystemTextField"
         }
       ],
       "no_delivery": false,
       "kladr_autodetected_address": "",
       "country_options": [
         {
           "code": "RU",
           "title": "Россия",
           "selected": true
         }
       ],
       "address": "address",
       "country": "RU",
       "state": "Moscow",
       "city": "Moscow",
       "zip": "123456",
       "street": null,
       "house": null,
       "flat": null,
       "entrance": null,
       "doorphone": null,
       "floor": null,
       "comment": null,
       "kladr_json": null,
       "location": {
         "kladr_code": null,
         "zip": "123456",
         "kladr_zip": null,
         "region_zip": null,
         "country": "RU",
         "state": "Moscow",
         "state_type": null,
         "area": null,
         "area_type": null,
         "city": "Moscow",
         "city_type": null,
         "settlement": null,
         "settlement_type": null,
         "address": "address",
         "street": "address",
         "street_type": null,
         "house": null,
         "flat": null,
         "is_kladr": false,
         "latitude": null,
         "longitude": null,
         "autodetected": null
       }
     },
     "client": {
       "id": 7,
       "email": "john2@doe.com",
       "name": "John Doe",
       "phone": "+7(926)111-11-11",
       "created_at": "2009-03-30T04:37:32.000+04:00",
       "updated_at": "2009-03-31T12:20:34.000+04:00",
       "comment": null,
       "registered": false,
       "subscribe": true,
       "client_group_id": null,
       "bonus_points": 100,
       "type": "Client::Individual",
       "correspondent_account": null,
       "settlement_account": null,
       "consent_to_personal_data": null,
       "o_auth_provider": null,
       "messenger_subscription": null,
       "external_id": null,
       "external_service": null,
       "contact_name": "John Doe",
       "surname": null,
       "middlename": null,
       "progressive_discount": null,
       "group_discount": null,
       "ip_addr": "",
       "fields_values": []
     },
     "discounts": [],
     "total_price": 100,
     "paid_amount": 0,
     "items_price": 0,
     "id": 6,
     "key": "merged_client_order",
     "number": 10011,
     "comment": "comment",
     "archived": false,
     "delivery_title": "самовывоз",
     "delivery_description": "самовывоз",
     "delivery_price": 100,
     "full_delivery_price": 100,
     "payment_description": null,
     "payment_title": "наличными курьеру",
     "first_referer": "http://google.com?q=my_query",
     "first_current_location": "/my_query",
     "first_query": null,
     "first_source_domain": null,
     "first_source": "Google",
     "referer": "http://yandex.ru/yandsearch?text=%D1%81%D0%BF%D0%B0%D0%BB%D1%8C%D0%BD%D1%8B%D0%B5+%D0%BC%D0%B5%D1%88%D0%BA%D0%B8&stpar2=%2Fh1%2Ftm7%2Fs1&stpar4=%2Fs1&stpar1=%2Fu1&stpar3=%2Fm3%2Ftc14%2Fnc1",
     "current_location": "/",
     "query": null,
     "source_domain": null,
     "source": "Прямой трафик",
     "fulfillment_status": "new",
     "custom_status": {
       "permalink": "new",
       "title": "Новый"
     },
     "delivered_at": null,
     "accepted_at": null,
     "created_at": "2009-03-18T10:53:14.000+03:00",
     "updated_at": "2009-03-18T10:53:15.000+03:00",
     "financial_status": "pending",
     "delivery_date": null,
     "delivery_from_hour": null,
     "delivery_from_minutes": null,
     "delivery_to_hour": null,
     "delivery_to_minutes": null,
     "delivery_time": "",
     "paid_at": null,
     "delivery_variant_id": 1,
     "payment_gateway_id": 1,
     "margin": "0.0",
     "margin_amount": "0.0",
     "client_transaction_id": null,
     "yandex_metrika_client_id": null,
     "currency_code": "RUR",
     "cookies": null,
     "account_id": 1,
     "manager_comment": "manager comment1",
     "locale": "ru",
     "delivery_info": {
       "delivery_variant_id": null,
       "tariff_id": null,
       "title": null,
       "description": null,
       "price": null,
       "shipping_company": null,
       "shipping_company_handle": null,
       "delivery_interval": {
         "min_days": null,
         "max_days": null,
         "description": ""
       },
       "errors": [],
       "warnings": [],
       "outlet": {
         "id": null,
         "external_id": null,
         "latitude": null,
         "longitude": null,
         "type": null,
         "title": null,
         "description": null,
         "address": null,
         "payment_method": null,
         "source_id": null
       },
       "not_available": null
     },
     "responsible_user_id": null,
     "total_profit": "0.0",
     "warehouse_id": null
   },
   {
     "fields_values": [
       {
         "id": 1,
         "value": "1234",
         "created_at": "2026-10-19T22:28:42.670+03:00",
         "updated_at": "2026-10-19T22:28:42.670+03:00",
         "field_id": 174,
         "type": "Текст",
         "name": "АКС айди отгрузки",
         "handle": "aks_shipment_id"
       }
     ],
     "order_lines": [
       {
         "id": 7,
         "order_id": 4,
         "sale_price": 800,
         "full_sale_price": 643.2,
         "total_price": 800,
         "full_total_price": 643.2,
         "discounts_amount": 264,
         "quantity": 1,
         "reserved_quantity": null,
         "weight": null,
         "dimensions": null,
         "variant_id": 1,
         "product_id": null,
         "sku": "425",
         "barcode": null,
         "title": "Cool t-shirt",
         "unit": "pce",
         "comment": null,
         "updated_at": "2011-03-18T10:53:15.000+03:00",
         "created_at": "2011-03-18T10:53:14.000+03:00",
         "bundle_id": null,
         "vat": -1,
         "fiscal_product_type": 1,
         "requires_marking": null,
         "marking_codes": null,
         "accessory_lines": [],
         "external_variant_id": null
       },
       {
         "id": 8,
         "order_id": 4,
         "sale_price": 100,
         "full_sale_price": 80.4,
         "total_price": 200,
         "full_total_price": 160.8,
         "discounts_amount": 66,
         "quantity": 2,
         "reserved_quantity": null,
         "weight": "0.3",
         "dimensions": null,
         "variant_id": 2,
         "product_id": null,
         "sku": "426",
         "barcode": null,
         "title": "shirt",
         "unit": "pce",
         "comment": null,
         "updated_at": "2009-03-18T10:53:15.000+03:00",
         "created_at": "2009-03-18T10:53:14.000+03:00",
         "bundle_id": null,
         "vat": -1,
         "fiscal_product_type": 1,
         "requires_marking": null,
         "marking_codes": null,
         "accessory_lines": [],
         "external_variant_id": null
       }
     ],
     "order_changes": [],
     "discount": {
       "id": 2,
       "description": "рублевая скидка",
       "warning": null,
       "type_id": 2,
       "amount": 330,
       "full_amount": 396,
       "percent": null,
       "discount": "330.0",
       "reference_id": null,
       "reference_type": null,
       "discount_products_ids": [],
       "discount_order_lines_ids": [],
       "discount_code_id": null,
       "created_at": "2009-03-18T10:53:14.000+03:00",
       "updated_at": "2009-03-18T10:53:15.000+03:00"
     },
     "shipping_address": null,
     "client": {
       "id": 3,
       "email": "some-one2@yandex.ru",
       "name": "Just Man",
       "phone": "+7(926)111-22-33",
       "created_at": "2009-04-30T04:37:32.000+04:00",
       "updated_at": "2009-04-30T12:20:34.000+04:00",
       "comment": null,
       "registered": false,
       "subscribe": true,
       "client_group_id": 1,
       "bonus_points": 0,
       "type": "Client::Individual",
       "correspondent_account": null,
       "settlement_account": null,
       "consent_to_personal_data": null,
       "o_auth_provider": null,
       "messenger_subscription": null,
       "external_id": null,
       "external_service": null,
       "contact_name": "Just Man",
       "surname": null,
       "middlename": null,
       "progressive_discount": "25.0",
       "group_discount": "25.0",
       "ip_addr": "",
       "fields_values": []
     },
     "discounts": [
       {
         "id": 2,
         "description": "рублевая скидка",
         "warning": null,
         "type_id": 2,
         "amount": 330,
         "full_amount": 396,
         "percent": null,
         "discount": "330.0",
         "reference_id": null,
         "reference_type": null,
         "discount_products_ids": [],
         "discount_order_lines_ids": [],
         "discount_code_id": null,
         "created_at": "2009-03-18T10:53:14.000+03:00",
         "updated_at": "2009-03-18T10:53:15.000+03:00"
       }
     ],
     "total_price": 804,
     "paid_amount": 0,
     "items_price": 804,
     "id": 4,
     "key": null,
     "number": 1005,
     "comment": "comment",
     "archived": false,
     "delivery_title": "самовывоз",
     "delivery_description": "самовывоз",
     "delivery_price": 0,
     "full_delivery_price": 0,
     "payment_description": null,
     "payment_title": "наличными курьеру",
     "first_referer": null,
     "first_current_location": null,
     "first_query": null,
     "first_source_domain": null,
     "first_source": "",
     "referer": "http://yandex.ru/yandsearch?text=%D1%81%D0%BF%D0%B0%D0%BB%D1%8C%D0%BD%D1%8B%D0%B5+%D0%BC%D0%B5%D1%88%D0%BA%D0%B8&stpar2=%2Fh1%2Ftm7%2Fs1&stpar4=%2Fs1&stpar1=%2Fu1&stpar3=%2Fm3%2Ftc14%2Fnc1",
     "current_location": null,
     "query": null,
     "source_domain": null,
     "source": "",
     "fulfillment_status": "new",
     "custom_status": {
       "permalink": "new",
       "title": "Новый"
     },
     "delivered_at": null,
     "accepted_at": null,
     "created_at": "2011-03-18T10:53:14.000+03:00",
     "updated_at": "2011-03-18T10:53:15.000+03:00",
     "financial_status": "paid",
     "delivery_date": null,
     "delivery_from_hour": null,
     "delivery_from_minutes": null,
     "delivery_to_hour": null,
     "delivery_to_minutes": null,
     "delivery_time": "",
     "paid_at": null,
     "delivery_variant_id": 1,
     "payment_gateway_id": 3,
     "margin": "20.0",
     "margin_amount": "134.0",
     "client_transaction_id": null,
     "yandex_metrika_client_id": null,
     "currency_code": "RUR",
     "cookies": null,
     "account_id": 1,
     "manager_comment": null,
     "locale": "ru",
     "delivery_info": {
       "delivery_variant_id": null,
       "tariff_id": null,
       "title": null,
       "description": null,
       "price": null,
       "shipping_company": null,
       "shipping_company_handle": null,
       "delivery_interval": {
         "min_days": null,
         "max_days": null,
         "description": ""
       },
       "errors": [],
       "warnings": [],
       "outlet": {
         "id": null,
         "external_id": null,
         "latitude": null,
         "longitude": null,
         "type": null,
         "title": null,
         "description": null,
         "address": null,
         "payment_method": null,
         "source_id": null
       },
       "not_available": null
     },
     "responsible_user_id": null,
     "total_profit": "804.0",
     "warehouse_id": null
   },
   {
     "fields_values": [
       {
         "id": 2,
         "value": "",
         "created_at": "2026-10-19T22:28:42.670+03:00",
         "updated_at": "2026-10-19T22:28:42.670+03:00",
         "field_id": 174,
         "type": "Текст",
         "name": "АКС айди отгрузки",
         "handle": "aks_shipment_id"
       }
     ],
     "order_lines": [
       {
         "id": 5,
         "order_id": 3,
         "sale_price": 800,
         "full_sale_price": 672,
         "total_price": 800,
         "full_total_price": 672,
         "discounts_amount": 240,
         "quantity": 1,
         "reserved_quantity": null,
         "weight": null,
         "dimensions": null,
         "variant_id": 1,
         "product_id": null,
         "sku": "425",
         "barcode": null,
         "title": "Cool t-shirt",
         "unit": "pce",
         "comment": null,
         "updated_at": "2011-03-18T10:53:15.000+03:00",
         "created_at": "2011-03-18T10:53:14.000+03:00",
         "bundle_id": null,
         "vat": -1,
         "fiscal_product_type": 1,
         "requires_marking": null,
         "marking_codes": null,
         "accessory_lines": [],
         "external_variant_id": null
       },
       {
         "id": 6,
         "order_id": 3,
         "sale_price": 100,
         "full_sale_price": 84,
         "total_price": 200,
         "full_total_price": 168,
         "discounts_amount": 60,
         "quantity": 2,
         "reserved_quantity": null,
         "weight": "0.3",
         "dimensions": null,
         "variant_id": 2,
         "product_id": null,
         "sku": "426",
         "barcode": null,
         "title": "shirt",
         "unit": "pce",
         "comment": null,
         "updated_at": "2009-03-18T10:53:15.000+03:00",
         "created_at": "2009-03-18T10:53:14.000+03:00",
         "bundle_id": null,
         "vat": 0,
         "fiscal_product_type": 1,
         "requires_marking": null,
         "marking_codes": null,
         "accessory_lines": [],
         "external_variant_id": null
       }
     ],
     "order_changes": [],
     "discount": {
       "id": 1,
       "description": "процентная скидка",
       "warning": null,
       "type_id": 1,
       "amount": 300,
       "full_amount": 360,
       "percent": "30.0",
       "discount": "30.0",
       "reference_id": null,
       "reference_type": null,
       "discount_products_ids": [],
       "discount_order_lines_ids": [],
       "discount_code_id": null,
       "created_at": "2009-03-18T10:53:14.000+03:00",
       "updated_at": "2009-03-18T10:53:15.000+03:00"
     },
     "shipping_address": {
       "id": 11,
       "fields_values": [],
       "name": "Name Name",
       "surname": null,
       "middlename": null,
       "phone": "+7(495)888-99-08",
       "formatted_phone": "+7(495)888-99-08",
       "full_name": "Name Name",
       "full_locality_name": null,
       "full_delivery_address": "567889, state, Manchester, address",
       "address_for_gis": "567889, state, Manchester, address",
       "location_valid": true,
       "recipient_fields": [
         {
           "id": 11,
           "destiny": 2,
           "position": 1,
           "office_title": "Имя",
           "for_buyer": true,
           "obligatory": true,
           "active": true,
           "system_name": "name",
           "created_at": "2010-10-12T13:31:09.692+04:00",
           "updated_at": "2010-10-12T13:31:09.692+04:00",
           "show_in_result": true,
           "show_in_checkout": true,
           "is_indexed": null,
           "hide_in_backoffice": null,
           "handle": null,
           "placeholder": null,
           "title": null,
           "example": null,
           "type": "Field::ObligatoryTextField"
         },
         {
           "id": 12,
           "destiny": 2,
           "position": 2,
           "office_title": "Телефон",
           "for_buyer": true,
           "obligatory": true,
           "active": true,
           "system_name": "phone",
           "created_at": "2010-10-12T13:31:09.692+04:00",
           "updated_at": "2010-10-12T13:31:09.692+04:00",
           "show_in_result": true,
           "show_in_checkout": true,
           "is_indexed": null,
           "hide_in_backoffice": null,
           "handle": null,
           "placeholder": null,
           "title": null,
           "example": null,
           "type": "Field::Phone"
         }
       ],
       "backoffice_fields": [
         {
           "id": 4,
           "destiny": 1,
           "position": 3,
           "office_title": "Адрес",
           "for_buyer": true,
           "obligatory": false,
           "active": true,
           "system_name": "address",
           "created_at": "2010-10-12T13:31:09.692+04:00",
           "updated_at": "2010-10-12T13:31:09.692+04:00",
           "show_in_result": true,
           "show_in_checkout": true,
           "is_indexed": null,
           "hide_in_backoffice": null,
           "handle": null,
           "placeholder": null,
           "title": null,
           "example": null,
           "type": "Field::SystemTextArea"
         },
         {
           "id": 448,
           "destiny": 1,
           "position": 22,
           "office_title": "special",
           "for_buyer": true,
           "obligatory": false,
           "active": true,
           "system_name": null,
           "created_at": "2026-10-21T23:27:33.258+03:00",
           "updated_at": "2026-10-21T23:27:33.258+03:00",
           "show_in_result": true,
           "show_in_checkout": true,
           "is_indexed": null,
           "hide_in_backoffice": null,
           "handle": null,
           "placeholder": null,
           "title": "special",
           "example": null,
           "type": "Field::TextField"
         },
         {
           "id": 1,
           "destiny": 1,
           "position": 0,
           "office_title": "Страна",
           "for_buyer": true,
           "obligatory": false,
           "active": false,
           "system_name": "country",
           "created_at": "2010-10-12T13:31:09.692+04:00",
           "updated_at": "2010-10-12T13:31:09.692+04:00",
           "show_in_result": true,
           "show_in_checkout": true,
           "is_indexed": null,
           "hide_in_backoffice": null,
           "handle": null,
           "placeholder": null,
           "title": null,
           "example": null,
           "type": "Field::Country"
         },
         {
           "id": 2,
           "destiny": 1,
           "position": 1,
           "office_title": "Регион",
           "for_buyer": true,
           "obligatory": false,
           "active": false,
           "system_name": "state",
           "created_at": "2010-10-12T13:31:09.692+04:00",
           "updated_at": "2010-10-12T13:31:09.692+04:00",
           "show_in_result": true,
           "show_in_checkout": true,
           "is_indexed": null,
           "hide_in_backoffice": null,
           "handle": null,
           "placeholder": null,
           "title": null,
           "example": null,
           "type": "Field::SystemTextField"
         },
         {
           "id": 3,
           "destiny": 1,
           "position": 2,
           "office_title": "Город",
           "for_buyer": true,
           "obligatory": false,
           "active": false,
           "system_name": "city",
           "created_at": "2010-10-12T13:31:09.692+04:00",
           "updated_at": "2010-10-12T13:31:09.692+04:00",
           "show_in_result": true,
           "show_in_checkout": true,
           "is_indexed": null,
           "hide_in_backoffice": null,
           "handle": null,
           "placeholder": null,
           "title": null,
           "example": null,
           "type": "Field::SystemTextField"
         },
         {
           "id": 5,
           "destiny": 1,
           "position": 4,
           "office_title": "Почтовый индекс",
           "for_buyer": true,
           "obligatory": false,
           "active": false,
           "system_name": "zip",
           "created_at": "2010-10-12T13:31:09.692+04:00",
           "updated_at": "2010-10-12T13:31:09.692+04:00",
           "show_in_result": true,
           "show_in_checkout": true,
           "is_indexed": null,
           "hide_in_backoffice": null,
           "handle": null,
           "placeholder": null,
           "title": null,
           "example": null,
           "type": "Field::SystemTextField"
         }
       ],
       "no_delivery": false,
       "kladr_autodetected_address": "",
       "country_options": [
         {
           "code": "RU",
           "title": "Россия",
           "selected": true
         }
       ],
       "address": "address",
       "country": "RU",
       "state": "state",
       "city": "Manchester",
       "zip": "567889",
       "street": null,
       "house": null,
       "flat": null,
       "entrance": null,
       "doorphone": null,
       "floor": null,
       "comment": null,
       "kladr_json": null,
       "location": {
         "kladr_code": null,
         "zip": "567889",
         "kladr_zip": null,
         "region_zip": null,
         "country": "RU",
         "state": "state",
         "state_type": null,
         "area": null,
         "area_type": null,
         "city": "Manchester",
         "city_type": null,
         "settlement": null,
         "settlement_type": null,
         "address": "address",
         "street": "address",
         "street_type": null,
         "house": null,
         "flat": null,
         "is_kladr": false,
         "latitude": null,
         "longitude": null,
         "autodetected": null
       }
     },
     "client": {
       "id": 3,
       "email": "some-one2@yandex.ru",
       "name": "Just Man",
       "phone": "+7(926)111-22-33",
       "created_at": "2009-04-30T04:37:32.000+04:00",
       "updated_at": "2009-04-30T12:20:34.000+04:00",
       "comment": null,
       "registered": false,
       "subscribe": true,
       "client_group_id": 1,
       "bonus_points": 0,
       "type": "Client::Individual",
       "correspondent_account": null,
       "settlement_account": null,
       "consent_to_personal_data": null,
       "o_auth_provider": null,
       "messenger_subscription": null,
       "external_id": null,
       "external_service": null,
       "contact_name": "Just Man",
       "surname": null,
       "middlename": null,
       "progressive_discount": "25.0",
       "group_discount": "25.0",
       "ip_addr": "",
       "fields_values": []
     },
     "discounts": [
       {
         "id": 1,
         "description": "процентная скидка",
         "warning": null,
         "type_id": 1,
         "amount": 300,
         "full_amount": 360,
         "percent": "30.0",
         "discount": "30.0",
         "reference_id": null,
         "reference_type": null,
         "discount_products_ids": [],
         "discount_order_lines_ids": [],
         "discount_code_id": null,
         "created_at": "2009-03-18T10:53:14.000+03:00",
         "updated_at": "2009-03-18T10:53:15.000+03:00"
       }
     ],
     "total_price": 840,
     "paid_amount": 0,
     "items_price": 840,
     "id": 3,
     "key": null,
     "number": 1004,
     "comment": "comment",
     "archived": false,
     "delivery_title": "самовывоз",
     "delivery_description": "самовывоз",
     "delivery_price": 0,
     "full_delivery_price": 0,
     "payment_description": null,
     "payment_title": "наличными курьеру",
     "first_referer": null,
     "first_current_location": null,
     "first_query": null,
     "first_source_domain": null,
     "first_source": "",
     "referer": "http://yandex.ru/yandsearch?text=%D1%81%D0%BF%D0%B0%D0%BB%D1%8C%D0%BD%D1%8B%D0%B5+%D0%BC%D0%B5%D1%88%D0%BA%D0%B8&stpar2=%2Fh1%2Ftm7%2Fs1&stpar4=%2Fs1&stpar1=%2Fu1&stpar3=%2Fm3%2Ftc14%2Fnc1",
     "current_location": null,
     "query": null,
     "source_domain": null,
     "source": "",
     "fulfillment_status": "new",
     "custom_status": {
       "permalink": "new",
       "title": "Новый"
     },
     "delivered_at": null,
     "accepted_at": null,
     "created_at": "2011-03-18T10:53:14.000+03:00",
     "updated_at": "2011-03-18T10:53:15.000+03:00",
     "financial_status": "paid",
     "delivery_date": null,
     "delivery_from_hour": null,
     "delivery_from_minutes": null,
     "delivery_to_hour": null,
     "delivery_to_minutes": null,
     "delivery_time": "",
     "paid_at": null,
     "delivery_variant_id": 1,
     "payment_gateway_id": 3,
     "margin": "20.0",
     "margin_amount": "140.0",
     "client_transaction_id": null,
     "yandex_metrika_client_id": null,
     "currency_code": "RUR",
     "cookies": null,
     "account_id": 1,
     "manager_comment": null,
     "locale": "ru",
     "delivery_info": {
       "delivery_variant_id": null,
       "tariff_id": null,
       "title": null,
       "description": null,
       "price": null,
       "shipping_company": null,
       "shipping_company_handle": null,
       "delivery_interval": {
         "min_days": null,
         "max_days": null,
         "description": ""
       },
       "errors": [],
       "warnings": [],
       "outlet": {
         "id": null,
         "external_id": null,
         "latitude": null,
         "longitude": null,
         "type": null,
         "title": null,
         "description": null,
         "address": null,
         "payment_method": null,
         "source_id": null
       },
       "not_available": null
     },
     "responsible_user_id": null,
     "total_profit": "840.0",
     "warehouse_id": null
   },
   {
     "fields_values": [
       {
         "id": 147,
         "value": "old value",
         "created_at": "2026-10-21T23:27:33.315+03:00",
         "updated_at": "2026-10-21T23:27:33.315+03:00",
         "field_id": 456,
         "type": "Текст",
         "name": "special",
         "handle": "my_awesome_field"
       }
     ],
     "order_lines": [
       {
         "id": 1,
         "order_id": 1,
         "sale_price": 300,
         "full_sale_price": 300,
         "total_price": 300,
         "full_total_price": 300,
         "discounts_amount": 0,
         "quantity": 1,
         "reserved_quantity": null,
         "weight": null,
         "dimensions": null,
         "variant_id": 1,
         "product_id": 1,
         "sku": "423",
         "barcode": null,
         "title": "Cool t-shirt",
         "unit": "pce",
         "comment": null,
         "updated_at": "2009-03-18T10:53:15.000+03:00",
         "created_at": "2009-03-18T10:53:14.000+03:00",
         "bundle_id": null,
         "vat": -1,
         "fiscal_product_type": 1,
         "requires_marking": null,
         "marking_codes": [
           "code1",
           "code2"
         ],
         "accessory_lines": [],
         "external_variant_id": null
       },
       {
         "id": 2,
         "order_id": 1,
         "sale_price": 600,
         "full_sale_price": 600,
         "total_price": 1200,
         "full_total_price": 1200,
         "discounts_amount": 0,
         "quantity": 2,
         "reserved_quantity": null,
         "weight": "0.3",
         "dimensions": null,
         "variant_id": 2,
         "product_id": 2,
         "sku": "424",
         "barcode": null,
         "title": "shirt",
         "unit": "pce",
         "comment": null,
         "updated_at": "2009-03-18T10:53:15.000+03:00",
         "created_at": "2009-03-18T10:53:14.000+03:00",
         "bundle_id": null,
         "vat": 20,
         "fiscal_product_type": 1,
         "requires_marking": null,
         "marking_codes": null,
         "accessory_lines": [],
         "external_variant_id": null
       }
     ],
     "order_changes": [],
     "discount": null,
     "shipping_address": {
       "id": 1,
       "fields_values": [
         {
           "id": 139,
           "value": "old value",
           "created_at": "2026-10-21T23:27:33.272+03:00",
           "updated_at": "2026-10-21T23:27:33.272+03:00",
           "field_id": 448,
           "type": "Текст",
           "name": "special",
           "handle": null
         }
       ],
       "name": "Tom Dellay",
       "surname": null,
       "middlename": null,
       "phone": "+7(495)212-85-06",
       "formatted_phone": "+7(495)212-85-06",
       "full_name": "Tom Dellay",
       "full_locality_name": null,
       "full_delivery_address": "123456, state, London, address, old value",
       "address_for_gis": "123456, state, London, address",
       "location_valid": true,
       "recipient_fields": [
         {
           "id": 11,
           "destiny": 2,
           "position": 1,
           "office_title": "Имя",
           "for_buyer": true,
           "obligatory": true,
           "active": true,
           "system_name": "name",
           "created_at": "2010-10-12T13:31:09.692+04:00",
           "updated_at": "2010-10-12T13:31:09.692+04:00",
           "show_in_result": true,
           "show_in_checkout": true,
           "is_indexed": null,
           "hide_in_backoffice": null,
           "handle": null,
           "placeholder": null,
           "title": null,
           "example": null,
           "type": "Field::ObligatoryTextField"
         },
         {
           "id": 12,
           "destiny": 2,
           "position": 2,
           "office_title": "Телефон",
           "for_buyer": true,
           "obligatory": true,
           "active": true,
           "system_name": "phone",
           "created_at": "2010-10-12T13:31:09.692+04:00",
           "updated_at": "2010-10-12T13:31:09.692+04:00",
           "show_in_result": true,
           "show_in_checkout": true,
           "is_indexed": null,
           "hide_in_backoffice": null,
           "handle": null,
           "placeholder": null,
           "title": null,
           "example": null,
           "type": "Field::Phone"
         }
       ],
       "backoffice_fields": [
         {
           "id": 4,
           "destiny": 1,
           "position": 3,
           "office_title": "Адрес",
           "for_buyer": true,
           "obligatory": false,
           "active": true,
           "system_name": "address",
           "created_at": "2010-10-12T13:31:09.692+04:00",
           "updated_at": "2010-10-12T13:31:09.692+04:00",
           "show_in_result": true,
           "show_in_checkout": true,
           "is_indexed": null,
           "hide_in_backoffice": null,
           "handle": null,
           "placeholder": null,
           "title": null,
           "example": null,
           "type": "Field::SystemTextArea"
         },
         {
           "id": 448,
           "destiny": 1,
           "position": 22,
           "office_title": "special",
           "for_buyer": true,
           "obligatory": false,
           "active": true,
           "system_name": null,
           "created_at": "2026-10-21T23:27:33.258+03:00",
           "updated_at": "2026-10-21T23:27:33.258+03:00",
           "show_in_result": true,
           "show_in_checkout": true,
           "is_indexed": null,
           "hide_in_backoffice": null,
           "handle": null,
           "placeholder": null,
           "title": "special",
           "example": null,
           "type": "Field::TextField"
         },
         {
           "id": 1,
           "destiny": 1,
           "position": 0,
           "office_title": "Страна",
           "for_buyer": true,
           "obligatory": false,
           "active": false,
           "system_name": "country",
           "created_at": "2010-10-12T13:31:09.692+04:00",
           "updated_at": "2010-10-12T13:31:09.692+04:00",
           "show_in_result": true,
           "show_in_checkout": true,
           "is_indexed": null,
           "hide_in_backoffice": null,
           "handle": null,
           "placeholder": null,
           "title": null,
           "example": null,
           "type": "Field::Country"
         },
         {
           "id": 2,
           "destiny": 1,
           "position": 1,
           "office_title": "Регион",
           "for_buyer": true,
           "obligatory": false,
           "active": false,
           "system_name": "state",
           "created_at": "2010-10-12T13:31:09.692+04:00",
           "updated_at": "2010-10-12T13:31:09.692+04:00",
           "show_in_result": true,
           "show_in_checkout": true,
           "is_indexed": null,
           "hide_in_backoffice": null,
           "handle": null,
           "placeholder": null,
           "title": null,
           "example": null,
           "type": "Field::SystemTextField"
         },
         {
           "id": 3,
           "destiny": 1,
           "position": 2,
           "office_title": "Город",
           "for_buyer": true,
           "obligatory": false,
           "active": false,
           "system_name": "city",
           "created_at": "2010-10-12T13:31:09.692+04:00",
           "updated_at": "2010-10-12T13:31:09.692+04:00",
           "show_in_result": true,
           "show_in_checkout": true,
           "is_indexed": null,
           "hide_in_backoffice": null,
           "handle": null,
           "placeholder": null,
           "title": null,
           "example": null,
           "type": "Field::SystemTextField"
         },
         {
           "id": 5,
           "destiny": 1,
           "position": 4,
           "office_title": "Почтовый индекс",
           "for_buyer": true,
           "obligatory": false,
           "active": false,
           "system_name": "zip",
           "created_at": "2010-10-12T13:31:09.692+04:00",
           "updated_at": "2010-10-12T13:31:09.692+04:00",
           "show_in_result": true,
           "show_in_checkout": true,
           "is_indexed": null,
           "hide_in_backoffice": null,
           "handle": null,
           "placeholder": null,
           "title": null,
           "example": null,
           "type": "Field::SystemTextField"
         }
       ],
       "no_delivery": false,
       "kladr_autodetected_address": "",
       "country_options": [
         {
           "code": "RU",
           "title": "Россия",
           "selected": true
         }
       ],
       "address": "address",
       "country": "RU",
       "state": "state",
       "city": "London",
       "zip": "123456",
       "street": null,
       "house": null,
       "flat": null,
       "entrance": null,
       "doorphone": null,
       "floor": null,
       "comment": null,
       "kladr_json": null,
       "location": {
         "kladr_code": null,
         "zip": "123456",
         "kladr_zip": null,
         "region_zip": null,
         "country": "RU",
         "state": "state",
         "state_type": null,
         "area": null,
         "area_type": null,
         "city": "London",
         "city_type": null,
         "settlement": null,
         "settlement_type": null,
         "address": "address",
         "street": "address",
         "street_type": null,
         "house": null,
         "flat": null,
         "is_kladr": false,
         "latitude": null,
         "longitude": null,
         "autodetected": null
       }
     },
     "client": {
       "id": 2,
       "email": "some-one@yandex.ru",
       "name": "Mortimer Hant",
       "phone": "+79162128506",
       "created_at": "2009-03-30T04:37:32.000+04:00",
       "updated_at": "2026-10-21T23:27:33.000+03:00",
       "comment": null,
       "registered": false,
       "subscribe": true,
       "client_group_id": null,
       "bonus_points": 0,
       "type": "Client::Individual",
       "correspondent_account": null,
       "settlement_account": null,
       "consent_to_personal_data": null,
       "o_auth_provider": null,
       "messenger_subscription": null,
       "external_id": null,
       "external_service": null,
       "contact_name": "Mortimer Hant",
       "surname": null,
       "middlename": null,
       "progressive_discount": null,
       "group_discount": null,
       "ip_addr": "",
       "fields_values": [
         {
           "id": 131,
           "value": "old value",
           "created_at": "2026-10-21T23:27:33.240+03:00",
           "updated_at": "2026-10-21T23:27:33.240+03:00",
           "field_id": 440,
           "type": "Текст",
           "name": "special",
           "handle": null
         }
       ]
     },
     "discounts": [],
     "total_price": 1600,
     "paid_amount": 0,
     "items_price": 1500,
     "id": 1,
     "key": "teest",
     "number": 1001,
     "comment": "comment",
     "archived": false,
     "delivery_title": "самовывоз",
     "delivery_description": "самовывоз",
     "delivery_price": 100,
     "full_delivery_price": 100,
     "payment_description": null,
     "payment_title": "наличными курьеру",
     "first_referer": "http://google.com?q=my_query",
     "first_current_location": "/my_query",
     "first_query": null,
     "first_source_domain": null,
     "first_source": "Google",
     "referer": "http://yandex.ru/yandsearch?text=%D1%81%D0%BF%D0%B0%D0%BB%D1%8C%D0%BD%D1%8B%D0%B5+%D0%BC%D0%B5%D1%88%D0%BA%D0%B8&stpar2=%2Fh1%2Ftm7%2Fs1&stpar4=%2Fs1&stpar1=%2Fu1&stpar3=%2Fm3%2Ftc14%2Fnc1",
     "current_location": "/",
     "query": null,
     "source_domain": null,
     "source": "Прямой трафик",
     "fulfillment_status": "new",
     "custom_status": {
       "permalink": "new",
       "title": "Новый"
     },
     "delivered_at": null,
     "accepted_at": null,
     "created_at": "2009-03-18T10:53:14.000+03:00",
     "updated_at": "2026-10-21T23:27:33.000+03:00",
     "financial_status": "pending",
     "delivery_date": null,
     "delivery_from_hour": null,
     "delivery_from_minutes": null,
     "delivery_to_hour": null,
     "delivery_to_minutes": null,
     "delivery_time": "",
     "paid_at": null,
     "delivery_variant_id": 1,
     "payment_gateway_id": 1,
     "margin": "0.0",
     "margin_amount": "0.0",
     "client_transaction_id": 1,
     "yandex_metrika_client_id": null,
     "currency_code": "RUR",
     "cookies": null,
     "account_id": 1,
     "manager_comment": "manager comment1",
     "locale": "ru",
     "delivery_info": {
       "delivery_variant_id": null,
       "tariff_id": null,
       "title": null,
       "description": null,
       "price": null,
       "shipping_company": null,
       "shipping_company_handle": null,
       "delivery_interval": {
         "min_days": null,
         "max_days": null,
         "description": ""
       },
       "errors": [],
       "warnings": [],
       "outlet": {
         "id": null,
         "external_id": null,
         "latitude": null,
         "longitude": null,
         "type": null,
         "title": null,
         "description": null,
         "address": null,
         "payment_method": null,
         "source_id": null
       },
       "not_available": null
     },
     "responsible_user_id": null,
     "total_profit": "1500.0",
     "warehouse_id": null
   }
 ]

Params:

NameTypeAttributeDescription
options Object
options.token string

Required, access token for shop

options.url string

Required, shop url

options.fulfillment_status string | string[]
  • optional

Order status or array of statuses

options.delivery_variant number | number[]
  • optional

Delivery variant id or array of ids

options.payment_gateway_id number | number[]
  • optional

Payment gateway id or array of ids

options.updated_since string
  • optional

Orders updated since

options.from_id number | string
  • optional

Orders starting from this id

options.per_page number | string
  • optional

Orders per page

options.page number | string
  • optional

Page

id Number | String

Required, app id

Return:

Promise

public listOutlet(options: Object, id: Number | String): Promise source

import {listOutlet} from 'insales/lib/api/outlet.js'

GET /admin/outlets.json

Examples:

 insales.listOutlet({
   token: '1234567890',
   url: 'shop-test.myinsales.ru'
 }).then(response => {
   console.info(response.data);
 }).catch(err => {
   console.error(err);
 });

Output:

 [
   {
     "id": 2,
     "account_id": 1,
     "delivery_variant_id": 209,
     "price": "100.0",
     "title_translations": [
       "Самовывоз от метро"
     ],
     "description_translations": [
       "Вход через арку во двор"
     ],
     "address": "ул Хмурого д1",
     "latitude": "55.7558",
     "longitude": "37.6173",
     "created_at": "2026-10-21T23:30:58.910+03:00",
     "updated_at": "2026-10-21T23:30:58.910+03:00",
     "title": "Самовывоз от метро",
     "description": "Вход через арку во двор"
   }
 ]

Params:

NameTypeAttributeDescription
options Object
options.token string

Required, access token for shop

options.url string

Required, shop url

id Number | String

Required, app id

Return:

Promise

public listPage(options: Object, id: Number | String): Promise source

import {listPage} from 'insales/lib/api/page.js'

GET /admin/pages.json

Examples:

 insales.listPage({
   token: '1234567890',
   url: 'shop-test.myinsales.ru'
 }).then(response => {
   console.info(response.data);
 }).catch(err => {
   console.error(err);
 });

Output:

 [
   {
     "id": 1,
     "meta_keywords": "meta keywords",
     "meta_description": "meta description",
     "is_hidden": false,
     "kind": "only_page",
     "permalink": "страница",
     "custom_template": null,
     "created_at": "2026-10-19T22:28:42.000+03:00",
     "updated_at": "2009-03-18T10:55:15.000+03:00",
     "is_main": true,
     "title": "any_url",
     "html_title": "html title",
     "content": "abc"
   },
   {
     "id": 3,
     "meta_keywords": "meta keywords",
     "meta_description": "meta description",
     "is_hidden": false,
     "kind": "only_page",
     "permalink": "страница2",
     "custom_template": null,
     "created_at": "2026-10-19T22:28:42.000+03:00",
     "updated_at": "2009-03-17T10:55:15.000+03:00",
     "is_main": false,
     "title": "bany_url",
     "html_title": "html title",
     "content": "abc"
   }
 ]

Params:

NameTypeAttributeDescription
options Object
options.token string

Required, access token for shop

options.url string

Required, shop url

id Number | String

Required, app id

Return:

Promise

public listPaymentGateway(options: Object, id: Number | String): Promise source

import {listPaymentGateway} from 'insales/lib/api/paymentgateway.js'

GET /admin/payment_gateways.json

Examples:

 insales.listPaymentGateway({
   token: '1234567890',
   url: 'shop-test.myinsales.ru'
 }).then(response => {
   console.info(response.data);
 }).catch(err => {
   console.error(err);
 });

Output:

 [
   {
     "id": 1,
     "type": "PaymentGateway::Cod",
     "position": 1,
     "created_at": "2009-03-30T04:37:32.000+04:00",
     "updated_at": "2009-03-31T12:20:34.000+04:00",
     "margin": "0.0",
     "available_for_individual_clients": true,
     "available_for_juridical_clients": true,
     "title": "Наличными курьеру",
     "description": "",
     "payment_delivery_variants": [
       {
         "created_at": "2026-10-19T22:28:42.000+03:00",
         "delivery_variant_id": 1,
         "id": 1
       },
       {
         "created_at": "2026-10-19T22:28:42.000+03:00",
         "delivery_variant_id": 2,
         "id": 2
       }
     ]
   },
   {
     "id": 3,
     "type": "PaymentGateway::JuridicalPersonBill",
     "position": 2,
     "created_at": "2009-03-17T10:55:14.000+03:00",
     "updated_at": "2009-03-17T10:55:15.000+03:00",
     "margin": "20.0",
     "available_for_individual_clients": true,
     "available_for_juridical_clients": true,
     "title": "Выставление счета для юр. лиц.",
     "description": "",
     "redirect_to_payment": true,
     "payment_delivery_variants": []
   },
   {
     "id": 4,
     "type": "PaymentGateway::JuridicalPersonBill",
     "position": 3,
     "created_at": "2009-03-17T10:55:14.000+03:00",
     "updated_at": "2009-03-17T10:55:15.000+03:00",
     "margin": "0.0",
     "available_for_individual_clients": true,
     "available_for_juridical_clients": true,
     "title": "Выставление счета для юр. лиц 2.",
     "description": "",
     "redirect_to_payment": true,
     "payment_delivery_variants": []
   }
 ]

Params:

NameTypeAttributeDescription
options Object
options.token string

Required, access token for shop

options.url string

Required, shop url

id Number | String

Required, app id

Return:

Promise

public listPriceKind(options: Object, id: Number | String): Promise source

import {listPriceKind} from 'insales/lib/api/pricekind.js'

GET /admin/price_kinds.json

Examples:

 insales.listPriceKind({
   token: '1234567890',
   url: 'shop-test.myinsales.ru',
 }).then(response => {
   console.info(response.data);
 }).catch(err => {
   console.error(err);
 });

Output:

 [
   {
       "id": 111,
       "price_index": 1,
       "show_in_lists": true,
       "title": "тест 1",
       "variant_price_method_name": "price2"
   },
   {
       "id": 112,
       "price_index": 2,
       "show_in_lists": true,
       "title": "тест2",
       "variant_price_method_name": "price3"
   }
 ]

Params:

NameTypeAttributeDescription
options Object
options.token string

Required, access token for shop

options.url string

Required, shop url

id Number | String

Required, app id

Return:

Promise

public listProduct(options: Object, id: Number | String): Promise source

import {listProduct} from 'insales/lib/api/product.js'

GET /admin/products.xml

Examples:

 insales.listProduct({
   token: '1234567890',
   url: 'shop-test.myinsales.ru',
 }).then(response => {
   console.info(response.data);
 }).catch(err => {
   console.error(err);
 });

Output:

 { products:
   { product:
      [{ archived: 'false',
        available: '',
        'canonical-url-collection-id': '',
        'category-id': '1',
        'created-at': '2011-11-11 11:11:11 +0300',
        id: '12345',
        'is-hidden': 'false',
        'sort-weight': '',
        unit: 'pcs',
        'updated-at': '2011-11-11 11:11:11 +0300',
        title: 'Product 1',
        'short-description': '',
        permalink: 'product-1',
        'html-title': '',
        'meta-keywords': '',
        'meta-description': '',
        'currency-code': 'RUR',
        'collections-ids': '',
        images: '',
        'option-names': '',
        properties: '',
        characteristics: '',
        'product-field-values': '',
        variants: { variant: [Object] },
        description: '' },
      { archived: 'false',
        available: '',
        'canonical-url-collection-id': '',
        'category-id': '1',
        'created-at': '2011-11-11 11:11:11 +0300',
        id: '123456',
        'is-hidden': 'false',
        'sort-weight': '',
        unit: 'pcs',
        'updated-at': '2011-11-11 11:11:11 +0300',
        title: 'Product 2',
        'short-description': '',
        permalink: 'product-2',
        'html-title': '',
        'meta-keywords': '',
        'meta-description': '',
        'currency-code': 'RUR',
        'collections-ids': '',
        images: '',
        'option-names': '',
        properties: '',
        characteristics: '',
        'product-field-values': '',
        variants: { variant: [Object] },
        description: '' }]}}

Params:

NameTypeAttributeDescription
options Object
options.token string

Required, access token for shop

options.url string

Required, shop url

options.page string | number
  • optional
  • default: 1

Page

options.per_page string | number
  • optional
  • default: 100

Per page

options.updated_since string
  • optional

Products updated since. Format YYYY-MM-DD

options.deleted boolean
  • optional

Deleted products

id Number | String

Required, app id

Return:

Promise

public listProductField(options: Object, id: Number | String): Promise source

import {listProductField} from 'insales/lib/api/productfield.js'

GET /admin/product_fields.json

Examples:

 insales.listProductField({
   token: '1234567890',
   url: 'shop-test.myinsales.ru'
 }).then(response => {
   console.info(response.data);
 }).catch(err => {
   console.error(err);
 });

Output:

 [
   {
     "id": 1,
     "handle": "handle",
     "type": "ProductField::TextField",
     "application_id": null,
     "position": 1,
     "is_hidden": null,
     "is_indexed": null,
     "title": "title",
     "application_title": null
   },
   {
     "id": 4,
     "handle": "yml_import",
     "type": "ProductField::YmlImportField",
     "application_id": null,
     "position": 1,
     "is_hidden": null,
     "is_indexed": null,
     "title": "import field",
     "application_title": null
   },
   {
     "id": 2,
     "handle": "handle2",
     "type": "ProductField::TextArea",
     "application_id": 1,
     "position": 2,
     "is_hidden": null,
     "is_indexed": null,
     "title": "title2",
     "application_title": "Цифровые товары"
   }
 ]

Params:

NameTypeAttributeDescription
options Object
options.token string

Required, access token for shop

options.url string

Required, shop url

id Number | String

Required, app id

Return:

Promise

public listProductFieldValue(options: Object, id: Number | String): Promise source

import {listProductFieldValue} from 'insales/lib/api/productfieldvalue.js'

GET /admin/products/{product_id}/product_field_values.json

Examples:

 insales.listProductFieldValue({
   token: '1234567890',
   url: 'shop-test.myinsales.ru',
   productid: '1'
 }).then(response => {
   console.info(response.data);
 }).catch(err => {
   console.error(err);
 });

Output:

 [
   {
     "id": 1,
     "product_field_id": 1,
     "value": "some product field value"
   }
 ]

Params:

NameTypeAttributeDescription
options Object
options.token string

Required, access token for shop

options.url string

Required, shop url

options.productid number | string

Required, product id

id Number | String

Required, app id

Return:

Promise

public listProductImage(options: Object, id: Number | String): Promise source

import {listProductImage} from 'insales/lib/api/productimage.js'

GET /admin/products/{product_id}/images.json

Examples:

 insales.listProductImage({
   token: '1234567890',
   url: 'shop-test.myinsales.ru',
   productid: '1'
 }).then(response => {
   console.info(response.data);
 }).catch(err => {
   console.error(err);
 });

Output:

 []

Params:

NameTypeAttributeDescription
options Object
options.token string

Required, access token for shop

options.url string

Required, shop url

options.productid number | string

Required, product id

id Number | String

Required, app id

Return:

Promise

public listProperty(options: Object, id: Number | String): Promise source

import {listProperty} from 'insales/lib/api/property.js'

GET /admin/properties.json

Examples:

 insales.listProperty({
   token: '1234567890',
   url: 'shop-test.myinsales.ru'
 }).then(response => {
   console.info(response.data);
 }).catch(err => {
   console.error(err);
 });

Output:

 [
   {
     "id": -1,
     "position": 1,
     "backoffice": false,
     "is_hidden": false,
     "is_navigational": true,
     "permalink": "kategoriya-yandeks-marketa",
     "title": "Категория Яндекс Маркета"
   },
   {
     "id": 6,
     "position": 1,
     "backoffice": false,
     "is_hidden": true,
     "is_navigational": true,
     "permalink": "hidden",
     "title": "hidden"
   },
   {
     "id": -5,
     "position": 1,
     "backoffice": false,
     "is_hidden": false,
     "is_navigational": true,
     "permalink": "kategoriya-tovara-v-wildberries",
     "title": "Категория товара в Wildberries"
   },
   {
     "id": 7,
     "position": 2,
     "backoffice": false,
     "is_hidden": false,
     "is_navigational": true,
     "permalink": "visible",
     "title": "visible"
   },
   {
     "id": 9,
     "position": 3,
     "backoffice": false,
     "is_hidden": false,
     "is_navigational": false,
     "permalink": "numeric",
     "title": "numeric"
   },
   {
     "id": 8,
     "position": 3,
     "backoffice": false,
     "is_hidden": false,
     "is_navigational": false,
     "permalink": "not_navigational",
     "title": "not_navigational"
   },
   {
     "id": 5,
     "position": 4,
     "backoffice": false,
     "is_hidden": false,
     "is_navigational": true,
     "permalink": "параметр",
     "title": "параметр"
   },
   {
     "id": 4,
     "position": 5,
     "backoffice": false,
     "is_hidden": false,
     "is_navigational": true,
     "permalink": "style",
     "title": "Style"
   },
   {
     "id": 3,
     "position": 6,
     "backoffice": false,
     "is_hidden": false,
     "is_navigational": true,
     "permalink": "vendor",
     "title": "Vendor"
   },
   {
     "id": 2,
     "position": 7,
     "backoffice": false,
     "is_hidden": false,
     "is_navigational": true,
     "permalink": "importer",
     "title": "Importer"
   },
   {
     "id": 1,
     "position": 8,
     "backoffice": false,
     "is_hidden": false,
     "is_navigational": true,
     "permalink": "producer",
     "title": "Producer"
   },
   {
     "id": 14,
     "position": 11,
     "backoffice": false,
     "is_hidden": false,
     "is_navigational": true,
     "permalink": "age",
     "title": "Age"
   },
   {
     "id": 15,
     "position": 12,
     "backoffice": false,
     "is_hidden": false,
     "is_navigational": true,
     "permalink": "age_unit",
     "title": "Age Unit"
   },
   {
     "id": 100,
     "position": 100,
     "backoffice": false,
     "is_hidden": false,
     "is_navigational": true,
     "permalink": "color",
     "title": "Расцветка"
   },
   {
     "id": 101,
     "position": 101,
     "backoffice": false,
     "is_hidden": false,
     "is_navigational": true,
     "permalink": "shape",
     "title": "Форма"
   },
   {
     "id": 102,
     "position": 102,
     "backoffice": false,
     "is_hidden": false,
     "is_navigational": true,
     "permalink": "size",
     "title": "Размер"
   },
   {
     "id": 103,
     "position": 103,
     "backoffice": false,
     "is_hidden": false,
     "is_navigational": true,
     "permalink": "material",
     "title": "Материал"
   },
   {
     "id": -7,
     "position": 10000,
     "backoffice": false,
     "is_hidden": true,
     "is_navigational": false,
     "permalink": "new-ketagoriya-tovara-v-ozon",
     "title": "Новая категория товара в OZON"
   },
   {
     "id": -6,
     "position": 10001,
     "backoffice": false,
     "is_hidden": false,
     "is_navigational": true,
     "permalink": "kategoriya-tovara-v-vk",
     "title": "Категория товара в VK"
   }
 ]

Params:

NameTypeAttributeDescription
options Object
options.token string

Required, access token for shop

options.url string

Required, shop url

id Number | String

Required, app id

Return:

Promise

public listRedirect(options: Object, id: Number | String): Promise source

import {listRedirect} from 'insales/lib/api/redirect.js'

GET /admin/redirects.json

Examples:

 insales.listRedirect({
   token: '1234567890',
   url: 'shop-test.myinsales.ru'
 }).then(response => {
   console.info(response.data);
 }).catch(err => {
   console.error(err);
 });

Output:

 [
   {
     "id": 6,
     "old_url": "/so_old_url",
     "new_url": "/like_new_url",
     "created_at": "2026-10-21T23:06:05.851+03:00"
   }
 ]

Params:

NameTypeAttributeDescription
options Object
options.token string

Required, access token for shop

options.url string

Required, shop url

id Number | String

Required, app id

Return:

Promise

public listReview(options: Object, id: Number | String): Promise source

import {listReview} from 'insales/lib/api/review.js'

GET /admin/reviews.json

Examples:

 insales.listReview({
   token: '1234567890',
   url: 'shop-test.myinsales.ru'
 }).then(response => {
   console.info(response.data);
 }).catch(err => {
   console.error(err);
 });

Output:

 [
   {
     "id": 10,
     "product_id": 2,
     "author": "Автор 10",
     "content": "Быстрая доставка, хороший сервис.",
     "email": "email10@example.com",
     "rating": 3,
     "manager_name": null,
     "published": false,
     "created_at": "2023-09-10T18:00:00.000+03:00",
     "updated_at": "2023-09-10T18:00:00.000+03:00",
     "manager_reply": "nil",
     "replied_at": null,
     "spam": false,
     "published_at": null,
     "replied_q": false,
     "title": "shirt",
     "url": "/product/shirt",
     "first_image": {
       "id": null,
       "product_id": null,
       "external_id": null,
       "position": null,
       "created_at": null,
       "image_processing": null,
       "title": null,
       "url": "/images/no_image_thumb.jpg",
       "original_url": "/images/no_image_original.jpg",
       "medium_url": "/images/no_image_medium.jpg",
       "small_url": "/images/no_image_micro.jpg",
       "thumb_url": "/images/no_image_thumb.jpg",
       "compact_url": "/images/no_image_compact.jpg",
       "large_url": "/images/no_image_large.jpg",
       "filename": null,
       "has_bitmap_image": false,
       "image_content_type": null
     }
   },
   {
     "id": 9,
     "product_id": 1,
     "author": "Автор 9",
     "content": "Отличный продукт, рекомендую!",
     "email": "email9@example.com",
     "rating": 5,
     "manager_name": null,
     "published": true,
     "created_at": "2023-09-09T12:00:00.000+03:00",
     "updated_at": "2023-09-09T12:00:00.000+03:00",
     "manager_reply": "Спасибо за ваш отзыв!",
     "replied_at": null,
     "spam": false,
     "published_at": null,
     "replied_q": false,
     "title": "Cool t-shirt",
     "url": "/product/футболка",
     "first_image": {
       "id": null,
       "product_id": null,
       "external_id": null,
       "position": null,
       "created_at": null,
       "image_processing": null,
       "title": null,
       "url": "/images/no_image_thumb.jpg",
       "original_url": "/images/no_image_original.jpg",
       "medium_url": "/images/no_image_medium.jpg",
       "small_url": "/images/no_image_micro.jpg",
       "thumb_url": "/images/no_image_thumb.jpg",
       "compact_url": "/images/no_image_compact.jpg",
       "large_url": "/images/no_image_large.jpg",
       "filename": null,
       "has_bitmap_image": false,
       "image_content_type": null
     }
   },
   {
     "id": 7,
     "product_id": 7,
     "author": "Автор 7",
     "content": "Понравился, всё работает.",
     "email": "email7@example.com",
     "rating": 5,
     "manager_name": null,
     "published": true,
     "created_at": "2023-09-07T13:30:00.000+03:00",
     "updated_at": "2023-09-07T13:30:00.000+03:00",
     "manager_reply": "Спасибо за ваш отзыв!",
     "replied_at": null,
     "spam": false,
     "published_at": null,
     "replied_q": false,
     "title": "fb_product",
     "url": "/product/fb_product",
     "first_image": {
       "id": null,
       "product_id": null,
       "external_id": null,
       "position": null,
       "created_at": null,
       "image_processing": null,
       "title": null,
       "url": "/images/no_image_thumb.jpg",
       "original_url": "/images/no_image_original.jpg",
       "medium_url": "/images/no_image_medium.jpg",
       "small_url": "/images/no_image_micro.jpg",
       "thumb_url": "/images/no_image_thumb.jpg",
       "compact_url": "/images/no_image_compact.jpg",
       "large_url": "/images/no_image_large.jpg",
       "filename": null,
       "has_bitmap_image": false,
       "image_content_type": null
     }
   },
   {
     "id": 6,
     "product_id": 6,
     "author": "Автор 6",
     "content": "Средний продукт, есть лучше.",
     "email": "email6@example.com",
     "rating": 3,
     "manager_name": null,
     "published": true,
     "created_at": "2023-09-06T11:00:00.000+03:00",
     "updated_at": "2023-09-06T11:00:00.000+03:00",
     "manager_reply": "Спасибо за ваш отзыв.",
     "replied_at": null,
     "spam": false,
     "published_at": null,
     "replied_q": false,
     "title": "pants",
     "url": "/product/pants",
     "first_image": {
       "id": null,
       "product_id": null,
       "external_id": null,
       "position": null,
       "created_at": null,
       "image_processing": null,
       "title": null,
       "url": "/images/no_image_thumb.jpg",
       "original_url": "/images/no_image_original.jpg",
       "medium_url": "/images/no_image_medium.jpg",
       "small_url": "/images/no_image_micro.jpg",
       "thumb_url": "/images/no_image_thumb.jpg",
       "compact_url": "/images/no_image_compact.jpg",
       "large_url": "/images/no_image_large.jpg",
       "filename": null,
       "has_bitmap_image": false,
       "image_content_type": null
     }
   },
   {
     "id": 5,
     "product_id": 5,
     "author": "Автор 5",
     "content": "Отличная цена-качество!",
     "email": "email5@example.com",
     "rating": 5,
     "manager_name": null,
     "published": true,
     "created_at": "2023-09-05T17:00:00.000+03:00",
     "updated_at": "2023-09-05T17:00:00.000+03:00",
     "manager_reply": "Рады, что вам понравилось!",
     "replied_at": null,
     "spam": false,
     "published_at": null,
     "replied_q": false,
     "title": "shirt & pants",
     "url": "/product/shirt_and_pants",
     "first_image": {
       "id": null,
       "product_id": null,
       "external_id": null,
       "position": null,
       "created_at": null,
       "image_processing": null,
       "title": null,
       "url": "/images/no_image_thumb.jpg",
       "original_url": "/images/no_image_original.jpg",
       "medium_url": "/images/no_image_medium.jpg",
       "small_url": "/images/no_image_micro.jpg",
       "thumb_url": "/images/no_image_thumb.jpg",
       "compact_url": "/images/no_image_compact.jpg",
       "large_url": "/images/no_image_large.jpg",
       "filename": null,
       "has_bitmap_image": false,
       "image_content_type": null
     }
   },
   {
     "id": 4,
     "product_id": 4,
     "author": "Автор 4",
     "content": "Продукт нормальный, но требует доработки.",
     "email": "email4@example.com",
     "rating": 4,
     "manager_name": null,
     "published": true,
     "created_at": "2023-09-04T12:00:00.000+03:00",
     "updated_at": "2023-09-04T12:00:00.000+03:00",
     "manager_reply": "Спасибо за ваш отзыв. Мы работаем над улучшениями.",
     "replied_at": null,
     "spam": false,
     "published_at": null,
     "replied_q": false,
     "title": "shirt & t-short",
     "url": "/product/shirt_and_tshort",
     "first_image": {
       "id": null,
       "product_id": null,
       "external_id": null,
       "position": null,
       "created_at": null,
       "image_processing": null,
       "title": null,
       "url": "/images/no_image_thumb.jpg",
       "original_url": "/images/no_image_original.jpg",
       "medium_url": "/images/no_image_medium.jpg",
       "small_url": "/images/no_image_micro.jpg",
       "thumb_url": "/images/no_image_thumb.jpg",
       "compact_url": "/images/no_image_compact.jpg",
       "large_url": "/images/no_image_large.jpg",
       "filename": null,
       "has_bitmap_image": false,
       "image_content_type": null
     }
   },
   {
     "id": 2,
     "product_id": 2,
     "author": "Автор 2",
     "content": "Хороший, но есть недостатки.",
     "email": "email2@example.com",
     "rating": 3,
     "manager_name": null,
     "published": true,
     "created_at": "2023-09-02T14:00:00.000+03:00",
     "updated_at": "2023-09-02T14:00:00.000+03:00",
     "manager_reply": "Мы учтем ваши замечания и постараемся улучшить продукт.",
     "replied_at": null,
     "spam": false,
     "published_at": null,
     "replied_q": false,
     "title": "shirt",
     "url": "/product/shirt",
     "first_image": {
       "id": null,
       "product_id": null,
       "external_id": null,
       "position": null,
       "created_at": null,
       "image_processing": null,
       "title": null,
       "url": "/images/no_image_thumb.jpg",
       "original_url": "/images/no_image_original.jpg",
       "medium_url": "/images/no_image_medium.jpg",
       "small_url": "/images/no_image_micro.jpg",
       "thumb_url": "/images/no_image_thumb.jpg",
       "compact_url": "/images/no_image_compact.jpg",
       "large_url": "/images/no_image_large.jpg",
       "filename": null,
       "has_bitmap_image": false,
       "image_content_type": null
     },
     "image": {
       "id": 2,
       "created_at": "2023-09-02T14:00:00.000+03:00",
       "original_url": "http://minio.insales.io:9000/insales-test-sber/images/reviews/1/2/2/image_2.jpg",
       "medium_url": "http://minio.insales.io:9000/insales-test-sber/images/reviews/1/2/2/medium_image_2.jpg",
       "small_url": "http://minio.insales.io:9000/insales-test-sber/images/reviews/1/2/2/micro_image_2.jpg",
       "thumb_url": "http://minio.insales.io:9000/insales-test-sber/images/reviews/1/2/2/thumb_image_2.jpg",
       "compact_url": "http://minio.insales.io:9000/insales-test-sber/images/reviews/1/2/2/compact_image_2.jpg",
       "large_url": "http://minio.insales.io:9000/insales-test-sber/images/reviews/1/2/2/large_image_2.jpg",
       "image_content_type": "image/jpeg"
     }
   },
   {
     "id": 1,
     "product_id": 1,
     "author": "Автор 1",
     "content": "Отличный продукт!",
     "email": "email1@example.com",
     "rating": 5,
     "manager_name": null,
     "published": true,
     "created_at": "2023-09-01T13:00:00.000+03:00",
     "updated_at": "2023-09-01T13:00:00.000+03:00",
     "manager_reply": "nil",
     "replied_at": null,
     "spam": false,
     "published_at": null,
     "replied_q": false,
     "title": "Cool t-shirt",
     "url": "/product/футболка",
     "first_image": {
       "id": null,
       "product_id": null,
       "external_id": null,
       "position": null,
       "created_at": null,
       "image_processing": null,
       "title": null,
       "url": "/images/no_image_thumb.jpg",
       "original_url": "/images/no_image_original.jpg",
       "medium_url": "/images/no_image_medium.jpg",
       "small_url": "/images/no_image_micro.jpg",
       "thumb_url": "/images/no_image_thumb.jpg",
       "compact_url": "/images/no_image_compact.jpg",
       "large_url": "/images/no_image_large.jpg",
       "filename": null,
       "has_bitmap_image": false,
       "image_content_type": null
     },
     "image": {
       "id": 1,
       "created_at": "2023-09-01T13:00:00.000+03:00",
       "original_url": "http://minio.insales.io:9000/insales-test-sber/images/reviews/1/1/1/image_1.jpg",
       "medium_url": "http://minio.insales.io:9000/insales-test-sber/images/reviews/1/1/1/medium_image_1.jpg",
       "small_url": "http://minio.insales.io:9000/insales-test-sber/images/reviews/1/1/1/micro_image_1.jpg",
       "thumb_url": "http://minio.insales.io:9000/insales-test-sber/images/reviews/1/1/1/thumb_image_1.jpg",
       "compact_url": "http://minio.insales.io:9000/insales-test-sber/images/reviews/1/1/1/compact_image_1.jpg",
       "large_url": "http://minio.insales.io:9000/insales-test-sber/images/reviews/1/1/1/large_image_1.jpg",
       "image_content_type": "image/jpeg"
     }
   }
 ]

Params:

NameTypeAttributeDescription
options Object
options.token string

Required, access token for shop

options.url string

Required, shop url

id Number | String

Required, app id

Return:

Promise

public listSalesChannel(options: Object, id: Number | String): Promise source

import {listSalesChannel} from 'insales/lib/api/saleschannel.js'

GET /admin/sales_channels.json

Examples:

 insales.listSalesChannel({
   token: '1234567890',
   url: 'shop-test.myinsales.ru'
 }).then(response => {
   console.info(response.data);
 }).catch(err => {
   console.error(err);
 });

Output:

 [
   {
     "id": 3,
     "title": "test title",
     "state": null,
     "messages": [],
     "account_id": 1,
     "goods_setting_type": null,
     "goods_setting_id": null,
     "created_at": "2009-03-18T10:53:14.000+03:00",
     "updated_at": "2009-03-18T10:53:14.000+03:00",
     "application_id": 1,
     "last_rating_import_started_at": null,
     "last_feedbacks_import_started_at": null,
     "additional_fields": {},
     "auto_export_products": "disabled"
   }
 ]

Params:

NameTypeAttributeDescription
options Object
options.token string

Required, access token for shop

options.url string

Required, shop url

id Number | String

Required, app id

Return:

Promise

public listSimilar(options: Object, id: Number | String): Promise source

import {listSimilar} from 'insales/lib/api/similar.js'

GET /admin/products/{product_id}/similars.json

Examples:

 insales.listSimilar({
   token: '1234567890',
   url: 'shop-test.myinsales.ru',
   productid: '1'
 }).then(response => {
   console.info(response.data);
 }).catch(err => {
   console.error(err);
 });

Output:

 [
   {
     "id": 3
   }
 ]

Params:

NameTypeAttributeDescription
options Object
options.token string

Required, access token for shop

options.url string

Required, shop url

options.productid number | string

Required, product id

id Number | String

Required, app id

Return:

Promise

public listStockCurrency(options: Object, id: Number | String): Promise source

import {listStockCurrency} from 'insales/lib/api/stockcurrency.js'

GET /admin/stock_currencies.json

Examples:

 insales.listStockCurrency({
   token: '1234567890',
   url: 'shop-test.myinsales.ru'
 }).then(response => {
   console.info(response.data);
 }).catch(err => {
   console.error(err);
 });

Output:

 [
   {
     "id": 1,
     "is_default": true,
     "exchange_rate_use_cb": false,
     "exchange_rate_manual": "30.0",
     "exchange_rate_percent": "0.0",
     "exchange_rate_round": true,
     "code": "LVL",
     "title": "Латвийский лат",
     "cb_rate": "30.0",
     "unit": "Ls",
     "exchange_rate": "30.0"
   }
 ]

Params:

NameTypeAttributeDescription
options Object
options.token string

Required, access token for shop

options.url string

Required, shop url

id Number | String

Required, app id

Return:

Promise

public listSupplementary(options: Object, id: Number | String): Promise source

import {listSupplementary} from 'insales/lib/api/supplementary.js'

GET /admin/products/{product_id}/supplementaries.json

Examples:

 insales.listSupplementary({
   token: '1234567890',
   url: 'shop-test.myinsales.ru',
   productid: '1'
 }).then(response => {
   console.info(response.data);
 }).catch(err => {
   console.error(err);
 });

Output:

 [
   {
     "id": 3
   }
 ]

Params:

NameTypeAttributeDescription
options Object
options.token string

Required, access token for shop

options.url string

Required, shop url

options.productid number | string

Required, product id

id Number | String

Required, app id

Return:

Promise

public listThemes(options: Object, id: Number | String): Promise source

import {listThemes} from 'insales/lib/api/themes.js'

GET /admin/themes.xml

Examples:

 insales.listThemes({
   token: '1234567890',
   url: 'shop-test.myinsales.ru'
 }).then(response => {
   console.info(response.data.themes);
 }).catch(err => {
   console.error(err);
 });

Output:

 { 'themes':
    { theme:
        [ { 'created-at': '2016-05-12 20:12:08 +0300',
            description: '',
            'errors-text': '',
            id: '626874',
            'is-mobile': 'false',
            'is-published': 'false',
            title: 'Custom',
            'updated-at': '2016-06-17 07:59:26 +0300' },
          { 'created-at': '2016-06-01 21:55:16 +0300',
            description: '',
            'errors-text': '',
            id: '634252',
            'is-mobile': 'false',
            'is-published': 'true',
            title: 'Custom2',
            'updated-at': '2016-07-14 06:19:55 +0300' }]}};

Params:

NameTypeAttributeDescription
options Object
options.token string

Required, access token for shop

options.url string

Required, shop url

options.theme Number | String

Required, theme id

id Number | String

Required, app id

Return:

Promise

public listUnit(options: Object, id: Number | String): Promise source

import {listUnit} from 'insales/lib/api/unit.js'

GET /admin/units.json?lang=ru

Examples:

 insales.listUnit({
   token: '1234567890',
   url: 'shop-test.myinsales.ru',
   lang: 'ru'
 }).then(response => {
   console.info(response.data);
 }).catch(err => {
   console.error(err);
 });

Output:

 {
   "mmt": "мм",
   "cmt": "см",
   "dmt": "дм",
   "mtr": "м",
   "kmt": "км",
   "inh": "дюйм",
   "fot": "фут",
   "yrd": "ярд",
   "mtk": "м2",
   "dmk": "дм2",
   "mlt": "мл",
   "cmq": "см3",
   "ltr": "л",
   "dmq": "дм3",
   "mtq": "м3",
   "mgm": "мг",
   "grm": "г",
   "kgm": "кг",
   "tne": "т",
   "hur": "ч",
   "nbb": "боб",
   "lef": "л.",
   "set": "набор",
   "npr": "пар",
   "npl": "рул",
   "nmp": "упак",
   "dzp": "дюжина упак",
   "cnp": "100 упак",
   "pce": "шт",
   "cen": "100 шт",
   "mil": "тыс. шт",
   "box": "ящ",
   "sct": "секц",
   "btl": "флак",
   "lmt": "пог. м",
   "com": "компл",
   "pct": "кор",
   "day": "сут",
   "mth": "мес"
 }

Params:

NameTypeAttributeDescription
options Object
options.token string

Required, access token for shop

options.url string

Required, shop url

options.lang string

Required, locale, for example ru

id Number | String

Required, app id

Return:

Promise

public listUserTask(options: Object, id: Number | String): Promise source

import {listUserTask} from 'insales/lib/api/usertask.js'

GET /admin/user_tasks.json

Examples:

 insales.listUserTask({
   token: '1234567890',
   url: 'shop-test.myinsales.ru'
 }).then(response => {
   console.info(response.data);
 }).catch(err => {
   console.error(err);
 });

Output:

 [
   {
     "id": 2,
     "complete": null,
     "order_id": null,
     "assignee_id": 1,
     "title": "dispatch order N1",
     "description": "You should dispatch the order N1 till noon",
     "created_at": "2026-10-21T23:32:38.782+03:00",
     "updated_at": "2026-10-21T23:32:38.782+03:00",
     "deadline_at": "2021-01-01T00:00:00.000+03:00"
   }
 ]

Params:

NameTypeAttributeDescription
options Object
options.token string

Required, access token for shop

options.url string

Required, shop url

id Number | String

Required, app id

Return:

Promise

public listVariant(options: Object, id: Number | String): Promise source

import {listVariant} from 'insales/lib/api/variant.js'

GET /admin/products/{product_id}/variants.json

Examples:

 insales.listVariant({
   token: '1234567890',
   url: 'shop-test.myinsales.ru',
   productid: '1'
 }).then(response => {
   console.info(response.data);
 }).catch(err => {
   console.error(err);
 });

Output:

 [
   {
     "id": 1,
     "title": "Red",
     "product_id": 1,
     "sku": "423",
     "barcode": null,
     "dimensions": "10x20x30",
     "available": false,
     "image_ids": [],
     "image_id": null,
     "weight": null,
     "created_at": "2009-03-18T10:53:14.000+03:00",
     "updated_at": "2009-03-18T10:53:14.000+03:00",
     "quantity": 0,
     "quantity_at_warehouse0": "0.0",
     "quantity_at_warehouse1": "0.0",
     "cost_price": "3.0",
     "cost_price_in_site_currency": "90.0",
     "price_in_site_currency": "300.0",
     "base_price": "10.0",
     "old_price": null,
     "price2": 12,
     "price": "10.0",
     "base_price_in_site_currency": "300.0",
     "old_price_in_site_currency": null,
     "price2_in_site_currency": "360.0",
     "prices": [
       12
     ],
     "prices_in_site_currency": [
       "360.0"
     ],
     "variant_field_values": [
       {
         "id": 1,
         "variant_field_id": 1,
         "value": "some variant field value"
       }
     ],
     "option_values": [
       {
         "id": 1,
         "option_name_id": 1,
         "position": 1,
         "title": "Red",
         "image_url": null,
         "permalink": null
       }
     ]
   }
 ]

Params:

NameTypeAttributeDescription
options Object
options.token string

Required, access token for shop

options.url string

Required, shop url

options.productid number | string

Required, product id

id Number | String

Required, app id

Return:

Promise

public listVariantField(options: Object, id: Number | String): Promise source

import {listVariantField} from 'insales/lib/api/variantfield.js'

GET /admin/variant_fields.json

Examples:

 insales.listVariantField({
   token: '1234567890',
   url: 'shop-test.myinsales.ru'
 }).then(response => {
   console.info(response.data);
 }).catch(err => {
   console.error(err);
 });

Output:

 [
   {
     "id": 1,
     "handle": "handle",
     "type": "VariantField::TextField",
     "application_id": null,
     "position": 1,
     "is_hidden": null,
     "title": "title",
     "application_title": null
   },
   {
     "id": 2,
     "handle": "handle2",
     "type": "VariantField::TextArea",
     "application_id": 1,
     "position": 2,
     "is_hidden": null,
     "title": "title2",
     "application_title": "Цифровые товары"
   }
 ]

Params:

NameTypeAttributeDescription
options Object
options.token string

Required, access token for shop

options.url string

Required, shop url

id Number | String

Required, app id

Return:

Promise

public listVariantFieldValue(options: Object, id: Number | String): Promise source

import {listVariantFieldValue} from 'insales/lib/api/variantfieldvalue.js'

GET /admin/variants/{variant_id}/variant_field_values.json

Examples:

 insales.listVariantFieldValue({
   token: '1234567890',
   url: 'shop-test.myinsales.ru',
   variantid: '1'
 }).then(response => {
   console.info(response.data);
 }).catch(err => {
   console.error(err);
 });

Output:

 [
   {
     "id": 1,
     "variant_field_id": 1,
     "value": "some variant field value"
   }
 ]

Params:

NameTypeAttributeDescription
options Object
options.token string

Required, access token for shop

options.url string

Required, shop url

options.variantid number | string

Required, variant id

id Number | String

Required, app id

Return:

Promise

public listWarehouse(options: Object, id: Number | String): Promise source

import {listWarehouse} from 'insales/lib/api/warehouse.js'

GET /admin/warehouses.json

Examples:

 insales.listWarehouse({
   token: '1234567890',
   url: 'shop-test.myinsales.ru'
 }).then(response => {
   console.info(response.data);
 }).catch(err => {
   console.error(err);
 });

Output:

 [
   {
     "id": 1,
     "title": "Главный склад",
     "position": 1,
     "array_index": 0,
     "created_at": "2008-12-31T03:00:00.000+03:00",
     "updated_at": "2008-12-31T03:00:00.000+03:00",
     "status": "ready"
   },
   {
     "id": 37,
     "title": "main",
     "position": 2,
     "array_index": 1,
     "created_at": "2026-10-21T23:23:01.425+03:00",
     "updated_at": "2026-10-21T23:23:01.425+03:00",
     "status": "creating"
   }
 ]

Params:

NameTypeAttributeDescription
options Object
options.token string

Required, access token for shop

options.url string

Required, shop url

id Number | String

Required, app id

Return:

Promise

public listWebhook(options: Object, id: Number | String): Promise source

import {listWebhook} from 'insales/lib/api/webhook.js'

GET /admin/webhooks.json

Examples:

 insales.listWebhook({
   token: '1234567890',
   url: 'shop-test.myinsales.ru'
 }).then(response => {
   console.info(response.data);
 }).catch(err => {
   console.error(err);
 });

Output:

 [
   {
     "address": "https://webhook.site/4f4dd3e6-46d8-403f-8a3e-4fb0b1f108a0",
     "created_at": "2022-05-05T20:37:45.000+03:00",
     "id": 1,
     "topic": "products/update",
     "format_type": "json",
     "warehouse_id": null,
     "sales_channel_id": null,
     "batch_size": 5
   },
   {
     "address": "https://webhook.site/4f4dd3e6-46d8-403f-8a3e-4fb0b1f108a0",
     "created_at": "2022-05-05T20:37:45.000+03:00",
     "id": 3,
     "topic": "products/create",
     "format_type": "json",
     "warehouse_id": null,
     "sales_channel_id": null,
     "batch_size": 5
   },
   {
     "address": "https://webhook.site/4f4dd3e6-46d8-403f-8a3e-4fb0b1f108a0",
     "created_at": "2022-05-05T20:37:45.000+03:00",
     "id": 4,
     "topic": "client/update",
     "format_type": "json",
     "warehouse_id": null,
     "sales_channel_id": null,
     "batch_size": null
   },
   {
     "address": "https://webhook.site/4f4dd3e6-46d8-403f-8a3e-4fb0b1f108a0",
     "created_at": "2022-05-05T20:37:45.000+03:00",
     "id": 5,
     "topic": "client/create",
     "format_type": "json",
     "warehouse_id": null,
     "sales_channel_id": null,
     "batch_size": null
   },
   {
     "address": "http://app.ru/orders/create",
     "created_at": "2026-10-21T23:32:48.117+03:00",
     "id": 8,
     "topic": "orders/create",
     "format_type": "xml",
     "warehouse_id": null,
     "sales_channel_id": null,
     "batch_size": null
   }
 ]

Params:

NameTypeAttributeDescription
options Object
options.token string

Required, access token for shop

options.url string

Required, shop url

id Number | String

Required, app id

Return:

Promise

public listWidgetTypes(options: Object, id: Number | String): Promise source

import {listWidgetTypes} from 'insales/lib/api/widget_types.js'

GET /admin/themes/#{theme_id}/widget_types.xml

Examples:

 insales.listWidgetTypes({
   token: '1234567890',
   url: 'shop-test.myinsales.ru',
   theme: '643879'
 }).then(response => {
   console.info(response.data);
 }).catch(err => {
   console.error(err);
 });

Output:

 [{

'type': 'BlockListWidgetType', 'handle': 'widget_type_2', 'name': 'WidgetType 2', 'snippet_content': 'New text' 'widget_category_handle': 'drugie', 'page_kinds': ['all'], 'widget_list_kinds': ['content'], 'block_template_handle': 'system-title-and-content' }]

Params:

NameTypeAttributeDescription
options Object
options.token string

Required, access token for shop

options.url string

Required, shop url

options.theme Number | String

Required, theme id

id Number | String

Required, app id

Return:

Promise

public output(response: Object): Object source

import output from 'insales/lib/output.js'

Output Request-Promise response, used to create Promise resolve

Params:

NameTypeAttributeDescription
response Object

Required

Return:

Object

Return Properties:

NameTypeAttributeDescription
data Object

Response body

response Object

Full response

statusCode Number

Status code

callLimits Object

API call limit

callLimits.current number
callLimits.remaining number
callLimits.max Number

public patch(conn: Object): Promise source

import {patch} from 'insales/lib/methods/patch.js'

PATCH request

Params:

NameTypeAttributeDescription
conn Object
conn.id string

Required, app id

conn.token string

Required, token to access shop

conn.url string

Required, shop url

conn.api string

Required, api endpoint

conn.obj object

HTTP PATCH data

Return:

Promise

public post(conn: Object): Promise source

import {post} from 'insales/lib/methods/post.js'

POST request

Params:

NameTypeAttributeDescription
conn Object
conn.id string

Required, app id

conn.token string

Required, token to access shop

conn.url string

Required, shop url

conn.api string

Required, api endpoint

conn.obj object
  • optional

HTTP POST data

Return:

Promise

public put(conn: Object): Promise source

import {put} from 'insales/lib/methods/put.js'

PUT request

Params:

NameTypeAttributeDescription
conn Object
conn.id string

Required, app id

conn.token string

Required, token to access shop

conn.url string

Required, shop url

conn.api string

Required, api endpoint

conn.obj object

HTTP PUT data

Return:

Promise

public remove(conn: Object): Promise source

import {remove} from 'insales/lib/methods/remove.js'

DELETE request

Params:

NameTypeAttributeDescription
conn Object
conn.id string

Required, app id

conn.token string

Required, token to access shop

conn.url string

Required, shop url

conn.api string

Required, api endpoint

Return:

Promise

public removeAccessory(options: Object, id: Number | String): Promise source

import {removeAccessory} from 'insales/lib/api/accessory.js'

DELETE /admin/accessories/{accessory_id}.json

Examples:

 insales.removeAccessory({
   token: '1234567890',
   url: 'shop-test.myinsales.ru',
   accessoryid: '86'
 }).then(response => {
   console.info(response.data);
 }).catch(err => {
   console.error(err);
 });

Output:

 {
   "id": 86,
   "account_id": 1,
   "name_translations": [
     "Тяжёлый Шелковый Бутылка"
   ],
   "min_count": 2,
   "max_count": 7,
   "created_at": "2026-10-21T23:15:58.561+03:00",
   "updated_at": "2026-10-21T23:15:58.561+03:00",
   "back_office_name": "Великолепный Железный Стол",
   "permalink": "consequatur_laboriosam",
   "name": "Тяжёлый Шелковый Бутылка"
 }

Params:

NameTypeAttributeDescription
options Object
options.token string

Required, access token for shop

options.url string

Required, shop url

options.accessoryid number | string

Required, accessory id

id Number | String

Required, app id

Return:

Promise
import {removeAccessoryLink} from 'insales/lib/api/accessoryvalue.js'

DELETE /admin/products/{product_id}/product_accessory_links/{product_accessory_link_id}.json

Examples:

 insales.removeAccessoryLink({
   token: '1234567890',
   url: 'shop-test.myinsales.ru',
   productid: '293978513',
   accessorylinkid: '21'
 }).then(response => {
   console.info(response.data);
 }).catch(err => {
   console.error(err);
 });

Output:

 {
   "id": 21,
   "account_id": 1,
   "accessory_id": 102,
   "created_at": "2026-10-21T23:16:02.878+03:00",
   "updated_at": "2026-10-21T23:16:02.878+03:00",
   "product_id": 293978513,
   "accessory": {
     "id": 102,
     "account_id": 1,
     "name_translations": [
       "Опция 1"
     ],
     "min_count": 2,
     "max_count": 5,
     "created_at": "2026-10-21T23:16:02.813+03:00",
     "updated_at": "2026-10-21T23:16:02.813+03:00",
     "back_office_name": "Фантастический Стальной Часы",
     "permalink": "opcia-1",
     "name": "Опция 1"
   },
   "product": {
     "category_id": 1,
     "created_at": "2026-10-21T23:16:02.000+03:00",
     "updated_at": "2026-10-21T23:16:02.000+03:00",
     "is_hidden": false,
     "account_id": 1,
     "title_translations": [
       "product 6"
     ],
     "available": null,
     "archived": false,
     "key": null,
     "price_min_cached": null,
     "price_max_cached": null,
     "price_min_available_cached": null,
     "price_max_available_cached": null,
     "canonical_url_collection_id": null,
     "collections_id": [],
     "characteristics_id": [],
     "custom_layout": null,
     "custom_template": null,
     "old_price_min_cached": null,
     "old_price_max_cached": null,
     "old_price_min_available_cached": null,
     "old_price_max_available_cached": null,
     "permalink": "product-6",
     "unit": "pce",
     "deleted": false,
     "cost_price_min_cached": null,
     "cost_price_max_cached": null,
     "stock_currency_id": 1,
     "sort_weight": null,
     "bundle": null,
     "ignore_discounts": null,
     "vat": 10,
     "dimensions": null,
     "fiscal_product_type": 1,
     "popularity": null,
     "available_at_warehouses": [],
     "auto_assign_bundle_price": null,
     "demo": null,
     "sales_channels_id": null,
     "demo_thematic": null,
     "reviews_average_rating_cached": null,
     "reviews_count_cached": null,
     "merge_product_id": null,
     "merge_group_product_id": null,
     "merge_group_hidden": null,
     "no_delivery": false,
     "id": 293978513,
     "main_image_id": null,
     "is_adult": false,
     "title": "product 6"
   }
 }

Params:

NameTypeAttributeDescription
options Object
options.token string

Required, access token for shop

options.url string

Required, shop url

options.productid number | string

Required, product id

options.accessorylinkid number | string

Required, product accessory link id

id Number | String

Required, app id

Return:

Promise

public removeAccessoryValue(options: Object, id: Number | String): Promise source

import {removeAccessoryValue} from 'insales/lib/api/accessoryvalue.js'

DELETE /admin/accessories/{accessory_id}/values/{accessory_value_id}.json

Examples:

 insales.removeAccessoryValue({
   token: '1234567890',
   url: 'shop-test.myinsales.ru',
   accessoryid: '96',
   accessoryvalueid: '108'
 }).then(response => {
   console.info(response.data);
 }).catch(err => {
   console.error(err);
 });

Output:

 {
   "id": 108,
   "account_id": 1,
   "accessory_id": 96,
   "name_translations": [
     "Значение опции"
   ],
   "price": "7.09",
   "created_at": "2026-10-21T23:16:00.762+03:00",
   "updated_at": "2026-10-21T23:16:00.762+03:00",
   "accounting_variant_id": null,
   "name": "Значение опции"
 }

Params:

NameTypeAttributeDescription
options Object
options.token string

Required, access token for shop

options.url string

Required, shop url

options.accessoryid number | string

Required, accessory id

options.accessoryvalueid number | string

Required, accessory value id

id Number | String

Required, app id

Return:

Promise

public removeApplicationAction(options: Object, id: Number | String): Promise source

import {removeApplicationAction} from 'insales/lib/api/applicationaction.js'

DELETE /admin/application_actions/{application_action_id}.json

Examples:

 insales.removeApplicationAction({
   token: '1234567890',
   url: 'shop-test.myinsales.ru',
   actionid: '1'
 }).then(output => {
   console.info(output.statusCode);
 }).catch(err => {
   console.error(err);
 });

Output:

 200

Params:

NameTypeAttributeDescription
options Object
options.token string

Required, access token for shop

options.url string

Required, shop url

options.actionid number | string

Required, application action id

id Number | String

Required, app id

Return:

Promise

public removeApplicationWidget(options: Object, id: Number | String): Promise source

import {removeApplicationWidget} from 'insales/lib/api/applicationwidget.js'

DELETE /admin/application_widgets/{application_widget_id}.json

Examples:

 insales.removeApplicationWidget({
   token: '1234567890',
   url: 'shop-test.myinsales.ru',
   widgetid: '89'
 }).then(response => {
   console.info(response.data);
 }).catch(err => {
   console.error(err);
 });

Output:

 {
   "status": "ok"
 }

Params:

NameTypeAttributeDescription
options Object
options.token string

Required, access token for shop

options.url string

Required, shop url

options.widgetid number | string

Required, application widget id

id Number | String

Required, app id

Return:

Promise

public removeArticle(options: Object, id: Number | String): Promise source

import {removeArticle} from 'insales/lib/api/article.js'

DELETE /admin/blogs/{blog_id}/articles/{article_id}.json

Examples:

 insales.removeArticle({
   token: '1234567890',
   url: 'shop-test.myinsales.ru',
   blogid: '1',
   articleid: '2'
 }).then(response => {
   console.info(response.data);
 }).catch(err => {
   console.error(err);
 });

Output:

 {
   "status": "ok"
 }

Params:

NameTypeAttributeDescription
options Object
options.token string

Required, access token for shop

options.url string

Required, shop url

options.blogid number | string

Required, blog id

options.articleid number | string

Required, article id

id Number | String

Required, app id

Return:

Promise

public removeAsset(options: Object, id: Number | String): Promise source

import {removeAsset} from 'insales/lib/api/asset.js'

DELETE /admin/themes/#{theme_id}/assets/#{id}.xml

Examples:

 insales.removeAsset({
   token: '1234567890',
   url: 'shop-test.myinsales.ru',
     theme: '643879',
     assetId: '60423000'
 }).then(output => {
   console.info(output.response.statusCode);
 }).catch(err => {
   console.error(err);
 });

Output:

 200

Params:

NameTypeAttributeDescription
options Object
options.token string

Required, access token for shop

options.url string

Required, shop url

options.theme Number | String

Required, theme id

options.assetId Number | String

Required, asset id

id Number | String

Required, app id

Return:

Promise

public removeBlog(options: Object, id: Number | String): Promise source

import {removeBlog} from 'insales/lib/api/blog.js'

DELETE /admin/blogs/{blog_id}.json

Examples:

 insales.removeBlog({
   token: '1234567890',
   url: 'shop-test.myinsales.ru',
   blogid: '1'
 }).then(response => {
   console.info(response.data);
 }).catch(err => {
   console.error(err);
 });

Output:

 {
   "status": "ok"
 }

Params:

NameTypeAttributeDescription
options Object
options.token string

Required, access token for shop

options.url string

Required, shop url

options.blogid number | string

Required, blog id

id Number | String

Required, app id

Return:

Promise

public removeCategory(options: Object, id: Number | String): Promise source

import {removeCategory} from 'insales/lib/api/category.js'

DELETE /admin/categories/{category_id}.json

Examples:

 insales.removeCategory({
   token: '1234567890',
   url: 'shop-test.myinsales.ru',
   categoryid: '6'
 }).then(response => {
   console.info(response.data);
 }).catch(err => {
   console.error(err);
 });

Output:

 {
   "status": "ok"
 }

Params:

NameTypeAttributeDescription
options Object
options.token string

Required, access token for shop

options.url string

Required, shop url

options.categoryid number | string

Required, category id

id Number | String

Required, app id

Return:

Promise

public removeCharacteristic(options: Object, id: Number | String): Promise source

import {removeCharacteristic} from 'insales/lib/api/characteristic.js'

DELETE /admin/properties/{property_id}/characteristics/{characteristic_id}.json

Examples:

 insales.removeCharacteristic({
   token: '1234567890',
   url: 'shop-test.myinsales.ru',
   propertyid: '3',
   characteristicid: '7'
 }).then(response => {
   console.info(response.data);
 }).catch(err => {
   console.error(err);
 });

Output:

 {
   "status": "ok"
 }

Params:

NameTypeAttributeDescription
options Object
options.token string

Required, access token for shop

options.url string

Required, shop url

options.propertyid number | string

Required, property id

options.characteristicid number | string

Required, characteristic id

id Number | String

Required, app id

Return:

Promise

public removeClient(options: Object, id: Number | String): Promise source

import {removeClient} from 'insales/lib/api/client.js'

DELETE /admin/clients/{client_id}.json

Examples:

 insales.removeClient({
   token: '1234567890',
   url: 'shop-test.myinsales.ru',
   clientid: '5'
 }).then(response => {
   console.info(response.data);
 }).catch(err => {
   console.error(err);
 });

Output:

 ok

Params:

NameTypeAttributeDescription
options Object
options.token string

Required, access token for shop

options.url string

Required, shop url

options.clientid number | string

Required, client id

id Number | String

Required, app id

Return:

Promise

public removeClientGroup(options: Object, id: Number | String): Promise source

import {removeClientGroup} from 'insales/lib/api/clientgroup.js'

DELETE /admin/client_groups/{client_group_id}.json

Examples:

 insales.removeClientGroup({
   token: '1234567890',
   url: 'shop-test.myinsales.ru',
   clientgroupid: '1'
 }).then(output => {
   console.info(output.statusCode);
 }).catch(err => {
   console.error(err);
 });

Output:

 200

Params:

NameTypeAttributeDescription
options Object
options.token string

Required, access token for shop

options.url string

Required, shop url

options.clientgroupid number | string

Required, client group id

id Number | String

Required, app id

Return:

Promise

public removeCollect(options: Object, id: Number | String): Promise source

import {removeCollect} from 'insales/lib/api/collect.js'

DELETE /admin/collects/{collect_id}.json

Examples:

 insales.removeCollect({
   token: '1234567890',
   url: 'shop-test.myinsales.ru',
   collectid: '2'
 }).then(response => {
   console.info(response.data);
 }).catch(err => {
   console.error(err);
 });

Output:

 {
   "status": "ok"
 }

Params:

NameTypeAttributeDescription
options Object
options.token string

Required, access token for shop

options.url string

Required, shop url

options.collectid number | string

Required, collect id

id Number | String

Required, app id

Return:

Promise

public removeCollection(options: Object, id: Number | String): Promise source

import {removeCollection} from 'insales/lib/api/collection.js'

DELETE /admin/collections/{collection_id}.json

Examples:

 insales.removeCollection({
   token: '1234567890',
   url: 'shop-test.myinsales.ru',
   collectionid: '6'
 }).then(response => {
   console.info(response.data);
 }).catch(err => {
   console.error(err);
 });

Output:

 {
   "status": "ok"
 }

Params:

NameTypeAttributeDescription
options Object
options.token string

Required, access token for shop

options.url string

Required, shop url

options.collectionid number | string

Required, collection id

id Number | String

Required, app id

Return:

Promise

public removeCollectionField(options: Object, id: Number | String): Promise source

import {removeCollectionField} from 'insales/lib/api/collectionfield.js'

DELETE /admin/collection_fields/{collection_field_id}.json

Examples:

 insales.removeCollectionField({
   token: '1234567890',
   url: 'shop-test.myinsales.ru',
   fieldid: '2'
 }).then(response => {
   console.info(response.data);
 }).catch(err => {
   console.error(err);
 });

Output:

 {
   "status": "ok"
 }

 insales.removeCollectionField({
   token: '1234567890',
   url: 'shop-test.myinsales.ru',
   fieldid: 'handle2'
 }).then(response => {
   console.info(response.data);
 }).catch(err => {
   console.error(err);
 });

Output:

 {
   "status": "ok"
 }

Params:

NameTypeAttributeDescription
options Object
options.token string

Required, access token for shop

options.url string

Required, shop url

options.fieldid number | string

Required, collection field id or handle

id Number | String

Required, app id

Return:

Promise

public removeCollectionFilter(options: Object, id: Number | String): Promise source

import {removeCollectionFilter} from 'insales/lib/api/collectionfilter.js'

DELETE /admin/collection_filters/{filter_id}.json

Examples:

 insales.removeCollectionFilter({
   token: '1234567890',
   url: 'shop-test.myinsales.ru',
   filterid: '1'
 }).then(output => {
   console.info(output.statusCode);
 }).catch(err => {
   console.error(err);
 });

Output:

 200

Params:

NameTypeAttributeDescription
options Object
options.token string

Required, access token for shop

options.url string

Required, shop url

options.filterid number | string

Required, collection filter id

id Number | String

Required, app id

Return:

Promise

public removeCoupon(options: Object, id: Number | String): Promise source

import {removeCoupon} from 'insales/lib/api/coupon.js'

DELETE /admin/discount_codes/{id}.xml

Examples:

 insales.removeCoupon({
   token: '1234567890',
   url: 'shop-test.myinsales.ru',
   couponid: '100000'
 }).then(output => {
   console.info(output.response.statusCode);
 }).catch(err => {
   console.error(err);
 });

Output:

 200

Params:

NameTypeAttributeDescription
options Object
options.token string

Required, access token for shop

options.url string

Required, shop url

options.couponid number | string

Required, coupon id

id Number | String

Required, app id

Return:

Promise

public removeCustomStatus(options: Object, id: Number | String): Promise source

import {removeCustomStatus} from 'insales/lib/api/customstatus.js'

DELETE /admin/custom_statuses/{custom_status_permalink}.json

Examples:

 insales.removeCustomStatus({
   token: '1234567890',
   url: 'shop-test.myinsales.ru',
   permalink: 'novyy'
 }).then(response => {
   console.info(response.data);
 }).catch(err => {
   console.error(err);
 });

Output:

 {
   "status": "ok"
 }

Params:

NameTypeAttributeDescription
options Object
options.token string

Required, access token for shop

options.url string

Required, shop url

options.permalink number | string

Required, custom status permalink

id Number | String

Required, app id

Return:

Promise

public removeDeliveryVariant(options: Object, id: Number | String): Promise source

import {removeDeliveryVariant} from 'insales/lib/api/deliveryvariant.js'

DELETE /admin/delivery_variants/{delivery_variant_id}.json

Examples:

 insales.removeDeliveryVariant({
   token: '1234567890',
   url: 'shop-test.myinsales.ru',
   deliveryvariantid: '2'
 }).then(response => {
   console.info(response.data);
 }).catch(err => {
   console.error(err);
 });

Output:

 {
   "status": "ok"
 }

Params:

NameTypeAttributeDescription
options Object
options.token string

Required, access token for shop

options.url string

Required, shop url

options.deliveryvariantid number | string

Required, delivery variant id

id Number | String

Required, app id

Return:

Promise

public removeDomain(options: Object, id: Number | String): Promise source

import {removeDomain} from 'insales/lib/api/domain.js'

DELETE /admin/domains/{domain_id}.json

Examples:

 insales.removeDomain({
   token: '1234567890',
   url: 'shop-test.myinsales.ru',
   domainid: '40'
 }).then(output => {
   console.info(output.statusCode);
 }).catch(err => {
   console.error(err);
 });

Output:

 200

Params:

NameTypeAttributeDescription
options Object
options.token string

Required, access token for shop

options.url string

Required, shop url

options.domainid number | string

Required, domain id

id Number | String

Required, app id

Return:

Promise

public removeExternalDiscount(options: Object, id: Number | String): Promise source

import {removeExternalDiscount} from 'insales/lib/api/externaldiscount.js'

DELETE /admin/external_discounts/{external_discount_id}.json

Examples:

 insales.removeExternalDiscount({
   token: '1234567890',
   url: 'shop-test.myinsales.ru',
   discountid: '89'
 }).then(response => {
   console.info(response.data);
 }).catch(err => {
   console.error(err);
 });

Output:

 {
   "status": "ok"
 }

Params:

NameTypeAttributeDescription
options Object
options.token string

Required, access token for shop

options.url string

Required, shop url

options.discountid number | string

Required, external discount id

id Number | String

Required, app id

Return:

Promise

public removeField(options: Object, id: Number | String): Promise source

import {removeField} from 'insales/lib/api/field.js'

DELETE /admin/fields/{field_id}.json

Examples:

 insales.removeField({
   token: '1234567890',
   url: 'shop-test.myinsales.ru',
   fieldid: '23'
 }).then(response => {
   console.info(response.data);
 }).catch(err => {
   console.error(err);
 });

Output:

 {
   "status": "ok"
 }

Params:

NameTypeAttributeDescription
options Object
options.token string

Required, access token for shop

options.url string

Required, shop url

options.fieldid number | string

Required, field id

id Number | String

Required, app id

Return:

Promise

public removeFile(options: Object, id: Number | String): Promise source

import {removeFile} from 'insales/lib/api/file.js'

DELETE /admin/files/{id}.xml

Examples:

 insales.removeFile({
   token: '1234567890',
   url: 'shop-test.myinsales.ru',
   fileid: '12345'
 }).then(output => {
   console.info(output.response.statusCode);
 }).catch(err => {
   console.error(err);
 });

Output:

 200

Params:

NameTypeAttributeDescription
options Object
options.token string

Required, access token for shop

options.url string

Required, shop url

options.fileid number | string

Required, file id

id Number | String

Required, app id

Return:

Promise

public removeJsTag(options: Object, id: Number | String): Promise source

import {removeJsTag} from 'insales/lib/api/jstag.js'

DELETE /admin/js_tags/{js_tag_id}.json

Examples:

 insales.removeJsTag({
   token: '1234567890',
   url: 'shop-test.myinsales.ru',
   jstagid: '121'
 }).then(response => {
   console.info(response.data);
 }).catch(err => {
   console.error(err);
 });

Output:

 {
   "status": "ok"
 }

Params:

NameTypeAttributeDescription
options Object
options.token string

Required, access token for shop

options.url string

Required, shop url

options.jstagid number | string

Required, js tag id

id Number | String

Required, app id

Return:

Promise

public removeMarketplace(options: Object, id: Number | String): Promise source

import {removeMarketplace} from 'insales/lib/api/marketplace.js'

DELETE /admin/marketplaces/{ym_marketplace_id}.json

Examples:

 insales.removeMarketplace({
   token: '1234567890',
   url: 'shop-test.myinsales.ru',
   marketplaceid: '153'
 }).then(response => {
   console.info(response.data);
 }).catch(err => {
   console.error(err);
 });

Output:

 {
   "status": "ok"
 }

Params:

NameTypeAttributeDescription
options Object
options.token string

Required, access token for shop

options.url string

Required, shop url

options.marketplaceid number | string

Required, marketplace id

id Number | String

Required, app id

Return:

Promise

public removeMenu(options: Object, id: Number | String): Promise source

import {removeMenu} from 'insales/lib/api/menu.js'

DELETE /admin/menus/{menu_id}.json

Examples:

 insales.removeMenu({
   token: '1234567890',
   url: 'shop-test.myinsales.ru',
   menuid: '1'
 }).then(output => {
   console.info(output.statusCode);
 }).catch(err => {
   console.error(err);
 });

Output:

 200

Params:

NameTypeAttributeDescription
options Object
options.token string

Required, access token for shop

options.url string

Required, shop url

options.menuid number | string

Required, menu id

id Number | String

Required, app id

Return:

Promise

public removeMenuItem(options: Object, id: Number | String): Promise source

import {removeMenuItem} from 'insales/lib/api/menuitem.js'

DELETE /admin/menus/{menu_id}/items/{item_id}.json

Examples:

 insales.removeMenuItem({
   token: '1234567890',
   url: 'shop-test.myinsales.ru',
   menuid: '1',
   itemid: '1'
 }).then(output => {
   console.info(output.statusCode);
 }).catch(err => {
   console.error(err);
 });

Output:

 200

Params:

NameTypeAttributeDescription
options Object
options.token string

Required, access token for shop

options.url string

Required, shop url

options.menuid number | string

Required, menu id

options.itemid number | string

Required, menu item id

id Number | String

Required, app id

Return:

Promise

public removeOAuthApp(options: Object, id: Number | String): Promise source

import {removeOAuthApp} from 'insales/lib/api/oauthapp.js'

DELETE /admin/o_auth_apps/{o_auth_app_id}.json

Examples:

 insales.removeOAuthApp({
   token: '1234567890',
   url: 'shop-test.myinsales.ru',
   oauthappid: '12'
 }).then(response => {
   console.info(response.data);
 }).catch(err => {
   console.error(err);
 });

Output:

 {
   "status": "ok"
 }

Params:

NameTypeAttributeDescription
options Object
options.token string

Required, access token for shop

options.url string

Required, shop url

options.oauthappid number | string

Required, oauth app id

id Number | String

Required, app id

Return:

Promise

public removeOptionName(options: Object, id: Number | String): Promise source

import {removeOptionName} from 'insales/lib/api/optionname.js'

DELETE /admin/option_names/{option_name_id}.json

Examples:

 insales.removeOptionName({
   token: '1234567890',
   url: 'shop-test.myinsales.ru',
   optionnameid: '1'
 }).then(response => {
   console.info(response.data);
 }).catch(err => {
   console.error(err);
 });

Output:

 {
   "status": "ok"
 }

Params:

NameTypeAttributeDescription
options Object
options.token string

Required, access token for shop

options.url string

Required, shop url

options.optionnameid number | string

Required, option name id

id Number | String

Required, app id

Return:

Promise

public removeOptionValue(options: Object, id: Number | String): Promise source

import {removeOptionValue} from 'insales/lib/api/optionvalue.js'

DELETE /admin/option_names/{option_name_id}/option_values/{option_value_id}.json

Examples:

 insales.removeOptionValue({
   token: '1234567890',
   url: 'shop-test.myinsales.ru',
   optionnameid: '1',
   optionvalueid: '20'
 }).then(response => {
   console.info(response.data);
 }).catch(err => {
   console.error(err);
 });

Output:

 {
   "id": 20,
   "jid": 1229
 }

Params:

NameTypeAttributeDescription
options Object
options.token string

Required, access token for shop

options.url string

Required, shop url

options.optionnameid number | string

Required, option name id

options.optionvalueid number | string

Required, option value id

id Number | String

Required, app id

Return:

Promise

public removeOptionValueImage(options: Object, id: Number | String): Promise source

import {removeOptionValueImage} from 'insales/lib/api/optionvalue.js'

DELETE /admin/option_names/{option_name_id}/option_values/{option_value_id}/destroy_image.json

Examples:

 insales.removeOptionValueImage({
   token: '1234567890',
   url: 'shop-test.myinsales.ru',
   optionnameid: '1',
   optionvalueid: '20'
 }).then(response => {
   console.info(response.data);
 }).catch(err => {
   console.error(err);
 });

Output:

 {
   "id": 20,
   "option_name_id": 1,
   "position": 20,
   "title": "Синий-10",
   "image_url": null,
   "permalink": "siniy-10"
 }

Params:

NameTypeAttributeDescription
options Object
options.token string

Required, access token for shop

options.url string

Required, shop url

options.optionnameid number | string

Required, option name id

options.optionvalueid number | string

Required, option value id

id Number | String

Required, app id

Return:

Promise

public removeOutlet(options: Object, id: Number | String): Promise source

import {removeOutlet} from 'insales/lib/api/outlet.js'

DELETE /admin/outlets/{outlet_id}.json

Examples:

 insales.removeOutlet({
   token: '1234567890',
   url: 'shop-test.myinsales.ru',
   outletid: '12'
 }).then(output => {
   console.info(output.statusCode);
 }).catch(err => {
   console.error(err);
 });

Output:

 200

Params:

NameTypeAttributeDescription
options Object
options.token string

Required, access token for shop

options.url string

Required, shop url

options.outletid number | string

Required, outlet id

id Number | String

Required, app id

Return:

Promise

public removePage(options: Object, id: Number | String): Promise source

import {removePage} from 'insales/lib/api/page.js'

DELETE /admin/pages/{page_id}.json

Examples:

 insales.removePage({
   token: '1234567890',
   url: 'shop-test.myinsales.ru',
   pageid: '1'
 }).then(response => {
   console.info(response.data);
 }).catch(err => {
   console.error(err);
 });

Output:

 {
   "status": "ok"
 }

Params:

NameTypeAttributeDescription
options Object
options.token string

Required, access token for shop

options.url string

Required, shop url

options.pageid number | string

Required, page id

id Number | String

Required, app id

Return:

Promise

public removePaymentGateway(options: Object, id: Number | String): Promise source

import {removePaymentGateway} from 'insales/lib/api/paymentgateway.js'

DELETE /admin/payment_gateways/{payment_gateway_id_1}.json

Examples:

 insales.removePaymentGateway({
   token: '1234567890',
   url: 'shop-test.myinsales.ru',
   gatewayid: '1'
 }).then(output => {
   console.info(output.statusCode);
 }).catch(err => {
   console.error(err);
 });

Output:

 200

Params:

NameTypeAttributeDescription
options Object
options.token string

Required, access token for shop

options.url string

Required, shop url

options.gatewayid number | string

Required, payment gateway id

id Number | String

Required, app id

Return:

Promise

public removePriceKind(options: Object, id: Number | String): Promise source

import {removePriceKind} from 'insales/lib/api/pricekind.js'

DELETE /admin/price_kinds/{id}.json

Examples:

 insales.removePriceKind({
   token: '1234567890',
   url: 'shop-test.myinsales.ru',
   id: '111'
 }).then(output => {
   console.info(output.statusCode);
 }).catch(err => {
   console.error(err);
 });

Output:

 200

Params:

NameTypeAttributeDescription
options Object
options.token string

Required, access token for shop

options.url string

Required, shop url

options.id number | string

Required, price kind id

id Number | String

Required, app id

Return:

Promise

public removeProduct(options: Object, id: Number | String): Promise source

import {removeProduct} from 'insales/lib/api/product.js'

DELETE /admin/products/{id}.xml

Examples:

 insales.removeProduct({
   token: '1234567890',
   url: 'shop-test.myinsales.ru',
   productid: '12345'
 }).then(output => {
   console.info(output.response.statusCode);
 }).catch(err => {
   console.error(err);
 });

Output:

 200

Params:

NameTypeAttributeDescription
options Object
options.token string

Required, access token for shop

options.url string

Required, shop url

options.productid number | string

Required, product id

id Number | String

Required, app id

Return:

Promise

public removeProductField(options: Object, id: Number | String): Promise source

import {removeProductField} from 'insales/lib/api/productfield.js'

DELETE /admin/product_fields/{product_field_id}.json

Examples:

 insales.removeProductField({
   token: '1234567890',
   url: 'shop-test.myinsales.ru',
   fieldid: '2'
 }).then(response => {
   console.info(response.data);
 }).catch(err => {
   console.error(err);
 });

Output:

 {
   "status": "ok"
 }

 insales.removeProductField({
   token: '1234567890',
   url: 'shop-test.myinsales.ru',
   fieldid: 'handle2'
 }).then(response => {
   console.info(response.data);
 }).catch(err => {
   console.error(err);
 });

Output:

 {
   "status": "ok"
 }

Params:

NameTypeAttributeDescription
options Object
options.token string

Required, access token for shop

options.url string

Required, shop url

options.fieldid number | string

Required, product field id or handle

id Number | String

Required, app id

Return:

Promise

public removeProductFieldValue(options: Object, id: Number | String): Promise source

import {removeProductFieldValue} from 'insales/lib/api/productfieldvalue.js'

DELETE /admin/products/{product_id}/product_field_values/{product_field_value_id}.json

Examples:

 insales.removeProductFieldValue({
   token: '1234567890',
   url: 'shop-test.myinsales.ru',
   productid: '1',
   valueid: '1'
 }).then(response => {
   console.info(response.data);
 }).catch(err => {
   console.error(err);
 });

Output:

 {
   "status": "ok"
 }

 insales.removeProductFieldValue({
   token: '1234567890',
   url: 'shop-test.myinsales.ru',
   productid: '1',
   valueid: 'handle'
 }).then(response => {
   console.info(response.data);
 }).catch(err => {
   console.error(err);
 });

Output:

 {
   "status": "ok"
 }

Params:

NameTypeAttributeDescription
options Object
options.token string

Required, access token for shop

options.url string

Required, shop url

options.productid number | string

Required, product id

options.valueid number | string

Required, product field value id or field handle

id Number | String

Required, app id

Return:

Promise

public removeProductImage(options: Object, id: Number | String): Promise source

import {removeProductImage} from 'insales/lib/api/productimage.js'

DELETE /admin/products/{product_id}/images/{image_id}.json

Examples:

 insales.removeProductImage({
   token: '1234567890',
   url: 'shop-test.myinsales.ru',
   productid: '1',
   productimageid: '4419'
 }).then(response => {
   console.info(response.data);
 }).catch(err => {
   console.error(err);
 });

Output:

 {
   "status": "ok"
 }

Params:

NameTypeAttributeDescription
options Object
options.token string

Required, access token for shop

options.url string

Required, shop url

options.productid number | string

Required, product id

options.productimageid number | string

Required, product image id

id Number | String

Required, app id

Return:

Promise

public removeProperty(options: Object, id: Number | String): Promise source

import {removeProperty} from 'insales/lib/api/property.js'

DELETE /admin/properties/{property_id}.json

Examples:

 insales.removeProperty({
   token: '1234567890',
   url: 'shop-test.myinsales.ru',
   propertyid: '1'
 }).then(response => {
   console.info(response.data);
 }).catch(err => {
   console.error(err);
 });

Output:

 {
   "status": "ok"
 }

Params:

NameTypeAttributeDescription
options Object
options.token string

Required, access token for shop

options.url string

Required, shop url

options.propertyid number | string

Required, property id

id Number | String

Required, app id

Return:

Promise

public removeRecurring(options: Object, id: Number | String): Promise source

import {removeRecurring} from 'insales/lib/api/recurringcharge.js'

DELETE /admin/recurring_application_charge.xml

Examples:

 insales.changeRecurring({
   token: '1234567890',
   url: 'shop-test.myinsales.ru'
 }).then(output => {
   console.info(output.response.statusCode);
 }).catch(err => {
   console.error(err);
 });

Output:

 200

Params:

NameTypeAttributeDescription
options Object
options.token string

Required, access token for shop

options.url string

Required, shop url

id Number | String

Required, app id

Return:

Promise

public removeRedirect(options: Object, id: Number | String): Promise source

import {removeRedirect} from 'insales/lib/api/redirect.js'

DELETE /admin/redirects/{redirect_id}.json

Examples:

 insales.removeRedirect({
   token: '1234567890',
   url: 'shop-test.myinsales.ru',
   redirectid: '18'
 }).then(response => {
   console.info(response.data);
 }).catch(err => {
   console.error(err);
 });

Output:

 {
   "status": "ok"
 }

Params:

NameTypeAttributeDescription
options Object
options.token string

Required, access token for shop

options.url string

Required, shop url

options.redirectid number | string

Required, redirect id

id Number | String

Required, app id

Return:

Promise

public removeReview(options: Object, id: Number | String): Promise source

import {removeReview} from 'insales/lib/api/review.js'

DELETE /admin/reviews/{review_id}.json

Examples:

 insales.removeReview({
   token: '1234567890',
   url: 'shop-test.myinsales.ru',
   reviewid: '1'
 }).then(response => {
   console.info(response.data);
 }).catch(err => {
   console.error(err);
 });

Output:

 {
   "status": "ok"
 }

Params:

NameTypeAttributeDescription
options Object
options.token string

Required, access token for shop

options.url string

Required, shop url

options.reviewid number | string

Required, review id

id Number | String

Required, app id

Return:

Promise

public removeSalesChannel(options: Object, id: Number | String): Promise source

import {removeSalesChannel} from 'insales/lib/api/saleschannel.js'

DELETE /admin/sales_channels/{sales_channel_id}.json

Examples:

 insales.removeSalesChannel({
   token: '1234567890',
   url: 'shop-test.myinsales.ru',
   saleschannelid: '3'
 }).then(response => {
   console.info(response.data);
 }).catch(err => {
   console.error(err);
 });

Output:

 {
   "status": "ok"
 }

Params:

NameTypeAttributeDescription
options Object
options.token string

Required, access token for shop

options.url string

Required, shop url

options.saleschannelid number | string

Required, sales channel id

id Number | String

Required, app id

Return:

Promise

public removeSimilar(options: Object, id: Number | String): Promise source

import {removeSimilar} from 'insales/lib/api/similar.js'

DELETE /admin/products/{product_id}/similars/{similar_id}.json

Examples:

 insales.removeSimilar({
   token: '1234567890',
   url: 'shop-test.myinsales.ru',
   productid: '1',
   similarid: '1'
 }).then(response => {
   console.info(response.data);
 }).catch(err => {
   console.error(err);
 });

Output:

 {
   "status": "ok"
 }

Params:

NameTypeAttributeDescription
options Object
options.token string

Required, access token for shop

options.url string

Required, shop url

options.productid number | string

Required, product id

options.similarid number | string

Required, similar id

id Number | String

Required, app id

Return:

Promise

public removeSupplementary(options: Object, id: Number | String): Promise source

import {removeSupplementary} from 'insales/lib/api/supplementary.js'

DELETE /admin/products/{product_id}/supplementaries/{supplementary_id}.json

Examples:

 insales.removeSupplementary({
   token: '1234567890',
   url: 'shop-test.myinsales.ru',
   productid: '1',
   supplementaryid: '1'
 }).then(response => {
   console.info(response.data);
 }).catch(err => {
   console.error(err);
 });

Output:

 {
   "status": "ok"
 }

Params:

NameTypeAttributeDescription
options Object
options.token string

Required, access token for shop

options.url string

Required, shop url

options.productid number | string

Required, product id

options.supplementaryid number | string

Required, supplementary id

id Number | String

Required, app id

Return:

Promise

public removeUserTask(options: Object, id: Number | String): Promise source

import {removeUserTask} from 'insales/lib/api/usertask.js'

DELETE /admin/user_tasks/{user_task_id}.json

Examples:

 insales.removeUserTask({
   token: '1234567890',
   url: 'shop-test.myinsales.ru',
   taskid: '12'
 }).then(output => {
   console.info(output.statusCode);
 }).catch(err => {
   console.error(err);
 });

Output:

 200

Params:

NameTypeAttributeDescription
options Object
options.token string

Required, access token for shop

options.url string

Required, shop url

options.taskid number | string

Required, user task id

id Number | String

Required, app id

Return:

Promise

public removeVariant(options: Object, id: Number | String): Promise source

import {removeVariant} from 'insales/lib/api/variant.js'

DELETE /admin/products/{product_id}/variants/{variant_success_id}.json

Examples:

 insales.removeVariant({
   token: '1234567890',
   url: 'shop-test.myinsales.ru',
   productid: '1',
   variantid: '509945724'
 }).then(response => {
   console.info(response.data);
 }).catch(err => {
   console.error(err);
 });

Output:

 {
   "status": "ok"
 }

Params:

NameTypeAttributeDescription
options Object
options.token string

Required, access token for shop

options.url string

Required, shop url

options.productid number | string

Required, product id

options.variantid number | string

Required, variant id

id Number | String

Required, app id

Return:

Promise

public removeVariantField(options: Object, id: Number | String): Promise source

import {removeVariantField} from 'insales/lib/api/variantfield.js'

DELETE /admin/variant_fields/{variant_field_id}.json

Examples:

 insales.removeVariantField({
   token: '1234567890',
   url: 'shop-test.myinsales.ru',
   fieldid: '2'
 }).then(response => {
   console.info(response.data);
 }).catch(err => {
   console.error(err);
 });

Output:

 {
   "status": "ok"
 }

 insales.removeVariantField({
   token: '1234567890',
   url: 'shop-test.myinsales.ru',
   fieldid: 'handle2'
 }).then(response => {
   console.info(response.data);
 }).catch(err => {
   console.error(err);
 });

Output:

 {
   "status": "ok"
 }

Params:

NameTypeAttributeDescription
options Object
options.token string

Required, access token for shop

options.url string

Required, shop url

options.fieldid number | string

Required, variant field id or handle

id Number | String

Required, app id

Return:

Promise

public removeVariantFieldValue(options: Object, id: Number | String): Promise source

import {removeVariantFieldValue} from 'insales/lib/api/variantfieldvalue.js'

DELETE /admin/variants/{variant_id}/variant_field_values/{variant_field_value_id}.json

Examples:

 insales.removeVariantFieldValue({
   token: '1234567890',
   url: 'shop-test.myinsales.ru',
   variantid: '1',
   valueid: '1'
 }).then(response => {
   console.info(response.data);
 }).catch(err => {
   console.error(err);
 });

Output:

 {
   "status": "ok"
 }

 insales.removeVariantFieldValue({
   token: '1234567890',
   url: 'shop-test.myinsales.ru',
   variantid: '1',
   valueid: 'handle'
 }).then(response => {
   console.info(response.data);
 }).catch(err => {
   console.error(err);
 });

Output:

 {
   "status": "ok"
 }

Params:

NameTypeAttributeDescription
options Object
options.token string

Required, access token for shop

options.url string

Required, shop url

options.variantid number | string

Required, variant id

options.valueid number | string

Required, variant field value id or field handle

id Number | String

Required, app id

Return:

Promise

public removeWarehouse(options: Object, id: Number | String): Promise source

import {removeWarehouse} from 'insales/lib/api/warehouse.js'

DELETE /admin/warehouses/{warehouse_id}.json

Examples:

 insales.removeWarehouse({
   token: '1234567890',
   url: 'shop-test.myinsales.ru',
   warehouseid: '47'
 }).then(output => {
   console.info(output.statusCode);
 }).catch(err => {
   console.error(err);
 });

Output:

 202

Params:

NameTypeAttributeDescription
options Object
options.token string

Required, access token for shop

options.url string

Required, shop url

options.warehouseid number | string

Required, warehouse id

id Number | String

Required, app id

Return:

Promise

public removeWebhook(options: Object, id: Number | String): Promise source

import {removeWebhook} from 'insales/lib/api/webhook.js'

DELETE /admin/webhooks/{webhook_id}.json

Examples:

 insales.removeWebhook({
   token: '1234567890',
   url: 'shop-test.myinsales.ru',
   webhookid: '18'
 }).then(response => {
   console.info(response.data);
 }).catch(err => {
   console.error(err);
 });

Output:

 {
   "status": "ok"
 }

Params:

NameTypeAttributeDescription
options Object
options.token string

Required, access token for shop

options.url string

Required, shop url

options.webhookid number | string

Required, webhook id

id Number | String

Required, app id

Return:

Promise

public removeWidgetType(options: Object, id: Number | String): Promise source

import {removeWidgetType} from 'insales/lib/api/widget_types.js'

DELETE /admin/themes/#{theme_id}/widget_types/#{id}.xml

Examples:

 insales.removeWidgetType({
   token: '1234567890',
   url: 'shop-test.myinsales.ru',
   theme: '643879',
   widgetId: '60423000'
 }).then(output => {
   console.info(output.response.statusCode);
 }).catch(err => {
   console.error(err);
 });

Output:

 200

Params:

NameTypeAttributeDescription
options Object
options.token string

Required, access token for shop

options.url string

Required, shop url

options.theme Number | String

Required, theme id

options.widgetId Number | String

Required, widget id

id Number | String

Required, app id

Return:

Promise

public renameAsset(options: Object, id: Number | String): Promise source

import {renameAsset} from 'insales/lib/api/asset.js'

PUT /admin/themes/#{theme_id}/assets/#{id}/rename.xml

Examples:

 insales.renameAsset({
   token: '1234567890',
   url: 'shop-test.myinsales.ru',
   theme: '643879',
   assetId: '60423000',
   assets: {
     'asset': {
       'new_name': 'page.amazing_new_page.liquid'
     }
   }
 }).then(output => {
   console.info(output.response.statusCode);
 }).catch(err => {
   console.error(err);
 });

Output:

 { asset:
   { id: '60423000',
     'theme-id': '643879',
     type: 'Asset::Template',
     name: 'page.amazing_new_page.liquid',
     'content-type': 'text/x-liquid',
     'file-size': '42',
     'human-readable-name': 'Страница: amazing_new_page' } }

Params:

NameTypeAttributeDescription
options Object
options.token string

Required, access token for shop

options.url string

Required, shop url

options.assets Object

Required, asset new_name

options.theme Number | String

Required, theme id

options.assetId Number | String

Required, asset id

id Number | String

Required, app id

Return:

Promise

public request(r: Object): Promise source

import {request} from 'insales/lib/request.js'

Events of Request-Promise

Params:

NameTypeAttributeDescription
r Object

Required, request-promise

Return:

Promise

public token(token: String | Number, secret: String | Number): String source

import {token} from 'insales/lib/api/token.js'

Generate access token for shop

Examples:

 insales.token('12345');

Output:

 8cfa2282b17de0a598c010f5f0109e7d

Params:

NameTypeAttributeDescription
token String | Number

Required, token receive when install app

secret String | Number

Required, app secret

Return:

String

access token

public uploadAsset(options: Object, id: Number | String): Promise source

import {uploadAsset} from 'insales/lib/api/asset.js'

POST /admin/themes/#{theme_id}/assets.xml

Examples:

 insales.uploadAsset({
   token: '1234567890',
   url: 'shop-test.myinsales.ru',
   theme: '643879',
   asset: {
      'name': 'logo.png',
      'src': 'http://www.insales.ru/assets/images/content/logo.png',
      'type': 'Asset::Media'
      }
 }).then(output => {
   console.info(output.data);
 }).catch(err => {
   console.error(err);
 });

Output:

 { asset:
    { id: '60374631',
      'theme-id': '643879',
      type: 'Asset::Media',
      name: 'logo.png',
      'content-type': 'image/jpeg',
      'file-size': '71373',
      'human-readable-name': 'logo.png',
        asset_url: '/assets/1/4903/643879/v_1467231594/logo.png?1467234697' } }

Params:

NameTypeAttributeDescription
options Object
options.token string

Required, access token for shop

options.url string

Required, shop url

options.theme Number | String

Required, theme id

id Number | String

Required, app id

options.asset object

Required, asset property

Return:

Promise

public uploadFile(options: Object, id: Number | String): Promise source

import {uploadFile} from 'insales/lib/api/file.js'

POST /admin/files.xml

Examples:

 insales.uploadFile({
   token: '1234567890',
   url: 'shop-test.myinsales.ru',
   files: {
      'file': {
        'src': 'http://url'
      }
   }
 }).then(output => {
   console.info(output.data);
 }).catch(err => {
   console.error(err);
 });

Output:

 { file:
   { 'created-at': '2011-11-11T11:11:11+03:00',
     id: '111111',
     'absolute-url': 'http://static-internal.insales.ru' } }

Params:

NameTypeAttributeDescription
options Object
options.token string

Required, access token for shop

options.url string

Required, shop url

options.file object

Required, url to file

id Number | String

Required, app id

Return:

Promise

public uploadWidgetType(options: Object, id: Number | String): Promise source

import {uploadWidgetType} from 'insales/lib/api/widget_types.js'

POST /admin/themes/#{theme_id}/widget_types.xml

Examples:

 insales.uploadWidgetType({
   token: '1234567890',
   url: 'shop-test.myinsales.ru',
   theme: '643879',
   data: {

'type': 'BlockListWidgetType', 'handle': 'widget_type_2', 'name': 'WidgetType 2', 'widget_category_handle': 'drugie', 'page_kinds': ['all'], 'widget_list_kinds': ['content'], 'block_template_handle': 'system-title-and-content' } }).then(output => { console.info(output.data); }).catch(err => { console.error(err); }); Output:

   {

'type': 'BlockListWidgetType', 'handle': 'widget_type_2', 'name': 'WidgetType 2', 'widget_category_handle': 'drugie', 'page_kinds': ['all'], 'widget_list_kinds': ['content'], 'block_template_handle': 'system-title-and-content' }

Params:

NameTypeAttributeDescription
options Object
options.token string

Required, access token for shop

options.url string

Required, shop url

options.theme Number | String

Required, theme id

id Number | String

Required, app id

options.data object

Required, widget property

Return:

Promise