InSales API documentation

Accessories

Create accessory

Endpoint

POST /admin/accessories.json

Parameters

Name Description
accessory[name] required Наименование
accessory[max_count] required Максимальное количество опций в заказе
accessory[min_count] required Минимальное количество опций в заказе
accessory[permalink] required Идентификатор

Request

Route

POST /admin/accessories.json

Headers

Content-Type: application/json
Authorization: Basic ZGlnaXRhbC1nb29kczpjNTFjOTA3MDdhMTNjZTNmZmYyMTNhZmJiNWNkMTI3MA==

Body

{
  "accessory": {
    "name": "Опция 1",
    "max_count": 8,
    "min_count": 7,
    "permalink": "opcia-1"
  }
}

Response

Simulated Response

Status

201

Headers

API-Usage-Limit: 1/500
Content-Type: application/json; charset=utf-8

Body

{
  "id": 40,
  "account_id": 1,
  "name_translations": [
    "Опция 1"
  ],
  "min_count": 7,
  "max_count": 8,
  "created_at": "2024-10-05T00:56:37.272+03:00",
  "updated_at": "2024-10-05T00:56:37.272+03:00",
  "back_office_name": "Опция 1",
  "permalink": "opcia-1",
  "name": "Опция 1"
}

Destroy accessory

Endpoint

DELETE /admin/accessories/:accessory_id.json

Request

Route

DELETE /admin/accessories/68.json

Headers

Content-Type: application/json
Authorization: Basic ZGlnaXRhbC1nb29kczpjNTFjOTA3MDdhMTNjZTNmZmYyMTNhZmJiNWNkMTI3MA==

Response

Simulated Response

Status

200

Headers

API-Usage-Limit: 1/500
Content-Type: application/json; charset=utf-8

Body

{
  "id": 68,
  "account_id": 1,
  "name_translations": [
    "Маленький Хлопковый Клавиатура"
  ],
  "min_count": 2,
  "max_count": 5,
  "created_at": "2024-10-05T00:56:37.764+03:00",
  "updated_at": "2024-10-05T00:56:37.764+03:00",
  "back_office_name": "Потрясающий Льняной Ремень",
  "permalink": "incidunt_velit",
  "name": "Маленький Хлопковый Клавиатура"
}

Get accessories

Endpoint

GET /admin/accessories.json

Request

Route

GET /admin/accessories.json

Headers

Authorization: Basic ZGlnaXRhbC1nb29kczpjNTFjOTA3MDdhMTNjZTNmZmYyMTNhZmJiNWNkMTI3MA==

Response

Simulated Response

Status

200

Headers

API-Usage-Limit: 1/500
Content-Type: application/json; charset=utf-8

Body

[
  {
    "id": 7,
    "account_id": 1,
    "name_translations": [
      "Опция 0"
    ],
    "min_count": 1,
    "max_count": 3,
    "created_at": "2024-10-05T00:56:36.656+03:00",
    "updated_at": "2024-10-05T00:56:36.656+03:00",
    "back_office_name": "Эргономичный Алюминиевый Кулон",
    "permalink": "quidem_dolorum",
    "name": "Опция 0"
  },
  {
    "id": 8,
    "account_id": 1,
    "name_translations": [
      "Опция 1"
    ],
    "min_count": 4,
    "max_count": 9,
    "created_at": "2024-10-05T00:56:36.666+03:00",
    "updated_at": "2024-10-05T00:56:36.666+03:00",
    "back_office_name": "Потрясающий Бумажный Свитер",
    "permalink": "molestiae_deleniti",
    "name": "Опция 1"
  },
  {
    "id": 9,
    "account_id": 1,
    "name_translations": [
      "Опция 2"
    ],
    "min_count": 1,
    "max_count": 3,
    "created_at": "2024-10-05T00:56:36.674+03:00",
    "updated_at": "2024-10-05T00:56:36.674+03:00",
    "back_office_name": "Огромный Кожаный Пальто",
    "permalink": "aliquam_odit",
    "name": "Опция 2"
  },
  {
    "id": 10,
    "account_id": 1,
    "name_translations": [
      "Опция 0"
    ],
    "min_count": 3,
    "max_count": 3,
    "created_at": "2024-10-05T00:56:36.683+03:00",
    "updated_at": "2024-10-05T00:56:36.683+03:00",
    "back_office_name": "Интеллектуальный Хлопковый Часы",
    "permalink": "porro_autem",
    "name": "Опция 0"
  },
  {
    "id": 11,
    "account_id": 1,
    "name_translations": [
      "Опция 1"
    ],
    "min_count": 8,
    "max_count": 8,
    "created_at": "2024-10-05T00:56:36.692+03:00",
    "updated_at": "2024-10-05T00:56:36.692+03:00",
    "back_office_name": "Практичный Бронзовый Клавиатура",
    "permalink": "ea_voluptatem",
    "name": "Опция 1"
  },
  {
    "id": 12,
    "account_id": 1,
    "name_translations": [
      "Опция 2"
    ],
    "min_count": 3,
    "max_count": 8,
    "created_at": "2024-10-05T00:56:36.700+03:00",
    "updated_at": "2024-10-05T00:56:36.700+03:00",
    "back_office_name": "Прочный Деревянный Нож",
    "permalink": "sed_quos",
    "name": "Опция 2"
  }
]

Get accessory

Endpoint

GET /admin/accessories/:accessory_id.json

Request

Route

GET /admin/accessories/26.json

Headers

Authorization: Basic ZGlnaXRhbC1nb29kczpjNTFjOTA3MDdhMTNjZTNmZmYyMTNhZmJiNWNkMTI3MA==

Response

Simulated Response

Status

200

Headers

API-Usage-Limit: 1/500
Content-Type: application/json; charset=utf-8

Body

{
  "id": 26,
  "account_id": 1,
  "name_translations": [
    "Огромный Кожаный Клавиатура"
  ],
  "min_count": 1,
  "max_count": 8,
  "created_at": "2024-10-05T00:56:36.950+03:00",
  "updated_at": "2024-10-05T00:56:36.950+03:00",
  "back_office_name": "Фантастический Бронзовый Ботинок",
  "permalink": "autem_minus",
  "name": "Огромный Кожаный Клавиатура"
}

Update accessory

Endpoint

PUT /admin/accessories/:accessory_id.json

Parameters

Name Description
accessory[name] Наименование
accessory[max_count] Максимальное количество опций в заказе
accessory[min_count] Минимальное количество опций в заказе
accessory[permalink] Идентификатор

Request

Route

PUT /admin/accessories/54.json

Headers

Content-Type: application/json
Authorization: Basic ZGlnaXRhbC1nb29kczpjNTFjOTA3MDdhMTNjZTNmZmYyMTNhZmJiNWNkMTI3MA==

Body

{
  "accessory": {
    "name": "Опция 1",
    "max_count": 8,
    "min_count": 4,
    "permalink": "opcia-1"
  }
}

Response

Simulated Response

Status

200

Headers

API-Usage-Limit: 1/500
Content-Type: application/json; charset=utf-8

Body

{
  "account_id": 1,
  "name": "Опция 1",
  "min_count": 4,
  "max_count": 8,
  "permalink": "opcia-1",
  "id": 54,
  "name_translations": [
    "Опция 1"
  ],
  "created_at": "2024-10-05T00:56:37.488+03:00",
  "updated_at": "2024-10-05T00:56:37.539+03:00",
  "back_office_name": "Легкий Пластиковый Свитер"
}

AccessoryValues

Create accessory value

Endpoint

POST /admin/accessories/:accessory_id/values.json

Parameters

Name Description
accessory_value[name] required Название
accessory_value[price] required Цена
accessory_value[accounting_variant_id] Идентификатор списываемого товара

Request

Route

POST /admin/accessories/74/values.json

Headers

Content-Type: application/json
Authorization: Basic ZGlnaXRhbC1nb29kczpjNTFjOTA3MDdhMTNjZTNmZmYyMTNhZmJiNWNkMTI3MA==

Body

{
  "accessory_value": {
    "name": "Значение опции",
    "price": 100.0,
    "accounting_variant_id": null
  }
}

Response

Simulated Response

Status

201

Headers

API-Usage-Limit: 1/500
Content-Type: application/json; charset=utf-8

Body

{
  "id": 44,
  "account_id": 1,
  "accessory_id": 74,
  "name_translations": [
    "Значение опции"
  ],
  "price": "100.0",
  "accounting_variant_id": null,
  "created_at": "2024-10-05T00:56:38.937+03:00",
  "updated_at": "2024-10-05T00:56:38.937+03:00",
  "name": "Значение опции"
}

Destroy accessory value

Endpoint

DELETE /admin/accessories/:accessory_id/values/:accessory_value_id.json

Request

Route

DELETE /admin/accessories/78/values/66.json

Headers

Content-Type: application/json
Authorization: Basic ZGlnaXRhbC1nb29kczpjNTFjOTA3MDdhMTNjZTNmZmYyMTNhZmJiNWNkMTI3MA==

Response

Simulated Response

Status

200

Headers

API-Usage-Limit: 1/500
Content-Type: application/json; charset=utf-8

Body

{
  "id": 66,
  "account_id": 1,
  "accessory_id": 78,
  "name_translations": [
    "Значение опции"
  ],
  "price": "3.57",
  "accounting_variant_id": null,
  "created_at": "2024-10-05T00:56:39.317+03:00",
  "updated_at": "2024-10-05T00:56:39.317+03:00",
  "name": "Значение опции"
}

Get accessory value

Endpoint

GET /admin/accessories/:accessory_id/values/:accessory_value_id.json

Request

Route

GET /admin/accessories/72/values/22.json

Headers

Authorization: Basic ZGlnaXRhbC1nb29kczpjNTFjOTA3MDdhMTNjZTNmZmYyMTNhZmJiNWNkMTI3MA==

Response

Simulated Response

Status

200

Headers

API-Usage-Limit: 1/500
Content-Type: application/json; charset=utf-8

Body

{
  "id": 22,
  "account_id": 1,
  "accessory_id": 72,
  "name_translations": [
    "Значение опции"
  ],
  "price": "9.15",
  "accounting_variant_id": null,
  "created_at": "2024-10-05T00:56:38.244+03:00",
  "updated_at": "2024-10-05T00:56:38.244+03:00",
  "name": "Значение опции"
}

Get accessory values

Endpoint

GET /admin/accessories/:accessory_id/values.json

Request

Route

GET /admin/accessories/70/values.json

Headers

Authorization: Basic ZGlnaXRhbC1nb29kczpjNTFjOTA3MDdhMTNjZTNmZmYyMTNhZmJiNWNkMTI3MA==

Response

Simulated Response

Status

200

Headers

API-Usage-Limit: 1/500
Content-Type: application/json; charset=utf-8

Body

[
  {
    "id": 8,
    "account_id": 1,
    "accessory_id": 70,
    "name_translations": [
      "Значение опции"
    ],
    "price": "9.79",
    "accounting_variant_id": null,
    "created_at": "2024-10-05T00:56:38.004+03:00",
    "updated_at": "2024-10-05T00:56:38.004+03:00",
    "name": "Значение опции"
  },
  {
    "id": 9,
    "account_id": 1,
    "accessory_id": 70,
    "name_translations": [
      "Значение опции 0"
    ],
    "price": "6.32",
    "accounting_variant_id": null,
    "created_at": "2024-10-05T00:56:38.010+03:00",
    "updated_at": "2024-10-05T00:56:38.010+03:00",
    "name": "Значение опции 0"
  },
  {
    "id": 10,
    "account_id": 1,
    "accessory_id": 70,
    "name_translations": [
      "Значение опции 1"
    ],
    "price": "2.75",
    "accounting_variant_id": null,
    "created_at": "2024-10-05T00:56:38.016+03:00",
    "updated_at": "2024-10-05T00:56:38.016+03:00",
    "name": "Значение опции 1"
  },
  {
    "id": 11,
    "account_id": 1,
    "accessory_id": 70,
    "name_translations": [
      "Значение опции 2"
    ],
    "price": "4.76",
    "accounting_variant_id": null,
    "created_at": "2024-10-05T00:56:38.023+03:00",
    "updated_at": "2024-10-05T00:56:38.023+03:00",
    "name": "Значение опции 2"
  },
  {
    "id": 12,
    "account_id": 1,
    "accessory_id": 70,
    "name_translations": [
      "Значение опции 0"
    ],
    "price": "8.58",
    "accounting_variant_id": null,
    "created_at": "2024-10-05T00:56:38.029+03:00",
    "updated_at": "2024-10-05T00:56:38.029+03:00",
    "name": "Значение опции 0"
  },
  {
    "id": 13,
    "account_id": 1,
    "accessory_id": 70,
    "name_translations": [
      "Значение опции 1"
    ],
    "price": "4.68",
    "accounting_variant_id": null,
    "created_at": "2024-10-05T00:56:38.040+03:00",
    "updated_at": "2024-10-05T00:56:38.040+03:00",
    "name": "Значение опции 1"
  },
  {
    "id": 14,
    "account_id": 1,
    "accessory_id": 70,
    "name_translations": [
      "Значение опции 2"
    ],
    "price": "3.86",
    "accounting_variant_id": null,
    "created_at": "2024-10-05T00:56:38.048+03:00",
    "updated_at": "2024-10-05T00:56:38.048+03:00",
    "name": "Значение опции 2"
  }
]

Update accessory value

Endpoint

PUT /admin/accessories/:accessory_id/values/:accessory_value_id.json

Parameters

Name Description
accessory_value[name] Название
accessory_value[price] Цена
accessory_value[accounting_variant_id] Идентификатор списываемого товара

Request

Route

PUT /admin/accessories/76/values/52.json

Headers

Content-Type: application/json
Authorization: Basic ZGlnaXRhbC1nb29kczpjNTFjOTA3MDdhMTNjZTNmZmYyMTNhZmJiNWNkMTI3MA==

Body

{
  "accessory_value": {
    "name": "Обновлённое значение опции",
    "price": 200.0,
    "accounting_variant_id": null
  }
}

Response

Simulated Response

Status

200

Headers

API-Usage-Limit: 1/500
Content-Type: application/json; charset=utf-8

Body

{
  "accessory_id": 76,
  "name": "Обновлённое значение опции",
  "price": "200.0",
  "accounting_variant_id": null,
  "name_translations": [
    "Обновлённое значение опции"
  ],
  "id": 52,
  "account_id": 1,
  "created_at": "2024-10-05T00:56:39.089+03:00",
  "updated_at": "2024-10-05T00:56:39.175+03:00"
}

Account

Get account

Endpoint

GET admin/account.json

Request

Route

GET admin/account.json

Headers

Authorization: Basic ZGlnaXRhbC1nb29kczpjNTFjOTA3MDdhMTNjZTNmZmYyMTNhZmJiNWNkMTI3MA==

Response

Simulated Response

Status

200

Headers

API-Usage-Limit: 1/500
Content-Type: application/json; charset=utf-8

Body

{
  "id": 1,
  "subdomain": "quentin",
  "organization": "InSales, ltd",
  "contact_phone": "+79993332211",
  "notification_email": null,
  "inviter_id": null,
  "blocked": false,
  "created_at": "2008-12-31T03:00:00.000+03:00",
  "hide_items_out_of_stock": false,
  "country": null,
  "city": null,
  "enable_order_discounts": false,
  "enable_client_discounts": false,
  "enable_group_discounts": false,
  "enable_cart_discounts": false,
  "state": null,
  "registration_type_id": 0,
  "paid_till": "2009-03-02",
  "sms_notification_phone": null,
  "default_vat": 10,
  "email": "somone@anyone.com",
  "icq": null,
  "phone": "+7 812 309 51 21",
  "title": "My account",
  "minimum_items_price": null,
  "stock_currency_exchange_rate": "30.0",
  "client_cookies_whitelist": null,
  "main_host": "quentin.insales.io:3002",
  "main_host_protocol": "http",
  "next_order_number": 1006,
  "time_zone": null,
  "owner": {
    "id": 1,
    "name": "quentin",
    "email": "quentin@example.com",
    "created_at": "2024-09-30T00:55:58.000+03:00"
  }
}

Update account

Endpoint

PUT /admin/account.json

Parameters

Name Description
account[client_cookies_whitelist] cookies whitelist

Request

Route

PUT /admin/account.json

Headers

Content-Type: application/json
Authorization: Basic ZGlnaXRhbC1nb29kczpjNTFjOTA3MDdhMTNjZTNmZmYyMTNhZmJiNWNkMTI3MA==

Body

{
  "account": {
    "client_cookies_whitelist": "my_cookie"
  }
}

Response

Simulated Response

Status

200

Headers

API-Usage-Limit: 1/500
Content-Type: application/json; charset=utf-8

Body

{
  "status": "ok"
}

ApplicationAction

Create application_action

Endpoint

POST /admin/application_actions.json

Parameters

Name Description
application_action[title] required title to show in backoffice
application_action[handle] required unique string identifier
application_action[entity] required string, defines entity that action belongs to: order, product, client, discount_code, file, page, article, collection_filter
application_action[url] required URL to which POST request with serialized entities will be made

Request

Route

POST /admin/application_actions.json

Headers

Content-Type: application/json
Authorization: Basic ZGlnaXRhbC1nb29kczpjNTFjOTA3MDdhMTNjZTNmZmYyMTNhZmJiNWNkMTI3MA==

Body

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

Response

Simulated Response

Status

201

Headers

API-Usage-Limit: 1/500
Content-Type: application/json; charset=utf-8

Body

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

Destroy application_action

Endpoint

DELETE /admin/application_actions/:application_action_id.json

Request

Route

DELETE /admin/application_actions/1.json

Headers

Content-Type: application/json
Authorization: Basic ZGlnaXRhbC1nb29kczpjNTFjOTA3MDdhMTNjZTNmZmYyMTNhZmJiNWNkMTI3MA==

Response

Simulated Response

Status

200

Headers

API-Usage-Limit: 1/500
Content-Type: application/json

Get application actions

Endpoint

GET /admin/application_actions.json

Request

Route

GET /admin/application_actions.json

Headers

Authorization: Basic ZGlnaXRhbC1nb29kczpjNTFjOTA3MDdhMTNjZTNmZmYyMTNhZmJiNWNkMTI3MA==

Response

Simulated Response

Status

200

Headers

API-Usage-Limit: 1/500
Content-Type: application/json; charset=utf-8

Body

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

Get application_action

Endpoint

GET /admin/application_actions/:application_action_id.json

Request

Route

GET /admin/application_actions/1.json

Headers

Authorization: Basic ZGlnaXRhbC1nb29kczpjNTFjOTA3MDdhMTNjZTNmZmYyMTNhZmJiNWNkMTI3MA==

Response

Simulated Response

Status

200

Headers

API-Usage-Limit: 1/500
Content-Type: application/json; charset=utf-8

Body

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

Update application_action

Endpoint

PUT /admin/application_actions/:application_action_id.json

Parameters

Name Description
application_action[title] title to show in backoffice
application_action[handle] unique string identifier
application_action[entity] string, defines entity that action belongs to: order, product, client, discount_code, file, page, article, collection_filter
application_action[url] URL to which POST request with serialized entities will be made

Request

Route

PUT /admin/application_actions/1.json

Headers

Content-Type: application/json
Authorization: Basic ZGlnaXRhbC1nb29kczpjNTFjOTA3MDdhMTNjZTNmZmYyMTNhZmJiNWNkMTI3MA==

Body

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

Response

Simulated Response

Status

200

Headers

API-Usage-Limit: 1/500
Content-Type: application/json; charset=utf-8

Body

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

ApplicationCharge

Create application_charge

Endpoint

POST /admin/application_charges.json

Parameters

Name Description
application_charge[name] required purpose of payment
application_charge[price] required bill amount
application_charge[return_url] url for notification about payment
application_charge[test] flag for debugging purpose; if true, bill can be confirmed without payment; false by default

Request

Route

POST /admin/application_charges.json

Headers

Content-Type: application/json
Authorization: Basic ZGlnaXRhbC1nb29kczpjNTFjOTA3MDdhMTNjZTNmZmYyMTNhZmJiNWNkMTI3MA==

Body

{
  "application_charge": {
    "name": "Payment for premium",
    "price": 300,
    "return_url": "http://app.my/check_payment_url/%id_in_my_application%",
    "test": true
  }
}

Response

Simulated Response

Status

201

Headers

API-Usage-Limit: 1/500
Content-Type: application/json; charset=utf-8

Body

{
  "id": 8,
  "name": "Payment for premium",
  "price": "300.0",
  "return_url": "http://app.my/check_payment_url/%id_in_my_application%",
  "test": true,
  "created_at": "2024-10-05T00:56:01.018+03:00",
  "updated_at": "2024-10-05T00:56:01.018+03:00",
  "confirmation_url": "https://quentin.insales.io:3002/admin/application_charges/8",
  "status": "pending"
}

Decline application_charge

Only bill with status ‘pending’ can be declined.

Endpoint

POST /admin/application_charges/:application_charge_id/decline.json

Request

Route

POST /admin/application_charges/10/decline.json

Headers

Content-Type: application/json
Authorization: Basic ZGlnaXRhbC1nb29kczpjNTFjOTA3MDdhMTNjZTNmZmYyMTNhZmJiNWNkMTI3MA==

Response

Simulated Response

Status

200

Headers

API-Usage-Limit: 1/500
Content-Type: application/json; charset=utf-8

Body

{
  "id": 10,
  "name": "Pay",
  "price": "180.0",
  "return_url": "http://applicaiton.my/check_payment_url/%id_in_my_application%",
  "test": null,
  "created_at": "2024-10-05T00:56:01.181+03:00",
  "updated_at": "2024-10-05T00:56:01.181+03:00",
  "confirmation_url": "https://quentin.insales.io:3002/admin2/invoices/8",
  "status": "declined"
}

Get application_charge

Endpoint

GET /admin/application_charges/:application_charge_id.json

Request

Route

GET /admin/application_charges/4.json

Headers

Authorization: Basic ZGlnaXRhbC1nb29kczpjNTFjOTA3MDdhMTNjZTNmZmYyMTNhZmJiNWNkMTI3MA==

Response

Simulated Response

Status

200

Headers

API-Usage-Limit: 1/500
Content-Type: application/json; charset=utf-8

Body

{
  "id": 4,
  "name": "Pay",
  "price": "180.0",
  "return_url": "http://applicaiton.my/check_payment_url/%id_in_my_application%",
  "test": null,
  "created_at": "2024-10-05T00:56:00.692+03:00",
  "updated_at": "2024-10-05T00:56:00.692+03:00",
  "confirmation_url": "https://quentin.insales.io:3002/admin2/invoices/4",
  "status": "pending"
}

Get application_charges

Endpoint

GET /admin/application_charges.json

Request

Route

GET /admin/application_charges.json

Headers

Authorization: Basic ZGlnaXRhbC1nb29kczpjNTFjOTA3MDdhMTNjZTNmZmYyMTNhZmJiNWNkMTI3MA==

Response

Simulated Response

Status

200

Headers

API-Usage-Limit: 1/500
Content-Type: application/json; charset=utf-8

Body

[
  {
    "id": 2,
    "name": "Pay",
    "price": "180.0",
    "return_url": "http://applicaiton.my/check_payment_url/%id_in_my_application%",
    "test": null,
    "created_at": "2024-10-05T00:56:00.476+03:00",
    "updated_at": "2024-10-05T00:56:00.476+03:00",
    "confirmation_url": "https://quentin.insales.io:3002/admin2/invoices/2",
    "status": "pending"
  }
]

ApplicationWidget

Create application_widget

Endpoint

POST /admin/application_widgets.json

Parameters

Name Description
application_widget[code] required html or javascript code of widget
application_widget[height] required height of iframe block
application_widget[page_type] product or order

Request

Route

POST /admin/application_widgets.json

Headers

Content-Type: application/json
Authorization: Basic ZGlnaXRhbC1nb29kczpjNTFjOTA3MDdhMTNjZTNmZmYyMTNhZmJiNWNkMTI3MA==

Body

{
  "application_widget": {
    "code": "some html or javascript code",
    "height": 70,
    "page_type": "order"
  }
}

Response

Simulated Response

Status

201

Headers

API-Usage-Limit: 1/500
Content-Type: application/json; charset=utf-8

Body

{
  "id": 8,
  "code": "some html or javascript code",
  "created_at": "2024-10-05T00:56:02.138+03:00",
  "height": 70,
  "page_type": "order"
}

Destroy application_widget

Endpoint

DELETE /admin/application_widgets/:application_widget_id.json

Request

Route

DELETE /admin/application_widgets/12.json

Headers

Content-Type: application/json
Authorization: Basic ZGlnaXRhbC1nb29kczpjNTFjOTA3MDdhMTNjZTNmZmYyMTNhZmJiNWNkMTI3MA==

Response

Simulated Response

Status

200

Headers

API-Usage-Limit: 1/500
Content-Type: application/json; charset=utf-8

Body

{
  "status": "ok"
}

Get application_widget

Endpoint

GET /admin/application_widgets/:application_widget_id.json

Request

Route

GET /admin/application_widgets/4.json

Headers

Authorization: Basic ZGlnaXRhbC1nb29kczpjNTFjOTA3MDdhMTNjZTNmZmYyMTNhZmJiNWNkMTI3MA==

Response

Simulated Response

Status

200

Headers

API-Usage-Limit: 1/500
Content-Type: application/json; charset=utf-8

Body

{
  "id": 4,
  "code": "html/js code",
  "created_at": "2024-10-05T00:56:01.611+03:00",
  "height": 50,
  "page_type": "product"
}

Get application_widgets

Endpoint

GET /admin/application_widgets.json

Request

Route

GET /admin/application_widgets.json

Headers

Authorization: Basic ZGlnaXRhbC1nb29kczpjNTFjOTA3MDdhMTNjZTNmZmYyMTNhZmJiNWNkMTI3MA==

Response

Simulated Response

Status

200

Headers

API-Usage-Limit: 1/500
Content-Type: application/json; charset=utf-8

Body

[
  {
    "id": 2,
    "code": "html/js code",
    "created_at": "2024-10-05T00:56:01.470+03:00",
    "height": 50,
    "page_type": "product"
  }
]

Update application_widget

Endpoint

PUT /admin/application_widgets/:application_widget_id.json

Parameters

Name Description
application_widget[code] html or javascript code of widget
application_widget[height] height of iframe block
application_widget[page_type] product or order

Request

Route

PUT /admin/application_widgets/10.json

Headers

Content-Type: application/json
Authorization: Basic ZGlnaXRhbC1nb29kczpjNTFjOTA3MDdhMTNjZTNmZmYyMTNhZmJiNWNkMTI3MA==

Body

{
  "application_widget": {
    "code": "code changed",
    "height": 80,
    "page_type": "order"
  }
}

Response

Simulated Response

Status

200

Headers

API-Usage-Limit: 1/500
Content-Type: application/json; charset=utf-8

Body

{
  "code": "code changed",
  "height": 80,
  "page_type": "order",
  "id": 10,
  "created_at": "2024-10-05T00:56:02.261+03:00"
}

Article

Create article

Endpoint

POST /admin/blogs/:blog_id/articles.json

Parameters

Name Description
article[title] required article title
article[content] required article content
article[notice] notice for article
article[published_at] required publication date, the article is invisible to users while publication date > current time
article[author] required article author name
article[permalink] permalink on blog/*
article[html_title] html title tag content
article[meta_keywords] html meta words on page
article[meta_description] html meta description
article[image_attributes] image for article
article[all_tags] array of all tags for article, max 10 tags
article[pinned] set to true to pin article: it will be always on the top of the blog; only one article can be pinned, so when you pin article, previously pinned article will be unpinned

Request

Route

POST /admin/blogs/1/articles.json

Headers

Content-Type: application/json
Authorization: Basic ZGlnaXRhbC1nb29kczpjNTFjOTA3MDdhMTNjZTNmZmYyMTNhZmJiNWNkMTI3MA==

Body

{
  "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"
    },
    "all_tags": [
      "test3",
      "test4"
    ],
    "pinned": true
  }
}

Response

Simulated Response

Status

201

Headers

API-Usage-Limit: 1/500
Content-Type: application/json; charset=utf-8

Body

{
  "id": 6,
  "created_at": "2024-10-05T00:57:16.000+03:00",
  "updated_at": "2024-10-05T00:57:16.000+03:00",
  "custom_template": null,
  "published_at": "2014-09-09T00:00:00.000+04:00",
  "pinned": true,
  "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": 3,
    "created_at": "2024-10-05T00:57:16.000+03:00",
    "original_url": "http://minio.insales.io:9000/insales-test-sber/images/articles/1/3/3/no_image_compact.jpg?1728079036"
  },
  "tags": [
    {
      "title": "test3"
    },
    {
      "title": "test4"
    }
  ],
  "related_products": [

  ],
  "notice": "some notice",
  "content": "<p>content of my article<p>"
}

Delete article

Endpoint

DELETE /admin/blogs/:blog_id/articles/:article_id.json

Request

Route

DELETE /admin/blogs/1/articles/2.json

Headers

Authorization: Basic ZGlnaXRhbC1nb29kczpjNTFjOTA3MDdhMTNjZTNmZmYyMTNhZmJiNWNkMTI3MA==
Content-Type: application/x-www-form-urlencoded

Response

Simulated Response

Status

200

Headers

API-Usage-Limit: 1/500
Content-Type: application/json; charset=utf-8

Body

{
  "status": "ok"
}

Get article

Endpoint

GET /admin/blogs/:blog_id/articles/:article_id.json

Request

Route

GET /admin/blogs/1/articles/2.json

Headers

Authorization: Basic ZGlnaXRhbC1nb29kczpjNTFjOTA3MDdhMTNjZTNmZmYyMTNhZmJiNWNkMTI3MA==

Response

Simulated Response

Status

200

Headers

API-Usage-Limit: 1/500
Content-Type: application/json; charset=utf-8

Body

{
  "id": 2,
  "created_at": "2024-10-05T00:55:41.000+03:00",
  "updated_at": "2024-10-05T00:57:14.000+03:00",
  "custom_template": null,
  "published_at": "2017-03-01T07:53:15.000+03:00",
  "pinned": false,
  "title": "Второая Статья",
  "author": "Ivan",
  "permalink": "statya-2",
  "html_title": null,
  "meta_keywords": null,
  "meta_description": null,
  "image": {
    "id": 1,
    "created_at": "2024-10-05T00:55:41.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": [
    {
      "id": 1,
      "category_id": 1,
      "created_at": "2024-10-05T00:55:42.000+03:00",
      "updated_at": "2015-07-27T17:05:35.000+03:00",
      "is_hidden": false,
      "main_image_id": null,
      "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,
      "title": "Cool t-shirt"
    }
  ],
  "notice": "Второй анонс",
  "content": "Привет"
}

Get articles list

Endpoint

GET /admin/blogs/:blog_id/articles.json

Request

Route

GET /admin/blogs/1/articles.json

Headers

Authorization: Basic ZGlnaXRhbC1nb29kczpjNTFjOTA3MDdhMTNjZTNmZmYyMTNhZmJiNWNkMTI3MA==

Response

Simulated Response

Status

200

Headers

API-Usage-Limit: 1/500
Content-Type: application/json; charset=utf-8

Body

[
  {
    "id": 2,
    "created_at": "2024-10-05T00:55:41.000+03:00",
    "updated_at": "2024-10-05T00:57:14.000+03:00",
    "custom_template": null,
    "published_at": "2017-03-01T07:53:15.000+03:00",
    "pinned": false,
    "title": "Второая Статья",
    "author": "Ivan",
    "permalink": "statya-2",
    "html_title": null,
    "meta_keywords": null,
    "meta_description": null,
    "image": {
      "id": 1,
      "created_at": "2024-10-05T00:55:41.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": [
      {
        "id": 1,
        "category_id": 1,
        "created_at": "2024-10-05T00:55:42.000+03:00",
        "updated_at": "2015-07-27T17:05:35.000+03:00",
        "is_hidden": false,
        "main_image_id": null,
        "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,
        "title": "Cool t-shirt"
      }
    ],
    "notice": "Второй анонс",
    "content": "Привет"
  },
  {
    "id": 1,
    "created_at": "2024-10-05T00:55:41.000+03:00",
    "updated_at": "2024-10-05T00:55:41.000+03:00",
    "custom_template": null,
    "published_at": "2009-03-18T07:53:15.000+03:00",
    "pinned": false,
    "title": "Статья",
    "author": "Ivan",
    "permalink": "statya",
    "html_title": null,
    "meta_keywords": null,
    "meta_description": null,
    "tags": [

    ],
    "related_products": [

    ],
    "notice": "Первый анонс",
    "content": "Первая статья"
  }
]

Update article

Endpoint

PUT /admin/blogs/:blog_id/articles/:article_id.json

Parameters

Name Description
article[title] article title
article[content] article content
article[notice] notice for article
article[author] article author name
article[permalink] permalink on blog/*
article[html_title] html title tag content
article[meta_keywords] html meta words on page
article[meta_description] html meta description
article[published_at] publication date, the article is invisible to users while publication date > current time
article[image_attributes] image for article
article[all_tags] array of tags for article, max 10 tags: to remove tags from list - pass the array without this tag, to add tag - pass a full list with a new tag added
article[pinned] set to true to pin article: it will be always on the top of the blog; only one article can be pinned, so when you pin article, previously pinned article will be unpinned

Request

Route

PUT /admin/blogs/1/articles/2.json

Headers

Content-Type: application/json
Authorization: Basic ZGlnaXRhbC1nb29kczpjNTFjOTA3MDdhMTNjZTNmZmYyMTNhZmJiNWNkMTI3MA==

Body

{
  "article": {
    "title": "new title",
    "image_attributes": {
      "src": "https://abc.myinsales.ru/images/no_image_compact.jpg"
    },
    "all_tags": [
      "test",
      "test3"
    ],
    "pinned": true
  }
}

Response

Simulated Response

Status

200

Headers

API-Usage-Limit: 1/500
Content-Type: application/json; charset=utf-8

Body

{
  "pinned": true,
  "id": 2,
  "created_at": "2024-10-05T00:55:41.000+03:00",
  "updated_at": "2024-10-05T00:57:18.000+03:00",
  "custom_template": null,
  "published_at": "2017-03-01T07:53:15.000+03:00",
  "title": "new title",
  "author": "Ivan",
  "permalink": "statya-2",
  "html_title": null,
  "meta_keywords": null,
  "meta_description": null,
  "image": {
    "id": 5,
    "created_at": "2024-10-05T00:57:18.000+03:00",
    "original_url": "http://minio.insales.io:9000/insales-test-sber/images/articles/1/5/5/no_image_compact.jpg?1728079037"
  },
  "tags": [
    {
      "title": "test"
    },
    {
      "title": "test3"
    }
  ],
  "related_products": [
    {
      "id": 1,
      "category_id": 1,
      "created_at": "2024-10-05T00:55:42.000+03:00",
      "updated_at": "2015-07-27T17:05:35.000+03:00",
      "is_hidden": false,
      "main_image_id": null,
      "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,
      "title": "Cool t-shirt"
    }
  ],
  "notice": "Второй анонс",
  "content": "Привет"
}

Blog

Create blog

Endpoint

POST /admin/blogs.json

Parameters

Name Description
blog[title] required title
blog[html_title] html title tag content
blog[meta_keywords] html meta words on page
blog[meta_description] html meta description
blog[notify_about_comment] true by default
blog[captcha_enabled] false by default
blog[disallow_links_in_comments] false by default
blog[commentable] default: 'no', available: no, yes, moderable

Request

Route

POST /admin/blogs.json

Headers

Content-Type: application/json
Authorization: Basic ZGlnaXRhbC1nb29kczpjNTFjOTA3MDdhMTNjZTNmZmYyMTNhZmJiNWNkMTI3MA==

Body

{
  "blog": {
    "title": "SuperBlog",
    "html_title": "HTML TAG TITLE",
    "meta_keywords": "new cool products",
    "meta_description": "It's a blog about our new products"
  }
}

Response

Simulated Response

Status

201

Headers

API-Usage-Limit: 1/500
Content-Type: application/json; charset=utf-8

Body

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

  ]
}

Destroy blog

Endpoint

DELETE /admin/blogs/:blog_id.json

Request

Route

DELETE /admin/blogs/1.json

Headers

Content-Type: application/json
Authorization: Basic ZGlnaXRhbC1nb29kczpjNTFjOTA3MDdhMTNjZTNmZmYyMTNhZmJiNWNkMTI3MA==

Response

Simulated Response

Status

200

Headers

API-Usage-Limit: 1/500
Content-Type: application/json; charset=utf-8

Body

{
  "status": "ok"
}

Get blog

Endpoint

GET /admin/blogs/:blog_id.json

Request

Route

GET /admin/blogs/1.json

Headers

Authorization: Basic ZGlnaXRhbC1nb29kczpjNTFjOTA3MDdhMTNjZTNmZmYyMTNhZmJiNWNkMTI3MA==

Response

Simulated Response

Status

200

Headers

API-Usage-Limit: 1/500
Content-Type: application/json; charset=utf-8

Body

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

Get blogs

Endpoint

GET /admin/blogs.json

Request

Route

GET /admin/blogs.json

Headers

Authorization: Basic ZGlnaXRhbC1nb29kczpjNTFjOTA3MDdhMTNjZTNmZmYyMTNhZmJiNWNkMTI3MA==

Response

Simulated Response

Status

200

Headers

API-Usage-Limit: 1/500
Content-Type: application/json; charset=utf-8

Body

[
  {
    "id": 1,
    "commentable": "no",
    "notify_about_comment": true,
    "captcha_enabled": false,
    "disallow_links_in_comments": false,
    "handle": null,
    "custom_template": 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,
    "handle": "second_blog",
    "custom_template": null,
    "title": "Second blog",
    "html_title": null,
    "meta_keywords": null,
    "meta_description": null,
    "tags": [

    ]
  }
]

Update blog

Endpoint

PUT /admin/blogs/:blog_id.json

Parameters

Name Description
blog[title] title
blog[html_title] html title tag content
blog[meta_keywords] html meta words on page
blog[meta_description] html meta description
blog[notify_about_comment] true by default
blog[captcha_enabled] false by default
blog[disallow_links_in_comments] false by default
blog[commentable] default: 'no', available: no, yes, moderable

Request

Route

PUT /admin/blogs/1.json

Headers

Content-Type: application/json
Authorization: Basic ZGlnaXRhbC1nb29kczpjNTFjOTA3MDdhMTNjZTNmZmYyMTNhZmJiNWNkMTI3MA==

Body

{
  "blog": {
    "title": "WowBlog",
    "notify_about_comment": false,
    "captcha_enabled": true,
    "disallow_links_in_comments": true,
    "commentable": "yes"
  }
}

Response

Simulated Response

Status

200

Headers

API-Usage-Limit: 1/500
Content-Type: application/json; charset=utf-8

Body

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

BonusSystemTransaction

Create transaction for client

Endpoint

POST /admin/clients/:client_id/bonus_system_transactions.json

Parameters

Name Description
bonus_system_transaction[bonus_points] required bonus points; pass negative quantity if you need to revert their addition or just remove them in some cases
bonus_system_transaction[description] description

Request

Route

POST /admin/clients/2/bonus_system_transactions.json

Headers

Content-Type: application/json
Authorization: Basic ZGlnaXRhbC1nb29kczpjNTFjOTA3MDdhMTNjZTNmZmYyMTNhZmJiNWNkMTI3MA==

Body

{
  "bonus_system_transaction": {
    "bonus_points": 100,
    "description": "compliment"
  }
}

Response

Simulated Response

Status

201

Headers

API-Usage-Limit: 1/500
Content-Type: application/json; charset=utf-8

Body

{
  "id": 19,
  "bonus_points": 100,
  "client_id": 2,
  "bonus_system_id": 1,
  "initiator_type": "ApplicationPassword",
  "initiator_id": 1,
  "description": "compliment",
  "status": "charged",
  "created_at": "2024-10-05T00:56:17.219+03:00",
  "updated_at": "2024-10-05T00:56:17.223+03:00"
}

Get bonus_system_transactions

Endpoint

GET /admin/bonus_system_transactions.json

Parameters

Name Description
updated_since Set datetime to get only data updated after it.
from_id Set id to get only data starting from it.
per_page Quantity of objects per page.

Request

Route

GET /admin/bonus_system_transactions.json?updated_since=2009-01-04+14%3A44%3A43+%2B0300

Headers

Authorization: Basic ZGlnaXRhbC1nb29kczpjNTFjOTA3MDdhMTNjZTNmZmYyMTNhZmJiNWNkMTI3MA==

Query Parameters

updated_since=2009-01-04 14:44:43 +0300

Response

Simulated Response

Status

200

Headers

API-Usage-Limit: 1/500
Content-Type: application/json; charset=utf-8

Body

[
  {
    "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": 4,
    "bonus_points": 100,
    "client_id": 2,
    "bonus_system_id": 1,
    "initiator_type": "Order",
    "initiator_id": 1,
    "description": "test",
    "status": "charged",
    "created_at": "2024-10-05T00:56:16.624+03:00",
    "updated_at": "2024-10-05T00:56:16.624+03:00"
  },
  {
    "id": 5,
    "bonus_points": 100,
    "client_id": 2,
    "bonus_system_id": 1,
    "initiator_type": "User",
    "initiator_id": 1,
    "description": "test",
    "status": "charged",
    "created_at": "2024-10-05T00:56:16.632+03:00",
    "updated_at": "2024-10-05T00:56:16.632+03:00"
  }
]

Get transaction for client

Endpoint

GET /admin/bonus_system_transactions/:bst_id.json

Request

Route

GET /admin/bonus_system_transactions/12.json

Headers

Authorization: Basic ZGlnaXRhbC1nb29kczpjNTFjOTA3MDdhMTNjZTNmZmYyMTNhZmJiNWNkMTI3MA==

Response

Simulated Response

Status

200

Headers

API-Usage-Limit: 1/500
Content-Type: application/json; charset=utf-8

Body

{
  "id": 12,
  "bonus_points": 100,
  "client_id": 2,
  "bonus_system_id": 1,
  "initiator_type": "Order",
  "initiator_id": 1,
  "description": "test",
  "status": "charged",
  "created_at": "2024-10-05T00:56:16.982+03:00",
  "updated_at": "2024-10-05T00:56:16.982+03:00"
}

Get transactions for client

Endpoint

GET /admin/clients/:client_id/bonus_system_transactions.json

Request

Route

GET /admin/clients/2/bonus_system_transactions.json

Headers

Authorization: Basic ZGlnaXRhbC1nb29kczpjNTFjOTA3MDdhMTNjZTNmZmYyMTNhZmJiNWNkMTI3MA==

Response

Simulated Response

Status

200

Headers

API-Usage-Limit: 1/500
Content-Type: application/json; charset=utf-8

Body

[
  {
    "id": 8,
    "bonus_points": 100,
    "client_id": 2,
    "bonus_system_id": 1,
    "initiator_type": "Order",
    "initiator_id": 1,
    "description": "test",
    "status": "charged",
    "created_at": "2024-10-05T00:56:16.807+03:00",
    "updated_at": "2024-10-05T00:56:16.807+03:00"
  },
  {
    "id": 9,
    "bonus_points": 100,
    "client_id": 2,
    "bonus_system_id": 1,
    "initiator_type": "User",
    "initiator_id": 1,
    "description": "test",
    "status": "charged",
    "created_at": "2024-10-05T00:56:16.816+03:00",
    "updated_at": "2024-10-05T00:56:16.816+03:00"
  }
]

Category

Create category

Endpoint

POST /admin/categories.json

Parameters

Name Description
category[title] required title
category[parent_id] parent category id
category[position] position in categories list

Request

Route

POST /admin/categories.json

Headers

Content-Type: application/json
Authorization: Basic ZGlnaXRhbC1nb29kczpjNTFjOTA3MDdhMTNjZTNmZmYyMTNhZmJiNWNkMTI3MA==

Body

{
  "category": {
    "title": "Reebok"
  }
}

Response

Simulated Response

Status

201

Headers

API-Usage-Limit: 1/500
Content-Type: application/json; charset=utf-8

Body

{
  "id": 20497900,
  "parent_id": 1,
  "title": "Reebok",
  "created_at": "2024-10-05T00:56:43.000+03:00",
  "updated_at": "2024-10-05T00:56:43.000+03:00",
  "position": 1
}

Destroy category

Endpoint

DELETE /admin/categories/:category_id.json

Request

Route

DELETE /admin/categories/6.json

Headers

Content-Type: application/json
Authorization: Basic ZGlnaXRhbC1nb29kczpjNTFjOTA3MDdhMTNjZTNmZmYyMTNhZmJiNWNkMTI3MA==

Response

Simulated Response

Status

200

Headers

API-Usage-Limit: 1/500
Content-Type: application/json; charset=utf-8

Body

{
  "status": "ok"
}

Get categories

Endpoint

GET /admin/categories.json

Request

Route

GET /admin/categories.json

Headers

Authorization: Basic ZGlnaXRhbC1nb29kczpjNTFjOTA3MDdhMTNjZTNmZmYyMTNhZmJiNWNkMTI3MA==

Response

Simulated Response

Status

200

Headers

API-Usage-Limit: 1/500
Content-Type: application/json; charset=utf-8

Body

[
  {
    "id": 6,
    "parent_id": 1,
    "title": "T-shirts",
    "created_at": "2024-10-05T00:55:41.000+03:00",
    "updated_at": "2024-10-05T00:55:41.000+03:00",
    "position": 0
  },
  {
    "id": 2,
    "parent_id": 1,
    "title": "Trousers",
    "created_at": "2024-10-05T00:55:41.000+03:00",
    "updated_at": "2024-10-05T00:55:41.000+03:00",
    "position": 1
  },
  {
    "id": 3,
    "parent_id": 1,
    "title": "Shirts",
    "created_at": "2024-10-05T00:55:41.000+03:00",
    "updated_at": "2024-10-05T00:55:41.000+03:00",
    "position": 2
  },
  {
    "id": 4,
    "parent_id": 1,
    "title": "Socks",
    "created_at": "2024-10-05T00:55:41.000+03:00",
    "updated_at": "2024-10-05T00:55:41.000+03:00",
    "position": 3
  },
  {
    "id": 5,
    "parent_id": 1,
    "title": "Hats",
    "created_at": "2024-10-05T00:55:41.000+03:00",
    "updated_at": "2024-10-05T00:55:41.000+03:00",
    "position": 4
  },
  {
    "id": 8,
    "parent_id": 5,
    "title": "Top Hat",
    "created_at": "2024-10-05T00:55:41.000+03:00",
    "updated_at": "2024-10-05T00:55:41.000+03:00",
    "position": 1
  },
  {
    "id": 1,
    "parent_id": null,
    "title": "Склад",
    "created_at": "2024-10-05T00:55:41.000+03:00",
    "updated_at": "2024-10-05T00:55:41.000+03:00",
    "position": 0
  }
]

Get category

Endpoint

GET /admin/categories/:category_id.json

Request

Route

GET /admin/categories/6.json

Headers

Authorization: Basic ZGlnaXRhbC1nb29kczpjNTFjOTA3MDdhMTNjZTNmZmYyMTNhZmJiNWNkMTI3MA==

Response

Simulated Response

Status

200

Headers

API-Usage-Limit: 1/500
Content-Type: application/json; charset=utf-8

Body

{
  "id": 6,
  "parent_id": 1,
  "title": "T-shirts",
  "created_at": "2024-10-05T00:55:41.000+03:00",
  "updated_at": "2024-10-05T00:55:41.000+03:00",
  "position": 0
}

Update category

Endpoint

PUT /admin/categories/:category_id.json

Parameters

Name Description
category[title] title

Request

Route

PUT /admin/categories/6.json

Headers

Content-Type: application/json
Authorization: Basic ZGlnaXRhbC1nb29kczpjNTFjOTA3MDdhMTNjZTNmZmYyMTNhZmJiNWNkMTI3MA==

Body

{
  "category": {
    "title": "Adidas"
  }
}

Response

Simulated Response

Status

200

Headers

API-Usage-Limit: 1/500
Content-Type: application/json; charset=utf-8

Body

{
  "id": 6,
  "parent_id": 1,
  "title": "Adidas",
  "created_at": "2024-10-05T00:55:41.000+03:00",
  "updated_at": "2024-10-05T00:56:43.000+03:00",
  "position": 0
}

Characteristic

Create characteristic

Endpoint

POST /admin/properties/:property_id/characteristics.json

Parameters

Name Description
characteristic[title] required title
characteristic[permalink] permalink
characteristic[position] position in characteristics list

Request

Route

POST /admin/properties/3/characteristics.json

Headers

Content-Type: application/json
Authorization: Basic ZGlnaXRhbC1nb29kczpjNTFjOTA3MDdhMTNjZTNmZmYyMTNhZmJiNWNkMTI3MA==

Body

{
  "characteristic": {
    "title": "Reebok"
  }
}

Response

Simulated Response

Status

201

Headers

API-Usage-Limit: 1/500
Content-Type: application/json; charset=utf-8

Body

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

Destroy characteristic

Endpoint

DELETE /admin/properties/:property_id/characteristics/:characteristic_id.json

Request

Route

DELETE /admin/properties/3/characteristics/7.json

Headers

Content-Type: application/json
Authorization: Basic ZGlnaXRhbC1nb29kczpjNTFjOTA3MDdhMTNjZTNmZmYyMTNhZmJiNWNkMTI3MA==

Response

Simulated Response

Status

200

Headers

API-Usage-Limit: 1/500
Content-Type: application/json; charset=utf-8

Body

{
  "status": "ok"
}

Get characteristic

Endpoint

GET /admin/properties/:property_id/characteristics/:characteristic_id.json

Request

Route

GET /admin/properties/3/characteristics/7.json

Headers

Authorization: Basic ZGlnaXRhbC1nb29kczpjNTFjOTA3MDdhMTNjZTNmZmYyMTNhZmJiNWNkMTI3MA==

Response

Simulated Response

Status

200

Headers

API-Usage-Limit: 1/500
Content-Type: application/json; charset=utf-8

Body

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

Get characteristics

Endpoint

GET /admin/properties/:property_id/characteristics.json

Request

Route

GET /admin/properties/3/characteristics.json

Headers

Authorization: Basic ZGlnaXRhbC1nb29kczpjNTFjOTA3MDdhMTNjZTNmZmYyMTNhZmJiNWNkMTI3MA==

Response

Simulated Response

Status

200

Headers

API-Usage-Limit: 1/500
Content-Type: application/json; charset=utf-8

Body

[
  {
    "id": 7,
    "property_id": 3,
    "position": 1,
    "title": "Nike",
    "permalink": "nike"
  },
  {
    "id": 8,
    "property_id": 3,
    "position": 2,
    "title": "Puma",
    "permalink": "puma"
  }
]

Update characteristic

Endpoint

PUT /admin/properties/:property_id/characteristics/:characteristic_id.json

Parameters

Name Description
characteristic[title] title

Request

Route

PUT /admin/properties/3/characteristics/7.json

Headers

Content-Type: application/json
Authorization: Basic ZGlnaXRhbC1nb29kczpjNTFjOTA3MDdhMTNjZTNmZmYyMTNhZmJiNWNkMTI3MA==

Body

{
  "characteristic": {
    "title": "Adidas"
  }
}

Response

Simulated Response

Status

200

Headers

API-Usage-Limit: 1/500
Content-Type: application/json; charset=utf-8

Body

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

Client

Create individual client

To assign values to fields, you should create them in advance. For more information, please go to section about Field. Individual client is a natural person, as opposed to legal entity or a sole trader.

Endpoint

POST /admin/clients.json

Parameters

Name Description
client[name] required name
client[surname] required surname
client[middlename] required middlename
client[registered] if true, email and password are required
client[email] email
client[password] password at least 6 characters
client[phone] phone number
client[subscribe] set true to subscribe client for emails
client[client_group_id] client group id
client[type] Client::Individual, by default
client[ip_addr] IP address
client[correspondent_account] Correspondent account
client[settlement_account] Settlement account
client[fields_values_attributes] fields values array
client[fields_values_attributes][value] value of field
client[fields_values_attributes][field_id] field id
client[skip_send_mail] set it true to skip sending email confirmation

Request

Route

POST /admin/clients.json

Headers

Content-Type: application/json
Authorization: Basic ZGlnaXRhbC1nb29kczpjNTFjOTA3MDdhMTNjZTNmZmYyMTNhZmJiNWNkMTI3MA==

Body

{
  "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": 186,
        "value": "text"
      }
    ]
  }
}

Response

Simulated Response

Status

201

Headers

API-Usage-Limit: 1/500
Content-Type: application/json; charset=utf-8

Body

{
  "id": 19,
  "email": "test@example.com",
  "name": "Ivan",
  "phone": "+71111111111",
  "created_at": "2024-10-05T00:56:18.000+03:00",
  "updated_at": "2024-10-05T00:56:18.000+03:00",
  "comment": null,
  "registered": true,
  "subscribe": true,
  "client_group_id": 1,
  "surname": "Ivanov",
  "middlename": "Ivanovich",
  "bonus_points": 0,
  "type": "Client::Individual",
  "correspondent_account": null,
  "settlement_account": null,
  "consent_to_personal_data": true,
  "o_auth_provider": null,
  "messenger_subscription": null,
  "contact_name": "Ivan",
  "progressive_discount": null,
  "group_discount": "25.0",
  "ip_addr": "",
  "fields_values": [
    {
      "id": 11,
      "field_id": 186,
      "value": "text",
      "created_at": "2024-10-05T00:56:18.790+03:00",
      "updated_at": "2024-10-05T00:56:18.790+03:00",
      "type": "Текст",
      "name": "special",
      "handle": null
    }
  ],
  "default_address": null,
  "client_tags": [

  ],
  "full_name": "Ivanov Ivan Ivanovich"
}

Create juridical client

To assign values to fields, you should create them in advance. For more information, please go to section about Field. Juridical client is a sole trader (individual entrepreneur) or legal entity.

Endpoint

POST /admin/clients.json

Parameters

Name Description
client[name] required name of company or a sole trader
client[registered] if true, email and password are required
client[email] email
client[password] password at least 6 characters
client[phone] phone number
client[subscribe] set true to subscribe client for emails
client[client_group_id] client group id
client[type] required Client::Juridical
client[ip_addr] IP address
client[juridical_address] address of company or a sole trader
client[inn] required INN
client[kpp] KPP
client[ogrn] OGRN
client[okpo] OKPO
client[bik] BIK
client[bank_name] bank name
client[correspondent_account] Correspondent account
client[settlement_account] Settlement account
client[fields_values_attributes] fields values array
client[fields_values_attributes][field_id] field id
client[fields_values_attributes][value] value of field
client[skip_send_mail] set it true to skip sending email confirmation

Request

Route

POST /admin/clients.json

Headers

Content-Type: application/json
Authorization: Basic ZGlnaXRhbC1nb29kczpjNTFjOTA3MDdhMTNjZTNmZmYyMTNhZmJiNWNkMTI3MA==

Body

{
  "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": 190,
        "value": "text_value"
      }
    ]
  }
}

Response

Simulated Response

Status

201

Headers

API-Usage-Limit: 1/500
Content-Type: application/json; charset=utf-8

Body

{
  "id": 21,
  "email": null,
  "name": "OOO 'Company'",
  "phone": null,
  "created_at": "2024-10-05T00:56:19.000+03:00",
  "updated_at": "2024-10-05T00:56:19.000+03:00",
  "comment": null,
  "registered": false,
  "subscribe": true,
  "client_group_id": null,
  "bonus_points": 0,
  "type": "Client::Juridical",
  "juridical_address": "123456, Moscow, Novaya st., 1, 222",
  "inn": "1234567890",
  "kpp": "123456789",
  "ogrn": null,
  "okpo": null,
  "bik": "123456789",
  "bank_name": null,
  "correspondent_account": null,
  "settlement_account": null,
  "consent_to_personal_data": true,
  "o_auth_provider": null,
  "messenger_subscription": null,
  "contact_name": null,
  "progressive_discount": null,
  "group_discount": null,
  "ip_addr": "",
  "fields_values": [
    {
      "id": 15,
      "field_id": 190,
      "value": "text_value",
      "created_at": "2024-10-05T00:56:19.101+03:00",
      "updated_at": "2024-10-05T00:56:19.101+03:00",
      "type": "Текст",
      "name": "field_juridical",
      "handle": null
    }
  ],
  "default_address": null,
  "client_tags": [

  ],
  "full_name": "OOO 'Company'"
}

Destroy client

Endpoint

DELETE /admin/clients/:client_id.json

Request

Route

DELETE /admin/clients/5.json

Headers

Content-Type: application/json
Authorization: Basic ZGlnaXRhbC1nb29kczpjNTFjOTA3MDdhMTNjZTNmZmYyMTNhZmJiNWNkMTI3MA==

Response

Simulated Response

Status

200

Headers

API-Usage-Limit: 1/500
Content-Type: application/json; charset=utf-8

Body

"ok"

Get client

Endpoint

GET /admin/clients/:client_id.json

Request

Route

GET /admin/clients/5.json

Headers

Authorization: Basic ZGlnaXRhbC1nb29kczpjNTFjOTA3MDdhMTNjZTNmZmYyMTNhZmJiNWNkMTI3MA==

Response

Simulated Response

Status

200

Headers

API-Usage-Limit: 1/500
Content-Type: application/json; charset=utf-8

Body

{
  "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": "2024-10-05T00:56:18.000+03:00",
  "comment": null,
  "registered": true,
  "subscribe": true,
  "client_group_id": null,
  "surname": null,
  "middlename": 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,
  "contact_name": "John Smith",
  "progressive_discount": null,
  "group_discount": null,
  "ip_addr": "",
  "fields_values": [
    {
      "id": 7,
      "field_id": 184,
      "value": "old value",
      "created_at": "2024-10-05T00:56:18.461+03:00",
      "updated_at": "2024-10-05T00:56:18.461+03:00",
      "type": "Текст",
      "name": "special",
      "handle": null
    }
  ],
  "default_address": null,
  "client_tags": [

  ],
  "full_name": "John Smith"
}

Get clients

Endpoint

GET /admin/clients.json

Parameters

Name Description
updated_since Set datetime to get only data updated after it.
from_id Set id to get only data starting from it.
per_page Quantity of objects per page.

Request

Route

GET /admin/clients.json?updated_since=2009-01-04+14%3A44%3A43+%2B0300

Headers

Authorization: Basic ZGlnaXRhbC1nb29kczpjNTFjOTA3MDdhMTNjZTNmZmYyMTNhZmJiNWNkMTI3MA==

Query Parameters

updated_since=2009-01-04 14:44:43 +0300

Response

Simulated Response

Status

200

Headers

API-Usage-Limit: 1/500
Content-Type: application/json; charset=utf-8

Body

[
  {
    "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,
    "surname": null,
    "middlename": 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,
    "contact_name": "Mortimer Hant",
    "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,
    "surname": null,
    "middlename": 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,
    "contact_name": "Just Man",
    "progressive_discount": null,
    "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": "2024-10-05T00:56:18.000+03:00",
    "comment": null,
    "registered": true,
    "subscribe": true,
    "client_group_id": null,
    "surname": null,
    "middlename": 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,
    "contact_name": "John Smith",
    "progressive_discount": null,
    "group_discount": null,
    "ip_addr": "",
    "fields_values": [
      {
        "id": 5,
        "field_id": 182,
        "value": "old value",
        "created_at": "2024-10-05T00:56:18.251+03:00",
        "updated_at": "2024-10-05T00:56:18.251+03:00",
        "type": "Текст",
        "name": "special",
        "handle": null
      }
    ],
    "default_address": null,
    "client_tags": [

    ],
    "full_name": "John Smith"
  }
]

Update client

Endpoint

PUT /admin/clients/:client_id.json

Parameters

Name Description
client[name] name
client[phone] phone number
client[subscribe] set true to subscribe client for emails
client[client_group_id] client group id
client[ip_addr] IP address
client[juridical_address] address of company or a sole trader
client[inn] INN
client[kpp] KPP
client[ogrn] OGRN
client[okpo] OKPO
client[bik] BIK
client[bank_name] bank name
client[correspondent_account] Correspondent account
client[settlement_account] Settlement account
client[fields_values_attributes] fields values array

Request

Route

PUT /admin/clients/5.json

Headers

Content-Type: application/json
Authorization: Basic ZGlnaXRhbC1nb29kczpjNTFjOTA3MDdhMTNjZTNmZmYyMTNhZmJiNWNkMTI3MA==

Body

{
  "client": {
    "phone": "+7(911)111-11-11",
    "subscribe": false,
    "client_group_id": 2,
    "fields_values_attributes": [
      {
        "field_id": 192,
        "value": "new value"
      }
    ]
  }
}

Response

Simulated Response

Status

200

Headers

API-Usage-Limit: 1/500
Content-Type: application/json; charset=utf-8

Body

{
  "phone": "+79111111111",
  "subscribe": false,
  "client_group_id": 2,
  "id": 5,
  "email": "john@smith.com",
  "name": "John Smith",
  "created_at": "2009-04-30T04:37:32.000+04:00",
  "updated_at": "2024-10-05T00:56:19.000+03:00",
  "comment": null,
  "registered": true,
  "surname": null,
  "middlename": 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,
  "contact_name": "John Smith",
  "progressive_discount": null,
  "group_discount": null,
  "ip_addr": "",
  "fields_values": [
    {
      "field_id": 192,
      "id": 17,
      "value": "new value",
      "created_at": "2024-10-05T00:56:19.343+03:00",
      "updated_at": "2024-10-05T00:56:19.437+03:00",
      "type": "Текст",
      "name": "special",
      "handle": null
    }
  ],
  "default_address": null,
  "client_tags": [

  ],
  "full_name": "John Smith"
}

ClientGroup

Create client group

Endpoint

POST /admin/client_groups.json

Parameters

Name Description
client_group[title] client group title
client_group[discount] discount
client_group[discount_description] discount description
client_group[is_default] set as default group

Request

Route

POST /admin/client_groups.json

Headers

Content-Type: application/json
Authorization: Basic ZGlnaXRhbC1nb29kczpjNTFjOTA3MDdhMTNjZTNmZmYyMTNhZmJiNWNkMTI3MA==

Body

{
  "client_group": {
    "title": "test group",
    "discount": 0.2,
    "discount_description": "test group discount",
    "is_default": false
  }
}

Response

Simulated Response

Status

201

Headers

API-Usage-Limit: 1/500
Content-Type: application/json; charset=utf-8

Body

{
  "id": 19,
  "title": "test group",
  "discount": "0.2",
  "discount_description": "test group discount",
  "is_default": false,
  "b2b": false,
  "created_at": "2024-10-05T00:56:17.726+03:00",
  "updated_at": "2024-10-05T00:56:17.729+03:00"
}

Destroy client group

Endpoint

DELETE /admin/client_groups/:client_group_id.json

Request

Route

DELETE /admin/client_groups/1.json

Headers

Content-Type: application/json
Authorization: Basic ZGlnaXRhbC1nb29kczpjNTFjOTA3MDdhMTNjZTNmZmYyMTNhZmJiNWNkMTI3MA==

Response

Simulated Response

Status

200

Headers

API-Usage-Limit: 1/500
Content-Type: application/json

Get client group

Endpoint

GET /admin/client_groups/:client_group_id.json

Request

Route

GET /admin/client_groups/1.json

Headers

Authorization: Basic ZGlnaXRhbC1nb29kczpjNTFjOTA3MDdhMTNjZTNmZmYyMTNhZmJiNWNkMTI3MA==

Response

Simulated Response

Status

200

Headers

API-Usage-Limit: 1/500
Content-Type: application/json; charset=utf-8

Body

{
  "id": 1,
  "title": "vip",
  "discount": "25.0",
  "discount_description": null,
  "is_default": true,
  "b2b": false,
  "created_at": "2024-06-27T00:55:40.000+03:00",
  "updated_at": "2024-10-05T00:55:41.417+03:00"
}

Get client groups

Endpoint

GET /admin/client_groups.json

Request

Route

GET /admin/client_groups.json

Headers

Authorization: Basic ZGlnaXRhbC1nb29kczpjNTFjOTA3MDdhMTNjZTNmZmYyMTNhZmJiNWNkMTI3MA==

Response

Simulated Response

Status

200

Headers

API-Usage-Limit: 1/500
Content-Type: application/json; charset=utf-8

Body

[
  {
    "id": 1,
    "title": "vip",
    "discount": "25.0",
    "discount_description": null,
    "is_default": true,
    "b2b": false,
    "created_at": "2024-06-27T00:55:40.000+03:00",
    "updated_at": "2024-10-05T00:55:41.417+03:00"
  }
]

Update client group

Endpoint

PUT /admin/client_groups/:client_group_id.json

Parameters

Name Description
client_group[title] client group title
client_group[discount] discount
client_group[discount_description] discount description
client_group[is_default] set as default group

Request

Route

PUT /admin/client_groups/1.json

Headers

Content-Type: application/json
Authorization: Basic ZGlnaXRhbC1nb29kczpjNTFjOTA3MDdhMTNjZTNmZmYyMTNhZmJiNWNkMTI3MA==

Body

{
  "client_group": {
    "title": "test group",
    "discount": 0.2,
    "discount_description": "test group discount",
    "is_default": false
  }
}

Response

Simulated Response

Status

200

Headers

API-Usage-Limit: 1/500
Content-Type: application/json; charset=utf-8

Body

{
  "status": "ok"
}

Collect

Add product to collection

Endpoint

POST /admin/collects.json

Parameters

Name Description
collect[collection_id] required collection id
collect[product_id] required product id

Request

Route

POST /admin/collects.json

Headers

Content-Type: application/json
Authorization: Basic ZGlnaXRhbC1nb29kczpjNTFjOTA3MDdhMTNjZTNmZmYyMTNhZmJiNWNkMTI3MA==

Body

{
  "collect": {
    "collection_id": 2,
    "product_id": 1
  }
}

Response

Simulated Response

Status

201

Headers

API-Usage-Limit: 1/500
Content-Type: application/json; charset=utf-8

Body

{
  "collection_id": 2,
  "product_id": 1,
  "created_at": "2024-10-05T00:56:47.000+03:00",
  "position": 1,
  "id": 9854
}

Get collections by product

Endpoint

GET /admin/collects.json?product_id=:product_id

Request

Route

GET /admin/collects.json?product_id=1

Headers

Authorization: Basic ZGlnaXRhbC1nb29kczpjNTFjOTA3MDdhMTNjZTNmZmYyMTNhZmJiNWNkMTI3MA==

Query Parameters

product_id=1

Response

Simulated Response

Status

200

Headers

API-Usage-Limit: 1/500
Content-Type: application/json; charset=utf-8

Body

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

Get collects

Endpoint

GET /admin/collects.json

Request

Route

GET /admin/collects.json

Headers

Authorization: Basic ZGlnaXRhbC1nb29kczpjNTFjOTA3MDdhMTNjZTNmZmYyMTNhZmJiNWNkMTI3MA==

Response

Simulated Response

Status

200

Headers

API-Usage-Limit: 1/500
Content-Type: application/json; charset=utf-8

Body

[
  {
    "collection_id": 1,
    "product_id": 1,
    "created_at": "2009-03-18T07:53:15.000+03:00",
    "position": 1,
    "id": 1
  },
  {
    "collection_id": 1,
    "product_id": 2,
    "created_at": "2009-03-18T07:53:15.000+03:00",
    "position": 2,
    "id": 2
  },
  {
    "collection_id": 3,
    "product_id": 1,
    "created_at": "2009-03-18T07:53:15.000+03:00",
    "position": 3,
    "id": 3
  },
  {
    "collection_id": 8,
    "product_id": 1,
    "created_at": "2009-03-18T07:53:15.000+03:00",
    "position": 1,
    "id": 4
  },
  {
    "collection_id": 8,
    "product_id": 2,
    "created_at": "2009-03-18T07:53:15.000+03:00",
    "position": 2,
    "id": 5
  },
  {
    "collection_id": 8,
    "product_id": 3,
    "created_at": "2009-03-18T07:53:15.000+03:00",
    "position": 3,
    "id": 6
  }
]

Get products by collection

Endpoint

GET /admin/collects.json?collection_id=:collection_id

Request

Route

GET /admin/collects.json?collection_id=1

Headers

Authorization: Basic ZGlnaXRhbC1nb29kczpjNTFjOTA3MDdhMTNjZTNmZmYyMTNhZmJiNWNkMTI3MA==

Query Parameters

collection_id=1

Response

Simulated Response

Status

200

Headers

API-Usage-Limit: 1/500
Content-Type: application/json; charset=utf-8

Body

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

Move product to another collection

Endpoint

PUT /admin/collects/:collect_id.json

Parameters

Name Description
collect[collection_id] collection id

Request

Route

PUT /admin/collects/2.json

Headers

Content-Type: application/json
Authorization: Basic ZGlnaXRhbC1nb29kczpjNTFjOTA3MDdhMTNjZTNmZmYyMTNhZmJiNWNkMTI3MA==

Body

{
  "collect": {
    "collection_id": 3
  }
}

Response

Simulated Response

Status

200

Headers

API-Usage-Limit: 1/500
Content-Type: application/json; charset=utf-8

Body

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

Remove product from collection

Endpoint

DELETE /admin/collects/:collect_id.json

Request

Route

DELETE /admin/collects/2.json

Headers

Content-Type: application/json
Authorization: Basic ZGlnaXRhbC1nb29kczpjNTFjOTA3MDdhMTNjZTNmZmYyMTNhZmJiNWNkMTI3MA==

Response

Simulated Response

Status

200

Headers

API-Usage-Limit: 1/500
Content-Type: application/json; charset=utf-8

Body

{
  "status": "ok"
}

Update position

Endpoint

PUT /admin/collects/:collect_id.json

Parameters

Name Description
collect[position] position

Request

Route

PUT /admin/collects/2.json

Headers

Content-Type: application/json
Authorization: Basic ZGlnaXRhbC1nb29kczpjNTFjOTA3MDdhMTNjZTNmZmYyMTNhZmJiNWNkMTI3MA==

Body

{
  "collect": {
    "position": 3
  }
}

Response

Simulated Response

Status

200

Headers

API-Usage-Limit: 1/500
Content-Type: application/json; charset=utf-8

Body

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

Collection

Create collection

Endpoint

POST /admin/collections.json

Parameters

Name Description
collection[title] required title
collection[parent_id] required parent collection id
collection[position] position in collections list
collection[sort_type] Alphabetically: A - Z => 1, Alphabetically: Z - A => 2, By date: New - Old => 3, By date: Old - New => 4, By price: Expensive - Cheap => 5, By price: Cheap - Expensive => 6, Manual => 7, By discount: Large - Little => 8, By discount: Little - Large => 9, By sort rank: Low - High => 10, By sort rank: High - Low => 11, Sort by ascending popularity => 12, Sort by descending popularity => 13
collection[description] description
collection[html_title] html title
collection[seo_description] seo description
collection[meta_description] meta description
collection[meta_keywords] meta keywords
collection[is_hidden] set true to hide collection
collection[permalink] generated
collection[recursive] recursive
collection[image_attributes] image for collection
collection[image_attributes][src] image url
collection[field_values_attributes] collection field values attributes

Request

Route

POST /admin/collections.json

Headers

Content-Type: application/json
Authorization: Basic ZGlnaXRhbC1nb29kczpjNTFjOTA3MDdhMTNjZTNmZmYyMTNhZmJiNWNkMTI3MA==

Body

{
  "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
      }
    ]
  }
}

Response

Simulated Response

Status

201

Headers

API-Usage-Limit: 1/500
Content-Type: application/json; charset=utf-8

Body

{
  "id": 20924767,
  "parent_id": 1,
  "created_at": "2024-10-05T00:56:42.000+03:00",
  "updated_at": "2024-10-05T00:56:42.000+03:00",
  "is_hidden": false,
  "position": 1,
  "sort_type": 1,
  "custom_template": null,
  "recursive": null,
  "is_smart": null,
  "title": "T-shirts",
  "html_title": null,
  "meta_description": null,
  "meta_keywords": null,
  "permalink": "t-shirts",
  "url": "/collection/t-shirts",
  "image": {
    "id": 2,
    "created_at": "2024-10-05T00:56:42.000+03:00",
    "original_url": "http://minio.insales.io:9000/insales-test-sber/images/collections/1/2/2/image.jpg?1728079002"
  },
  "field_values": [
    {
      "id": 4,
      "collection_field_id": 1,
      "value": "12345"
    }
  ],
  "description": "text",
  "seo_description": null
}

Destroy collection

Endpoint

DELETE /admin/collections/:collection_id.json

Request

Route

DELETE /admin/collections/6.json

Headers

Content-Type: application/json
Authorization: Basic ZGlnaXRhbC1nb29kczpjNTFjOTA3MDdhMTNjZTNmZmYyMTNhZmJiNWNkMTI3MA==

Response

Simulated Response

Status

200

Headers

API-Usage-Limit: 1/500
Content-Type: application/json; charset=utf-8

Body

{
  "status": "ok"
}

Get collection

Endpoint

GET /admin/collections/:collection_id.json

Request

Route

GET /admin/collections/6.json

Headers

Authorization: Basic ZGlnaXRhbC1nb29kczpjNTFjOTA3MDdhMTNjZTNmZmYyMTNhZmJiNWNkMTI3MA==

Response

Simulated Response

Status

200

Headers

API-Usage-Limit: 1/500
Content-Type: application/json; charset=utf-8

Body

{
  "id": 6,
  "parent_id": 1,
  "created_at": "2024-06-27T00:55:40.000+03:00",
  "updated_at": "2024-10-05T00:55:41.000+03:00",
  "is_hidden": false,
  "position": 0,
  "sort_type": 7,
  "custom_template": null,
  "recursive": null,
  "is_smart": null,
  "title": "all",
  "html_title": null,
  "meta_description": null,
  "meta_keywords": null,
  "permalink": "all",
  "url": "/collection/all",
  "field_values": [

  ],
  "description": null,
  "seo_description": null
}

Get collections

Endpoint

GET /admin/collections.json

Parameters

Name Description
updated_since Set datetime to get only data updated after it.
from_id Set id to get only data starting from it.
per_page Quantity of objects per page.

Request

Route

GET /admin/collections.json?updated_since=2016-07-04+14%3A44%3A43+%2B0300

Headers

Authorization: Basic ZGlnaXRhbC1nb29kczpjNTFjOTA3MDdhMTNjZTNmZmYyMTNhZmJiNWNkMTI3MA==

Query Parameters

updated_since=2016-07-04 14:44:43 +0300

Response

Simulated Response

Status

200

Headers

API-Usage-Limit: 1/500
Content-Type: application/json; charset=utf-8

Body

[
  {
    "id": 1,
    "parent_id": null,
    "created_at": "2024-06-27T00:55:40.000+03:00",
    "updated_at": "2024-10-05T00:55:41.000+03:00",
    "is_hidden": false,
    "position": -1,
    "sort_type": 7,
    "custom_template": null,
    "recursive": null,
    "is_smart": null,
    "title": "T-shirts",
    "html_title": null,
    "meta_description": null,
    "meta_keywords": null,
    "permalink": "футболка",
    "url": "/collection/футболка",
    "field_values": [
      {
        "id": 1,
        "collection_field_id": 1,
        "value": "some collection field value"
      },
      {
        "id": 2,
        "collection_field_id": 2,
        "value": "some collection field value"
      }
    ],
    "description": null,
    "seo_description": null
  },
  {
    "id": 2,
    "parent_id": 1,
    "created_at": "2024-06-27T00:55:40.000+03:00",
    "updated_at": "2024-10-05T00:55:41.000+03:00",
    "is_hidden": false,
    "position": 1,
    "sort_type": 7,
    "custom_template": null,
    "recursive": null,
    "is_smart": null,
    "title": "Shirts",
    "html_title": null,
    "meta_description": null,
    "meta_keywords": null,
    "permalink": "shirts",
    "url": "/collection/shirts",
    "field_values": [

    ],
    "description": null,
    "seo_description": null
  },
  {
    "id": 3,
    "parent_id": 1,
    "created_at": "2024-06-27T00:55:40.000+03:00",
    "updated_at": "2024-10-05T00:55:41.000+03:00",
    "is_hidden": false,
    "position": 2,
    "sort_type": 7,
    "custom_template": null,
    "recursive": null,
    "is_smart": null,
    "title": "Trousers",
    "html_title": null,
    "meta_description": null,
    "meta_keywords": null,
    "permalink": "trousers",
    "url": "/collection/trousers",
    "field_values": [

    ],
    "description": null,
    "seo_description": null
  },
  {
    "id": 4,
    "parent_id": 1,
    "created_at": "2024-06-27T00:55:40.000+03:00",
    "updated_at": "2024-10-05T00:55:41.000+03:00",
    "is_hidden": false,
    "position": 3,
    "sort_type": 7,
    "custom_template": null,
    "recursive": null,
    "is_smart": null,
    "title": "Stylish",
    "html_title": null,
    "meta_description": null,
    "meta_keywords": null,
    "permalink": "stylish",
    "url": "/collection/stylish",
    "field_values": [

    ],
    "description": null,
    "seo_description": null
  },
  {
    "id": 5,
    "parent_id": 1,
    "created_at": "2024-06-27T00:55:40.000+03:00",
    "updated_at": "2024-10-05T00:55:41.000+03:00",
    "is_hidden": false,
    "position": 4,
    "sort_type": 7,
    "custom_template": null,
    "recursive": null,
    "is_smart": null,
    "title": "Sport",
    "html_title": null,
    "meta_description": null,
    "meta_keywords": null,
    "permalink": "sport",
    "url": "/collection/sport",
    "field_values": [

    ],
    "description": null,
    "seo_description": null
  },
  {
    "id": 6,
    "parent_id": 1,
    "created_at": "2024-06-27T00:55:40.000+03:00",
    "updated_at": "2024-10-05T00:55:41.000+03:00",
    "is_hidden": false,
    "position": 0,
    "sort_type": 7,
    "custom_template": null,
    "recursive": null,
    "is_smart": null,
    "title": "all",
    "html_title": null,
    "meta_description": null,
    "meta_keywords": null,
    "permalink": "all",
    "url": "/collection/all",
    "field_values": [

    ],
    "description": null,
    "seo_description": null
  },
  {
    "id": 8,
    "parent_id": 1,
    "created_at": "2024-06-27T00:55:40.000+03:00",
    "updated_at": "2024-10-05T00:55:41.000+03:00",
    "is_hidden": false,
    "position": 4,
    "sort_type": 7,
    "custom_template": null,
    "recursive": null,
    "is_smart": null,
    "title": "sort test",
    "html_title": null,
    "meta_description": null,
    "meta_keywords": null,
    "permalink": "sort test",
    "url": "/collection/sort test",
    "field_values": [

    ],
    "description": null,
    "seo_description": null
  }
]

Update collection

Endpoint

PUT /admin/collections/:collection_id.json

Parameters

Name Description
collection[title] title
collection[position] position in collections list
collection[sort_type] Alphabetically: A - Z => 1, Alphabetically: Z - A => 2, By date: New - Old => 3, By date: Old - New => 4, By price: Expensive - Cheap => 5, By price: Cheap - Expensive => 6, Manual => 7, By discount: Large - Little => 8, By discount: Little - Large => 9, By sort rank: Low - High => 10, By sort rank: High - Low => 11, Sort by ascending popularity => 12, Sort by descending popularity => 13
collection[description] description
collection[html_title] html title
collection[seo_description] seo description
collection[meta_description] meta description
collection[meta_keywords] meta keywords
collection[is_hidden] set true to hide collection
collection[permalink] generated
collection[recursive] recursive
collection[field_values_attributes] collection field values attributes

Request

Route

PUT /admin/collections/6.json

Headers

Content-Type: application/json
Authorization: Basic ZGlnaXRhbC1nb29kczpjNTFjOTA3MDdhMTNjZTNmZmYyMTNhZmJiNWNkMTI3MA==

Body

{
  "collection": {
    "title": "Books",
    "position": 2,
    "sort_type": 11,
    "description": "Description",
    "is_hidden": true,
    "field_values_attributes": [
      {
        "handle": "handle",
        "value": 12345
      }
    ]
  }
}

Response

Simulated Response

Status

200

Headers

API-Usage-Limit: 1/500
Content-Type: application/json; charset=utf-8

Body

{
  "is_hidden": true,
  "sort_type": 11,
  "position": 2,
  "id": 6,
  "parent_id": 1,
  "created_at": "2024-06-27T00:55:40.000+03:00",
  "updated_at": "2024-10-05T00:56:42.000+03:00",
  "custom_template": null,
  "recursive": null,
  "is_smart": null,
  "title": "Books",
  "html_title": null,
  "meta_description": null,
  "meta_keywords": null,
  "permalink": "all",
  "url": "/collection/all",
  "field_values": [
    {
      "id": 6,
      "collection_field_id": 1,
      "value": "12345"
    }
  ],
  "description": "Description",
  "seo_description": null
}

CollectionField

Create collection_field

Endpoint

POST /admin/collection_fields.json

Parameters

Name Description
collection_field[title] required title
collection_field[handle] required handle used in liquid
collection_field[type] required CollectionField::TextArea - textarea, CollectionField::TextField - textfield
collection_field[position] position in collection_fields list
collection_field[is_hidden] boolean

Request

Route

POST /admin/collection_fields.json

Headers

Content-Type: application/json
Authorization: Basic ZGlnaXRhbC1nb29kczpjNTFjOTA3MDdhMTNjZTNmZmYyMTNhZmJiNWNkMTI3MA==

Body

{
  "collection_field": {
    "title": "Size",
    "handle": "size",
    "type": "CollectionField::TextArea"
  }
}

Response

Simulated Response

Status

201

Headers

API-Usage-Limit: 1/500
Content-Type: application/json; charset=utf-8

Body

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

Destroy collection_field by handle

Endpoint

DELETE /admin/collection_fields/:collection_field_handle.json

Request

Route

DELETE /admin/collection_fields/handle2.json

Headers

Content-Type: application/json
Authorization: Basic ZGlnaXRhbC1nb29kczpjNTFjOTA3MDdhMTNjZTNmZmYyMTNhZmJiNWNkMTI3MA==

Response

Simulated Response

Status

200

Headers

API-Usage-Limit: 1/500
Content-Type: application/json; charset=utf-8

Body

{
  "status": "ok"
}

Destroy collection_field

Endpoint

DELETE /admin/collection_fields/:collection_field_id.json

Request

Route

DELETE /admin/collection_fields/2.json

Headers

Content-Type: application/json
Authorization: Basic ZGlnaXRhbC1nb29kczpjNTFjOTA3MDdhMTNjZTNmZmYyMTNhZmJiNWNkMTI3MA==

Response

Simulated Response

Status

200

Headers

API-Usage-Limit: 1/500
Content-Type: application/json; charset=utf-8

Body

{
  "status": "ok"
}

Get collection_field by handle

Endpoint

GET /admin/collection_fields/:collection_field_handle.json

Request

Route

GET /admin/collection_fields/handle2.json

Headers

Authorization: Basic ZGlnaXRhbC1nb29kczpjNTFjOTA3MDdhMTNjZTNmZmYyMTNhZmJiNWNkMTI3MA==

Response

Simulated Response

Status

200

Headers

API-Usage-Limit: 1/500
Content-Type: application/json; charset=utf-8

Body

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

Get collection_field

Endpoint

GET /admin/collection_fields/:collection_field_id.json

Request

Route

GET /admin/collection_fields/2.json

Headers

Authorization: Basic ZGlnaXRhbC1nb29kczpjNTFjOTA3MDdhMTNjZTNmZmYyMTNhZmJiNWNkMTI3MA==

Response

Simulated Response

Status

200

Headers

API-Usage-Limit: 1/500
Content-Type: application/json; charset=utf-8

Body

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

Get collection_fields

Endpoint

GET /admin/collection_fields.json

Request

Route

GET /admin/collection_fields.json

Headers

Authorization: Basic ZGlnaXRhbC1nb29kczpjNTFjOTA3MDdhMTNjZTNmZmYyMTNhZmJiNWNkMTI3MA==

Response

Simulated Response

Status

200

Headers

API-Usage-Limit: 1/500
Content-Type: application/json; charset=utf-8

Body

[
  {
    "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": "Цифровые товары"
  }
]

Update collection_field by handle

Endpoint

PUT /admin/collection_fields/:collection_field_handle.json

Parameters

Name Description Method
collection_field[title] title
collection_field[handle] handle used in liquid new_handle
collection_field[position] position in collection_fields list
collection_field[is_hidden] boolean

Request

Route

PUT /admin/collection_fields/handle2.json

Headers

Content-Type: application/json
Authorization: Basic ZGlnaXRhbC1nb29kczpjNTFjOTA3MDdhMTNjZTNmZmYyMTNhZmJiNWNkMTI3MA==

Body

{
  "collection_field": {
    "title": "Volume",
    "position": 2
  }
}

Response

Simulated Response

Status

200

Headers

API-Usage-Limit: 1/500
Content-Type: application/json; charset=utf-8

Body

{
  "status": "ok"
}

Update collection_field

Endpoint

PUT /admin/collection_fields/:collection_field_id.json

Parameters

Name Description
collection_field[title] title
collection_field[handle] handle used in liquid
collection_field[position] position in collection_fields list
collection_field[is_hidden] boolean

Request

Route

PUT /admin/collection_fields/2.json

Headers

Content-Type: application/json
Authorization: Basic ZGlnaXRhbC1nb29kczpjNTFjOTA3MDdhMTNjZTNmZmYyMTNhZmJiNWNkMTI3MA==

Body

{
  "collection_field": {
    "title": "Volume",
    "handle": "volume",
    "position": 2
  }
}

Response

Simulated Response

Status

200

Headers

API-Usage-Limit: 1/500
Content-Type: application/json; charset=utf-8

Body

{
  "status": "ok"
}

CollectionFieldValue

Get collection field value by handle

Endpoint

GET /admin/collections/:collection_id/collection_field_values/:field_handle.json

Parameters

Name Description
collection_id collection id
field_handle field handle

Request

Route

GET /admin/collections/1/collection_field_values/handle2.json

Headers

Authorization: Basic ZGlnaXRhbC1nb29kczpjNTFjOTA3MDdhMTNjZTNmZmYyMTNhZmJiNWNkMTI3MA==

Response

Simulated Response

Status

200

Headers

API-Usage-Limit: 1/500
Content-Type: application/json; charset=utf-8

Body

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

Get collection field value

Endpoint

GET /admin/collections/:collection_id/collection_field_values/:field_id.json

Parameters

Name Description
collection_id collection id
field_id field_id

Request

Route

GET /admin/collections/1/collection_field_values/2.json

Headers

Authorization: Basic ZGlnaXRhbC1nb29kczpjNTFjOTA3MDdhMTNjZTNmZmYyMTNhZmJiNWNkMTI3MA==

Response

Simulated Response

Status

200

Headers

API-Usage-Limit: 1/500
Content-Type: application/json; charset=utf-8

Body

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

Get collection fields values

Endpoint

GET /admin/collections/:collection_id/collection_field_values.json

Parameters

Name Description
collection_id collection id

Request

Route

GET /admin/collections/1/collection_field_values.json

Headers

Authorization: Basic ZGlnaXRhbC1nb29kczpjNTFjOTA3MDdhMTNjZTNmZmYyMTNhZmJiNWNkMTI3MA==

Response

Simulated Response

Status

200

Headers

API-Usage-Limit: 1/500
Content-Type: application/json; charset=utf-8

Body

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

Update collection field value by handle

Endpoint

PUT /admin/collections/:collection_id/collection_field_values/:field_handle.json

Parameters

Name Description
collection_id collection id
field_handle field handle
collection_field_value[value] field value

Request

Route

PUT /admin/collections/1/collection_field_values/handle2.json

Headers

Content-Type: application/json
Authorization: Basic ZGlnaXRhbC1nb29kczpjNTFjOTA3MDdhMTNjZTNmZmYyMTNhZmJiNWNkMTI3MA==

Body

{
  "collection_field_value": {
    "value": "new test value of field"
  }
}

Response

Simulated Response

Status

200

Headers

API-Usage-Limit: 1/500
Content-Type: application/json; charset=utf-8

Body

{
  "status": "ok"
}

Update collection field value

Endpoint

PUT /admin/collections/:collection_id/collection_field_values/:field_id.json

Parameters

Name Description
collection_id collection id
field_id field_id
collection_field_value[value] field value

Request

Route

PUT /admin/collections/1/collection_field_values/2.json

Headers

Content-Type: application/json
Authorization: Basic ZGlnaXRhbC1nb29kczpjNTFjOTA3MDdhMTNjZTNmZmYyMTNhZmJiNWNkMTI3MA==

Body

{
  "collection_field_value": {
    "value": "new test value of field"
  }
}

Response

Simulated Response

Status

200

Headers

API-Usage-Limit: 1/500
Content-Type: application/json; charset=utf-8

Body

{
  "status": "ok"
}

CollectionFilter

Create collection filter

Endpoint

POST /admin/collection_filters.json

Parameters

Name Description
filter[title] required filter title
filter[collection_id] required collection id
filter[description] description
filter[permalink] filter permalink
filter[html_title] tag title
filter[meta_keywords] tag keyword
filter[meta_description] tag description
filter[properties_attributes] properties
filter[options_attributes] options
filter[field_values_attributes] collection filter field values attributes

Request

Route

POST /admin/collection_filters.json

Headers

Content-Type: application/json
Authorization: Basic ZGlnaXRhbC1nb29kczpjNTFjOTA3MDdhMTNjZTNmZmYyMTNhZmJiNWNkMTI3MA==

Body

{
  "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
      }
    ]
  }
}

Response

Simulated Response

Status

201

Headers

API-Usage-Limit: 1/500
Content-Type: application/json; charset=utf-8

Body

{
  "id": 4,
  "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": 898582778,
      "property_id": 35187297,
      "position": 1,
      "title": "first prop value",
      "permalink": "first-prop-value"
    },
    {
      "id": 898582779,
      "property_id": 35187298,
      "position": 1,
      "title": "second property value",
      "permalink": "second-property-value"
    }
  ],
  "option_values": [
    {
      "id": 21063157,
      "option_name_id": 2517843,
      "position": 1,
      "title": "first option value",
      "image_url": null
    },
    {
      "id": 21063158,
      "option_name_id": 2517844,
      "position": 1,
      "title": "second option value",
      "image_url": null
    }
  ]
}

Delete collection filter

Endpoint

DELETE /admin/collection_filters/:filter_id.json

Parameters

Name Description
filter[id] required filter id

Request

Route

DELETE /admin/collection_filters/1.json

Headers

Authorization: Basic ZGlnaXRhbC1nb29kczpjNTFjOTA3MDdhMTNjZTNmZmYyMTNhZmJiNWNkMTI3MA==
Content-Type: application/x-www-form-urlencoded

Response

Simulated Response

Status

200

Headers

API-Usage-Limit: 1/500
Content-Type: application/json

Get collection filter

Endpoint

GET /admin/collection_filters/:filter_id.json

Parameters

Name Description
filter_id filter id

Request

Route

GET /admin/collection_filters/1.json

Headers

Authorization: Basic ZGlnaXRhbC1nb29kczpjNTFjOTA3MDdhMTNjZTNmZmYyMTNhZmJiNWNkMTI3MA==

Response

Simulated Response

Status

200

Headers

API-Usage-Limit: 1/500
Content-Type: application/json; charset=utf-8

Body

{
  "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": [

  ]
}

Get collection filters

Endpoint

GET /admin/collection_filters.json?collection_id=:collection_id

Parameters

Name Description
collection_id collection id

Request

Route

GET /admin/collection_filters.json?collection_id=1

Headers

Authorization: Basic ZGlnaXRhbC1nb29kczpjNTFjOTA3MDdhMTNjZTNmZmYyMTNhZmJiNWNkMTI3MA==

Query Parameters

collection_id=1

Response

Simulated Response

Status

200

Headers

API-Usage-Limit: 1/500
Content-Type: application/json; charset=utf-8

Body

[
  {
    "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
      },
      {
        "id": 2,
        "option_name_id": 1,
        "position": 2,
        "title": "Зеленый",
        "image_url": null
      }
    ]
  }
]

Update collection filter

Endpoint

PUT /admin/collection_filters/:filter_id.json

Parameters

Name Description
filter[id] required filter id
filter[title] filter title
filter[collection_id] collection id
filter[description] description
filter[permalink] filter permalink
filter[html_title] tag title
filter[meta_keywords] tag keyword
filter[meta_description] tag description
filter[properties_attributes] properties
filter[options_attributes] options
filter[field_values_attributes] collection filter field values attributes

Request

Route

PUT /admin/collection_filters/1.json

Headers

Content-Type: application/json
Authorization: Basic ZGlnaXRhbC1nb29kczpjNTFjOTA3MDdhMTNjZTNmZmYyMTNhZmJiNWNkMTI3MA==

Body

{
  "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
      }
    ]
  }
}

Response

Simulated Response

Status

200

Headers

API-Usage-Limit: 1/500
Content-Type: application/json; charset=utf-8

Body

{
  "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": 898582782,
      "property_id": 35187301,
      "position": 1,
      "title": "first prop value",
      "permalink": "first-prop-value"
    },
    {
      "id": 898582783,
      "property_id": 35187302,
      "position": 1,
      "title": "second property value",
      "permalink": "second-property-value"
    }
  ],
  "option_values": [
    {
      "id": 21063161,
      "option_name_id": 2517847,
      "position": 1,
      "title": "first option value",
      "image_url": null
    },
    {
      "id": 21063162,
      "option_name_id": 2517848,
      "position": 1,
      "title": "second option value",
      "image_url": null
    }
  ]
}

CustomStatus

Create custom status

For more information about custom statuses More info

Endpoint

POST /admin/custom_statuses.json

Parameters

Name Description
custom_status[system_status] required system status
custom_status[title] required description

Request

Route

POST /admin/custom_statuses.json

Headers

Content-Type: application/json
Authorization: Basic ZGlnaXRhbC1nb29kczpjNTFjOTA3MDdhMTNjZTNmZmYyMTNhZmJiNWNkMTI3MA==

Body

{
  "custom_status": {
    "system_status": "new",
    "title": "New (ordered by phone)"
  }
}

Response

Simulated Response

Status

201

Headers

API-Usage-Limit: 1/500
Content-Type: application/json; charset=utf-8

Body

{
  "id": 6,
  "permalink": "new-ordered-by-phone",
  "position": 2,
  "system_status": "new",
  "created_at": "2024-10-05T00:56:20.174+03:00",
  "updated_at": "2024-10-05T00:56:20.174+03:00",
  "is_default": false,
  "title": "New (ordered by phone)",
  "color": "#DC5F59"
}

Destroy custom status

For more information about custom statuses More info

Endpoint

DELETE /admin/custom_statuses/:custom_status_permalink.json

Request

Route

DELETE /admin/custom_statuses/novyy.json

Headers

Content-Type: application/json
Authorization: Basic ZGlnaXRhbC1nb29kczpjNTFjOTA3MDdhMTNjZTNmZmYyMTNhZmJiNWNkMTI3MA==

Response

Simulated Response

Status

200

Headers

API-Usage-Limit: 1/500
Content-Type: application/json; charset=utf-8

Body

{
  "status": "ok"
}

Get custom status

For more information about custom statuses More info

Endpoint

GET /admin/custom_statuses/:custom_status_permalink.json

Request

Route

GET /admin/custom_statuses/novyy.json

Headers

Authorization: Basic ZGlnaXRhbC1nb29kczpjNTFjOTA3MDdhMTNjZTNmZmYyMTNhZmJiNWNkMTI3MA==

Response

Simulated Response

Status

200

Headers

API-Usage-Limit: 1/500
Content-Type: application/json; charset=utf-8

Body

{
  "id": 2,
  "permalink": "novyy",
  "position": 1,
  "system_status": "new",
  "created_at": "2024-10-05T00:56:19.953+03:00",
  "updated_at": "2024-10-05T00:56:19.953+03:00",
  "is_default": true,
  "title": "Новый",
  "color": "#DC5F59"
}

Get custom statuses

For more information about custom statuses More info

Endpoint

GET /admin/custom_statuses.json

Request

Route

GET /admin/custom_statuses.json

Headers

Authorization: Basic ZGlnaXRhbC1nb29kczpjNTFjOTA3MDdhMTNjZTNmZmYyMTNhZmJiNWNkMTI3MA==

Response

Simulated Response

Status

200

Headers

API-Usage-Limit: 1/500
Content-Type: application/json; charset=utf-8

Body

[
  {
    "id": null,
    "permalink": "new",
    "position": null,
    "system_status": "new",
    "created_at": null,
    "updated_at": null,
    "is_default": true,
    "title": "Новый",
    "color": "#DC5F59"
  },
  {
    "id": null,
    "permalink": "accepted",
    "position": null,
    "system_status": "accepted",
    "created_at": null,
    "updated_at": null,
    "is_default": true,
    "title": "В обработке",
    "color": "#85C5E0"
  },
  {
    "id": null,
    "permalink": "approved",
    "position": null,
    "system_status": "approved",
    "created_at": null,
    "updated_at": null,
    "is_default": true,
    "title": "Согласован",
    "color": "#86AA60"
  },
  {
    "id": null,
    "permalink": "dispatched",
    "position": null,
    "system_status": "dispatched",
    "created_at": null,
    "updated_at": null,
    "is_default": true,
    "title": "Отгружен",
    "color": "#3A9FC9"
  },
  {
    "id": null,
    "permalink": "delivered",
    "position": null,
    "system_status": "delivered",
    "created_at": null,
    "updated_at": null,
    "is_default": true,
    "title": "Доставлен",
    "color": "#249641"
  },
  {
    "id": null,
    "permalink": "returning",
    "position": null,
    "system_status": "returning",
    "created_at": null,
    "updated_at": null,
    "is_default": true,
    "title": "В процессе возврата",
    "color": "#686A69"
  },
  {
    "id": null,
    "permalink": "declined",
    "position": null,
    "system_status": "declined",
    "created_at": null,
    "updated_at": null,
    "is_default": true,
    "title": "Отменен",
    "color": "#929594"
  },
  {
    "id": null,
    "permalink": "returned",
    "position": null,
    "system_status": "returned",
    "created_at": null,
    "updated_at": null,
    "is_default": true,
    "title": "Возврат",
    "color": "#A69196"
  }
]

Update custom status

For more information about custom statuses More info

Endpoint

PUT /admin/custom_statuses/:custom_status_permalink.json

Parameters

Name Description
custom_status[title] discount

Request

Route

PUT /admin/custom_statuses/novyy.json

Headers

Content-Type: application/json
Authorization: Basic ZGlnaXRhbC1nb29kczpjNTFjOTA3MDdhMTNjZTNmZmYyMTNhZmJiNWNkMTI3MA==

Body

{
  "custom_status": {
    "title": "New (ordered by website)"
  }
}

Response

Simulated Response

Status

200

Headers

API-Usage-Limit: 1/500
Content-Type: application/json; charset=utf-8

Body

{
  "status": "ok"
}

DeliveryVariant

Create delivery_variant External

DeliveryVariant::External is an external delivery variant.

Endpoint

POST /admin/delivery_variants.json

Parameters

Name Description
delivery_variant[title] required title
delivery_variant[type] required DeliveryVariant::External, DeliveryVariant::Fixed, DeliveryVariant::LocationDepend, DeliveryVariant::MapZoneDelivery, DeliveryVariant::None, DeliveryVariant::OfficialEmsShipping, DeliveryVariant::OfficialFirstClass, DeliveryVariant::OfficialRussianpost, DeliveryVariant::PickUp, DeliveryVariant::PriceDepend
delivery_variant[description] description
delivery_variant[position] position
delivery_variant[add_payment_gateways] set true to add all payment variants
delivery_variant[delivery_locations_attributes] array of delivery locations
delivery_variant[delivery_locations_attributes][country] Optional. Default: RU. It should be enabled in checkout options to be binded to shipping method.
delivery_variant[delivery_locations_attributes][region] Required. Field Region should be enabled in checkout options to be binded to shipping method. Examples: "Ивановская", "Омская"
delivery_variant[delivery_locations_attributes][area] Optional. Ignored if city present. Field Region should be filled. Examples: "Знаменский"
delivery_variant[delivery_locations_attributes][city] Optional. Field Region should be filled. Examples: "Омск"
delivery_variant[inverted] false by default, if true this delivery variant will be available for all regions except passed in parameters 'country', 'region' and 'city'
delivery_variant[charge_up_to] free on orders from given sum
delivery_variant[javascript] if needed, paste javascript to be displayed on page of delivery variant selection
delivery_variant[url] url for sending request on delivery price estimation
delivery_variant[api_version] 'v1' or 'v2' (recomended)
delivery_variant[customer_pickup] false by default, set it true if this delivery variant is customer pickup

Request

Route

POST /admin/delivery_variants.json

Headers

Content-Type: application/json
Authorization: Basic ZGlnaXRhbC1nb29kczpjNTFjOTA3MDdhMTNjZTNmZmYyMTNhZmJiNWNkMTI3MA==

Body

{
  "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"
  }
}

Response

Simulated Response

Status

201

Headers

API-Usage-Limit: 1/500
Content-Type: application/json; charset=utf-8

Body

{
  "id": 21,
  "updated_at": "2024-10-05T00:56:09.000+03:00",
  "created_at": "2024-10-05T00:56:09.000+03:00",
  "position": 1,
  "inverted": false,
  "charge_up_to": "1000.0",
  "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,
  "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": 12,
      "payment_gateway_id": 1,
      "created_at": "2024-10-05T00:56:09.000+03:00"
    },
    {
      "id": 13,
      "payment_gateway_id": 3,
      "created_at": "2024-10-05T00:56:09.000+03:00"
    },
    {
      "id": 14,
      "payment_gateway_id": 4,
      "created_at": "2024-10-05T00:56:09.000+03:00"
    }
  ],
  "delivery_locations": [
    {
      "id": 4,
      "region": "A",
      "city": "B",
      "country": "RU"
    }
  ],
  "delivery_time_intervals": [

  ]
}

Create delivery_variant Fixed

DeliveryVariant::Fixed is a delivery variant with a fixed delivery price.

Endpoint

POST /admin/delivery_variants.json

Parameters

Name Description
delivery_variant[title] required title
delivery_variant[type] required DeliveryVariant::External, DeliveryVariant::Fixed, DeliveryVariant::LocationDepend, DeliveryVariant::MapZoneDelivery, DeliveryVariant::None, DeliveryVariant::OfficialEmsShipping, DeliveryVariant::OfficialFirstClass, DeliveryVariant::OfficialRussianpost, DeliveryVariant::PickUp, DeliveryVariant::PriceDepend
delivery_variant[description] description
delivery_variant[position] position
delivery_variant[add_payment_gateways] set true to add all payment variants
delivery_variant[delivery_locations_attributes] array of delivery locations
delivery_variant[delivery_locations_attributes][country] if shop has many countries, fill this field;it should be enabled in checkout options to be binded to shipping method
delivery_variant[delivery_locations_attributes][region] field Region should be enabled in checkout options to be binded to shipping method
delivery_variant[delivery_locations_attributes][city] field Region should be filled
delivery_variant[inverted] false by default, if true this delivery variant will be available for all regions except passed in parameters 'country', 'region' and 'city'
delivery_variant[charge_up_to] free on orders from given sum
delivery_variant[price] required delivery price
delivery_variant[javascript] if needed, paste javascript to be displayed on page of delivery variant selection
delivery_variant[show_calendar_in_checkout] show delivery date selection in checkout
delivery_variant[delivery_date_required] delivery date selection is required in chekout
delivery_variant[forbid_weekends] weekend days are forbidden for delivery
delivery_variant[estimated_delivery_period] estimated delivery period
delivery_variant[order_time_is_later] increase estimated delivery time for one day if order time is later
delivery_variant[forbidden_days] forbidden days for delivery (23.02,08.03,..)
delivery_variant[show_time_intervals_in_checkout] show delivery time intervals in checkout
delivery_variant[time_intervals_required] delivery time interval selection is required in checkout
delivery_variant[time_intervals] time intervals (10-12, 12-16, ...)

Request

Route

POST /admin/delivery_variants.json

Headers

Content-Type: application/json
Authorization: Basic ZGlnaXRhbC1nb29kczpjNTFjOTA3MDdhMTNjZTNmZmYyMTNhZmJiNWNkMTI3MA==

Body

{
  "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"
  }
}

Response

Simulated Response

Status

201

Headers

API-Usage-Limit: 1/500
Content-Type: application/json; charset=utf-8

Body

{
  "id": 19,
  "updated_at": "2024-10-05T00:56:09.000+03:00",
  "created_at": "2024-10-05T00:56:09.000+03:00",
  "position": 1,
  "inverted": false,
  "charge_up_to": "1000.0",
  "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,
  "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": 6,
      "payment_gateway_id": 1,
      "created_at": "2024-10-05T00:56:09.000+03:00"
    },
    {
      "id": 7,
      "payment_gateway_id": 3,
      "created_at": "2024-10-05T00:56:09.000+03:00"
    },
    {
      "id": 8,
      "payment_gateway_id": 4,
      "created_at": "2024-10-05T00:56:09.000+03:00"
    }
  ],
  "delivery_locations": [
    {
      "id": 2,
      "region": "A",
      "city": "B",
      "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
    }
  ]
}

Create delivery_variant LocationDepend

DeliveryVariant::LocationDepend is a delivery variant where delivery price depends on location (through delivery zones) and weight of delivered object.

Endpoint

POST /admin/delivery_variants.json

Parameters

Name Description
delivery_variant[title] required title
delivery_variant[type] required DeliveryVariant::External, DeliveryVariant::Fixed, DeliveryVariant::LocationDepend, DeliveryVariant::MapZoneDelivery, DeliveryVariant::None, DeliveryVariant::OfficialEmsShipping, DeliveryVariant::OfficialFirstClass, DeliveryVariant::OfficialRussianpost, DeliveryVariant::PickUp, DeliveryVariant::PriceDepend
delivery_variant[description] description
delivery_variant[position] position
delivery_variant[add_payment_gateways] set true to add all payment variants
delivery_variant[delivery_locations_attributes] array of delivery locations
delivery_variant[delivery_locations_attributes][country] if shop has many countries, fill this field;it should be enabled in checkout options to be binded to shipping method
delivery_variant[delivery_locations_attributes][region] field Region should be enabled in checkout options to be binded to shipping method
delivery_variant[delivery_locations_attributes][city] field Region should be filled
delivery_variant[inverted] false by default, if true this delivery variant will be available for all regions except passed in parameters 'country', 'region' and 'city'
delivery_variant[charge_up_to] free on orders from given sum
delivery_variant[delivery_zones_attributes] required array of delivery zones
delivery_variant[delivery_zones_attributes][title] title of delivery zone
delivery_variant[delivery_zones_attributes][tariffs_attributes] required array of tariffs attributes for delivery zone
delivery_variant[delivery_zones_attributes][tariffs_attributes][price] required delivery tariff price
delivery_variant[delivery_zones_attributes][tariffs_attributes][step] required increment which increases delivery price; measured in kg
delivery_variant[delivery_zones_attributes][tariffs_attributes][step_price] required price of increment
delivery_variant[delivery_zones_attributes][tariffs_attributes][max_weight] required max weight for tariff
delivery_variant[delivery_zones_attributes][locations_attributes] array of locations in delivery zone
delivery_variant[delivery_zones_attributes][locations_attributes][country] required field country should be enabled in checkout options to be binded to shipping method
delivery_variant[delivery_zones_attributes][locations_attributes][region] field Region should be enabled in checkout options to be binded to shipping method
delivery_variant[delivery_locations_attributes][locations_attributes][city] field Region should be filled

Request

Route

POST /admin/delivery_variants.json

Headers

Content-Type: application/json
Authorization: Basic ZGlnaXRhbC1nb29kczpjNTFjOTA3MDdhMTNjZTNmZmYyMTNhZmJiNWNkMTI3MA==

Body

{
  "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"
  }
}

Response

Simulated Response

Status

201

Headers

API-Usage-Limit: 1/500
Content-Type: application/json; charset=utf-8

Body

{
  "id": 23,
  "updated_at": "2024-10-05T00:56:09.000+03:00",
  "created_at": "2024-10-05T00:56:09.000+03:00",
  "position": 1,
  "inverted": true,
  "charge_up_to": "1000.0",
  "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,
  "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": 18,
      "payment_gateway_id": 1,
      "created_at": "2024-10-05T00:56:09.000+03:00"
    },
    {
      "id": 19,
      "payment_gateway_id": 3,
      "created_at": "2024-10-05T00:56:09.000+03:00"
    },
    {
      "id": 20,
      "payment_gateway_id": 4,
      "created_at": "2024-10-05T00:56:09.000+03:00"
    }
  ],
  "delivery_locations": [
    {
      "id": 7,
      "region": "A",
      "city": "B",
      "country": "RU"
    }
  ],
  "delivery_time_intervals": [

  ],
  "delivery_zones": [
    {
      "id": 2,
      "title": "test",
      "tariffs": [
        {
          "id": 2,
          "max_weight": "30.0",
          "price": "100.0",
          "step": "2.0",
          "step_price": "50.0"
        }
      ],
      "locations": [
        {
          "id": 8,
          "region": "C",
          "city": "D",
          "country": "A"
        }
      ]
    }
  ]
}

Create delivery_variant PickUp

DeliveryVariant::PickUp is a delivery variant with a fixed delivery price.

Endpoint

POST /admin/delivery_variants.json

Parameters

Name Description
delivery_variant[title] required title
delivery_variant[type] required DeliveryVariant::External, DeliveryVariant::Fixed, DeliveryVariant::LocationDepend, DeliveryVariant::MapZoneDelivery, DeliveryVariant::None, DeliveryVariant::OfficialEmsShipping, DeliveryVariant::OfficialFirstClass, DeliveryVariant::OfficialRussianpost, DeliveryVariant::PickUp, DeliveryVariant::PriceDepend
delivery_variant[description] description
delivery_variant[position] position
delivery_variant[add_payment_gateways] set true to add all payment variants
delivery_variant[delivery_locations_attributes] array of delivery locations
delivery_variant[delivery_locations_attributes][country] if shop has many countries, fill this field;it should be enabled in checkout options to be binded to shipping method
delivery_variant[delivery_locations_attributes][region] field Region should be enabled in checkout options to be binded to shipping method
delivery_variant[delivery_locations_attributes][city] field Region should be filled
delivery_variant[inverted] false by default, if true this delivery variant will be available for all regions except passed in parameters 'country', 'region' and 'city'
delivery_variant[charge_up_to] free on orders from given sum
delivery_variant[javascript] if needed, paste javascript to be displayed on page of delivery variant selection
delivery_variant[show_calendar_in_checkout] show delivery date selection in checkout
delivery_variant[delivery_date_required] delivery date selection is required in chekout
delivery_variant[forbid_weekends] weekend days are forbidden for delivery
delivery_variant[estimated_delivery_period] estimated delivery period
delivery_variant[order_time_is_later] increase estimated delivery time for one day if order time is later
delivery_variant[forbidden_days] forbidden days for delivery (23.02,08.03,..)
delivery_variant[show_time_intervals_in_checkout] show delivery time intervals in checkout
delivery_variant[time_intervals_required] delivery time interval selection is required in checkout
delivery_variant[time_intervals] time intervals (10-12, 12-16, ...)
delivery_variant[pick_up_sources_attributes] array of pick up sources
delivery_variant[pick_up_sources_attributes][title] required title
delivery_variant[pick_up_sources_attributes][http_method] required http method (GET, POST) used for request
delivery_variant[pick_up_sources_attributes][url] required url for receiving list of delivery points
delivery_variant[pick_up_sources_attributes][point_info_url] required url for receiving delivery info to the selected point

Request

Route

POST /admin/delivery_variants.json

Headers

Content-Type: application/json
Authorization: Basic ZGlnaXRhbC1nb29kczpjNTFjOTA3MDdhMTNjZTNmZmYyMTNhZmJiNWNkMTI3MA==

Body

{
  "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://my_awesome_domain.com/get_points",
        "point_info_url": "https://my_awesome_domain.com/get_point_info"
      }
    ]
  },
  "delivery_variant[pick_up_sources_attributes]": {
    "title": "express delivery",
    "http_method": "post"
  }
}

Response

Simulated Response

Status

201

Headers

API-Usage-Limit: 1/500
Content-Type: application/json; charset=utf-8

Body

{
  "id": 27,
  "updated_at": "2024-10-05T00:56:10.000+03:00",
  "created_at": "2024-10-05T00:56:10.000+03:00",
  "position": 1,
  "inverted": false,
  "charge_up_to": "1000.0",
  "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,
  "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": 32,
      "payment_gateway_id": 1,
      "created_at": "2024-10-05T00:56:10.000+03:00"
    },
    {
      "id": 33,
      "payment_gateway_id": 3,
      "created_at": "2024-10-05T00:56:10.000+03:00"
    },
    {
      "id": 34,
      "payment_gateway_id": 4,
      "created_at": "2024-10-05T00:56:10.000+03:00"
    },
    {
      "id": 35,
      "payment_gateway_id": 20,
      "created_at": "2024-10-05T00:56:10.000+03:00"
    }
  ],
  "delivery_locations": [
    {
      "id": 12,
      "region": "A",
      "city": "B",
      "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,
      "method": "POST",
      "url": "https://my_awesome_domain.com/get_points",
      "created_at": "2024-10-05T00:56:10.351+03:00",
      "point_info_url": "https://my_awesome_domain.com/get_point_info"
    }
  ],
  "pick_up_source_delivery_variants": [
    {
      "id": 2,
      "pick_up_source_id": 2,
      "created_at": "2024-10-05T00:56:10.352+03:00"
    }
  ]
}

Create delivery_variant PriceDepend

DeliveryVariant::PriceDepend is a delivery variant with rules which define delivery price depending on order sum and weight.

Endpoint

POST /admin/delivery_variants.json

Parameters

Name Description
delivery_variant[title] required title
delivery_variant[type] required DeliveryVariant::External, DeliveryVariant::Fixed, DeliveryVariant::LocationDepend, DeliveryVariant::MapZoneDelivery, DeliveryVariant::None, DeliveryVariant::OfficialEmsShipping, DeliveryVariant::OfficialFirstClass, DeliveryVariant::OfficialRussianpost, DeliveryVariant::PickUp, DeliveryVariant::PriceDepend
delivery_variant[description] description
delivery_variant[position] position
delivery_variant[add_payment_gateways] set true to add all payment variants
delivery_variant[delivery_locations_attributes] array of delivery locations
delivery_variant[delivery_locations_attributes][country] if shop has many countries, fill this field;it should be enabled in checkout options to be binded to shipping method
delivery_variant[delivery_locations_attributes][region] field Region should be enabled in checkout options to be binded to shipping method
delivery_variant[delivery_locations_attributes][city] field Region should be filled
delivery_variant[inverted] false by default, if true this delivery variant will be available for all regions except passed in parameters 'country', 'region' and 'city'
delivery_variant[charge_up_to] free on orders from given sum
delivery_variant[min_price] minimal delivery price
delivery_variant[rules_attributes] array of rules define delivery price depending on order sum and weight
delivery_variant[rules_attributes][price] delivery price by a rule
delivery_variant[rules_attributes][order_price] order sum by a rule
delivery_variant[rules_attributes][order_weight] order weight by a rule

Request

Route

POST /admin/delivery_variants.json

Headers

Content-Type: application/json
Authorization: Basic ZGlnaXRhbC1nb29kczpjNTFjOTA3MDdhMTNjZTNmZmYyMTNhZmJiNWNkMTI3MA==

Body

{
  "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
      }
    ]
  }
}

Response

Simulated Response

Status

201

Headers

API-Usage-Limit: 1/500
Content-Type: application/json; charset=utf-8

Body

{
  "id": 25,
  "updated_at": "2024-10-05T00:56:09.000+03:00",
  "created_at": "2024-10-05T00:56:09.000+03:00",
  "position": 1,
  "inverted": false,
  "charge_up_to": "1000.0",
  "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,
  "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": 24,
      "payment_gateway_id": 1,
      "created_at": "2024-10-05T00:56:09.000+03:00"
    },
    {
      "id": 25,
      "payment_gateway_id": 3,
      "created_at": "2024-10-05T00:56:09.000+03:00"
    },
    {
      "id": 26,
      "payment_gateway_id": 4,
      "created_at": "2024-10-05T00:56:09.000+03:00"
    }
  ],
  "delivery_locations": [
    {
      "id": 10,
      "region": "A",
      "city": "B",
      "country": "RU"
    }
  ],
  "delivery_time_intervals": [

  ],
  "rules": [
    {
      "id": 10,
      "order_price": "10.0",
      "price": "300.0",
      "order_weight": "1.0"
    }
  ]
}

Destroy delivery_variant

Endpoint

DELETE /admin/delivery_variants/:delivery_variant_id.json

Request

Route

DELETE /admin/delivery_variants/2.json

Headers

Content-Type: application/json
Authorization: Basic ZGlnaXRhbC1nb29kczpjNTFjOTA3MDdhMTNjZTNmZmYyMTNhZmJiNWNkMTI3MA==

Response

Simulated Response

Status

200

Headers

API-Usage-Limit: 1/500
Content-Type: application/json; charset=utf-8

Body

{
  "status": "ok"
}

Get delivery_variant

Endpoint

GET /admin/delivery_variants/:delivery_variant_id.json

Request

Route

GET /admin/delivery_variants/2.json

Headers

Authorization: Basic ZGlnaXRhbC1nb29kczpjNTFjOTA3MDdhMTNjZTNmZmYyMTNhZmJiNWNkMTI3MA==

Response

Simulated Response

Status

200

Headers

API-Usage-Limit: 1/500
Content-Type: application/json; charset=utf-8

Body

{
  "id": 2,
  "updated_at": "2009-03-31T12:20:34.000+04:00",
  "created_at": "2009-03-30T04:37:32.000+04:00",
  "position": 2,
  "inverted": false,
  "charge_up_to": null,
  "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,
  "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.0,
  "payment_delivery_variants": [
    {
      "id": 2,
      "payment_gateway_id": 1,
      "created_at": "2024-10-05T00:55:42.000+03:00"
    }
  ],
  "delivery_locations": [

  ],
  "delivery_time_intervals": [

  ],
  "rules": [
    {
      "id": 1,
      "order_price": 2000.0,
      "price": 600.0,
      "order_weight": 10
    },
    {
      "id": 2,
      "order_price": 2000.0,
      "price": 700.0,
      "order_weight": 20
    },
    {
      "id": 3,
      "order_price": 2000.0,
      "price": 800.0,
      "order_weight": null
    },
    {
      "id": 4,
      "order_price": 10000.0,
      "price": 300.0,
      "order_weight": 10
    },
    {
      "id": 5,
      "order_price": 10000.0,
      "price": 400.0,
      "order_weight": 20
    },
    {
      "id": 6,
      "order_price": 10000.0,
      "price": 500.0,
      "order_weight": null
    },
    {
      "id": 7,
      "order_price": null,
      "price": 0.0,
      "order_weight": 10
    },
    {
      "id": 8,
      "order_price": null,
      "price": 100.0,
      "order_weight": 20
    }
  ]
}

Get delivery_variants

Endpoint

GET /admin/delivery_variants.json

Request

Route

GET /admin/delivery_variants.json

Headers

Authorization: Basic ZGlnaXRhbC1nb29kczpjNTFjOTA3MDdhMTNjZTNmZmYyMTNhZmJiNWNkMTI3MA==

Response

Simulated Response

Status

200

Headers

API-Usage-Limit: 1/500
Content-Type: application/json; charset=utf-8

Body

[
  {
    "id": 1,
    "updated_at": "2009-03-31T12:20:34.000+04:00",
    "created_at": "2009-03-30T04:37:32.000+04:00",
    "position": 1,
    "inverted": false,
    "charge_up_to": null,
    "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,
    "estimated_delivery_period": null,
    "order_time_is_later": null,
    "forbidden_days": null,
    "show_time_intervals_in_checkout": null,
    "time_intervals_required": null,
    "price": 100.0,
    "javascript": null,
    "payment_delivery_variants": [
      {
        "id": 1,
        "payment_gateway_id": 1,
        "created_at": "2024-10-05T00:55:42.000+03:00"
      }
    ],
    "delivery_locations": [

    ],
    "delivery_time_intervals": [

    ]
  },
  {
    "id": 2,
    "updated_at": "2009-03-31T12:20:34.000+04:00",
    "created_at": "2009-03-30T04:37:32.000+04:00",
    "position": 2,
    "inverted": false,
    "charge_up_to": null,
    "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,
    "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.0,
    "payment_delivery_variants": [
      {
        "id": 2,
        "payment_gateway_id": 1,
        "created_at": "2024-10-05T00:55:42.000+03:00"
      }
    ],
    "delivery_locations": [

    ],
    "delivery_time_intervals": [

    ],
    "rules": [
      {
        "id": 1,
        "order_price": 2000.0,
        "price": 600.0,
        "order_weight": 10
      },
      {
        "id": 2,
        "order_price": 2000.0,
        "price": 700.0,
        "order_weight": 20
      },
      {
        "id": 3,
        "order_price": 2000.0,
        "price": 800.0,
        "order_weight": null
      },
      {
        "id": 4,
        "order_price": 10000.0,
        "price": 300.0,
        "order_weight": 10
      },
      {
        "id": 5,
        "order_price": 10000.0,
        "price": 400.0,
        "order_weight": 20
      },
      {
        "id": 6,
        "order_price": 10000.0,
        "price": 500.0,
        "order_weight": null
      },
      {
        "id": 7,
        "order_price": null,
        "price": 0.0,
        "order_weight": 10
      },
      {
        "id": 8,
        "order_price": null,
        "price": 100.0,
        "order_weight": 20
      }
    ]
  },
  {
    "id": 3,
    "updated_at": "2009-03-31T12:20:34.000+04:00",
    "created_at": "2009-03-30T04:37:32.000+04:00",
    "position": 3,
    "inverted": false,
    "charge_up_to": null,
    "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,
    "estimated_delivery_period": null,
    "order_time_is_later": null,
    "forbidden_days": null,
    "show_time_intervals_in_checkout": null,
    "time_intervals_required": null,
    "url": null,
    "javascript": null,
    "customer_pickup": false,
    "payment_delivery_variants": [

    ],
    "delivery_locations": [

    ],
    "delivery_time_intervals": [

    ]
  },
  {
    "id": 4,
    "updated_at": "2009-03-31T12:20:34.000+04:00",
    "created_at": "2009-03-30T04:37:32.000+04:00",
    "position": 3,
    "inverted": false,
    "charge_up_to": null,
    "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,
    "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": [

    ]
  }
]

Update delivery variant

Endpoint

PUT /admin/delivery_variants/:delivery_variant_id.json

Parameters

Name Description
delivery_variant[title] title
delivery_variant[description] description
delivery_variant[position] position
delivery_variant[add_payment_gateways] set true to add all payment variants
delivery_variant[charge_up_to] free on orders from given sum
delivery_variant[payment_delivery_variants_attributes] array of available payment gateways for this delivery variant
delivery_variant[pick_up_sources_attributes] array of pick up sources
delivery_variant[payment_delivery_variants_attributes][_destroy] set it 1 to delete this payment variant
delivery_variant[payment_delivery_variants_attributes][id] only for removal: id of delivery variant and payment gateway binding you want to delete
delivery_variant[payment_delivery_variants_attributes][payment_gateway_id] for creation: id of payment gateway you want to bind with this delivery variant

Request

Route

PUT /admin/delivery_variants/2.json

Headers

Content-Type: application/json
Authorization: Basic ZGlnaXRhbC1nb29kczpjNTFjOTA3MDdhMTNjZTNmZmYyMTNhZmJiNWNkMTI3MA==

Body

{
  "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://my_awesome_domain.com/get_points",
        "point_info_url": "https://my_awesome_domain.com/get_point_info"
      }
    ]
  }
}

Response

Simulated Response

Status

200

Headers

API-Usage-Limit: 1/500
Content-Type: application/json; charset=utf-8

Body

{
  "charge_up_to": "2500.0",
  "position": 1,
  "id": 2,
  "updated_at": "2024-10-05T00:56:10.000+03:00",
  "created_at": "2009-03-30T04:37:32.000+04:00",
  "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,
  "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.0,
  "payment_delivery_variants": [
    {
      "id": 42,
      "payment_gateway_id": 3,
      "created_at": "2024-10-05T00:56:10.000+03:00"
    }
  ],
  "delivery_locations": [

  ],
  "delivery_time_intervals": [

  ],
  "rules": [
    {
      "id": 1,
      "order_price": 2000.0,
      "price": 600.0,
      "order_weight": 10
    },
    {
      "id": 2,
      "order_price": 2000.0,
      "price": 700.0,
      "order_weight": 20
    },
    {
      "id": 3,
      "order_price": 2000.0,
      "price": 800.0,
      "order_weight": null
    },
    {
      "id": 4,
      "order_price": 10000.0,
      "price": 300.0,
      "order_weight": 10
    },
    {
      "id": 5,
      "order_price": 10000.0,
      "price": 400.0,
      "order_weight": 20
    },
    {
      "id": 6,
      "order_price": 10000.0,
      "price": 500.0,
      "order_weight": null
    },
    {
      "id": 7,
      "order_price": null,
      "price": 0.0,
      "order_weight": 10
    },
    {
      "id": 8,
      "order_price": null,
      "price": 100.0,
      "order_weight": 20
    }
  ]
}

DiscountCode

Create discount code

Endpoint

POST /admin/discount_codes.json

Parameters

Name Description
discount_code[code] required code
discount_code[description] description
discount_code[disabled] disabled
discount_code[act_once] act once
discount_code[act_once_for_client] act once for client
discount_code[expired_at] expired at
discount_code[type_id] required type_id (1 - percent, 2 - money)
discount_code[discount] required discount
discount_code[min_price] min price

Request

Route

POST /admin/discount_codes.json

Headers

Content-Type: application/json
Authorization: Basic ZGlnaXRhbC1nb29kczpjNTFjOTA3MDdhMTNjZTNmZmYyMTNhZmJiNWNkMTI3MA==

Body

{
  "discount_code": {
    "code": "BIRTHDAY",
    "description": "Birthday discount",
    "act_once_for_client": true,
    "expired_at": "2024-10-12",
    "type_id": 1,
    "discount": 10,
    "min_price": 500
  }
}

Response

Simulated Response

Status

201

Headers

API-Usage-Limit: 1/500
Content-Type: application/json; charset=utf-8

Body

{
  "id": 174,
  "code": "birthday",
  "disabled": true,
  "act_once": true,
  "expired_at": "2024-10-12",
  "type_id": 1,
  "discount": "10.0",
  "description": "Birthday discount",
  "created_at": "2024-10-05T00:56:21.038+03:00",
  "updated_at": "2024-10-05T00:56:21.041+03:00",
  "skip_discounted_product": null,
  "min_price": "500.0",
  "act_once_for_client": true,
  "skip_bundles": null,
  "worked": false,
  "discount_collections": [

  ]
}

Destroy discount code

Endpoint

DELETE /admin/discount_codes/:discount_code_id.json

Request

Route

DELETE /admin/discount_codes/1.json

Headers

Content-Type: application/json
Authorization: Basic ZGlnaXRhbC1nb29kczpjNTFjOTA3MDdhMTNjZTNmZmYyMTNhZmJiNWNkMTI3MA==

Response

Simulated Response

Status

200

Headers

API-Usage-Limit: 1/500
Content-Type: application/json; charset=utf-8

Body

{
  "status": "ok"
}

Get discount code

Endpoint

GET /admin/discount_codes/:discount_code_id.json

Request

Route

GET /admin/discount_codes/1.json

Headers

Authorization: Basic ZGlnaXRhbC1nb29kczpjNTFjOTA3MDdhMTNjZTNmZmYyMTNhZmJiNWNkMTI3MA==

Response

Simulated Response

Status

200

Headers

API-Usage-Limit: 1/500
Content-Type: application/json; charset=utf-8

Body

{
  "id": 1,
  "code": "dc1",
  "disabled": false,
  "act_once": true,
  "expired_at": "2020-12-12",
  "type_id": 1,
  "discount": "30.0",
  "description": "процентная скидка",
  "created_at": "2009-03-18T10:53:14.000+03:00",
  "updated_at": "2009-03-18T10:53:15.000+03:00",
  "skip_discounted_product": null,
  "min_price": null,
  "act_once_for_client": null,
  "skip_bundles": null,
  "worked": false,
  "discount_collections": [

  ]
}

Get discount codes

Endpoint

GET /admin/discount_codes.json

Request

Route

GET /admin/discount_codes.json

Headers

Authorization: Basic ZGlnaXRhbC1nb29kczpjNTFjOTA3MDdhMTNjZTNmZmYyMTNhZmJiNWNkMTI3MA==

Response

Simulated Response

Status

200

Headers

API-Usage-Limit: 1/500
Content-Type: application/json; charset=utf-8

Body

[
  {
    "id": 2,
    "code": "dc2",
    "disabled": false,
    "act_once": true,
    "expired_at": "2020-12-12",
    "type_id": 2,
    "discount": "100.0",
    "description": "фиксированная скидка",
    "created_at": "2009-03-18T10:53:14.000+03:00",
    "updated_at": "2009-03-18T10:53:15.000+03:00",
    "skip_discounted_product": null,
    "min_price": null,
    "act_once_for_client": null,
    "skip_bundles": null,
    "worked": false,
    "discount_collections": [

    ]
  },
  {
    "id": 1,
    "code": "dc1",
    "disabled": false,
    "act_once": true,
    "expired_at": "2020-12-12",
    "type_id": 1,
    "discount": "30.0",
    "description": "процентная скидка",
    "created_at": "2009-03-18T10:53:14.000+03:00",
    "updated_at": "2009-03-18T10:53:15.000+03:00",
    "skip_discounted_product": null,
    "min_price": null,
    "act_once_for_client": null,
    "skip_bundles": null,
    "worked": false,
    "discount_collections": [

    ]
  }
]

Update discount code

Endpoint

PUT /admin/discount_codes/:discount_code_id.json

Parameters

Name Description
discount_code[discount] discount

Request

Route

PUT /admin/discount_codes/1.json

Headers

Content-Type: application/json
Authorization: Basic ZGlnaXRhbC1nb29kczpjNTFjOTA3MDdhMTNjZTNmZmYyMTNhZmJiNWNkMTI3MA==

Body

{
  "discount_code": {
    "discount": 15
  }
}

Response

Simulated Response

Status

200

Headers

API-Usage-Limit: 1/500
Content-Type: application/json; charset=utf-8

Body

{
  "status": "ok"
}

Domain

Create domain

Endpoint

POST /admin/domains.json

Parameters

Name Description
domain[domain] required domain
domain[main] boolean, could be false only if there are more than one domain

Request

Route

POST /admin/domains.json

Headers

Content-Type: application/json
Authorization: Basic ZGlnaXRhbC1nb29kczpjNTFjOTA3MDdhMTNjZTNmZmYyMTNhZmJiNWNkMTI3MA==

Body

{
  "domain": {
    "domain": "another-domain.ru",
    "main": true
  }
}

Response

Simulated Response

Status

201

Headers

API-Usage-Limit: 1/500
Content-Type: application/json; charset=utf-8

Body

{
  "id": 16,
  "domain": "another-domain.ru",
  "created_at": "2024-10-05T00:56:11.000+03:00",
  "updated_at": "2024-10-05T00:56:11.000+03:00",
  "main": true
}

Destroy domain

Endpoint

DELETE /admin/domains/:domain_id.json

Request

Route

DELETE /admin/domains/20.json

Headers

Content-Type: application/json
Authorization: Basic ZGlnaXRhbC1nb29kczpjNTFjOTA3MDdhMTNjZTNmZmYyMTNhZmJiNWNkMTI3MA==

Response

Simulated Response

Status

200

Headers

API-Usage-Limit: 1/500
Content-Type: application/json

Get domain

Endpoint

GET /admin/domains/:domain_id.json

Request

Route

GET /admin/domains/12.json

Headers

Authorization: Basic ZGlnaXRhbC1nb29kczpjNTFjOTA3MDdhMTNjZTNmZmYyMTNhZmJiNWNkMTI3MA==

Response

Simulated Response

Status

200

Headers

API-Usage-Limit: 1/500
Content-Type: application/json; charset=utf-8

Body

{
  "id": 12,
  "domain": "some-domain.ru",
  "created_at": "2024-10-05T00:56:11.000+03:00",
  "updated_at": "2024-10-05T00:56:11.000+03:00",
  "main": true
}

Get domains

Endpoint

GET /admin/domains.json

Request

Route

GET /admin/domains.json

Headers

Authorization: Basic ZGlnaXRhbC1nb29kczpjNTFjOTA3MDdhMTNjZTNmZmYyMTNhZmJiNWNkMTI3MA==

Response

Simulated Response

Status

200

Headers

API-Usage-Limit: 1/500
Content-Type: application/json; charset=utf-8

Body

[
  {
    "id": 10,
    "domain": "some-domain.ru",
    "created_at": "2024-10-05T00:56:11.000+03:00",
    "updated_at": "2024-10-05T00:56:11.000+03:00",
    "main": true
  }
]

Update domain

Endpoint

PUT /admin/domains/:domain_id.json

Parameters

Name Description
domain[domain] domain
domain[main] boolean, could be false only if there are more than one domain

Request

Route

PUT /admin/domains/18.json

Headers

Content-Type: application/json
Authorization: Basic ZGlnaXRhbC1nb29kczpjNTFjOTA3MDdhMTNjZTNmZmYyMTNhZmJiNWNkMTI3MA==

Body

{
  "domain": {
    "domain": "other-domain.ru"
  }
}

Response

Simulated Response

Status

200

Headers

API-Usage-Limit: 1/500
Content-Type: application/json; charset=utf-8

Body

{
  "domain": "other-domain.ru",
  "id": 18,
  "created_at": "2024-10-05T00:56:11.000+03:00",
  "updated_at": "2024-10-05T00:56:11.000+03:00",
  "main": true
}

ExternalDiscount

Create external discount

Endpoint

POST /admin/external_discounts.json

Parameters

Name Description
external_discount[description] description
external_discount[url] external service url
external_discount[order_lines_depend] discount calculation depends on order lines
external_discount[active] active
external_discount[observed_fields] discount calculation depends on this order fields (array of field ids)

Request

Route

POST /admin/external_discounts.json

Headers

Content-Type: application/json
Authorization: Basic ZGlnaXRhbC1nb29kczpjNTFjOTA3MDdhMTNjZTNmZmYyMTNhZmJiNWNkMTI3MA==

Body

{
  "external_discount": {
    "description": "Birthday discount",
    "url": "https://myservice.com/birthday_external_discount",
    "order_lines_depend": false,
    "active": true,
    "observed_fields": [
      1,
      2
    ]
  }
}

Response

Simulated Response

Status

201

Headers

API-Usage-Limit: 1/500
Content-Type: application/json; charset=utf-8

Body

{
  "id": 8,
  "url": "https://myservice.com/birthday_external_discount",
  "order_lines_depend": false,
  "created_at": "2024-10-05T00:56:21.000+03:00",
  "updated_at": "2024-10-05T00:56:21.000+03:00",
  "active": true,
  "description": "Birthday discount",
  "observed_fields": [
    1,
    2
  ]
}

Destroy external discount

Endpoint

DELETE /admin/external_discounts/:external_discount_id.json

Request

Route

DELETE /admin/external_discounts/12.json

Headers

Content-Type: application/json
Authorization: Basic ZGlnaXRhbC1nb29kczpjNTFjOTA3MDdhMTNjZTNmZmYyMTNhZmJiNWNkMTI3MA==

Response

Simulated Response

Status

200

Headers

API-Usage-Limit: 1/500
Content-Type: application/json; charset=utf-8

Body

{
  "status": "ok"
}

Get external discount

Endpoint

GET /admin/external_discounts/:external_discount_id.json

Request

Route

GET /admin/external_discounts/4.json

Headers

Authorization: Basic ZGlnaXRhbC1nb29kczpjNTFjOTA3MDdhMTNjZTNmZmYyMTNhZmJiNWNkMTI3MA==

Response

Simulated Response

Status

200

Headers

API-Usage-Limit: 1/500
Content-Type: application/json; charset=utf-8

Body

{
  "id": 4,
  "url": "https://myservice.com/external_discount",
  "order_lines_depend": null,
  "created_at": "2024-10-05T00:56:21.000+03:00",
  "updated_at": "2024-10-05T00:56:21.000+03:00",
  "active": true,
  "description": "My External Discount",
  "observed_fields": [

  ]
}

Get external discounts

Endpoint

GET /admin/external_discounts.json

Request

Route

GET /admin/external_discounts.json

Headers

Authorization: Basic ZGlnaXRhbC1nb29kczpjNTFjOTA3MDdhMTNjZTNmZmYyMTNhZmJiNWNkMTI3MA==

Response

Simulated Response

Status

200

Headers

API-Usage-Limit: 1/500
Content-Type: application/json; charset=utf-8

Body

[
  {
    "id": 2,
    "url": "https://myservice.com/external_discount",
    "order_lines_depend": null,
    "created_at": "2024-10-05T00:56:21.000+03:00",
    "updated_at": "2024-10-05T00:56:21.000+03:00",
    "active": true,
    "description": "My External Discount",
    "observed_fields": [

    ]
  }
]

Update external discount

Endpoint

PUT /admin/external_discounts/:external_discount_id.json

Parameters

Name Description
external_discount[description] description
external_discount[url] external service url
external_discount[order_lines_depend] discount calculation depends on order lines
external_discount[active] active

Request

Route

PUT /admin/external_discounts/10.json

Headers

Content-Type: application/json
Authorization: Basic ZGlnaXRhbC1nb29kczpjNTFjOTA3MDdhMTNjZTNmZmYyMTNhZmJiNWNkMTI3MA==

Body

{
  "external_discount": {
    "url": "https://myservice.com/birthday_external_discount_v2"
  }
}

Response

Simulated Response

Status

200

Headers

API-Usage-Limit: 1/500
Content-Type: application/json; charset=utf-8

Body

{
  "url": "https://myservice.com/birthday_external_discount_v2",
  "id": 10,
  "order_lines_depend": null,
  "created_at": "2024-10-05T00:56:21.000+03:00",
  "updated_at": "2024-10-05T00:56:21.000+03:00",
  "active": true,
  "description": "My External Discount",
  "observed_fields": [

  ]
}

Field

Create field

Endpoint

POST /admin/fields.json

Parameters

Name Description
field[type] required Field::TextField, Field::TextArea, Field::Checkbox, Field::FileField (only for Order), Field::Delivery
field[office_title] required title for backoffice
field[destiny] required integer, defines subject that field belongs to: 1 - ShippingAddress, 2 - Client::Individual, 5 - Client::Juridical, 3 - Order, 4 - OrderLine, 6 - Client
field[handle] You can create or update value by handle
field[title] title
field[active] true by default, defines ability of filling field by a customer
field[for_buyer] true by defaut, defines visibility for a customer
field[obligatory] false by default
field[show_in_result] true by default, field will be shown in result
field[show_in_checkout] true by default, field will be shown in checkout
field[position] position in fields list
field[is_indexed] boolean, true if searchable
field[hide_in_backoffice] boolean, true to hide in backoffice

Request

Route

POST /admin/fields.json

Headers

Content-Type: application/json
Authorization: Basic ZGlnaXRhbC1nb29kczpjNTFjOTA3MDdhMTNjZTNmZmYyMTNhZmJiNWNkMTI3MA==

Body

{
  "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
  }
}

Response

Simulated Response

Status

201

Headers

API-Usage-Limit: 1/500
Content-Type: application/json; charset=utf-8

Body

{
  "id": 178,
  "destiny": 1,
  "position": 22,
  "office_title": "title_for_text_field",
  "for_buyer": false,
  "obligatory": false,
  "active": false,
  "system_name": null,
  "created_at": "2024-10-05T00:56:12.640+03:00",
  "updated_at": "2024-10-05T00:56:12.640+03:00",
  "show_in_result": false,
  "show_in_checkout": false,
  "is_indexed": true,
  "hide_in_backoffice": true,
  "handle": "my_awesome_field_1",
  "title": "title_for_text_field",
  "example": null,
  "type": "Field::TextField"
}

Create select field

Endpoint

POST /admin/fields.json

Parameters

Name Description
field[type] required Field::Select
field[office_title] required title for backoffice
field[destiny] required integer, defines subject that field belongs to: 1 - ShippingAddress, 2 - Client::Individual, 5 - Client::Juridical, 3 - Order, 4 - OrderLine, 6 - Client
field[handle] You can create or update value by handle
field[title] title
field[active] true by default, defines ability of filling field by a customer
field[for_buyer] true by defaut, defines visibility for a customer
field[obligatory] false by default
field[show_in_result] true by default, field will be shown in result
field[show_in_checkout] true by default, field will be shown in checkout
field[position] position in fields list
field[is_indexed] boolean, true if searchable
field[hide_in_backoffice] boolean, true to hide in backoffice
field[field_options_attributes] array of field options objects

Request

Route

POST /admin/fields.json

Headers

Content-Type: application/json
Authorization: Basic ZGlnaXRhbC1nb29kczpjNTFjOTA3MDdhMTNjZTNmZmYyMTNhZmJiNWNkMTI3MA==

Body

{
  "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
      }
    ]
  }
}

Response

Simulated Response

Status

201

Headers

API-Usage-Limit: 1/500
Content-Type: application/json; charset=utf-8

Body

{
  "id": 180,
  "destiny": 1,
  "position": 22,
  "office_title": "title_for_select_field",
  "for_buyer": false,
  "obligatory": false,
  "active": false,
  "system_name": null,
  "created_at": "2024-10-05T00:56:13.340+03:00",
  "updated_at": "2024-10-05T00:56:13.340+03:00",
  "show_in_result": false,
  "show_in_checkout": false,
  "is_indexed": true,
  "hide_in_backoffice": true,
  "handle": "my_select_field_1",
  "title": "title_for_select_field",
  "example": null,
  "type": "Field::Select",
  "field_options": [
    {
      "id": 7,
      "position": 1,
      "value": "1"
    },
    {
      "id": 8,
      "position": 2,
      "value": "2"
    }
  ]
}

Destroy field

Only these types can be destroyed: Field::TextField, Field::TextArea, Field::Select,Field::Checkbox, Field::Delivery, Field::FileField (only for Order)

Endpoint

DELETE /admin/fields/:field_id.json

Request

Route

DELETE /admin/fields/23.json

Headers

Content-Type: application/json
Authorization: Basic ZGlnaXRhbC1nb29kczpjNTFjOTA3MDdhMTNjZTNmZmYyMTNhZmJiNWNkMTI3MA==

Response

Simulated Response

Status

200

Headers

API-Usage-Limit: 1/500
Content-Type: application/json; charset=utf-8

Body

{
  "status": "ok"
}

Get field

Endpoint

GET /admin/fields/:field_id.json

Request

Route

GET /admin/fields/23.json

Headers

Authorization: Basic ZGlnaXRhbC1nb29kczpjNTFjOTA3MDdhMTNjZTNmZmYyMTNhZmJiNWNkMTI3MA==

Response

Simulated Response

Status

200

Headers

API-Usage-Limit: 1/500
Content-Type: application/json; charset=utf-8

Body

{
  "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,
  "title": "Селект",
  "example": null,
  "type": "Field::Select",
  "field_options": [
    {
      "id": 1,
      "position": 1,
      "value": "Передан"
    },
    {
      "id": 2,
      "position": 2,
      "value": "Не передан"
    }
  ]
}

Get fields

Endpoint

GET /admin/fields.json

Request

Route

GET /admin/fields.json

Headers

Authorization: Basic ZGlnaXRhbC1nb29kczpjNTFjOTA3MDdhMTNjZTNmZmYyMTNhZmJiNWNkMTI3MA==

Response

Simulated Response

Status

200

Headers

API-Usage-Limit: 1/500
Content-Type: application/json; charset=utf-8

Body

[
  {
    "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,
    "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,
    "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,
    "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,
    "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,
    "title": null,
    "example": null,
    "type": "Field::Phone"
  },
  {
    "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,
    "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,
    "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,
    "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,
    "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,
    "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,
    "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,
    "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": "2024-10-05T00:55:41.850+03:00",
    "updated_at": "2024-10-05T00:55:41.850+03:00",
    "show_in_result": true,
    "show_in_checkout": true,
    "is_indexed": null,
    "hide_in_backoffice": null,
    "handle": 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,
    "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,
    "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,
    "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": "2024-10-05T00:55:41.850+03:00",
    "updated_at": "2024-10-05T00:55:41.850+03:00",
    "show_in_result": true,
    "show_in_checkout": true,
    "is_indexed": null,
    "hide_in_backoffice": null,
    "handle": "aks_shipment_id",
    "title": null,
    "example": null,
    "type": "Field::TextField"
  }
]

Update field

Endpoint

PUT /admin/fields/:non_select_field_id.json

Parameters

Name Description
field[office_title] title for backoffice
field[title] title
field[active] true by default, defines ability of filling field by a customer
field[for_buyer] true by defaut, defines visibility for a customer
field[obligatory] false by default
field[show_in_result] true by default, field will be shown in result
field[show_in_checkout] true by default, field will be shown in checkout
field[position] position in fields list
field[handle] You can create or update value by handle
field[is_indexed] boolean, true if searchable
field[hide_in_backoffice] boolean, true to hide in backoffice

Request

Route

PUT /admin/fields/2.json

Headers

Content-Type: application/json
Authorization: Basic ZGlnaXRhbC1nb29kczpjNTFjOTA3MDdhMTNjZTNmZmYyMTNhZmJiNWNkMTI3MA==

Body

{
  "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
  }
}

Response

Simulated Response

Status

200

Headers

API-Usage-Limit: 1/500
Content-Type: application/json; charset=utf-8

Body

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

Update select field

Endpoint

PUT /admin/fields/:field_id.json

Parameters

Name Description
field[office_title] title for backoffice
field[title] title
field[active] true by default, defines ability of filling field by a customer
field[for_buyer] true by defaut, defines visibility for a customer
field[obligatory] false by default
field[show_in_result] true by default, field will be shown in result
field[show_in_checkout] true by default, field will be shown in checkout
field[position] position in fields list
field[handle] You can create or update value by handle
field[is_indexed] boolean, true if searchable
field[hide_in_backoffice] boolean, true to hide in backoffice
field[field_options_attributes] array of field options objects

Request

Route

PUT /admin/fields/23.json

Headers

Content-Type: application/json
Authorization: Basic ZGlnaXRhbC1nb29kczpjNTFjOTA3MDdhMTNjZTNmZmYyMTNhZmJiNWNkMTI3MA==

Body

{
  "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
      }
    ]
  }
}

Response

Simulated Response

Status

200

Headers

API-Usage-Limit: 1/500
Content-Type: application/json; charset=utf-8

Body

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

File

Create file from attachment

Endpoint

POST /admin/files.json

Parameters

Name Description
file[attachment] required file
file[filename] required file name

Request

Route

POST /admin/files.json

Headers

Content-Type: application/json
Authorization: Basic ZGlnaXRhbC1nb29kczpjNTFjOTA3MDdhMTNjZTNmZmYyMTNhZmJiNWNkMTI3MA==

Body

{
  "file": {
    "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": "some file"
  }
}

Response

Simulated Response

Status

201

Headers

API-Usage-Limit: 1/500
Content-Type: application/json; charset=utf-8

Body

{
  "id": 5,
  "created_at": "2024-10-05T00:57:21.098+03:00",
  "absolute_url": "http://minio.insales.io:9000/insales-test-sber/files/1/5/5/original/some_file.?1728079041"
}

Create file from url

Endpoint

POST /admin/files.json

Parameters

Name Description
file[src] required file url

Request

Route

POST /admin/files.json

Headers

Content-Type: application/json
Authorization: Basic ZGlnaXRhbC1nb29kczpjNTFjOTA3MDdhMTNjZTNmZmYyMTNhZmJiNWNkMTI3MA==

Body

{
  "file": {
    "src": "https://abc.myinsales.ru/images/no_image_compact.jpg"
  }
}

Response

Simulated Response

Status

201

Headers

API-Usage-Limit: 1/500
Content-Type: application/json; charset=utf-8

Body

{
  "id": 3,
  "created_at": "2024-10-05T00:57:20.870+03:00",
  "absolute_url": "http://minio.insales.io:9000/insales-test-sber/files/1/3/3/original/no_image_compact.jpg?1728079040"
}

Destroy file

Endpoint

DELETE /admin/files/:account_file_id.json

Request

Route

DELETE /admin/files/1.json

Headers

Content-Type: application/json
Authorization: Basic ZGlnaXRhbC1nb29kczpjNTFjOTA3MDdhMTNjZTNmZmYyMTNhZmJiNWNkMTI3MA==

Response

Simulated Response

Status

200

Headers

API-Usage-Limit: 1/500
Content-Type: application/json; charset=utf-8

Body

{
  "status": "ok"
}

Get file

Endpoint

GET /admin/files/:account_file_id.json

Request

Route

GET /admin/files/1.json

Headers

Authorization: Basic ZGlnaXRhbC1nb29kczpjNTFjOTA3MDdhMTNjZTNmZmYyMTNhZmJiNWNkMTI3MA==

Response

Simulated Response

Status

200

Headers

API-Usage-Limit: 1/500
Content-Type: application/json; charset=utf-8

Body

{
  "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"
}

Get files

Endpoint

GET /admin/files.json

Request

Route

GET /admin/files.json

Headers

Authorization: Basic ZGlnaXRhbC1nb29kczpjNTFjOTA3MDdhMTNjZTNmZmYyMTNhZmJiNWNkMTI3MA==

Response

Simulated Response

Status

200

Headers

API-Usage-Limit: 1/500
Content-Type: application/json; charset=utf-8

Body

[
  {
    "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"
  }
]

Image

Create image from attachment

After uploading your picture you may find ‘loading.gif’ instead of it. That’s because picture uploading and creating of thumbnails are asynchronous. When it’s uploaded and thumbnails’re created its attribute updated_at will be overwritten with new timestamp.

Endpoint

POST /admin/products/:product_id/images.json

Parameters

Name Description
image[attachment] required image file
image[filename] required file name
image[title] title
image[position] position

Request

Route

POST /admin/products/1/images.json

Headers

Content-Type: application/json
Authorization: Basic ZGlnaXRhbC1nb29kczpjNTFjOTA3MDdhMTNjZTNmZmYyMTNhZmJiNWNkMTI3MA==

Body

{
  "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"
  }
}

Response

Simulated Response

Status

201

Headers

API-Usage-Limit: 1/500
Content-Type: application/json; charset=utf-8

Body

{
  "id": 9,
  "product_id": 1,
  "position": 1,
  "created_at": "2024-10-05T00:56:48.000+03:00",
  "image_processing": true,
  "external_id": null,
  "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",
  "image_content_type": "image/jpeg"
}

Create image from src

After uploading your picture you may find ‘loading.gif’ instead of it. That’s because picture uploading and creating of thumbnails are asynchronous. When it’s uploaded and thumbnails’re created its attribute updated_at will be overwritten with a new timestamp.

Endpoint

POST /admin/products/:product_id/images.json

Parameters

Name Description
image[src] required image url
image[filename] file name
image[title] title
image[position] position
image[external_id] ID in external system. It helps to identify image after recreation and so on

Request

Route

POST /admin/products/1/images.json

Headers

Content-Type: application/json
Authorization: Basic ZGlnaXRhbC1nb29kczpjNTFjOTA3MDdhMTNjZTNmZmYyMTNhZmJiNWNkMTI3MA==

Body

{
  "image": {
    "src": "https://abc.myinsales.ru/images/no_image_compact.jpg"
  }
}

Response

Simulated Response

Status

201

Headers

API-Usage-Limit: 1/500
Content-Type: application/json; charset=utf-8

Body

{
  "id": 7,
  "product_id": 1,
  "position": 1,
  "created_at": "2024-10-05T00:56:48.000+03:00",
  "image_processing": true,
  "external_id": null,
  "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",
  "image_content_type": "image/jpeg"
}

Destroy image

Endpoint

DELETE /admin/products/:product_id/images/:image_id.json

Request

Route

DELETE /admin/products/1/images/13.json

Headers

Content-Type: application/json
Authorization: Basic ZGlnaXRhbC1nb29kczpjNTFjOTA3MDdhMTNjZTNmZmYyMTNhZmJiNWNkMTI3MA==

Response

Simulated Response

Status

200

Headers

API-Usage-Limit: 1/500
Content-Type: application/json; charset=utf-8

Body

{
  "status": "ok"
}

Get image

Endpoint

GET /admin/products/:product_id/images/:image_id.json

Request

Route

GET /admin/products/1/images/5.json

Headers

Authorization: Basic ZGlnaXRhbC1nb29kczpjNTFjOTA3MDdhMTNjZTNmZmYyMTNhZmJiNWNkMTI3MA==

Response

Simulated Response

Status

200

Headers

API-Usage-Limit: 1/500
Content-Type: application/json; charset=utf-8

Body

{
  "id": 5,
  "product_id": 1,
  "position": 1,
  "created_at": "2024-10-05T00:56:48.000+03:00",
  "image_processing": true,
  "external_id": null,
  "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",
  "image_content_type": "image/jpeg"
}

Get images

Endpoint

GET /admin/products/:product_id/images.json

Request

Route

GET /admin/products/1/images.json

Headers

Authorization: Basic ZGlnaXRhbC1nb29kczpjNTFjOTA3MDdhMTNjZTNmZmYyMTNhZmJiNWNkMTI3MA==

Response

Simulated Response

Status

200

Headers

API-Usage-Limit: 1/500
Content-Type: application/json; charset=utf-8

Body

[

]

Update image

Endpoint

PUT /admin/products/:product_id/images/:image_id.json

Parameters

Name Description
image[position] position
image[title] title

Request

Route

PUT /admin/products/1/images/11.json

Headers

Content-Type: application/json
Authorization: Basic ZGlnaXRhbC1nb29kczpjNTFjOTA3MDdhMTNjZTNmZmYyMTNhZmJiNWNkMTI3MA==

Body

{
  "image": {
    "position": 5,
    "title": "myimage"
  }
}

Response

Simulated Response

Status

200

Headers

API-Usage-Limit: 1/500
Content-Type: application/json; charset=utf-8

Body

{
  "position": 5,
  "id": 11,
  "product_id": 1,
  "created_at": "2024-10-05T00:56:49.000+03:00",
  "image_processing": true,
  "external_id": null,
  "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",
  "image_content_type": "image/jpeg"
}

JsTag

Create js_tag from code

Please be careful when plugging in jquery: many default themes use old version of it. Including of a new version of JQuery may result in malfunction of your store.

Endpoint

POST /admin/js_tags.json

Parameters

Name Description
js_tag[type] required JsTag::TextTag
js_tag[content] required javascript code without tag SCRIPT
js_tag[name] name for js tag

Request

Route

POST /admin/js_tags.json

Headers

Content-Type: application/json
Authorization: Basic ZGlnaXRhbC1nb29kczpjNTFjOTA3MDdhMTNjZTNmZmYyMTNhZmJiNWNkMTI3MA==

Body

{
  "js_tag": {
    "type": "JsTag::TextTag",
    "content": "alert('test');",
    "name": "alert test"
  }
}

Response

Simulated Response

Status

201

Headers

API-Usage-Limit: 1/500
Content-Type: application/json; charset=utf-8

Body

{
  "id": 8,
  "name": "alert test",
  "content": "alert('test');",
  "created_at": "2024-10-05T00:57:21.000+03:00",
  "updated_at": "2024-10-05T00:57:21.000+03:00",
  "type": "JsTag::TextTag"
}

Create js_tag from url

Please be careful while including JQuery: many default themes use an old version of it. Including of a new version of JQuery may result in malfunction of your store.

Endpoint

POST /admin/js_tags.json

Parameters

Name Description
js_tag[type] required JsTag::FileTag
js_tag[content] required url of javascript file
js_tag[name] name for js tag

Request

Route

POST /admin/js_tags.json

Headers

Content-Type: application/json
Authorization: Basic ZGlnaXRhbC1nb29kczpjNTFjOTA3MDdhMTNjZTNmZmYyMTNhZmJiNWNkMTI3MA==

Body

{
  "js_tag": {
    "type": "JsTag::FileTag",
    "content": "http://code.jquery.com/jquery-1.9.1.min.js",
    "name": "jquery-1.9.1.min"
  }
}

Response

Simulated Response

Status

201

Headers

API-Usage-Limit: 1/500
Content-Type: application/json; charset=utf-8

Body

{
  "id": 12,
  "name": "jquery-1.9.1.min",
  "content": "http://code.jquery.com/jquery-1.9.1.min.js",
  "created_at": "2024-10-05T00:57:22.000+03:00",
  "updated_at": "2024-10-05T00:57:22.000+03:00",
  "type": "JsTag::FileTag"
}

Destroy js_tag

Endpoint

DELETE /admin/js_tags/:js_tag_id.json

Request

Route

DELETE /admin/js_tags/16.json

Headers

Content-Type: application/json
Authorization: Basic ZGlnaXRhbC1nb29kczpjNTFjOTA3MDdhMTNjZTNmZmYyMTNhZmJiNWNkMTI3MA==

Response

Simulated Response

Status

200

Headers

API-Usage-Limit: 1/500
Content-Type: application/json; charset=utf-8

Body

{
  "status": "ok"
}

Get js_tag

Endpoint

GET /admin/js_tags/:js_tag_id.json

Request

Route

GET /admin/js_tags/4.json

Headers

Authorization: Basic ZGlnaXRhbC1nb29kczpjNTFjOTA3MDdhMTNjZTNmZmYyMTNhZmJiNWNkMTI3MA==

Response

Simulated Response

Status

200

Headers

API-Usage-Limit: 1/500
Content-Type: application/json; charset=utf-8

Body

{
  "id": 4,
  "name": "jquery1.9.1",
  "content": "http://code.jquery.com/jquery-1.9.1.min.js",
  "created_at": "2024-10-05T00:57:21.000+03:00",
  "updated_at": "2024-10-05T00:57:21.000+03:00",
  "type": "JsTag::FileTag"
}

Get js_tags

Endpoint

GET /admin/js_tags.json

Request

Route

GET /admin/js_tags.json

Headers

Authorization: Basic ZGlnaXRhbC1nb29kczpjNTFjOTA3MDdhMTNjZTNmZmYyMTNhZmJiNWNkMTI3MA==

Response

Simulated Response

Status

200

Headers

API-Usage-Limit: 1/500
Content-Type: application/json; charset=utf-8

Body

[
  {
    "id": 2,
    "name": "jquery1.9.1",
    "content": "http://code.jquery.com/jquery-1.9.1.min.js",
    "created_at": "2024-10-05T00:57:21.000+03:00",
    "updated_at": "2024-10-05T00:57:21.000+03:00",
    "type": "JsTag::FileTag"
  }
]

Update js_tag

Endpoint

PUT /admin/js_tags/:js_tag_id.json

Parameters

Name Description
js_tag[content] url of javascript file or javascript code without tag SCRIPT
js_tag[name] name for js tag

Request

Route

PUT /admin/js_tags/14.json

Headers

Content-Type: application/json
Authorization: Basic ZGlnaXRhbC1nb29kczpjNTFjOTA3MDdhMTNjZTNmZmYyMTNhZmJiNWNkMTI3MA==

Body

{
  "js_tag": {
    "content": "http://code.jquery.com/jquery-2.2.4.min.js",
    "name": "jquery-2.2.4"
  }
}

Response

Simulated Response

Status

200

Headers

API-Usage-Limit: 1/500
Content-Type: application/json; charset=utf-8

Body

{
  "name": "jquery-2.2.4",
  "content": "http://code.jquery.com/jquery-2.2.4.min.js",
  "id": 14,
  "created_at": "2024-10-05T00:57:22.000+03:00",
  "updated_at": "2024-10-05T00:57:22.000+03:00",
  "type": "JsTag::FileTag"
}

Marketplace

Create Google Merchant marketplace

Endpoint

POST /admin/marketplaces.json

Parameters

Name Description
marketplace[name] required Name
marketplace[type] required Marketplace::GoogleMerchant
marketplace[description_type] 1 fo short description, 2 for full
marketplace[local_delivery_cost] Local delivery cost
marketplace[adult] 1 if products are adult-only, else 0
marketplace[utm_label] UTM label

Request

Route

POST /admin/marketplaces.json

Headers

Content-Type: application/json
Authorization: Basic ZGlnaXRhbC1nb29kczpjNTFjOTA3MDdhMTNjZTNmZmYyMTNhZmJiNWNkMTI3MA==

Body

{
  "marketplace": {
    "name": "GM",
    "type": "Marketplace::GoogleMerchant",
    "description_type": 1,
    "adult": 0
  }
}

Response

Simulated Response

Status

201

Headers

API-Usage-Limit: 1/500
Content-Type: application/json; charset=utf-8

Body

{
  "id": 10,
  "name": "GM",
  "type": "Marketplace::GoogleMerchant",
  "created_at": "2024-10-05T00:57:13.158+03:00",
  "updated_at": "2024-10-05T00:57:13.158+03:00",
  "url": "https://quentin.insales.io:3002/marketplace/10.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
}

Create Liquid for Yandex marketplace

Endpoint

POST /admin/marketplaces.json

Parameters

Name Description
marketplace[name] required Name
marketplace[type] required Marketplace type, e.g. Marketplace::LiquidYandexMarket
marketplace[shop_name] Shop name
marketplace[use_variants] Create document for all variants, not aggregated product
marketplace[shop_company] Company name
marketplace[page_encoding] required Encoding, windows-1251 or utf-8
marketplace[offer_liquid] required Liquid template
marketplace[collection_ids] Collections to load

Request

Route

POST /admin/marketplaces.json

Headers

Content-Type: application/json
Authorization: Basic ZGlnaXRhbC1nb29kczpjNTFjOTA3MDdhMTNjZTNmZmYyMTNhZmJiNWNkMTI3MA==

Body

{
  "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
    ]
  }
}

Response

Simulated Response

Status

201

Headers

API-Usage-Limit: 1/500
Content-Type: application/json; charset=utf-8

Body

{
  "id": 16,
  "name": "LYM",
  "type": "Marketplace::LiquidYandexMarket",
  "created_at": "2024-10-05T00:57:13.886+03:00",
  "updated_at": "2024-10-05T00:57:13.886+03:00",
  "url": "https://quentin.insales.io:3002/marketplace/16.xml",
  "collection_ids": [
    6,
    1,
    2,
    3,
    4,
    5,
    8
  ],
  "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
}

Create Model for Yandex marketplace

Endpoint

POST /admin/marketplaces.json

Parameters

Name Description
marketplace[name] required Name
marketplace[type] required Marketplace type, e.g. Marketplace::ModelYandexMarket
marketplace[shop_name] Shop name
marketplace[shop_company] Company name
marketplace[description_type] 1 fo short description, 2 for full
marketplace[vendor_id] required id of corresponding property
marketplace[use_sku_as_vendor_code] Use sku as vendor code
marketplace[pickup] Pickup enable
marketplace[store] Offline store exists
marketplace[delivery_style] Delivery pricing type, 0 for old, 1 for new
marketplace[local_delivery_cost] Local delivery cost
marketplace[adult] 1 if products are adult-only, else 0
marketplace[utm_label] UTM label
marketplace[page_encoding] required Encoding, windows-1251 or utf-8
marketplace[image_style] required Image style: thumb, compact, medium, large or original
marketplace[model_type] required Model naming type: name or sku
marketplace[collection_ids] Collections to load

Request

Route

POST /admin/marketplaces.json

Headers

Content-Type: application/json
Authorization: Basic ZGlnaXRhbC1nb29kczpjNTFjOTA3MDdhMTNjZTNmZmYyMTNhZmJiNWNkMTI3MA==

Body

{
  "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
    ]
  }
}

Response

Simulated Response

Status

201

Headers

API-Usage-Limit: 1/500
Content-Type: application/json; charset=utf-8

Body

{
  "id": 8,
  "name": "YM",
  "type": "Marketplace::ModelYandexMarket",
  "created_at": "2024-10-05T00:57:12.966+03:00",
  "updated_at": "2024-10-05T00:57:12.966+03:00",
  "url": "https://quentin.insales.io:3002/marketplace/8.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": 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
}

Destroy marketplace

Endpoint

DELETE /admin/marketplaces/:ym_marketplace_id.json

Request

Route

DELETE /admin/marketplaces/20.json

Headers

Content-Type: application/json
Authorization: Basic ZGlnaXRhbC1nb29kczpjNTFjOTA3MDdhMTNjZTNmZmYyMTNhZmJiNWNkMTI3MA==

Response

Simulated Response

Status

200

Headers

API-Usage-Limit: 1/500
Content-Type: application/json; charset=utf-8

Body

{
  "status": "ok"
}

Get marketplace

Endpoint

GET /admin/marketplaces/:ym_marketplace_id.json

Request

Route

GET /admin/marketplaces/6.json

Headers

Authorization: Basic ZGlnaXRhbC1nb29kczpjNTFjOTA3MDdhMTNjZTNmZmYyMTNhZmJiNWNkMTI3MA==

Response

Simulated Response

Status

200

Headers

API-Usage-Limit: 1/500
Content-Type: application/json; charset=utf-8

Body

{
  "id": 6,
  "name": "Yandex Model",
  "type": "Marketplace::ModelYandexMarket",
  "created_at": "2024-10-05T00:57:12.204+03:00",
  "updated_at": "2024-10-05T00:57:12.204+03:00",
  "url": "https://quentin.insales.io:3002/marketplace/6.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
}

Get marketplaces

Endpoint

GET /admin/marketplaces.json

Request

Route

GET /admin/marketplaces.json

Headers

Authorization: Basic ZGlnaXRhbC1nb29kczpjNTFjOTA3MDdhMTNjZTNmZmYyMTNhZmJiNWNkMTI3MA==

Response

Simulated Response

Status

200

Headers

API-Usage-Limit: 1/500
Content-Type: application/json; charset=utf-8

Body

[
  {
    "id": 3,
    "name": "Yandex Model",
    "type": "Marketplace::LiquidYandexMarket",
    "created_at": "2024-10-05T00:57:12.000+03:00",
    "updated_at": "2024-10-05T00:57:12.000+03:00",
    "url": "https://quentin.insales.io:3002/marketplace/3.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": 4,
    "name": "Google Model",
    "type": "Marketplace::GoogleMerchant",
    "created_at": "2024-10-05T00:57:12.005+03:00",
    "updated_at": "2024-10-05T00:57:12.005+03:00",
    "url": "https://quentin.insales.io:3002/marketplace/4.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
  }
]

Update Google Merchant marketplace

Endpoint

PUT /admin/marketplaces/:gm_marketplace_id.json

Parameters

Name Description
marketplace[name] Name
marketplace[description_type] 1 fo short description, 2 for full
marketplace[local_delivery_cost] Local delivery cost
marketplace[adult] 1 if products are adult-only, else 0
marketplace[utm_label] UTM label

Request

Route

PUT /admin/marketplaces/14.json

Headers

Content-Type: application/json
Authorization: Basic ZGlnaXRhbC1nb29kczpjNTFjOTA3MDdhMTNjZTNmZmYyMTNhZmJiNWNkMTI3MA==

Body

{
  "marketplace": {
    "name": "New GM",
    "description_type": 2,
    "adult": 0
  }
}

Response

Simulated Response

Status

200

Headers

API-Usage-Limit: 1/500
Content-Type: application/json; charset=utf-8

Body

{
  "name": "New GM",
  "id": 14,
  "type": "Marketplace::GoogleMerchant",
  "created_at": "2024-10-05T00:57:13.564+03:00",
  "updated_at": "2024-10-05T00:57:13.616+03:00",
  "url": "https://quentin.insales.io:3002/marketplace/14.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
}

Update Liquid for Yandex marketplace

Endpoint

PUT /admin/marketplaces/:yl_marketplace_id.json

Parameters

Name Description
marketplace[name] Name
marketplace[shop_name] Shop name
marketplace[use_variants] Create document for all variants, not aggregated product
marketplace[shop_company] Company name
marketplace[page_encoding] Encoding, windows-1251 or utf-8
marketplace[offer_liquid] Liquid template
marketplace[collection_ids] Collections to load

Request

Route

PUT /admin/marketplaces/18.json

Headers

Content-Type: application/json
Authorization: Basic ZGlnaXRhbC1nb29kczpjNTFjOTA3MDdhMTNjZTNmZmYyMTNhZmJiNWNkMTI3MA==

Body

{
  "marketplace": {
    "name": "New LYM"
  }
}

Response

Simulated Response

Status

200

Headers

API-Usage-Limit: 1/500
Content-Type: application/json; charset=utf-8

Body

{
  "name": "New LYM",
  "id": 18,
  "type": "Marketplace::LiquidYandexMarket",
  "created_at": "2024-10-05T00:57:14.037+03:00",
  "updated_at": "2024-10-05T00:57:14.089+03:00",
  "url": "https://quentin.insales.io:3002/marketplace/18.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
}

Update Model for Yandex marketplace

Endpoint

PUT /admin/marketplaces/:ym_marketplace_id.json

Parameters

Name Description
marketplace[name] Name
marketplace[shop_name] Shop name
marketplace[shop_company] Company name
marketplace[description_type] 1 fo short description, 2 for full
marketplace[vendor_id] id of corresponding property
marketplace[use_sku_as_vendor_code] Use sku as vendor code
marketplace[pickup] Pickup enable
marketplace[store] Offline store exists
marketplace[delivery_style] Delivery pricing type, 0 for old, 1 for new
marketplace[local_delivery_cost] Local delivery cost
marketplace[adult] 1 if products are adult-only, else 0
marketplace[utm_label] UTM label
marketplace[page_encoding] Encoding, windows-1251 or utf-8
marketplace[image_style] Image style: thumb, compact, medium, large or original
marketplace[model_type] Model naming type: name or sku
marketplace[collection_ids] Collections to load

Request

Route

PUT /admin/marketplaces/12.json

Headers

Content-Type: application/json
Authorization: Basic ZGlnaXRhbC1nb29kczpjNTFjOTA3MDdhMTNjZTNmZmYyMTNhZmJiNWNkMTI3MA==

Body

{
  "marketplace": {
    "name": "New YM",
    "vendor_id": 4,
    "collection_ids": [
      6,
      1,
      2,
      3,
      4,
      5,
      8
    ]
  }
}

Response

Simulated Response

Status

200

Headers

API-Usage-Limit: 1/500
Content-Type: application/json; charset=utf-8

Body

{
  "name": "New YM",
  "id": 12,
  "type": "Marketplace::ModelYandexMarket",
  "created_at": "2024-10-05T00:57:13.342+03:00",
  "updated_at": "2024-10-05T00:57:13.425+03:00",
  "url": "https://quentin.insales.io:3002/marketplace/12.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
}

OAuthApp

Create o_auth_app

Endpoint

POST /admin/o_auth_apps.json

Parameters

Name Description
o_auth_app[provider_handle] required provider name
o_auth_app[client_id] required client id
o_auth_app[client_secret] required client_secret
o_auth_app[issuer] required issuer

Request

Route

POST /admin/o_auth_apps.json

Headers

Content-Type: application/json
Authorization: Basic ZGlnaXRhbC1nb29kczpjNTFjOTA3MDdhMTNjZTNmZmYyMTNhZmJiNWNkMTI3MA==

Body

{
  "o_auth_app": {
    "provider_handle": "provider name",
    "client_id": "10332",
    "client_secret": "NdsaPd",
    "issuer": "/.well-known/openid-configuration"
  }
}

Response

Simulated Response

Status

201

Headers

API-Usage-Limit: 1/500
Content-Type: application/json; charset=utf-8

Body

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

Destroy o_auth_app

Endpoint

DELETE /admin/o_auth_apps/:o_auth_app_id.json

Request

Route

DELETE /admin/o_auth_apps/12.json

Headers

Content-Type: application/json
Authorization: Basic ZGlnaXRhbC1nb29kczpjNTFjOTA3MDdhMTNjZTNmZmYyMTNhZmJiNWNkMTI3MA==

Response

Simulated Response

Status

200

Headers

API-Usage-Limit: 1/500
Content-Type: application/json; charset=utf-8

Body

{
  "status": "ok"
}

Get o_auth_app

Endpoint

GET /admin/o_auth_apps/:o_auth_app_id.json

Request

Route

GET /admin/o_auth_apps/4.json

Headers

Authorization: Basic ZGlnaXRhbC1nb29kczpjNTFjOTA3MDdhMTNjZTNmZmYyMTNhZmJiNWNkMTI3MA==

Response

Simulated Response

Status

200

Headers

API-Usage-Limit: 1/500
Content-Type: application/json; charset=utf-8

Body

{
  "id": 4,
  "provider": "new_provider",
  "client_id": "953",
  "client_secret": "NdsaPd",
  "issuer": "/.well-known/openid-configuration"
}

Get o_auth_apps

Endpoint

GET /admin/o_auth_apps.json

Request

Route

GET /admin/o_auth_apps.json

Headers

Authorization: Basic ZGlnaXRhbC1nb29kczpjNTFjOTA3MDdhMTNjZTNmZmYyMTNhZmJiNWNkMTI3MA==

Response

Simulated Response

Status

200

Headers

API-Usage-Limit: 1/500
Content-Type: application/json; charset=utf-8

Body

[
  {
    "id": 2,
    "provider": "new_provider",
    "client_id": "953",
    "client_secret": "NdsaPd",
    "issuer": "/.well-known/openid-configuration"
  }
]

Update o_auth_app

Endpoint

PUT /admin/o_auth_apps/:o_auth_app_id.json

Parameters

Name Description
o_auth_app[provider_handle] provider name
o_auth_app[client_id] client id
o_auth_app[client_secret] client secret
o_auth_app[issuer] issuer

Request

Route

PUT /admin/o_auth_apps/10.json

Headers

Content-Type: application/json
Authorization: Basic ZGlnaXRhbC1nb29kczpjNTFjOTA3MDdhMTNjZTNmZmYyMTNhZmJiNWNkMTI3MA==

Body

{
  "o_auth_app": {
    "provider_handle": "new name provider"
  }
}

Response

Simulated Response

Status

200

Headers

API-Usage-Limit: 1/500
Content-Type: application/json; charset=utf-8

Body

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

OptionName

Create option_name

Endpoint

POST /admin/option_names.json

Parameters

Name Description
option_name[title] required title
option_name[position] position in option names list
option_name[navigational] true by default; show in products filter on category page

Request

Route

POST /admin/option_names.json

Headers

Content-Type: application/json
Authorization: Basic ZGlnaXRhbC1nb29kczpjNTFjOTA3MDdhMTNjZTNmZmYyMTNhZmJiNWNkMTI3MA==

Body

{
  "option_name": {
    "title": "Colour",
    "navigational": false
  }
}

Response

Simulated Response

Status

201

Headers

API-Usage-Limit: 1/500
Content-Type: application/json; charset=utf-8

Body

{
  "id": 2517850,
  "position": 3,
  "navigational": false,
  "title": "Colour"
}

Destroy option_name

Endpoint

DELETE /admin/option_names/:option_name_id.json

Request

Route

DELETE /admin/option_names/1.json

Headers

Content-Type: application/json
Authorization: Basic ZGlnaXRhbC1nb29kczpjNTFjOTA3MDdhMTNjZTNmZmYyMTNhZmJiNWNkMTI3MA==

Response

Simulated Response

Status

200

Headers

API-Usage-Limit: 1/500
Content-Type: application/json; charset=utf-8

Body

{
  "status": "ok"
}

Get option_name

Endpoint

GET /admin/option_names/:option_name_id.json

Request

Route

GET /admin/option_names/1.json

Headers

Authorization: Basic ZGlnaXRhbC1nb29kczpjNTFjOTA3MDdhMTNjZTNmZmYyMTNhZmJiNWNkMTI3MA==

Response

Simulated Response

Status

200

Headers

API-Usage-Limit: 1/500
Content-Type: application/json; charset=utf-8

Body

{
  "id": 1,
  "position": 1,
  "navigational": true,
  "title": "Вариант"
}

Get option_names

Endpoint

GET /admin/option_names.json

Request

Route

GET /admin/option_names.json

Headers

Authorization: Basic ZGlnaXRhbC1nb29kczpjNTFjOTA3MDdhMTNjZTNmZmYyMTNhZmJiNWNkMTI3MA==

Response

Simulated Response

Status

200

Headers

API-Usage-Limit: 1/500
Content-Type: application/json; charset=utf-8

Body

[
  {
    "id": 1,
    "position": 1,
    "navigational": true,
    "title": "Вариант"
  },
  {
    "id": 3,
    "position": 2,
    "navigational": true,
    "title": "Цвет"
  }
]

Update option_name

Endpoint

PUT /admin/option_names/:option_name_id.json

Parameters

Name Description
option_name[title] title
option_name[position] position
option_name[navigational] true by default; show in products filter on category page

Request

Route

PUT /admin/option_names/1.json

Headers

Content-Type: application/json
Authorization: Basic ZGlnaXRhbC1nb29kczpjNTFjOTA3MDdhMTNjZTNmZmYyMTNhZmJiNWNkMTI3MA==

Body

{
  "option_name": {
    "title": "Type",
    "position": 2,
    "navigational": false
  }
}

Response

Simulated Response

Status

200

Headers

API-Usage-Limit: 1/500
Content-Type: application/json; charset=utf-8

Body

{
  "id": 1,
  "position": 2,
  "navigational": false,
  "title": "Type"
}

OptionValue

Create option_value

Endpoint

POST /admin/option_names/:option_name_id/option_values.json

Parameters

Name Description
option_value[title] required title
option_value[position] position in option_values list
option_value[image][filename] image filename, required if attachment present
option_value[image][attachment] base64 encoded image body
option_value[image][src] image url

Request

Route

POST /admin/option_names/1/option_values.json

Headers

Content-Type: application/json
Authorization: Basic ZGlnaXRhbC1nb29kczpjNTFjOTA3MDdhMTNjZTNmZmYyMTNhZmJiNWNkMTI3MA==

Body

{
  "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"
    }
  }
}

Response

Simulated Response

Status

201

Headers

API-Usage-Limit: 1/500
Content-Type: application/json; charset=utf-8

Body

{
  "id": 21063164,
  "option_name_id": 1,
  "position": 21,
  "title": "Blue",
  "image_url": "http://minio.insales.io:9000/insales-test-sber/images/option_values/1/1532/21063164/thumb/image.jpg?1728079011"
}

Destroy option_value image

Endpoint

DELETE /admin/option_names/:option_name_id/option_values/:option_value_id/destroy_image.json

Request

Route

DELETE /admin/option_names/1/option_values/20/destroy_image.json

Headers

Content-Type: application/json
Authorization: Basic ZGlnaXRhbC1nb29kczpjNTFjOTA3MDdhMTNjZTNmZmYyMTNhZmJiNWNkMTI3MA==

Response

Simulated Response

Status

200

Headers

API-Usage-Limit: 1/500
Content-Type: application/json; charset=utf-8

Body

{
  "option_name_id": 1,
  "id": 20,
  "position": 20,
  "title": "Синий-10",
  "image_url": null
}

Destroy option_value

Endpoint

DELETE /admin/option_names/:option_name_id/option_values/:option_value_id.json

Request

Route

DELETE /admin/option_names/1/option_values/20.json

Headers

Content-Type: application/json
Authorization: Basic ZGlnaXRhbC1nb29kczpjNTFjOTA3MDdhMTNjZTNmZmYyMTNhZmJiNWNkMTI3MA==

Response

Simulated Response

Status

200

Headers

API-Usage-Limit: 1/500
Content-Type: application/json; charset=utf-8

Body

{
  "status": "ok"
}

Get option_value

Endpoint

GET /admin/option_names/:option_name_id/option_values/:option_value_id.json

Request

Route

GET /admin/option_names/1/option_values/2.json

Headers

Authorization: Basic ZGlnaXRhbC1nb29kczpjNTFjOTA3MDdhMTNjZTNmZmYyMTNhZmJiNWNkMTI3MA==

Response

Simulated Response

Status

200

Headers

API-Usage-Limit: 1/500
Content-Type: application/json; charset=utf-8

Body

{
  "id": 2,
  "option_name_id": 1,
  "position": 2,
  "title": "Зеленый",
  "image_url": null
}

Get option_values for all options

Endpoint

GET /admin/option_values.json

Request

Route

GET /admin/option_values.json

Headers

Authorization: Basic ZGlnaXRhbC1nb29kczpjNTFjOTA3MDdhMTNjZTNmZmYyMTNhZmJiNWNkMTI3MA==

Response

Simulated Response

Status

200

Headers

API-Usage-Limit: 1/500
Content-Type: application/json; charset=utf-8

Body

[
  {
    "id": 1,
    "option_name_id": 1,
    "position": 1,
    "title": "Red",
    "image_url": null
  },
  {
    "id": 4,
    "option_name_id": 3,
    "position": 1,
    "title": "Синий",
    "image_url": null
  },
  {
    "id": 2,
    "option_name_id": 1,
    "position": 2,
    "title": "Зеленый",
    "image_url": null
  },
  {
    "id": 3,
    "option_name_id": 1,
    "position": 3,
    "title": "Базовая",
    "image_url": null
  },
  {
    "id": 20,
    "option_name_id": 1,
    "position": 20,
    "title": "Синий-10",
    "image_url": null
  }
]

Get option_values for specific option

Endpoint

GET /admin/option_names/:option_name_id/option_values.json

Request

Route

GET /admin/option_names/1/option_values.json

Headers

Authorization: Basic ZGlnaXRhbC1nb29kczpjNTFjOTA3MDdhMTNjZTNmZmYyMTNhZmJiNWNkMTI3MA==

Response

Simulated Response

Status

200

Headers

API-Usage-Limit: 1/500
Content-Type: application/json; charset=utf-8

Body

[
  {
    "id": 1,
    "option_name_id": 1,
    "position": 1,
    "title": "Red",
    "image_url": null
  },
  {
    "id": 2,
    "option_name_id": 1,
    "position": 2,
    "title": "Зеленый",
    "image_url": null
  },
  {
    "id": 3,
    "option_name_id": 1,
    "position": 3,
    "title": "Базовая",
    "image_url": null
  },
  {
    "id": 20,
    "option_name_id": 1,
    "position": 20,
    "title": "Синий-10",
    "image_url": null
  }
]

Update option_value

Endpoint

PUT /admin/option_names/:option_name_id/option_values/:option_value_id.json

Parameters

Name Description
option_value[position] position
option_value[image][filename] image filename, required if attachment present
option_value[image][attachment] base64 encoded image body
option_value[image][src] image url

Request

Route

PUT /admin/option_names/1/option_values/2.json

Headers

Content-Type: application/json
Authorization: Basic ZGlnaXRhbC1nb29kczpjNTFjOTA3MDdhMTNjZTNmZmYyMTNhZmJiNWNkMTI3MA==

Body

{
  "option_value": {
    "position": 3,
    "image": {
      "src": "https://abc.myinsales.ru/images/no_image_compact.jpg"
    }
  }
}

Response

Simulated Response

Status

200

Headers

API-Usage-Limit: 1/500
Content-Type: application/json; charset=utf-8

Body

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

Order

Create discount

Endpoint

PUT /admin/orders/:order_id.json

Parameters

Name Description
order[discounts_attributes] required discounts attributes
order[discounts_attributes][][discount] required discount amount
order[discounts_attributes][][type_id] 1 - percent (default), 2 - money
order[discounts_attributes][][description] description text
order[discounts_attributes][][discount_order_lines_ids] ids of affected order lines (all will be affected if not specified)

Request

Route

PUT /admin/orders/1.json

Headers

Content-Type: application/json
Authorization: Basic ZGlnaXRhbC1nb29kczpjNTFjOTA3MDdhMTNjZTNmZmYyMTNhZmJiNWNkMTI3MA==

Body

{
  "order": {
    "discounts_attributes": [
      {
        "discount": 100,
        "type_id": 2,
        "description": "-100 (absolute)"
      },
      {
        "discount": 10,
        "description": "10% only for first order line",
        "discount_order_lines_ids": [
          25
        ]
      }
    ]
  }
}

Response

Simulated Response

Status

200

Headers

API-Usage-Limit: 1/500
Content-Type: application/json; charset=utf-8

Body

{
  "fields_values": [
    {
      "id": 100,
      "field_id": 275,
      "value": "old value",
      "created_at": "2024-10-05T00:56:33.617+03:00",
      "updated_at": "2024-10-05T00:56:33.617+03:00",
      "type": "Текст",
      "name": "special",
      "handle": "my_awesome_field"
    }
  ],
  "order_lines": [
    {
      "id": 25,
      "order_id": 1,
      "sale_price": 100.0,
      "full_sale_price": 55.72,
      "total_price": 200.0,
      "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": "2024-10-05T00:56:34.000+03:00",
      "created_at": "2024-10-05T00:56:33.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": 26,
      "order_id": 1,
      "sale_price": 150.0,
      "full_sale_price": 98.57,
      "total_price": 150.0,
      "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": "2024-10-05T00:56:34.000+03:00",
      "created_at": "2024-10-05T00:56:33.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": 14,
    "description": "-20 (absolute)",
    "type_id": 2,
    "amount": 20.0,
    "full_amount": 20.0,
    "percent": null,
    "discount": "20.0",
    "reference_id": null,
    "reference_type": null,
    "discount_products_ids": [

    ],
    "discount_order_lines_ids": [

    ],
    "discount_code_id": null,
    "created_at": "2024-10-05T00:56:33.000+03:00",
    "updated_at": "2024-10-05T00:56:33.000+03:00"
  },
  "shipping_address": {
    "id": 1,
    "fields_values": [
      {
        "id": 99,
        "field_id": 274,
        "value": "old value",
        "created_at": "2024-10-05T00:56:33.590+03:00",
        "updated_at": "2024-10-05T00:56:33.590+03:00",
        "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,
        "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,
        "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,
        "title": null,
        "example": null,
        "type": "Field::SystemTextArea"
      },
      {
        "id": 274,
        "destiny": 1,
        "position": 22,
        "office_title": "special",
        "for_buyer": true,
        "obligatory": false,
        "active": true,
        "system_name": null,
        "created_at": "2024-10-05T00:56:33.582+03:00",
        "updated_at": "2024-10-05T00:56:33.582+03:00",
        "show_in_result": true,
        "show_in_checkout": true,
        "is_indexed": null,
        "hide_in_backoffice": null,
        "handle": 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,
        "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,
        "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,
        "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,
        "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,
    "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": "2024-10-05T00:56:33.000+03:00",
    "comment": null,
    "registered": false,
    "subscribe": true,
    "client_group_id": null,
    "surname": null,
    "middlename": 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,
    "contact_name": "Mortimer Hant",
    "progressive_discount": null,
    "group_discount": null,
    "ip_addr": "",
    "fields_values": [
      {
        "id": 98,
        "field_id": 273,
        "value": "old value",
        "created_at": "2024-10-05T00:56:33.570+03:00",
        "updated_at": "2024-10-05T00:56:33.570+03:00",
        "type": "Текст",
        "name": "special",
        "handle": null
      }
    ]
  },
  "discounts": [
    {
      "id": 14,
      "description": "-20 (absolute)",
      "type_id": 2,
      "amount": 20.0,
      "full_amount": 20.0,
      "percent": null,
      "discount": "20.0",
      "reference_id": null,
      "reference_type": null,
      "discount_products_ids": [

      ],
      "discount_order_lines_ids": [

      ],
      "discount_code_id": null,
      "created_at": "2024-10-05T00:56:33.000+03:00",
      "updated_at": "2024-10-05T00:56:33.000+03:00"
    },
    {
      "id": 15,
      "description": "-100 (absolute)",
      "type_id": 2,
      "amount": 100.0,
      "full_amount": 100.0,
      "percent": null,
      "discount": "100.0",
      "reference_id": null,
      "reference_type": null,
      "discount_products_ids": [

      ],
      "discount_order_lines_ids": [

      ],
      "discount_code_id": null,
      "created_at": "2024-10-05T00:56:33.000+03:00",
      "updated_at": "2024-10-05T00:56:33.000+03:00"
    },
    {
      "id": 16,
      "description": "10% only for first order line",
      "type_id": 1,
      "amount": 20.0,
      "full_amount": 20.0,
      "percent": "10.0",
      "discount": "10.0",
      "reference_id": null,
      "reference_type": null,
      "discount_products_ids": [
        1
      ],
      "discount_order_lines_ids": [
        25
      ],
      "discount_code_id": null,
      "created_at": "2024-10-05T00:56:33.000+03:00",
      "updated_at": "2024-10-05T00:56:33.000+03:00"
    }
  ],
  "total_price": 310.0,
  "items_price": 210.0,
  "id": 1,
  "key": "teest",
  "number": 1001,
  "comment": "comment",
  "archived": false,
  "delivery_title": "самовывоз",
  "delivery_description": "самовывоз",
  "delivery_price": 100.0,
  "full_delivery_price": 100.0,
  "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": "2024-10-05T00:56: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,
  "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,
      "title": null,
      "description": null,
      "address": null,
      "payment_method": null,
      "source_id": null
    },
    "not_available": null
  },
  "responsible_user_id": null,
  "total_profit": "30.0"
}

Create order line by product_id

Endpoint

PUT /admin/orders/:order_id.json

Parameters

Name Description
order[order_lines_attributes] required order lines attributes
order[order_lines_attributes][][quantity] required quantity
order[order_lines_attributes][][vat] integer, VAT for order line is equal to VAT of its product, by default, products get their value from account by default,if default in account set as 'No VAT', you need to use 'force' to change VAT of order line through API; possible values depend on country, set to -1 if this product is not a subject to VAT
order[order_lines_attributes][][product_id] required product id

Request

Route

PUT /admin/orders/1.json

Headers

Content-Type: application/json
Authorization: Basic ZGlnaXRhbC1nb29kczpjNTFjOTA3MDdhMTNjZTNmZmYyMTNhZmJiNWNkMTI3MA==

Body

{
  "order": {
    "order_lines_attributes": [
      {
        "product_id": 1,
        "quantity": 1,
        "vat": 18
      }
    ]
  }
}

Response

Simulated Response

Status

200

Headers

API-Usage-Limit: 1/500
Content-Type: application/json; charset=utf-8

Body

{
  "fields_values": [
    {
      "id": 91,
      "field_id": 266,
      "value": "old value",
      "created_at": "2024-10-05T00:56:32.521+03:00",
      "updated_at": "2024-10-05T00:56:32.521+03:00",
      "type": "Текст",
      "name": "special",
      "handle": "my_awesome_field"
    }
  ],
  "order_lines": [
    {
      "id": 24,
      "order_id": 1,
      "sale_price": 300.0,
      "full_sale_price": 300.0,
      "total_price": 300.0,
      "full_total_price": 300.0,
      "discounts_amount": 0.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": "2024-10-05T00:56:32.000+03:00",
      "created_at": "2024-10-05T00:56:32.000+03:00",
      "bundle_id": null,
      "vat": 18,
      "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": 90,
        "field_id": 265,
        "value": "old value",
        "created_at": "2024-10-05T00:56:32.496+03:00",
        "updated_at": "2024-10-05T00:56:32.496+03:00",
        "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,
        "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,
        "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,
        "title": null,
        "example": null,
        "type": "Field::SystemTextArea"
      },
      {
        "id": 265,
        "destiny": 1,
        "position": 22,
        "office_title": "special",
        "for_buyer": true,
        "obligatory": false,
        "active": true,
        "system_name": null,
        "created_at": "2024-10-05T00:56:32.488+03:00",
        "updated_at": "2024-10-05T00:56:32.488+03:00",
        "show_in_result": true,
        "show_in_checkout": true,
        "is_indexed": null,
        "hide_in_backoffice": null,
        "handle": 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,
        "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,
        "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,
        "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,
        "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,
    "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": "2024-10-05T00:56:32.000+03:00",
    "comment": null,
    "registered": false,
    "subscribe": true,
    "client_group_id": null,
    "surname": null,
    "middlename": 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,
    "contact_name": "Mortimer Hant",
    "progressive_discount": null,
    "group_discount": null,
    "ip_addr": "",
    "fields_values": [
      {
        "id": 89,
        "field_id": 264,
        "value": "old value",
        "created_at": "2024-10-05T00:56:32.477+03:00",
        "updated_at": "2024-10-05T00:56:32.477+03:00",
        "type": "Текст",
        "name": "special",
        "handle": null
      }
    ]
  },
  "discounts": [

  ],
  "total_price": 400.0,
  "items_price": 300.0,
  "id": 1,
  "key": "teest",
  "number": 1001,
  "comment": "comment",
  "archived": false,
  "delivery_title": "самовывоз",
  "delivery_description": "самовывоз",
  "delivery_price": 100.0,
  "full_delivery_price": 100.0,
  "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": "2024-10-05T00:56:32.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,
  "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,
      "title": null,
      "description": null,
      "address": null,
      "payment_method": null,
      "source_id": null
    },
    "not_available": null
  },
  "responsible_user_id": null,
  "total_profit": "210.0"
}

Create order line by variant_id

Endpoint

PUT /admin/orders/:order_id.json

Parameters

Name Description
order[order_lines_attributes] required order lines attributes
order[order_lines_attributes][][quantity] required quantity
order[order_lines_attributes][][vat] integer, VAT for order line is equal to VAT of its product, by default, products get their value from account by default,if default in account set as 'No VAT', you need to use 'force' to change VAT of order line through API; possible values depend on country, set to -1 if this product is not a subject to VAT
order[order_lines_attributes][][variant_id] required variant id

Request

Route

PUT /admin/orders/1.json

Headers

Content-Type: application/json
Authorization: Basic ZGlnaXRhbC1nb29kczpjNTFjOTA3MDdhMTNjZTNmZmYyMTNhZmJiNWNkMTI3MA==

Body

{
  "order": {
    "order_lines_attributes": [
      {
        "variant_id": 1,
        "quantity": 1,
        "vat": -1
      }
    ]
  }
}

Response

Simulated Response

Status

200

Headers

API-Usage-Limit: 1/500
Content-Type: application/json; charset=utf-8

Body

{
  "fields_values": [
    {
      "id": 88,
      "field_id": 263,
      "value": "old value",
      "created_at": "2024-10-05T00:56:32.083+03:00",
      "updated_at": "2024-10-05T00:56:32.083+03:00",
      "type": "Текст",
      "name": "special",
      "handle": "my_awesome_field"
    }
  ],
  "order_lines": [
    {
      "id": 23,
      "order_id": 1,
      "sale_price": 300.0,
      "full_sale_price": 300.0,
      "total_price": 300.0,
      "full_total_price": 300.0,
      "discounts_amount": 0.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": "2024-10-05T00:56:32.000+03:00",
      "created_at": "2024-10-05T00:56:32.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": 87,
        "field_id": 262,
        "value": "old value",
        "created_at": "2024-10-05T00:56:32.059+03:00",
        "updated_at": "2024-10-05T00:56:32.059+03:00",
        "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,
        "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,
        "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,
        "title": null,
        "example": null,
        "type": "Field::SystemTextArea"
      },
      {
        "id": 262,
        "destiny": 1,
        "position": 22,
        "office_title": "special",
        "for_buyer": true,
        "obligatory": false,
        "active": true,
        "system_name": null,
        "created_at": "2024-10-05T00:56:32.050+03:00",
        "updated_at": "2024-10-05T00:56:32.050+03:00",
        "show_in_result": true,
        "show_in_checkout": true,
        "is_indexed": null,
        "hide_in_backoffice": null,
        "handle": 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,
        "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,
        "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,
        "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,
        "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,
    "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": "2024-10-05T00:56:32.000+03:00",
    "comment": null,
    "registered": false,
    "subscribe": true,
    "client_group_id": null,
    "surname": null,
    "middlename": 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,
    "contact_name": "Mortimer Hant",
    "progressive_discount": null,
    "group_discount": null,
    "ip_addr": "",
    "fields_values": [
      {
        "id": 86,
        "field_id": 261,
        "value": "old value",
        "created_at": "2024-10-05T00:56:32.036+03:00",
        "updated_at": "2024-10-05T00:56:32.036+03:00",
        "type": "Текст",
        "name": "special",
        "handle": null
      }
    ]
  },
  "discounts": [

  ],
  "total_price": 400.0,
  "items_price": 300.0,
  "id": 1,
  "key": "teest",
  "number": 1001,
  "comment": "comment",
  "archived": false,
  "delivery_title": "самовывоз",
  "delivery_description": "самовывоз",
  "delivery_price": 100.0,
  "full_delivery_price": 100.0,
  "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": "2024-10-05T00:56:32.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,
  "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,
      "title": null,
      "description": null,
      "address": null,
      "payment_method": null,
      "source_id": null
    },
    "not_available": null
  },
  "responsible_user_id": null,
  "total_profit": "210.0"
}

Create order with bundle

Endpoint

POST /admin/orders.json

Parameters

Name Description
order[order_lines_attributes] required order lines attributes
order[order_lines_attributes][][quantity] required quantity
order[order_lines_attributes][][variant_id] required variant id
order[order_lines_attributes][][vat] do not set vat for bundle, because after order creation bundle will break into bundle components, which have their own VAT rates
order[client] required client info
order[client][name] client name
order[client][email] client email
order[client][phone] required client phone
order[client][consent_to_personal_data] required consent to personal data
order[shipping_address_attributes] required array of shipping address attributes
order[shipping_address_attributes][address] shipping address
order[shipping_address_attributes][full_locality_name] required full locality name
order[delivery_variant_id] required delivery variant id
order[payment_gateway_id] required payment gateway id
order[coupon] discount code

Request

Route

POST /admin/orders.json

Headers

Content-Type: application/json
Authorization: Basic ZGlnaXRhbC1nb29kczpjNTFjOTA3MDdhMTNjZTNmZmYyMTNhZmJiNWNkMTI3MA==

Body

{
  "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"
  }
}

Response

Simulated Response

Status

201

Headers

API-Usage-Limit: 1/500
Content-Type: application/json; charset=utf-8

Body

{
  "fields_values": [

  ],
  "order_lines": [
    {
      "id": 13,
      "order_id": 12,
      "sale_price": 375.0,
      "full_sale_price": 375.0,
      "total_price": 750.0,
      "full_total_price": 750.0,
      "discounts_amount": 0.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": "2024-10-05T00:56:26.000+03:00",
      "created_at": "2024-10-05T00:56:26.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": 14,
      "order_id": 12,
      "sale_price": 375.0,
      "full_sale_price": 375.0,
      "total_price": 750.0,
      "full_total_price": 750.0,
      "discounts_amount": 0.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": "2024-10-05T00:56:26.000+03:00",
      "created_at": "2024-10-05T00:56:26.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": [
    {
      "id": 4,
      "created_at": "2024-10-05T00:56:26.151+03:00",
      "action": "order_created",
      "value_was": null,
      "value_is": null,
      "full_description": "Заказ создан пользователем Цифровые товары",
      "user_name": "Цифровые товары"
    }
  ],
  "discount": {
    "id": 6,
    "description": "Скидка по купону 20% discount",
    "type_id": 1,
    "amount": 300.0,
    "full_amount": 300.0,
    "percent": "20.0",
    "discount": "20.0",
    "reference_id": 178,
    "reference_type": "DiscountCode",
    "discount_products_ids": [

    ],
    "discount_order_lines_ids": [

    ],
    "discount_code_id": 178,
    "created_at": "2024-10-05T00:56:26.000+03:00",
    "updated_at": "2024-10-05T00:56:26.000+03:00"
  },
  "shipping_address": {
    "id": 21,
    "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,
        "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,
        "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,
        "title": null,
        "example": null,
        "type": "Field::SystemTextArea"
      },
      {
        "id": 223,
        "destiny": 1,
        "position": 22,
        "office_title": "special",
        "for_buyer": true,
        "obligatory": false,
        "active": true,
        "system_name": null,
        "created_at": "2024-10-05T00:56:25.711+03:00",
        "updated_at": "2024-10-05T00:56:25.711+03:00",
        "show_in_result": true,
        "show_in_checkout": true,
        "is_indexed": null,
        "hide_in_backoffice": null,
        "handle": 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,
    "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": 25,
    "email": "vasya@example.com",
    "name": "Vasya",
    "phone": "79111112233",
    "created_at": "2024-10-05T00:56:25.000+03:00",
    "updated_at": "2024-10-05T00:56:25.000+03:00",
    "comment": null,
    "registered": false,
    "subscribe": true,
    "client_group_id": null,
    "surname": null,
    "middlename": 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,
    "contact_name": "Vasya",
    "progressive_discount": null,
    "group_discount": null,
    "ip_addr": "",
    "fields_values": [

    ]
  },
  "discounts": [
    {
      "id": 6,
      "description": "Скидка по купону 20% discount",
      "type_id": 1,
      "amount": 300.0,
      "full_amount": 300.0,
      "percent": "20.0",
      "discount": "20.0",
      "reference_id": 178,
      "reference_type": "DiscountCode",
      "discount_products_ids": [

      ],
      "discount_order_lines_ids": [

      ],
      "discount_code_id": 178,
      "created_at": "2024-10-05T00:56:26.000+03:00",
      "updated_at": "2024-10-05T00:56:26.000+03:00"
    }
  ],
  "total_price": 1300.0,
  "items_price": 1200.0,
  "id": 12,
  "key": "69d7bc5241e8f1169009be860ef90cfc",
  "number": 1006,
  "comment": null,
  "archived": false,
  "delivery_title": "самовывоз",
  "delivery_description": "самовывоз (самовывоз из офиса)",
  "delivery_price": 100.0,
  "full_delivery_price": 100.0,
  "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",
  "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": "2024-10-05T00:56:26.000+03:00",
  "updated_at": "2024-10-05T00:56:26.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,
  "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.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,
      "title": null,
      "description": null,
      "address": null,
      "payment_method": [

      ],
      "source_id": null
    },
    "not_available": null
  },
  "responsible_user_id": null,
  "total_profit": "1200.0"
}

Create order with product

Endpoint

POST /admin/orders.json

Parameters

Name Description
order[order_lines_attributes] required order lines attributes
order[order_lines_attributes][][quantity] required quantity
order[order_lines_attributes][][variant_id] required variant id
order[order_lines_attributes][][vat] integer, VAT for order line is equal to VAT of its product, by default, products get their value from account by default,if default in account set as 'No VAT', you need to use 'force' to change VAT of order line through API; possible values depend on country, set to -1 if this product is not a subject to VAT
order[client] required client info
order[client][name] client name
order[client][email] client email
order[client][phone] required client phone
order[shipping_address_attributes] required array of shipping address attributes
order[shipping_address_attributes][address] shipping address
order[delivery_variant_id] required delivery variant id
order[payment_gateway_id] required payment gateway id
order[coupon] discount code

Request

Route

POST /admin/orders.json

Headers

Content-Type: application/json
Authorization: Basic ZGlnaXRhbC1nb29kczpjNTFjOTA3MDdhMTNjZTNmZmYyMTNhZmJiNWNkMTI3MA==

Body

{
  "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"
  }
}

Response

Simulated Response

Status

201

Headers

API-Usage-Limit: 1/500
Content-Type: application/json; charset=utf-8

Body

{
  "fields_values": [

  ],
  "order_lines": [
    {
      "id": 10,
      "order_id": 10,
      "sale_price": 600.0,
      "full_sale_price": 600.0,
      "total_price": 1200.0,
      "full_total_price": 1200.0,
      "discounts_amount": 0.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": "2024-10-05T00:56:25.000+03:00",
      "created_at": "2024-10-05T00:56:25.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": [
    {
      "id": 2,
      "created_at": "2024-10-05T00:56:25.070+03:00",
      "action": "order_created",
      "value_was": null,
      "value_is": null,
      "full_description": "Заказ создан пользователем Цифровые товары",
      "user_name": "Цифровые товары"
    }
  ],
  "discount": {
    "id": 4,
    "description": "Скидка по купону 20% discount",
    "type_id": 1,
    "amount": 240.0,
    "full_amount": 240.0,
    "percent": "20.0",
    "discount": "20.0",
    "reference_id": 176,
    "reference_type": "DiscountCode",
    "discount_products_ids": [

    ],
    "discount_order_lines_ids": [

    ],
    "discount_code_id": 176,
    "created_at": "2024-10-05T00:56:25.000+03:00",
    "updated_at": "2024-10-05T00:56:25.000+03:00"
  },
  "shipping_address": {
    "id": 19,
    "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,
        "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,
        "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,
        "title": null,
        "example": null,
        "type": "Field::SystemTextArea"
      },
      {
        "id": 217,
        "destiny": 1,
        "position": 22,
        "office_title": "special",
        "for_buyer": true,
        "obligatory": false,
        "active": true,
        "system_name": null,
        "created_at": "2024-10-05T00:56:24.723+03:00",
        "updated_at": "2024-10-05T00:56:24.723+03:00",
        "show_in_result": true,
        "show_in_checkout": true,
        "is_indexed": null,
        "hide_in_backoffice": null,
        "handle": 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,
    "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": 23,
    "email": "vasya@example.com",
    "name": "Vasya",
    "phone": "79111112233",
    "created_at": "2024-10-05T00:56:24.000+03:00",
    "updated_at": "2024-10-05T00:56:24.000+03:00",
    "comment": null,
    "registered": false,
    "subscribe": true,
    "client_group_id": null,
    "surname": null,
    "middlename": 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,
    "contact_name": "Vasya",
    "progressive_discount": null,
    "group_discount": null,
    "ip_addr": "",
    "fields_values": [

    ]
  },
  "discounts": [
    {
      "id": 4,
      "description": "Скидка по купону 20% discount",
      "type_id": 1,
      "amount": 240.0,
      "full_amount": 240.0,
      "percent": "20.0",
      "discount": "20.0",
      "reference_id": 176,
      "reference_type": "DiscountCode",
      "discount_products_ids": [

      ],
      "discount_order_lines_ids": [

      ],
      "discount_code_id": 176,
      "created_at": "2024-10-05T00:56:25.000+03:00",
      "updated_at": "2024-10-05T00:56:25.000+03:00"
    }
  ],
  "total_price": 1060.0,
  "items_price": 960.0,
  "id": 10,
  "key": "9aabef7bbab5d0b349a1434a5cb97d78",
  "number": 1006,
  "comment": null,
  "archived": false,
  "delivery_title": "самовывоз",
  "delivery_description": "самовывоз (самовывоз из офиса)",
  "delivery_price": 100.0,
  "full_delivery_price": 100.0,
  "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",
  "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": "2024-10-05T00:56:25.000+03:00",
  "updated_at": "2024-10-05T00:56:25.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,
  "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.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,
      "title": null,
      "description": null,
      "address": null,
      "payment_method": [

      ],
      "source_id": null
    },
    "not_available": null
  },
  "responsible_user_id": null,
  "total_profit": "960.0"
}

Get order

Endpoint

GET /admin/orders/:order_id.json

Request

Route

GET /admin/orders/1.json

Headers

Authorization: Basic ZGlnaXRhbC1nb29kczpjNTFjOTA3MDdhMTNjZTNmZmYyMTNhZmJiNWNkMTI3MA==

Response

Simulated Response

Status

200

Headers

API-Usage-Limit: 1/500
Content-Type: application/json; charset=utf-8

Body

{
  "fields_values": [
    {
      "id": 25,
      "field_id": 200,
      "value": "old value",
      "created_at": "2024-10-05T00:56:22.619+03:00",
      "updated_at": "2024-10-05T00:56:22.619+03:00",
      "type": "Текст",
      "name": "special",
      "handle": "my_awesome_field"
    }
  ],
  "order_lines": [
    {
      "id": 1,
      "order_id": 1,
      "sale_price": 300.0,
      "full_sale_price": 300.0,
      "total_price": 300.0,
      "full_total_price": 300.0,
      "discounts_amount": 0.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": null,
      "accessory_lines": [

      ],
      "external_variant_id": null
    },
    {
      "id": 2,
      "order_id": 1,
      "sale_price": 600.0,
      "full_sale_price": 600.0,
      "total_price": 1200.0,
      "full_total_price": 1200.0,
      "discounts_amount": 0.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": 24,
        "field_id": 199,
        "value": "old value",
        "created_at": "2024-10-05T00:56:22.590+03:00",
        "updated_at": "2024-10-05T00:56:22.590+03:00",
        "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,
        "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,
        "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,
        "title": null,
        "example": null,
        "type": "Field::SystemTextArea"
      },
      {
        "id": 199,
        "destiny": 1,
        "position": 22,
        "office_title": "special",
        "for_buyer": true,
        "obligatory": false,
        "active": true,
        "system_name": null,
        "created_at": "2024-10-05T00:56:22.580+03:00",
        "updated_at": "2024-10-05T00:56:22.580+03:00",
        "show_in_result": true,
        "show_in_checkout": true,
        "is_indexed": null,
        "hide_in_backoffice": null,
        "handle": 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,
        "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,
        "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,
        "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,
        "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,
    "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": "2024-10-05T00:56:22.000+03:00",
    "comment": null,
    "registered": false,
    "subscribe": true,
    "client_group_id": null,
    "surname": null,
    "middlename": 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,
    "contact_name": "Mortimer Hant",
    "progressive_discount": null,
    "group_discount": null,
    "ip_addr": "",
    "fields_values": [
      {
        "id": 23,
        "field_id": 198,
        "value": "old value",
        "created_at": "2024-10-05T00:56:22.568+03:00",
        "updated_at": "2024-10-05T00:56:22.568+03:00",
        "type": "Текст",
        "name": "special",
        "handle": null
      }
    ]
  },
  "discounts": [

  ],
  "total_price": 1600.0,
  "items_price": 1500.0,
  "id": 1,
  "key": "teest",
  "number": 1001,
  "comment": "comment",
  "archived": false,
  "delivery_title": "самовывоз",
  "delivery_description": "самовывоз",
  "delivery_price": 100.0,
  "full_delivery_price": 100.0,
  "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": "2024-10-05T00:56:22.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,
  "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,
      "title": null,
      "description": null,
      "address": null,
      "payment_method": null,
      "source_id": null
    },
    "not_available": null
  },
  "responsible_user_id": null,
  "total_profit": "1500.0"
}

Get orders count

Endpoint

GET /admin/orders/count.json

Parameters

Name Description
fulfillment_status array of statuses
delivery_variant array of delivery variant ids
payment_gateway_id array of payment gateway ids

Request

Route

GET /admin/orders/count.json

Headers

Authorization: Basic ZGlnaXRhbC1nb29kczpjNTFjOTA3MDdhMTNjZTNmZmYyMTNhZmJiNWNkMTI3MA==

Response

Simulated Response

Status

200

Headers

API-Usage-Limit: 1/500
Content-Type: application/json; charset=utf-8

Body

{
  "count": 6
}

Get orders

Endpoint

GET /admin/orders.json

Parameters

Name Description
fulfillment_status array of statuses
delivery_variant array of delivery variant ids
payment_gateway_id array of payment gateway ids
updated_since Set datetime to get only data updated after it.
from_id Set id to get only data starting from it.
per_page Quantity of objects per page.

Request

Route

GET /admin/orders.json?fulfillment_status[]=new&fulfillment_status[]=delivered&delivery_variant[]=1&delivery_variant[]=2&payment_gateway_id[]=1&payment_gateway_id[]=3

Headers

Authorization: Basic ZGlnaXRhbC1nb29kczpjNTFjOTA3MDdhMTNjZTNmZmYyMTNhZmJiNWNkMTI3MA==

Query Parameters

fulfillment_status=["new", "delivered"]
delivery_variant=["1", "2"]
payment_gateway_id=["1", "3"]

Response

Simulated Response

Status

200

Headers

API-Usage-Limit: 1/500
Content-Type: application/json; charset=utf-8

Body

[
  {
    "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,
          "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,
          "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,
          "title": null,
          "example": null,
          "type": "Field::SystemTextArea"
        },
        {
          "id": 211,
          "destiny": 1,
          "position": 22,
          "office_title": "special",
          "for_buyer": true,
          "obligatory": false,
          "active": true,
          "system_name": null,
          "created_at": "2024-10-05T00:56:23.753+03:00",
          "updated_at": "2024-10-05T00:56:23.753+03:00",
          "show_in_result": true,
          "show_in_checkout": true,
          "is_indexed": null,
          "hide_in_backoffice": null,
          "handle": 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,
          "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,
          "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,
          "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,
          "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,
      "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,
      "surname": null,
      "middlename": 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,
      "contact_name": "Just Man",
      "progressive_discount": null,
      "group_discount": "25.0",
      "ip_addr": "",
      "fields_values": [

      ]
    },
    "discounts": [

    ],
    "total_price": 0.0,
    "items_price": 0.0,
    "id": 8,
    "key": null,
    "number": 1008,
    "comment": "comment",
    "archived": false,
    "delivery_title": "самовывоз",
    "delivery_description": "самовывоз",
    "delivery_price": 0.0,
    "full_delivery_price": 0.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,
    "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,
        "title": null,
        "description": null,
        "address": null,
        "payment_method": null,
        "source_id": null
      },
      "not_available": null
    },
    "responsible_user_id": null,
    "total_profit": "0.0"
  },
  {
    "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,
          "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,
          "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,
          "title": null,
          "example": null,
          "type": "Field::SystemTextArea"
        },
        {
          "id": 211,
          "destiny": 1,
          "position": 22,
          "office_title": "special",
          "for_buyer": true,
          "obligatory": false,
          "active": true,
          "system_name": null,
          "created_at": "2024-10-05T00:56:23.753+03:00",
          "updated_at": "2024-10-05T00:56:23.753+03:00",
          "show_in_result": true,
          "show_in_checkout": true,
          "is_indexed": null,
          "hide_in_backoffice": null,
          "handle": 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,
          "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,
          "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,
          "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,
          "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,
      "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,
      "surname": null,
      "middlename": 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,
      "contact_name": "John Doe",
      "progressive_discount": null,
      "group_discount": null,
      "ip_addr": "",
      "fields_values": [

      ]
    },
    "discounts": [

    ],
    "total_price": 100.0,
    "items_price": 0.0,
    "id": 6,
    "key": "merged_client_order",
    "number": 10011,
    "comment": "comment",
    "archived": false,
    "delivery_title": "самовывоз",
    "delivery_description": "самовывоз",
    "delivery_price": 100.0,
    "full_delivery_price": 100.0,
    "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,
    "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,
        "title": null,
        "description": null,
        "address": null,
        "payment_method": null,
        "source_id": null
      },
      "not_available": null
    },
    "responsible_user_id": null,
    "total_profit": "0.0"
  },
  {
    "fields_values": [
      {
        "id": 1,
        "field_id": 174,
        "value": "1234",
        "created_at": "2024-10-05T00:55:41.838+03:00",
        "updated_at": "2024-10-05T00:55:41.838+03:00",
        "type": "Текст",
        "name": "АКС айди отгрузки",
        "handle": "aks_shipment_id"
      }
    ],
    "order_lines": [
      {
        "id": 7,
        "order_id": 4,
        "sale_price": 800.0,
        "full_sale_price": 643.2,
        "total_price": 800.0,
        "full_total_price": 643.2,
        "discounts_amount": 264.0,
        "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.0,
        "full_sale_price": 80.4,
        "total_price": 200.0,
        "full_total_price": 160.8,
        "discounts_amount": 66.0,
        "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": "рублевая скидка",
      "type_id": 2,
      "amount": 330.0,
      "full_amount": 396.0,
      "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,
      "surname": null,
      "middlename": 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,
      "contact_name": "Just Man",
      "progressive_discount": null,
      "group_discount": "25.0",
      "ip_addr": "",
      "fields_values": [

      ]
    },
    "discounts": [
      {
        "id": 2,
        "description": "рублевая скидка",
        "type_id": 2,
        "amount": 330.0,
        "full_amount": 396.0,
        "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.0,
    "items_price": 804.0,
    "id": 4,
    "key": null,
    "number": 1005,
    "comment": "comment",
    "archived": false,
    "delivery_title": "самовывоз",
    "delivery_description": "самовывоз",
    "delivery_price": 0.0,
    "full_delivery_price": 0.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,
    "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,
        "title": null,
        "description": null,
        "address": null,
        "payment_method": null,
        "source_id": null
      },
      "not_available": null
    },
    "responsible_user_id": null,
    "total_profit": "804.0"
  },
  {
    "fields_values": [
      {
        "id": 2,
        "field_id": 174,
        "value": "",
        "created_at": "2024-10-05T00:55:41.838+03:00",
        "updated_at": "2024-10-05T00:55:41.838+03:00",
        "type": "Текст",
        "name": "АКС айди отгрузки",
        "handle": "aks_shipment_id"
      }
    ],
    "order_lines": [
      {
        "id": 5,
        "order_id": 3,
        "sale_price": 800.0,
        "full_sale_price": 672.0,
        "total_price": 800.0,
        "full_total_price": 672.0,
        "discounts_amount": 240.0,
        "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.0,
        "full_sale_price": 84.0,
        "total_price": 200.0,
        "full_total_price": 168.0,
        "discounts_amount": 60.0,
        "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": "процентная скидка",
      "type_id": 1,
      "amount": 300.0,
      "full_amount": 360.0,
      "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": 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,
      "surname": null,
      "middlename": 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,
      "contact_name": "Just Man",
      "progressive_discount": null,
      "group_discount": "25.0",
      "ip_addr": "",
      "fields_values": [

      ]
    },
    "discounts": [
      {
        "id": 1,
        "description": "процентная скидка",
        "type_id": 1,
        "amount": 300.0,
        "full_amount": 360.0,
        "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.0,
    "items_price": 840.0,
    "id": 3,
    "key": null,
    "number": 1004,
    "comment": "comment",
    "archived": false,
    "delivery_title": "самовывоз",
    "delivery_description": "самовывоз",
    "delivery_price": 0.0,
    "full_delivery_price": 0.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,
    "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,
        "title": null,
        "description": null,
        "address": null,
        "payment_method": null,
        "source_id": null
      },
      "not_available": null
    },
    "responsible_user_id": null,
    "total_profit": "840.0"
  },
  {
    "fields_values": [
      {
        "id": 37,
        "field_id": 212,
        "value": "old value",
        "created_at": "2024-10-05T00:56:23.786+03:00",
        "updated_at": "2024-10-05T00:56:23.786+03:00",
        "type": "Текст",
        "name": "special",
        "handle": "my_awesome_field"
      }
    ],
    "order_lines": [
      {
        "id": 1,
        "order_id": 1,
        "sale_price": 300.0,
        "full_sale_price": 300.0,
        "total_price": 300.0,
        "full_total_price": 300.0,
        "discounts_amount": 0.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": null,
        "accessory_lines": [

        ],
        "external_variant_id": null
      },
      {
        "id": 2,
        "order_id": 1,
        "sale_price": 600.0,
        "full_sale_price": 600.0,
        "total_price": 1200.0,
        "full_total_price": 1200.0,
        "discounts_amount": 0.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": 36,
          "field_id": 211,
          "value": "old value",
          "created_at": "2024-10-05T00:56:23.760+03:00",
          "updated_at": "2024-10-05T00:56:23.760+03:00",
          "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,
          "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,
          "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,
          "title": null,
          "example": null,
          "type": "Field::SystemTextArea"
        },
        {
          "id": 211,
          "destiny": 1,
          "position": 22,
          "office_title": "special",
          "for_buyer": true,
          "obligatory": false,
          "active": true,
          "system_name": null,
          "created_at": "2024-10-05T00:56:23.753+03:00",
          "updated_at": "2024-10-05T00:56:23.753+03:00",
          "show_in_result": true,
          "show_in_checkout": true,
          "is_indexed": null,
          "hide_in_backoffice": null,
          "handle": 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,
          "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,
          "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,
          "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,
          "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,
      "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": "2024-10-05T00:56:23.000+03:00",
      "comment": null,
      "registered": false,
      "subscribe": true,
      "client_group_id": null,
      "surname": null,
      "middlename": 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,
      "contact_name": "Mortimer Hant",
      "progressive_discount": null,
      "group_discount": null,
      "ip_addr": "",
      "fields_values": [
        {
          "id": 35,
          "field_id": 210,
          "value": "old value",
          "created_at": "2024-10-05T00:56:23.743+03:00",
          "updated_at": "2024-10-05T00:56:23.743+03:00",
          "type": "Текст",
          "name": "special",
          "handle": null
        }
      ]
    },
    "discounts": [

    ],
    "total_price": 1600.0,
    "items_price": 1500.0,
    "id": 1,
    "key": "teest",
    "number": 1001,
    "comment": "comment",
    "archived": false,
    "delivery_title": "самовывоз",
    "delivery_description": "самовывоз",
    "delivery_price": 100.0,
    "full_delivery_price": 100.0,
    "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": "2024-10-05T00:56:23.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,
    "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,
        "title": null,
        "description": null,
        "address": null,
        "payment_method": null,
        "source_id": null
      },
      "not_available": null
    },
    "responsible_user_id": null,
    "total_profit": "1500.0"
  }
]

Remove discount

Endpoint

PUT /admin/orders/:order_id.json

Parameters

Name Description
order[discounts_attributes] required discounts attributes
order[discounts_attributes][][id] required discount id
order[discounts_attributes][][_destroy] required destroy marker (1 or true)

Request

Route

PUT /admin/orders/1.json

Headers

Content-Type: application/json
Authorization: Basic ZGlnaXRhbC1nb29kczpjNTFjOTA3MDdhMTNjZTNmZmYyMTNhZmJiNWNkMTI3MA==

Body

{
  "order": {
    "discounts_attributes": [
      {
        "id": 17,
        "_destroy": true
      }
    ]
  }
}

Response

Simulated Response

Status

200

Headers

API-Usage-Limit: 1/500
Content-Type: application/json; charset=utf-8

Body

{
  "fields_values": [
    {
      "id": 103,
      "field_id": 278,
      "value": "old value",
      "created_at": "2024-10-05T00:56:34.188+03:00",
      "updated_at": "2024-10-05T00:56:34.188+03:00",
      "type": "Текст",
      "name": "special",
      "handle": "my_awesome_field"
    }
  ],
  "order_lines": [
    {
      "id": 27,
      "order_id": 1,
      "sale_price": 100.0,
      "full_sale_price": 100.0,
      "total_price": 200.0,
      "full_total_price": 200.0,
      "discounts_amount": 0.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": "2024-10-05T00:56:34.000+03:00",
      "created_at": "2024-10-05T00:56:34.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": 28,
      "order_id": 1,
      "sale_price": 150.0,
      "full_sale_price": 150.0,
      "total_price": 150.0,
      "full_total_price": 150.0,
      "discounts_amount": 0.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": "2024-10-05T00:56:34.000+03:00",
      "created_at": "2024-10-05T00:56:34.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": 102,
        "field_id": 277,
        "value": "old value",
        "created_at": "2024-10-05T00:56:34.162+03:00",
        "updated_at": "2024-10-05T00:56:34.162+03:00",
        "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,
        "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,
        "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,
        "title": null,
        "example": null,
        "type": "Field::SystemTextArea"
      },
      {
        "id": 277,
        "destiny": 1,
        "position": 22,
        "office_title": "special",
        "for_buyer": true,
        "obligatory": false,
        "active": true,
        "system_name": null,
        "created_at": "2024-10-05T00:56:34.152+03:00",
        "updated_at": "2024-10-05T00:56:34.152+03:00",
        "show_in_result": true,
        "show_in_checkout": true,
        "is_indexed": null,
        "hide_in_backoffice": null,
        "handle": 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,
        "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,
        "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,
        "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,
        "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,
    "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": "2024-10-05T00:56:34.000+03:00",
    "comment": null,
    "registered": false,
    "subscribe": true,
    "client_group_id": null,
    "surname": null,
    "middlename": 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,
    "contact_name": "Mortimer Hant",
    "progressive_discount": null,
    "group_discount": null,
    "ip_addr": "",
    "fields_values": [
      {
        "id": 101,
        "field_id": 276,
        "value": "old value",
        "created_at": "2024-10-05T00:56:34.141+03:00",
        "updated_at": "2024-10-05T00:56:34.141+03:00",
        "type": "Текст",
        "name": "special",
        "handle": null
      }
    ]
  },
  "discounts": [

  ],
  "total_price": 450.0,
  "items_price": 350.0,
  "id": 1,
  "key": "teest",
  "number": 1001,
  "comment": "comment",
  "archived": false,
  "delivery_title": "самовывоз",
  "delivery_description": "самовывоз",
  "delivery_price": 100.0,
  "full_delivery_price": 100.0,
  "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": "2024-10-05T00:56:34.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,
  "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,
      "title": null,
      "description": null,
      "address": null,
      "payment_method": null,
      "source_id": null
    },
    "not_available": null
  },
  "responsible_user_id": null,
  "total_profit": "170.0"
}

Remove order line

Endpoint

PUT /admin/orders/:order_id.json

Parameters

Name Description
order[order_lines_attributes] required order lines attributes
order[order_lines_attributes][][id] required order line id
order[order_lines_attributes][][_destroy] required destroy marker (1 or true)

Request

Route

PUT /admin/orders/1.json

Headers

Content-Type: application/json
Authorization: Basic ZGlnaXRhbC1nb29kczpjNTFjOTA3MDdhMTNjZTNmZmYyMTNhZmJiNWNkMTI3MA==

Body

{
  "order": {
    "order_lines_attributes": [
      {
        "id": 1,
        "_destroy": true
      }
    ]
  }
}

Response

Simulated Response

Status

200

Headers

API-Usage-Limit: 1/500
Content-Type: application/json; charset=utf-8

Body

{
  "fields_values": [
    {
      "id": 94,
      "field_id": 269,
      "value": "old value",
      "created_at": "2024-10-05T00:56:32.961+03:00",
      "updated_at": "2024-10-05T00:56:32.961+03:00",
      "type": "Текст",
      "name": "special",
      "handle": "my_awesome_field"
    }
  ],
  "order_lines": [
    {
      "id": 2,
      "order_id": 1,
      "sale_price": 600.0,
      "full_sale_price": 600.0,
      "total_price": 1200.0,
      "full_total_price": 1200.0,
      "discounts_amount": 0.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": "2024-10-05T00:56:33.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": 93,
        "field_id": 268,
        "value": "old value",
        "created_at": "2024-10-05T00:56:32.932+03:00",
        "updated_at": "2024-10-05T00:56:32.932+03:00",
        "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,
        "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,
        "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,
        "title": null,
        "example": null,
        "type": "Field::SystemTextArea"
      },
      {
        "id": 268,
        "destiny": 1,
        "position": 22,
        "office_title": "special",
        "for_buyer": true,
        "obligatory": false,
        "active": true,
        "system_name": null,
        "created_at": "2024-10-05T00:56:32.924+03:00",
        "updated_at": "2024-10-05T00:56:32.924+03:00",
        "show_in_result": true,
        "show_in_checkout": true,
        "is_indexed": null,
        "hide_in_backoffice": null,
        "handle": 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,
        "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,
        "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,
        "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,
        "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,
    "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": "2024-10-05T00:56:32.000+03:00",
    "comment": null,
    "registered": false,
    "subscribe": true,
    "client_group_id": null,
    "surname": null,
    "middlename": 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,
    "contact_name": "Mortimer Hant",
    "progressive_discount": null,
    "group_discount": null,
    "ip_addr": "",
    "fields_values": [
      {
        "id": 92,
        "field_id": 267,
        "value": "old value",
        "created_at": "2024-10-05T00:56:32.914+03:00",
        "updated_at": "2024-10-05T00:56:32.914+03:00",
        "type": "Текст",
        "name": "special",
        "handle": null
      }
    ]
  },
  "discounts": [

  ],
  "total_price": 1300.0,
  "items_price": 1200.0,
  "id": 1,
  "key": "teest",
  "number": 1001,
  "comment": "comment",
  "archived": false,
  "delivery_title": "самовывоз",
  "delivery_description": "самовывоз",
  "delivery_price": 100.0,
  "full_delivery_price": 100.0,
  "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": "2024-10-05T00:56: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,
  "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,
      "title": null,
      "description": null,
      "address": null,
      "payment_method": null,
      "source_id": null
    },
    "not_available": null
  },
  "responsible_user_id": null,
  "total_profit": "1200.0"
}

Update custom status

This query updates custom status. Despite the fact that “order[fulfillment_status]” parameter is permitted, using both of the parameters is strongly discouraged. Please, keep in mind that if both parameters are transfered they MUST be compatible. Please, notice that you CAN’T update custom status using order[custom_status][permalink] parameter.

Endpoint

PUT /admin/orders/:order_id.json

Parameters

Name Description
order[custom_status_permalink] required custom status
order[fulfillment_status] fulfillment status

Request

Route

PUT /admin/orders/1.json

Headers

Content-Type: application/json
Authorization: Basic ZGlnaXRhbC1nb29kczpjNTFjOTA3MDdhMTNjZTNmZmYyMTNhZmJiNWNkMTI3MA==

Body

{
  "order": {
    "custom_status_permalink": "v-obrabotke"
  }
}

Response

Simulated Response

Status

200

Headers

API-Usage-Limit: 1/500
Content-Type: application/json; charset=utf-8

Body

{
  "fields_values": [
    {
      "id": 85,
      "field_id": 260,
      "value": "old value",
      "created_at": "2024-10-05T00:56:31.704+03:00",
      "updated_at": "2024-10-05T00:56:31.704+03:00",
      "type": "Текст",
      "name": "special",
      "handle": "my_awesome_field"
    }
  ],
  "order_lines": [
    {
      "id": 1,
      "order_id": 1,
      "sale_price": 300.0,
      "full_sale_price": 300.0,
      "total_price": 300.0,
      "full_total_price": 300.0,
      "discounts_amount": 0.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": null,
      "accessory_lines": [

      ],
      "external_variant_id": null
    },
    {
      "id": 2,
      "order_id": 1,
      "sale_price": 600.0,
      "full_sale_price": 600.0,
      "total_price": 1200.0,
      "full_total_price": 1200.0,
      "discounts_amount": 0.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": 84,
        "field_id": 259,
        "value": "old value",
        "created_at": "2024-10-05T00:56:31.661+03:00",
        "updated_at": "2024-10-05T00:56:31.661+03:00",
        "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,
        "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,
        "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,
        "title": null,
        "example": null,
        "type": "Field::SystemTextArea"
      },
      {
        "id": 259,
        "destiny": 1,
        "position": 22,
        "office_title": "special",
        "for_buyer": true,
        "obligatory": false,
        "active": true,
        "system_name": null,
        "created_at": "2024-10-05T00:56:31.651+03:00",
        "updated_at": "2024-10-05T00:56:31.651+03:00",
        "show_in_result": true,
        "show_in_checkout": true,
        "is_indexed": null,
        "hide_in_backoffice": null,
        "handle": 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,
        "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,
        "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,
        "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,
        "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,
    "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": "2024-10-05T00:56:31.000+03:00",
    "comment": null,
    "registered": false,
    "subscribe": true,
    "client_group_id": null,
    "surname": null,
    "middlename": 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,
    "contact_name": "Mortimer Hant",
    "progressive_discount": null,
    "group_discount": null,
    "ip_addr": "",
    "fields_values": [
      {
        "id": 83,
        "field_id": 258,
        "value": "old value",
        "created_at": "2024-10-05T00:56:31.640+03:00",
        "updated_at": "2024-10-05T00:56:31.640+03:00",
        "type": "Текст",
        "name": "special",
        "handle": null
      }
    ]
  },
  "discounts": [

  ],
  "total_price": 1600.0,
  "items_price": 1500.0,
  "id": 1,
  "key": "teest",
  "number": 1001,
  "comment": "comment",
  "archived": false,
  "delivery_title": "самовывоз",
  "delivery_description": "самовывоз",
  "delivery_price": 100.0,
  "full_delivery_price": 100.0,
  "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": "2024-10-05T00:56:31.000+03:00",
  "created_at": "2009-03-18T10:53:14.000+03:00",
  "updated_at": "2024-10-05T00:56: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,
  "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,
      "title": null,
      "description": null,
      "address": null,
      "payment_method": null,
      "source_id": null
    },
    "not_available": null
  },
  "responsible_user_id": null,
  "total_profit": "1500.0"
}

Update discount

Endpoint

PUT /admin/orders/:order_id.json

Parameters

Name Description
order[discounts_attributes] required discounts attributes
order[discounts_attributes][][id] required discount id
order[discounts_attributes][][discount] discount amount
order[discounts_attributes][][type_id] 1 - percent (default), 2 - money
order[discounts_attributes][][description] description text
order[discounts_attributes][][discount_order_lines_ids] ids of affected order lines (all will be affected if not specified)

Request

Route

PUT /admin/orders/1.json

Headers

Content-Type: application/json
Authorization: Basic ZGlnaXRhbC1nb29kczpjNTFjOTA3MDdhMTNjZTNmZmYyMTNhZmJiNWNkMTI3MA==

Body

{
  "order": {
    "discounts_attributes": {
      "1": {
        "id": 19,
        "discount_order_lines_ids": [
          31
        ]
      }
    }
  }
}

Response

Simulated Response

Status

200

Headers

API-Usage-Limit: 1/500
Content-Type: application/json; charset=utf-8

Body

{
  "fields_values": [
    {
      "id": 109,
      "field_id": 284,
      "value": "old value",
      "created_at": "2024-10-05T00:56:35.321+03:00",
      "updated_at": "2024-10-05T00:56:35.321+03:00",
      "type": "Текст",
      "name": "special",
      "handle": "my_awesome_field"
    }
  ],
  "order_lines": [
    {
      "id": 31,
      "order_id": 1,
      "sale_price": 100.0,
      "full_sale_price": 90.0,
      "total_price": 200.0,
      "full_total_price": 180.0,
      "discounts_amount": 20.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": "2024-10-05T00:56:35.000+03:00",
      "created_at": "2024-10-05T00:56:35.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": 32,
      "order_id": 1,
      "sale_price": 150.0,
      "full_sale_price": 150.0,
      "total_price": 150.0,
      "full_total_price": 150.0,
      "discounts_amount": 0.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": "2024-10-05T00:56:35.000+03:00",
      "created_at": "2024-10-05T00:56:35.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": 19,
    "description": "-20 (absolute)",
    "type_id": 2,
    "amount": 20.0,
    "full_amount": 20.0,
    "percent": null,
    "discount": "20.0",
    "reference_id": null,
    "reference_type": null,
    "discount_products_ids": [
      1
    ],
    "discount_order_lines_ids": [
      31
    ],
    "discount_code_id": null,
    "created_at": "2024-10-05T00:56:35.000+03:00",
    "updated_at": "2024-10-05T00:56:35.000+03:00"
  },
  "shipping_address": {
    "id": 1,
    "fields_values": [
      {
        "id": 108,
        "field_id": 283,
        "value": "old value",
        "created_at": "2024-10-05T00:56:35.294+03:00",
        "updated_at": "2024-10-05T00:56:35.294+03:00",
        "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,
        "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,
        "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,
        "title": null,
        "example": null,
        "type": "Field::SystemTextArea"
      },
      {
        "id": 283,
        "destiny": 1,
        "position": 22,
        "office_title": "special",
        "for_buyer": true,
        "obligatory": false,
        "active": true,
        "system_name": null,
        "created_at": "2024-10-05T00:56:35.287+03:00",
        "updated_at": "2024-10-05T00:56:35.287+03:00",
        "show_in_result": true,
        "show_in_checkout": true,
        "is_indexed": null,
        "hide_in_backoffice": null,
        "handle": 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,
        "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,
        "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,
        "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,
        "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,
    "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": "2024-10-05T00:56:35.000+03:00",
    "comment": null,
    "registered": false,
    "subscribe": true,
    "client_group_id": null,
    "surname": null,
    "middlename": 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,
    "contact_name": "Mortimer Hant",
    "progressive_discount": null,
    "group_discount": null,
    "ip_addr": "",
    "fields_values": [
      {
        "id": 107,
        "field_id": 282,
        "value": "old value",
        "created_at": "2024-10-05T00:56:35.276+03:00",
        "updated_at": "2024-10-05T00:56:35.276+03:00",
        "type": "Текст",
        "name": "special",
        "handle": null
      }
    ]
  },
  "discounts": [
    {
      "id": 19,
      "description": "-20 (absolute)",
      "type_id": 2,
      "amount": 20.0,
      "full_amount": 20.0,
      "percent": null,
      "discount": "20.0",
      "reference_id": null,
      "reference_type": null,
      "discount_products_ids": [
        1
      ],
      "discount_order_lines_ids": [
        31
      ],
      "discount_code_id": null,
      "created_at": "2024-10-05T00:56:35.000+03:00",
      "updated_at": "2024-10-05T00:56:35.000+03:00"
    }
  ],
  "total_price": 430.0,
  "items_price": 330.0,
  "id": 1,
  "key": "teest",
  "number": 1001,
  "comment": "comment",
  "archived": false,
  "delivery_title": "самовывоз",
  "delivery_description": "самовывоз",
  "delivery_price": 100.0,
  "full_delivery_price": 100.0,
  "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": "2024-10-05T00:56: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": 1,
  "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,
      "title": null,
      "description": null,
      "address": null,
      "payment_method": null,
      "source_id": null
    },
    "not_available": null
  },
  "responsible_user_id": null,
  "total_profit": "150.0"
}

Update discount

Endpoint

PUT /admin/orders/:order_id.json

Parameters

Name Description
order[discounts_attributes] required discounts attributes
order[discounts_attributes][][id] required discount id
order[discounts_attributes][][discount] discount amount
order[discounts_attributes][][type_id] 1 - percent (default), 2 - money
order[discounts_attributes][][description] description text
order[discounts_attributes][][discount_order_lines_ids] ids of affected order lines (all will be affected if not specified)

Request

Route

PUT /admin/orders/1.json

Headers

Content-Type: application/json
Authorization: Basic ZGlnaXRhbC1nb29kczpjNTFjOTA3MDdhMTNjZTNmZmYyMTNhZmJiNWNkMTI3MA==

Body

{
  "order": {
    "discounts_attributes": {
      "1": {
        "id": 19,
        "discount_order_lines_ids": [
          31
        ]
      }
    }
  }
}

Response

Simulated Response

Status

200

Headers

API-Usage-Limit: 1/500
Content-Type: application/json; charset=utf-8

Body

{
  "fields_values": [
    {
      "id": 109,
      "field_id": 284,
      "value": "old value",
      "created_at": "2024-10-05T00:56:35.321+03:00",
      "updated_at": "2024-10-05T00:56:35.321+03:00",
      "type": "Текст",
      "name": "special",
      "handle": "my_awesome_field"
    }
  ],
  "order_lines": [
    {
      "id": 31,
      "order_id": 1,
      "sale_price": 100.0,
      "full_sale_price": 90.0,
      "total_price": 200.0,
      "full_total_price": 180.0,
      "discounts_amount": 20.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": "2024-10-05T00:56:35.000+03:00",
      "created_at": "2024-10-05T00:56:35.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": 32,
      "order_id": 1,
      "sale_price": 150.0,
      "full_sale_price": 150.0,
      "total_price": 150.0,
      "full_total_price": 150.0,
      "discounts_amount": 0.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": "2024-10-05T00:56:35.000+03:00",
      "created_at": "2024-10-05T00:56:35.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": 19,
    "description": "-20 (absolute)",
    "type_id": 2,
    "amount": 20.0,
    "full_amount": 20.0,
    "percent": null,
    "discount": "20.0",
    "reference_id": null,
    "reference_type": null,
    "discount_products_ids": [
      1
    ],
    "discount_order_lines_ids": [
      31
    ],
    "discount_code_id": null,
    "created_at": "2024-10-05T00:56:35.000+03:00",
    "updated_at": "2024-10-05T00:56:35.000+03:00"
  },
  "shipping_address": {
    "id": 1,
    "fields_values": [
      {
        "id": 108,
        "field_id": 283,
        "value": "old value",
        "created_at": "2024-10-05T00:56:35.294+03:00",
        "updated_at": "2024-10-05T00:56:35.294+03:00",
        "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,
        "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,
        "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,
        "title": null,
        "example": null,
        "type": "Field::SystemTextArea"
      },
      {
        "id": 283,
        "destiny": 1,
        "position": 22,
        "office_title": "special",
        "for_buyer": true,
        "obligatory": false,
        "active": true,
        "system_name": null,
        "created_at": "2024-10-05T00:56:35.287+03:00",
        "updated_at": "2024-10-05T00:56:35.287+03:00",
        "show_in_result": true,
        "show_in_checkout": true,
        "is_indexed": null,
        "hide_in_backoffice": null,
        "handle": 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,
        "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,
        "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,
        "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,
        "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,
    "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": "2024-10-05T00:56:35.000+03:00",
    "comment": null,
    "registered": false,
    "subscribe": true,
    "client_group_id": null,
    "surname": null,
    "middlename": 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,
    "contact_name": "Mortimer Hant",
    "progressive_discount": null,
    "group_discount": null,
    "ip_addr": "",
    "fields_values": [
      {
        "id": 107,
        "field_id": 282,
        "value": "old value",
        "created_at": "2024-10-05T00:56:35.276+03:00",
        "updated_at": "2024-10-05T00:56:35.276+03:00",
        "type": "Текст",
        "name": "special",
        "handle": null
      }
    ]
  },
  "discounts": [
    {
      "id": 19,
      "description": "-20 (absolute)",
      "type_id": 2,
      "amount": 20.0,
      "full_amount": 20.0,
      "percent": null,
      "discount": "20.0",
      "reference_id": null,
      "reference_type": null,
      "discount_products_ids": [
        1
      ],
      "discount_order_lines_ids": [
        31
      ],
      "discount_code_id": null,
      "created_at": "2024-10-05T00:56:35.000+03:00",
      "updated_at": "2024-10-05T00:56:35.000+03:00"
    }
  ],
  "total_price": 430.0,
  "items_price": 330.0,
  "id": 1,
  "key": "teest",
  "number": 1001,
  "comment": "comment",
  "archived": false,
  "delivery_title": "самовывоз",
  "delivery_description": "самовывоз",
  "delivery_price": 100.0,
  "full_delivery_price": 100.0,
  "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": "2024-10-05T00:56: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": 1,
  "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,
      "title": null,
      "description": null,
      "address": null,
      "payment_method": null,
      "source_id": null
    },
    "not_available": null
  },
  "responsible_user_id": null,
  "total_profit": "150.0"
}

Update order

Endpoint

PUT /admin/orders/:order_id.json

Parameters

Name Description
order[client_attributes] client info
order[client_attributes][name] client name
order[client_attributes][email] client email
order[client_attributes][phone] client phone
order[delivery_variant_id] delivery variant id
order[payment_gateway_id] payment gateway id
order[coupon] discount code
order[comment] client comment to order
order[manager_comment] manager comment to order
order[financial_status] pending or paid
order[fields_values_attributes] fields values array
order[shipping_address_attributes] array of shipping address attributes
order[discounts_attributes] array of discounts attributes
order[warehouse_id] id of a warehouse to reserve products on

Request

Route

PUT /admin/orders/1.json

Headers

Content-Type: application/json
Authorization: Basic ZGlnaXRhbC1nb29kczpjNTFjOTA3MDdhMTNjZTNmZmYyMTNhZmJiNWNkMTI3MA==

Body

{
  "order": {
    "client_attributes": {
      "id": 2,
      "name": "Ivan",
      "email": "ivan@example.com",
      "phone": "79111113344",
      "fields_values_attributes": [
        {
          "field_id": 255,
          "value": "new!"
        }
      ]
    },
    "delivery_variant_id": 3,
    "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": 256,
          "value": "new value!"
        }
      ]
    },
    "warehouse_id": 42
  }
}

Response

Simulated Response

Status

200

Headers

API-Usage-Limit: 1/500
Content-Type: application/json; charset=utf-8

Body

{
  "fields_values": [
    {
      "field_id": 257,
      "id": 82,
      "value": "new value",
      "created_at": "2024-10-05T00:56:31.223+03:00",
      "updated_at": "2024-10-05T00:56:31.488+03:00",
      "type": "Текст",
      "name": "special",
      "handle": "my_awesome_field"
    }
  ],
  "order_lines": [
    {
      "id": 1,
      "order_id": 1,
      "sale_price": 300.0,
      "full_sale_price": 240.0,
      "total_price": 300.0,
      "full_total_price": 240.0,
      "discounts_amount": 60.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": null,
      "accessory_lines": [

      ],
      "external_variant_id": null
    },
    {
      "id": 2,
      "order_id": 1,
      "sale_price": 600.0,
      "full_sale_price": 480.0,
      "total_price": 1200.0,
      "full_total_price": 960.0,
      "discounts_amount": 240.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": {
    "id": 13,
    "description": "Скидка по купону 20% discount",
    "type_id": 1,
    "amount": 300.0,
    "full_amount": 300.0,
    "percent": "20.0",
    "discount": "20.0",
    "reference_id": 180,
    "reference_type": "DiscountCode",
    "discount_products_ids": [

    ],
    "discount_order_lines_ids": [

    ],
    "discount_code_id": 180,
    "created_at": "2024-10-05T00:56:31.000+03:00",
    "updated_at": "2024-10-05T00:56:31.000+03:00"
  },
  "shipping_address": {
    "id": 1,
    "fields_values": [
      {
        "field_id": 256,
        "id": 81,
        "value": "new value!",
        "created_at": "2024-10-05T00:56:31.194+03:00",
        "updated_at": "2024-10-05T00:56:31.495+03:00",
        "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,
        "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,
        "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,
        "title": null,
        "example": null,
        "type": "Field::SystemTextArea"
      },
      {
        "id": 256,
        "destiny": 1,
        "position": 22,
        "office_title": "special",
        "for_buyer": true,
        "obligatory": false,
        "active": true,
        "system_name": null,
        "created_at": "2024-10-05T00:56:31.186+03:00",
        "updated_at": "2024-10-05T00:56:31.186+03:00",
        "show_in_result": true,
        "show_in_checkout": true,
        "is_indexed": null,
        "hide_in_backoffice": null,
        "handle": 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,
        "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,
        "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,
        "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,
        "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,
    "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": {
    "name": "Ivan",
    "phone": "79111113344",
    "email": "ivan@example.com",
    "id": 2,
    "created_at": "2009-03-30T04:37:32.000+04:00",
    "updated_at": "2024-10-05T00:56:31.000+03:00",
    "comment": null,
    "registered": false,
    "subscribe": true,
    "client_group_id": null,
    "surname": null,
    "middlename": 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,
    "contact_name": "Ivan",
    "progressive_discount": null,
    "group_discount": null,
    "ip_addr": "",
    "fields_values": [
      {
        "field_id": 255,
        "id": 80,
        "value": "new!",
        "created_at": "2024-10-05T00:56:31.174+03:00",
        "updated_at": "2024-10-05T00:56:31.424+03:00",
        "type": "Текст",
        "name": "special",
        "handle": null
      }
    ]
  },
  "discounts": [
    {
      "id": 13,
      "description": "Скидка по купону 20% discount",
      "type_id": 1,
      "amount": 300.0,
      "full_amount": 300.0,
      "percent": "20.0",
      "discount": "20.0",
      "reference_id": 180,
      "reference_type": "DiscountCode",
      "discount_products_ids": [

      ],
      "discount_order_lines_ids": [

      ],
      "discount_code_id": 180,
      "created_at": "2024-10-05T00:56:31.000+03:00",
      "updated_at": "2024-10-05T00:56:31.000+03:00"
    }
  ],
  "total_price": 1500.0,
  "items_price": 1500.0,
  "id": 1,
  "key": "teest",
  "number": 1001,
  "comment": "Please call from 9 to 18",
  "archived": false,
  "delivery_title": "Внешний",
  "delivery_description": "Внешний (Внешний способ)",
  "delivery_price": 0.0,
  "full_delivery_price": 0.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": "2024-10-05T00:56:31.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": "2024-10-05T00:56:31.000+03:00",
  "delivery_variant_id": 3,
  "payment_gateway_id": 4,
  "margin": "0.0",
  "margin_amount": "0.0",
  "client_transaction_id": 1,
  "currency_code": "RUR",
  "cookies": null,
  "account_id": 1,
  "manager_comment": "New client",
  "locale": "ru",
  "delivery_info": {
    "delivery_variant_id": 3,
    "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": [
      "Невозможно рассчитать стоимость доставки. Не указан url для пересчета стоимости доставки"
    ],
    "warnings": [

    ],
    "outlet": {
      "id": null,
      "external_id": null,
      "latitude": null,
      "longitude": null,
      "title": null,
      "description": null,
      "address": null,
      "payment_method": [

      ],
      "source_id": null
    },
    "not_available": null
  },
  "responsible_user_id": null,
  "total_profit": "1500.0"
}

Update order line

Endpoint

PUT /admin/orders/:order_id.json

Parameters

Name Description Type
order[order_lines_attributes] required order lines attributes
order[order_lines_attributes][][id] required order line id
order[order_lines_attributes][][sale_price] order line sale price
order[order_lines_attributes][][quantity] order line quantity
order[order_lines_attributes][][comment] order line comment
order[order_lines_attributes][][vat] integer, VAT for order line is equal to VAT of its product, by default, products get their value from account by default,if default in account set as 'No VAT', you need to use 'force' to change VAT of order line through API; possible values depend on country, set to -1 if this product is not a subject to VAT
order[order_lines_attributes][][marking_codes] array of marking codes array

Request

Route

PUT /admin/orders/1.json

Headers

Content-Type: application/json
Authorization: Basic ZGlnaXRhbC1nb29kczpjNTFjOTA3MDdhMTNjZTNmZmYyMTNhZmJiNWNkMTI3MA==

Body

{
  "order": {
    "order_lines_attributes": [
      {
        "id": 1,
        "sale_price": 100,
        "quantity": 2,
        "comment": "New comment",
        "vat": 0,
        "marking_codes": [
          "da71d64e3f36ed7fa5d5",
          "bc5ac0818075f6f467f6"
        ]
      }
    ]
  }
}

Response

Simulated Response

Status

200

Headers

API-Usage-Limit: 1/500
Content-Type: application/json; charset=utf-8

Body

{
  "fields_values": [
    {
      "id": 97,
      "field_id": 272,
      "value": "old value",
      "created_at": "2024-10-05T00:56:33.275+03:00",
      "updated_at": "2024-10-05T00:56:33.275+03:00",
      "type": "Текст",
      "name": "special",
      "handle": "my_awesome_field"
    }
  ],
  "order_lines": [
    {
      "id": 1,
      "order_id": 1,
      "sale_price": 100.0,
      "full_sale_price": 100.0,
      "total_price": 200.0,
      "full_total_price": 200.0,
      "discounts_amount": 0.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": "2024-10-05T00:56:33.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": [
        "da71d64e3f36ed7fa5d5",
        "bc5ac0818075f6f467f6"
      ],
      "accessory_lines": [

      ],
      "external_variant_id": null
    },
    {
      "id": 2,
      "order_id": 1,
      "sale_price": 600.0,
      "full_sale_price": 600.0,
      "total_price": 1200.0,
      "full_total_price": 1200.0,
      "discounts_amount": 0.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": "2024-10-05T00:56:33.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": 96,
        "field_id": 271,
        "value": "old value",
        "created_at": "2024-10-05T00:56:33.246+03:00",
        "updated_at": "2024-10-05T00:56:33.246+03:00",
        "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,
        "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,
        "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,
        "title": null,
        "example": null,
        "type": "Field::SystemTextArea"
      },
      {
        "id": 271,
        "destiny": 1,
        "position": 22,
        "office_title": "special",
        "for_buyer": true,
        "obligatory": false,
        "active": true,
        "system_name": null,
        "created_at": "2024-10-05T00:56:33.238+03:00",
        "updated_at": "2024-10-05T00:56:33.238+03:00",
        "show_in_result": true,
        "show_in_checkout": true,
        "is_indexed": null,
        "hide_in_backoffice": null,
        "handle": 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,
        "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,
        "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,
        "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,
        "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,
    "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": "2024-10-05T00:56:33.000+03:00",
    "comment": null,
    "registered": false,
    "subscribe": true,
    "client_group_id": null,
    "surname": null,
    "middlename": 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,
    "contact_name": "Mortimer Hant",
    "progressive_discount": null,
    "group_discount": null,
    "ip_addr": "",
    "fields_values": [
      {
        "id": 95,
        "field_id": 270,
        "value": "old value",
        "created_at": "2024-10-05T00:56:33.227+03:00",
        "updated_at": "2024-10-05T00:56:33.227+03:00",
        "type": "Текст",
        "name": "special",
        "handle": null
      }
    ]
  },
  "discounts": [

  ],
  "total_price": 1500.0,
  "items_price": 1400.0,
  "id": 1,
  "key": "teest",
  "number": 1001,
  "comment": "comment",
  "archived": false,
  "delivery_title": "самовывоз",
  "delivery_description": "самовывоз",
  "delivery_price": 100.0,
  "full_delivery_price": 100.0,
  "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": "2024-10-05T00:56: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,
  "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,
      "title": null,
      "description": null,
      "address": null,
      "payment_method": null,
      "source_id": null
    },
    "not_available": null
  },
  "responsible_user_id": null,
  "total_profit": "1400.0"
}

Update shipping address

Endpoint

PUT /admin/orders/:order_id.json

Parameters

Name Description
order[shipping_address_attributes] required array of shipping address attributes
order[shipping_address_attributes][address] required shipping address

Request

Route

PUT /admin/orders/1.json

Headers

Content-Type: application/json
Authorization: Basic ZGlnaXRhbC1nb29kczpjNTFjOTA3MDdhMTNjZTNmZmYyMTNhZmJiNWNkMTI3MA==

Body

{
  "order": {
    "shipping_address_attributes": {
      "address": "Moscow, Znamenka 12"
    }
  }
}

Response

Simulated Response

Status

200

Headers

API-Usage-Limit: 1/500
Content-Type: application/json; charset=utf-8

Body

{
  "fields_values": [
    {
      "id": 112,
      "field_id": 287,
      "value": "old value",
      "created_at": "2024-10-05T00:56:35.891+03:00",
      "updated_at": "2024-10-05T00:56:35.891+03:00",
      "type": "Текст",
      "name": "special",
      "handle": "my_awesome_field"
    }
  ],
  "order_lines": [
    {
      "id": 1,
      "order_id": 1,
      "sale_price": 300.0,
      "full_sale_price": 300.0,
      "total_price": 300.0,
      "full_total_price": 300.0,
      "discounts_amount": 0.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": null,
      "accessory_lines": [

      ],
      "external_variant_id": null
    },
    {
      "id": 2,
      "order_id": 1,
      "sale_price": 600.0,
      "full_sale_price": 600.0,
      "total_price": 1200.0,
      "full_total_price": 1200.0,
      "discounts_amount": 0.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": 111,
        "field_id": 286,
        "value": "old value",
        "created_at": "2024-10-05T00:56:35.864+03:00",
        "updated_at": "2024-10-05T00:56:35.864+03:00",
        "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,
        "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,
        "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,
        "title": null,
        "example": null,
        "type": "Field::SystemTextArea"
      },
      {
        "id": 286,
        "destiny": 1,
        "position": 22,
        "office_title": "special",
        "for_buyer": true,
        "obligatory": false,
        "active": true,
        "system_name": null,
        "created_at": "2024-10-05T00:56:35.856+03:00",
        "updated_at": "2024-10-05T00:56:35.856+03:00",
        "show_in_result": true,
        "show_in_checkout": true,
        "is_indexed": null,
        "hide_in_backoffice": null,
        "handle": 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,
        "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,
        "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,
        "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,
        "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,
    "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": "2024-10-05T00:56:35.000+03:00",
    "comment": null,
    "registered": false,
    "subscribe": true,
    "client_group_id": null,
    "surname": null,
    "middlename": 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,
    "contact_name": "Mortimer Hant",
    "progressive_discount": null,
    "group_discount": null,
    "ip_addr": "",
    "fields_values": [
      {
        "id": 110,
        "field_id": 285,
        "value": "old value",
        "created_at": "2024-10-05T00:56:35.844+03:00",
        "updated_at": "2024-10-05T00:56:35.844+03:00",
        "type": "Текст",
        "name": "special",
        "handle": null
      }
    ]
  },
  "discounts": [

  ],
  "total_price": 1600.0,
  "items_price": 1500.0,
  "id": 1,
  "key": "teest",
  "number": 1001,
  "comment": "comment",
  "archived": false,
  "delivery_title": "самовывоз",
  "delivery_description": "самовывоз",
  "delivery_price": 100.0,
  "full_delivery_price": 100.0,
  "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": "2024-10-05T00:56:36.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,
  "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,
      "title": null,
      "description": null,
      "address": null,
      "payment_method": null,
      "source_id": null
    },
    "not_available": null
  },
  "responsible_user_id": null,
  "total_profit": "1500.0"
}

Outlet

Create outlet

Endpoint

POST /admin/outlets.json

Parameters

Name Description
outlet[title] required title
outlet[description] description
outlet[address] required address in text way
outlet[price] required delivery price
outlet[latitude] required point latitude
outlet[longitude] required point longitude

Request

Route

POST /admin/outlets.json

Headers

Content-Type: application/json
Authorization: Basic ZGlnaXRhbC1nb29kczpjNTFjOTA3MDdhMTNjZTNmZmYyMTNhZmJiNWNkMTI3MA==

Body

{
  "outlet": {
    "title": "Point 2",
    "description": "Point description",
    "address": "some address",
    "price": 300,
    "latitude": 55.7558,
    "longitude": 37.6173
  }
}

Response

Simulated Response

Status

201

Headers

API-Usage-Limit: 1/500
Content-Type: application/json; charset=utf-8

Body

{
  "id": 8,
  "account_id": 1,
  "delivery_variant_id": 35,
  "price": "300.0",
  "title_translations": [
    "Point 2"
  ],
  "description_translations": [
    "Point description"
  ],
  "address": "some address",
  "latitude": "55.7558",
  "longitude": "37.6173",
  "created_at": "2024-10-05T00:56:13.964+03:00",
  "updated_at": "2024-10-05T00:56:13.964+03:00",
  "title": "Point 2",
  "description": "Point description"
}

Destroy outlet

Endpoint

DELETE /admin/outlets/:outlet_id.json

Request

Route

DELETE /admin/outlets/12.json

Headers

Content-Type: application/json
Authorization: Basic ZGlnaXRhbC1nb29kczpjNTFjOTA3MDdhMTNjZTNmZmYyMTNhZmJiNWNkMTI3MA==

Response

Simulated Response

Status

200

Headers

API-Usage-Limit: 1/500
Content-Type: application/json

Get outlet

Endpoint

GET /admin/outlets/:outlet_id.json

Request

Route

GET /admin/outlets/4.json

Headers

Authorization: Basic ZGlnaXRhbC1nb29kczpjNTFjOTA3MDdhMTNjZTNmZmYyMTNhZmJiNWNkMTI3MA==

Response

Simulated Response

Status

200

Headers

API-Usage-Limit: 1/500
Content-Type: application/json; charset=utf-8

Body

{
  "id": 4,
  "account_id": 1,
  "delivery_variant_id": 33,
  "price": "100.0",
  "title_translations": [
    "Самовывоз от метро"
  ],
  "description_translations": [
    "Вход через арку во двор"
  ],
  "address": "ул Хмурого д1",
  "latitude": "55.7558",
  "longitude": "37.6173",
  "created_at": "2024-10-05T00:56:13.736+03:00",
  "updated_at": "2024-10-05T00:56:13.736+03:00",
  "title": "Самовывоз от метро",
  "description": "Вход через арку во двор"
}

Get outlets

Endpoint

GET /admin/outlets.json

Request

Route

GET /admin/outlets.json

Headers

Authorization: Basic ZGlnaXRhbC1nb29kczpjNTFjOTA3MDdhMTNjZTNmZmYyMTNhZmJiNWNkMTI3MA==

Response

Simulated Response

Status

200

Headers

API-Usage-Limit: 1/500
Content-Type: application/json; charset=utf-8

Body

[
  {
    "id": 2,
    "account_id": 1,
    "delivery_variant_id": 31,
    "price": "100.0",
    "title_translations": [
      "Самовывоз от метро"
    ],
    "description_translations": [
      "Вход через арку во двор"
    ],
    "address": "ул Хмурого д1",
    "latitude": "55.7558",
    "longitude": "37.6173",
    "created_at": "2024-10-05T00:56:13.525+03:00",
    "updated_at": "2024-10-05T00:56:13.525+03:00",
    "title": "Самовывоз от метро",
    "description": "Вход через арку во двор"
  }
]

Update outlet

Endpoint

PUT /admin/outlets/:outlet_id.json

Parameters

Name Description
outlet[title] required title
outlet[description] description
outlet[address] required address in text way
outlet[price] required delivery price
outlet[latitude] required point latitude
outlet[longitude] required point longitude

Request

Route

PUT /admin/outlets/10.json

Headers

Content-Type: application/json
Authorization: Basic ZGlnaXRhbC1nb29kczpjNTFjOTA3MDdhMTNjZTNmZmYyMTNhZmJiNWNkMTI3MA==

Body

{
  "outlet": {
    "title": "New point title",
    "description": "New point description",
    "address": "some new address",
    "price": 300,
    "latitude": 55.7558,
    "longitude": 37.6173
  }
}

Response

Simulated Response

Status

200

Headers

API-Usage-Limit: 1/500
Content-Type: application/json; charset=utf-8

Body

{
  "delivery_variant_id": 37,
  "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": "2024-10-05T00:56:14.111+03:00",
  "updated_at": "2024-10-05T00:56:14.161+03:00"
}

Page

Create page

Endpoint

POST /admin/pages.json

Parameters

Name Description
page[title] required page title
page[content] required page content
page[permalink] permalink on /page/*
page[html_title] html title tag content
page[meta_keywords] html meta words on page
page[meta_description] html meta description
page[created_at] publication date

Request

Route

POST /admin/pages.json

Headers

Content-Type: application/json
Authorization: Basic ZGlnaXRhbC1nb29kczpjNTFjOTA3MDdhMTNjZTNmZmYyMTNhZmJiNWNkMTI3MA==

Body

{
  "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"
  }
}

Response

Simulated Response

Status

201

Headers

API-Usage-Limit: 1/500
Content-Type: application/json; charset=utf-8

Body

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

Delete page

Endpoint

DELETE /admin/pages/:page_id.json

Request

Route

DELETE /admin/pages/1.json

Headers

Authorization: Basic ZGlnaXRhbC1nb29kczpjNTFjOTA3MDdhMTNjZTNmZmYyMTNhZmJiNWNkMTI3MA==
Content-Type: application/x-www-form-urlencoded

Response

Simulated Response

Status

200

Headers

API-Usage-Limit: 1/500
Content-Type: application/json; charset=utf-8

Body

{
  "status": "ok"
}

Get page

Endpoint

GET /admin/pages/:page_id.json

Request

Route

GET /admin/pages/1.json

Headers

Authorization: Basic ZGlnaXRhbC1nb29kczpjNTFjOTA3MDdhMTNjZTNmZmYyMTNhZmJiNWNkMTI3MA==

Response

Simulated Response

Status

200

Headers

API-Usage-Limit: 1/500
Content-Type: application/json; charset=utf-8

Body

{
  "id": 1,
  "title": "any_url",
  "content": "abc",
  "permalink": "страница",
  "is_main": true,
  "html_title": "html title",
  "meta_keywords": "meta keywords",
  "meta_description": "meta description",
  "created_at": "2024-10-05T00:55:42.000+03:00",
  "updated_at": "2009-03-18T10:55:15.000+03:00",
  "custom_template": null
}

Get pages list

Endpoint

GET /admin/pages.json

Request

Route

GET /admin/pages.json

Headers

Authorization: Basic ZGlnaXRhbC1nb29kczpjNTFjOTA3MDdhMTNjZTNmZmYyMTNhZmJiNWNkMTI3MA==

Response

Simulated Response

Status

200

Headers

API-Usage-Limit: 1/500
Content-Type: application/json; charset=utf-8

Body

[
  {
    "id": 1,
    "title": "any_url",
    "content": "abc",
    "permalink": "страница",
    "is_main": true,
    "html_title": "html title",
    "meta_keywords": "meta keywords",
    "meta_description": "meta description",
    "created_at": "2024-10-05T00:55:42.000+03:00",
    "updated_at": "2009-03-18T10:55:15.000+03:00",
    "custom_template": null
  },
  {
    "id": 3,
    "title": "bany_url",
    "content": "abc",
    "permalink": "страница2",
    "is_main": false,
    "html_title": "html title",
    "meta_keywords": "meta keywords",
    "meta_description": "meta description",
    "created_at": "2024-10-05T00:55:42.000+03:00",
    "updated_at": "2009-03-17T10:55:15.000+03:00",
    "custom_template": null
  }
]

Update page

Endpoint

PUT /admin/pages/:page_id.json

Parameters

Name Description
page[title] page title
page[content] page content
page[permalink] permalink on blog/*
page[html_title] html title tag content
page[meta_keywords] html meta words on page
page[meta_description] html meta description
page[created_at] publication date

Request

Route

PUT /admin/pages/1.json

Headers

Content-Type: application/json
Authorization: Basic ZGlnaXRhbC1nb29kczpjNTFjOTA3MDdhMTNjZTNmZmYyMTNhZmJiNWNkMTI3MA==

Body

{
  "page": {
    "title": "new title"
  }
}

Response

Simulated Response

Status

200

Headers

API-Usage-Limit: 1/500
Content-Type: application/json; charset=utf-8

Body

{
  "status": "ok"
}

PaymentGateway

Create Cod or Custom payment_gateway

Endpoint

POST /admin/payment_gateways.json

Parameters

Name Description
payment_gateway[title] required title
payment_gateway[margin] margin measured in percentage and applied to order price with current payment method; it should fall in the range from -100 to 1000
payment_gateway[position] position in payment gateways list
payment_gateway[type] required available types: PaymentGateway::Cod, PaymentGateway::Custom
payment_gateway[description] description
payment_gateway[payment_delivery_variants_attributes] array of available delivery variants for this payment gateway; payment gateway is unavailable if list is empty
payment_gateway[payment_delivery_variants_attributes][delivery_variant_id] id of delivery variant
payment_gateway[add_delivery_variants] set all delivery variants available for this payment gateway

Request

Route

POST /admin/payment_gateways.json

Headers

Content-Type: application/json
Authorization: Basic ZGlnaXRhbC1nb29kczpjNTFjOTA3MDdhMTNjZTNmZmYyMTNhZmJiNWNkMTI3MA==

Body

{
  "payment_gateway": {
    "title": "cash on delivery",
    "margin": 10,
    "type": "PaymentGateway::Cod",
    "description": "text",
    "payment_delivery_variants_attributes": [
      {
        "delivery_variant_id": 1
      }
    ]
  }
}

Response

Simulated Response

Status

201

Headers

API-Usage-Limit: 1/500
Content-Type: application/json; charset=utf-8

Body

{
  "id": 35,
  "position": 4,
  "type": "PaymentGateway::Cod",
  "created_at": "2024-10-05T00:56:14.000+03:00",
  "updated_at": "2024-10-05T00:56:14.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": [
    {
      "id": 58,
      "delivery_variant_id": 1,
      "created_at": "2024-10-05T00:56:14.000+03:00"
    }
  ]
}

Create External payment_gateway

Endpoint

POST /admin/payment_gateways.json

Parameters

Name Description
payment_gateway[title] required title
payment_gateway[margin] margin measured in percentage and added to order price with current payment method; it should fall in the range from -100 to 1000
payment_gateway[position] position in payment gateways list
payment_gateway[type] required PaymentGateway::External
payment_gateway[description] description
payment_gateway[payment_delivery_variants_attributes] array of available delivery variants for this payment gateway; payment gateway is unavailable if list is empty
payment_gateway[payment_delivery_variants_attributes][delivery_variant_id] id of delivery variant
payment_gateway[url] required url of external payment gateway
payment_gateway[shop_id] required shop id - store identificator for external systems
payment_gateway[send_order] set true to send order_lines information to the "url"; parameter name - "order_json"; do not forget add "order_json" to signature validation to the end of the string.
payment_gateway[add_delivery_variants] set all delivery variants available for this payment gateway
payment_gateway[redirect_to_payment] true by default; if true automatically redirect to payment after successful order creation;
payment_gateway[convert_currency] iso code, if you would like to convert order amount from site currency to another currency

Request

Route

POST /admin/payment_gateways.json

Headers

Content-Type: application/json
Authorization: Basic ZGlnaXRhbC1nb29kczpjNTFjOTA3MDdhMTNjZTNmZmYyMTNhZmJiNWNkMTI3MA==

Body

{
  "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"
  }
}

Response

Simulated Response

Status

201

Headers

API-Usage-Limit: 1/500
Content-Type: application/json; charset=utf-8

Body

{
  "id": 37,
  "position": 4,
  "type": "PaymentGateway::External",
  "created_at": "2024-10-05T00:56:15.000+03:00",
  "updated_at": "2024-10-05T00:56:15.000+03:00",
  "margin": "10.0",
  "available_for_individual_clients": true,
  "available_for_juridical_clients": true,
  "title": "external payment gateway",
  "description": "text",
  "password": "191c5ad322bfcbd7",
  "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,
  "success_url": "http://quentin.insales.io:3002/payments/external/37/success",
  "fail_url": "http://quentin.insales.io:3002/payments/external/37/fail",
  "server_url": "http://quentin.insales.io:3002/payments/external/37/server",
  "redirect_to_payment": false,
  "payment_delivery_variants": [
    {
      "id": 60,
      "delivery_variant_id": 1,
      "created_at": "2024-10-05T00:56:15.000+03:00"
    }
  ]
}

Destroy payment_gateway

Endpoint

DELETE /admin/payment_gateways/:payment_gateway_id_1.json

Request

Route

DELETE /admin/payment_gateways/1.json

Headers

Content-Type: application/json
Authorization: Basic ZGlnaXRhbC1nb29kczpjNTFjOTA3MDdhMTNjZTNmZmYyMTNhZmJiNWNkMTI3MA==

Response

Simulated Response

Status

200

Headers

API-Usage-Limit: 1/500
Content-Type: application/json

Get payment_gateway

Endpoint

GET /admin/payment_gateways/:payment_gateway_id_1.json

Request

Route

GET /admin/payment_gateways/1.json

Headers

Authorization: Basic ZGlnaXRhbC1nb29kczpjNTFjOTA3MDdhMTNjZTNmZmYyMTNhZmJiNWNkMTI3MA==

Response

Simulated Response

Status

200

Headers

API-Usage-Limit: 1/500
Content-Type: application/json; charset=utf-8

Body

{
  "id": 1,
  "position": 1,
  "type": "PaymentGateway::Cod",
  "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": [
    {
      "id": 1,
      "delivery_variant_id": 1,
      "created_at": "2024-10-05T00:55:42.000+03:00"
    },
    {
      "id": 2,
      "delivery_variant_id": 2,
      "created_at": "2024-10-05T00:55:42.000+03:00"
    }
  ]
}

Get payment_gateways

Endpoint

GET /admin/payment_gateways.json

Request

Route

GET /admin/payment_gateways.json

Headers

Authorization: Basic ZGlnaXRhbC1nb29kczpjNTFjOTA3MDdhMTNjZTNmZmYyMTNhZmJiNWNkMTI3MA==

Response

Simulated Response

Status

200

Headers

API-Usage-Limit: 1/500
Content-Type: application/json; charset=utf-8

Body

[
  {
    "id": 1,
    "position": 1,
    "type": "PaymentGateway::Cod",
    "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": [
      {
        "id": 1,
        "delivery_variant_id": 1,
        "created_at": "2024-10-05T00:55:42.000+03:00"
      },
      {
        "id": 2,
        "delivery_variant_id": 2,
        "created_at": "2024-10-05T00:55:42.000+03:00"
      }
    ]
  },
  {
    "id": 3,
    "position": 2,
    "type": "PaymentGateway::JuridicalPersonBill",
    "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,
    "position": 3,
    "type": "PaymentGateway::JuridicalPersonBill",
    "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": [

    ]
  }
]

Update payment_gateway

Endpoint

PUT /admin/payment_gateways/:payment_gateway_id_1.json

Parameters

Name Description
payment_gateway[title] title
payment_gateway[margin] margin measured in percentage and added to order price with current payment method; it should fall in the range from -100 to 1000
payment_gateway[position] position in payment gateways list
payment_gateway[description] description
payment_gateway[payment_delivery_variants_attributes] array of available delivery variants for this payment gateway. payment gateway is unavailable if list is empty
payment_gateway[payment_delivery_variants_attributes][_destroy] set it 1 to delete delivery variant for this payment gateway
delivery_variant[payment_delivery_variants_attributes][id] only for removal: specify id of payment gateway and delivery variant binding you want to delete
delivery_variant[payment_delivery_variants_attributes][delivery_variant_id] for creation: specify id of delivery variant you want to bind with this payment gateway

Request

Route

PUT /admin/payment_gateways/1.json

Headers

Content-Type: application/json
Authorization: Basic ZGlnaXRhbC1nb29kczpjNTFjOTA3MDdhMTNjZTNmZmYyMTNhZmJiNWNkMTI3MA==

Body

{
  "payment_gateway": {
    "title": "cash",
    "margin": 10,
    "description": "description",
    "payment_delivery_variants_attributes": [
      {
        "_destroy": 1,
        "id": 2
      },
      {
        "delivery_variant_id": 2
      }
    ]
  }
}

Response

Simulated Response

Status

200

Headers

API-Usage-Limit: 1/500
Content-Type: application/json; charset=utf-8

Body

{
  "margin": "10.0",
  "id": 1,
  "position": 1,
  "type": "PaymentGateway::Cod",
  "created_at": "2009-03-30T04:37:32.000+04:00",
  "updated_at": "2024-10-05T00:56:15.000+03:00",
  "available_for_individual_clients": true,
  "available_for_juridical_clients": true,
  "title": "cash",
  "description": "description",
  "payment_delivery_variants": [
    {
      "id": 1,
      "delivery_variant_id": 1,
      "created_at": "2024-10-05T00:55:42.000+03:00"
    },
    {
      "id": 2,
      "delivery_variant_id": 2,
      "created_at": "2024-10-05T00:55:42.000+03:00"
    }
  ]
}

PriceKind

Create price kind

Endpoint

POST /admin/price_kinds.json

Parameters

Name Description
price_kind[title] required title
price_kind[show_in_lists] show price in products list in back-office

Request

Route

POST /admin/price_kinds.json

Headers

Content-Type: application/json
Authorization: Basic ZGlnaXRhbC1nb29kczpjNTFjOTA3MDdhMTNjZTNmZmYyMTNhZmJiNWNkMTI3MA==

Body

{
  "price_kind": {
    "title": "large quantity price"
  }
}

Response

Simulated Response

Status

201

Headers

API-Usage-Limit: 1/500
Content-Type: application/json; charset=utf-8

Body

{
  "id": 175,
  "price_index": 2,
  "title": "large quantity price",
  "show_in_lists": true,
  "variant_price_method_name": "price3"
}

Destroy price kind

Endpoint

DELETE /admin/price_kinds/:price_kind_id.json

Request

Route

DELETE /admin/price_kinds/1.json

Headers

Content-Type: application/json
Authorization: Basic ZGlnaXRhbC1nb29kczpjNTFjOTA3MDdhMTNjZTNmZmYyMTNhZmJiNWNkMTI3MA==

Response

Simulated Response

Status

200

Headers

API-Usage-Limit: 1/500
Content-Type: application/json; charset=utf-8

Body

{
  "status": "ok"
}

Get price kind

Endpoint

GET /admin/price_kinds/:price_kind_id.json

Request

Route

GET /admin/price_kinds/1.json

Headers

Authorization: Basic ZGlnaXRhbC1nb29kczpjNTFjOTA3MDdhMTNjZTNmZmYyMTNhZmJiNWNkMTI3MA==

Response

Simulated Response

Status

200

Headers

API-Usage-Limit: 1/500
Content-Type: application/json; charset=utf-8

Body

{
  "id": 1,
  "price_index": 1,
  "title": "от 100",
  "show_in_lists": true,
  "variant_price_method_name": "price2"
}

Get price kinds

Endpoint

GET /admin/price_kinds.json

Request

Route

GET /admin/price_kinds.json

Headers

Authorization: Basic ZGlnaXRhbC1nb29kczpjNTFjOTA3MDdhMTNjZTNmZmYyMTNhZmJiNWNkMTI3MA==

Response

Simulated Response

Status

200

Headers

API-Usage-Limit: 1/500
Content-Type: application/json; charset=utf-8

Body

[
  {
    "id": 1,
    "price_index": 1,
    "title": "от 100",
    "show_in_lists": true,
    "variant_price_method_name": "price2"
  }
]

Update price kind

Endpoint

PUT /admin/price_kinds/:price_kind_id.json

Parameters

Name Description
price_kind[title] required title
price_kind[show_in_lists] show price in products list in back-office

Request

Route

PUT /admin/price_kinds/1.json

Headers

Content-Type: application/json
Authorization: Basic ZGlnaXRhbC1nb29kczpjNTFjOTA3MDdhMTNjZTNmZmYyMTNhZmJiNWNkMTI3MA==

Body

{
  "price_kind": {
    "title": "price for 10+ quantity"
  }
}

Response

Simulated Response

Status

200

Headers

API-Usage-Limit: 1/500
Content-Type: application/json; charset=utf-8

Body

{
  "title": "price for 10+ quantity",
  "id": 1,
  "price_index": 1,
  "show_in_lists": true,
  "variant_price_method_name": "price2"
}

Product

Create bundle

Endpoint

POST /admin/products.json

Parameters

Name Description
product[category_id] required category id
product[title] required title
product[description] description
product[short_description] short description
product[sort_weight] sort weight
product[bundle] required bundle
product[variants_attributes] required variants attributes
product[vat] do not set VAT for bundle because order lines will be created with its components, which have their own VAT
product[product_bundle_components_attributes] required product bundle components attributes

Request

Route

POST /admin/products.json

Headers

Content-Type: application/json
Authorization: Basic ZGlnaXRhbC1nb29kczpjNTFjOTA3MDdhMTNjZTNmZmYyMTNhZmJiNWNkMTI3MA==

Body

{
  "product": {
    "category_id": 1,
    "title": "Van Gogh Ruled Peach Notebook",
    "bundle": true,
    "variants_attributes": [
      {
        "price": 100
      }
    ],
    "product_bundle_components_attributes": [
      {
        "variant_id": 1,
        "quantity": 2,
        "free": false
      }
    ]
  }
}

Response

Simulated Response

Status

201

Headers

API-Usage-Limit: 1/500
Content-Type: application/json; charset=utf-8

Body

{
  "id": 293977291,
  "category_id": 1,
  "created_at": "2024-10-05T00:56:58.000+03:00",
  "updated_at": "2024-10-05T00:56:58.000+03:00",
  "is_hidden": false,
  "available": false,
  "archived": false,
  "canonical_url_collection_id": null,
  "custom_template": null,
  "unit": "pce",
  "sort_weight": null,
  "ignore_discounts": null,
  "vat": 10,
  "dimensions": null,
  "fiscal_product_type": 1,
  "title": "Van Gogh Ruled Peach Notebook",
  "short_description": null,
  "permalink": "van-gogh-ruled-peach-notebook",
  "html_title": null,
  "meta_keywords": null,
  "meta_description": null,
  "currency_code": "LVL",
  "collections_ids": [

  ],
  "sales_channels_id": null,
  "description": null,
  "images": [

  ],
  "video_links": [

  ],
  "option_names": [

  ],
  "properties": [

  ],
  "characteristics": [

  ],
  "product_field_values": [

  ],
  "variants": [
    {
      "id": 509944659,
      "title": "",
      "product_id": 293977291,
      "sku": null,
      "barcode": null,
      "dimensions": null,
      "available": false,
      "image_ids": [

      ],
      "image_id": null,
      "weight": null,
      "created_at": "2024-10-05T00:56:58.000+03:00",
      "updated_at": "2024-10-05T00:56:58.000+03:00",
      "quantity": 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": [

      ],
      "option_values": [

      ]
    }
  ],
  "product_bundle_components": [
    {
      "id": 1058167308,
      "variant_id": 1,
      "free": false,
      "quantity": "2.0",
      "discount_amount": null,
      "product_id": 1,
      "discount_type": 0
    }
  ]
}

Create product

Endpoint

POST /admin/products.json

Parameters

Name Description
product[category_id] required category id
product[title] required title
product[description] description
product[short_description] short description
product[variants_attributes] required variants attributes
product[sort_weight] sort weight
product[ignore_discounts] set to 1 to make this product ignore discounts
product[vat] integer, default value is set in account settings, if default in account set as 'No VAT' you cannot change VAT of products through API; possible values depend on country, set to -1 if this product is not a subject to VAT
product[product_field_values_attributes] product field values attributes

Request

Route

POST /admin/products.json

Headers

Content-Type: application/json
Authorization: Basic ZGlnaXRhbC1nb29kczpjNTFjOTA3MDdhMTNjZTNmZmYyMTNhZmJiNWNkMTI3MA==

Body

{
  "product": {
    "category_id": 1,
    "title": "Van Gogh Ruled Peach Notebook",
    "variants_attributes": [
      {
        "sku": "QP021MVEN-r",
        "quantity": 1,
        "price": 740
      }
    ],
    "ignore_discounts": 1,
    "vat": -1,
    "product_field_values_attributes": [
      {
        "handle": "handle",
        "value": 12345
      }
    ]
  }
}

Response

Simulated Response

Status

201

Headers

API-Usage-Limit: 1/500
Content-Type: application/json; charset=utf-8

Body

{
  "id": 293977289,
  "category_id": 1,
  "created_at": "2024-10-05T00:56:57.000+03:00",
  "updated_at": "2024-10-05T00:56:57.000+03:00",
  "is_hidden": false,
  "available": true,
  "archived": false,
  "canonical_url_collection_id": null,
  "custom_template": null,
  "unit": "pce",
  "sort_weight": null,
  "ignore_discounts": true,
  "vat": -1,
  "dimensions": null,
  "fiscal_product_type": 1,
  "title": "Van Gogh Ruled Peach Notebook",
  "short_description": null,
  "permalink": "van-gogh-ruled-peach-notebook",
  "html_title": null,
  "meta_keywords": null,
  "meta_description": null,
  "currency_code": "LVL",
  "collections_ids": [

  ],
  "sales_channels_id": null,
  "description": null,
  "images": [

  ],
  "video_links": [

  ],
  "option_names": [

  ],
  "properties": [

  ],
  "characteristics": [

  ],
  "product_field_values": [
    {
      "id": 9,
      "product_field_id": 1,
      "value": "12345"
    }
  ],
  "variants": [
    {
      "id": 509944657,
      "title": "",
      "product_id": 293977289,
      "sku": "QP021MVEN-r",
      "barcode": null,
      "dimensions": null,
      "available": true,
      "image_ids": [

      ],
      "image_id": null,
      "weight": null,
      "created_at": "2024-10-05T00:56:57.000+03:00",
      "updated_at": "2024-10-05T00:56:57.000+03:00",
      "quantity": 1,
      "cost_price": null,
      "cost_price_in_site_currency": null,
      "price_in_site_currency": "22200.0",
      "base_price": "740.0",
      "old_price": null,
      "price2": null,
      "price": "740.0",
      "base_price_in_site_currency": "22200.0",
      "old_price_in_site_currency": null,
      "price2_in_site_currency": null,
      "prices": [

      ],
      "prices_in_site_currency": [

      ],
      "variant_field_values": [

      ],
      "option_values": [

      ]
    }
  ],
  "product_bundle_components": [

  ]
}

Destroy product

Endpoint

DELETE /admin/products/:product_id.json

Request

Route

DELETE /admin/products/1.json

Headers

Content-Type: application/json
Authorization: Basic ZGlnaXRhbC1nb29kczpjNTFjOTA3MDdhMTNjZTNmZmYyMTNhZmJiNWNkMTI3MA==

Response

Simulated Response

Status

200

Headers

API-Usage-Limit: 1/500
Content-Type: application/json; charset=utf-8

Body

{
  "status": "ok"
}

Get product

Endpoint

GET /admin/products/:product_id.json

Request

Route

GET /admin/products/1.json

Headers

Authorization: Basic ZGlnaXRhbC1nb29kczpjNTFjOTA3MDdhMTNjZTNmZmYyMTNhZmJiNWNkMTI3MA==

Response

Simulated Response

Status

200

Headers

API-Usage-Limit: 1/500
Content-Type: application/json; charset=utf-8

Body

{
  "id": 1,
  "category_id": 1,
  "created_at": "2024-10-05T00:55:42.000+03:00",
  "updated_at": "2015-07-27T17:05:35.000+03:00",
  "is_hidden": false,
  "available": false,
  "archived": false,
  "canonical_url_collection_id": 1,
  "custom_template": null,
  "unit": "pce",
  "sort_weight": null,
  "ignore_discounts": null,
  "vat": -1,
  "dimensions": "10x20x30",
  "fiscal_product_type": 1,
  "title": "Cool t-shirt",
  "short_description": "its a cool t-shirt",
  "permalink": "футболка",
  "html_title": null,
  "meta_keywords": null,
  "meta_description": null,
  "currency_code": "LVL",
  "collections_ids": [
    1,
    3,
    8
  ],
  "sales_channels_id": null,
  "description": "guys, its a really cool t-shirt",
  "images": [

  ],
  "video_links": [

  ],
  "option_names": [
    {
      "id": 1,
      "position": 1,
      "navigational": true,
      "title": "Вариант"
    }
  ],
  "properties": [
    {
      "id": 6,
      "position": 1,
      "is_hidden": true,
      "is_navigational": true,
      "backoffice": false,
      "permalink": "hidden",
      "title": "hidden"
    },
    {
      "id": 8,
      "position": 3,
      "is_hidden": false,
      "is_navigational": false,
      "backoffice": false,
      "permalink": "not_navigational",
      "title": "not_navigational"
    },
    {
      "id": 4,
      "position": 5,
      "is_hidden": false,
      "is_navigational": true,
      "backoffice": false,
      "permalink": "style",
      "title": "Style"
    },
    {
      "id": 3,
      "position": 6,
      "is_hidden": false,
      "is_navigational": true,
      "backoffice": false,
      "permalink": "vendor",
      "title": "Vendor"
    }
  ],
  "characteristics": [
    {
      "id": 7,
      "property_id": 3,
      "position": 1,
      "title": "Nike",
      "permalink": "nike"
    },
    {
      "id": 9,
      "property_id": 4,
      "position": 1,
      "title": "Old",
      "permalink": "old"
    },
    {
      "id": 12,
      "property_id": 6,
      "position": 1,
      "title": "Hidden",
      "permalink": "Hidden"
    },
    {
      "id": 13,
      "property_id": 8,
      "position": 1,
      "title": "NotNavigational",
      "permalink": "NotNavigational"
    }
  ],
  "product_field_values": [
    {
      "id": 1,
      "product_field_id": 1,
      "value": "some product field value"
    }
  ],
  "variants": [
    {
      "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,
      "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.0,
      "price": "10.0",
      "base_price_in_site_currency": "300.0",
      "old_price_in_site_currency": null,
      "price2_in_site_currency": "360.0",
      "prices": [
        12.0
      ],
      "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
        }
      ]
    }
  ],
  "product_bundle_components": [

  ]
}

Get products count

Endpoint

GET /admin/products/count.json

Request

Route

GET /admin/products/count.json

Headers

Authorization: Basic ZGlnaXRhbC1nb29kczpjNTFjOTA3MDdhMTNjZTNmZmYyMTNhZmJiNWNkMTI3MA==

Response

Simulated Response

Status

200

Headers

API-Usage-Limit: 1/500
Content-Type: application/json; charset=utf-8

Body

{
  "count": 5
}

Get products

Endpoint

GET /admin/products.json

Parameters

Name Description
updated_since Set datetime to get only data updated after it.
from_id Set id to get only data starting from it.
per_page Quantity of objects per page.
with_deleted Set to true to get also deleted products.
deleted Set to true to get only deleted products.
variant_fields List of required fields separated with `,`. Possible values are: id,title,product_id,sku,barcode,dimensions,available.

Request

Route

GET /admin/products.json?updated_since=2009-01-04+14%3A44%3A43+%2B0300

Headers

Authorization: Basic ZGlnaXRhbC1nb29kczpjNTFjOTA3MDdhMTNjZTNmZmYyMTNhZmJiNWNkMTI3MA==

Query Parameters

updated_since=2009-01-04 14:44:43 +0300

Response

Simulated Response

Status

200

Headers

API-Usage-Limit: 1/500
Content-Type: application/json; charset=utf-8

Body

[
  {
    "id": 5,
    "category_id": 3,
    "created_at": "2024-10-05T00:55:42.000+03:00",
    "updated_at": "2015-07-26T23:59:59.000+03:00",
    "is_hidden": false,
    "available": true,
    "archived": false,
    "canonical_url_collection_id": null,
    "custom_template": null,
    "unit": "pce",
    "sort_weight": null,
    "ignore_discounts": null,
    "vat": 20,
    "dimensions": null,
    "fiscal_product_type": 1,
    "title": "shirt & pants",
    "short_description": null,
    "permalink": "shirt_and_pants",
    "html_title": null,
    "meta_keywords": null,
    "meta_description": null,
    "currency_code": "LVL",
    "collections_ids": [

    ],
    "sales_channels_id": null,
    "description": null,
    "images": [

    ],
    "video_links": [

    ],
    "option_names": [

    ],
    "properties": [

    ],
    "characteristics": [

    ],
    "product_field_values": [

    ],
    "variants": [
      {
        "id": 5,
        "title": "",
        "product_id": 5,
        "sku": "427",
        "barcode": null,
        "dimensions": null,
        "available": true,
        "image_ids": [

        ],
        "image_id": null,
        "weight": "0.3",
        "created_at": "2009-03-18T12:58:14.000+03:00",
        "updated_at": "2009-03-18T13:53:14.000+03:00",
        "quantity": null,
        "cost_price": null,
        "cost_price_in_site_currency": null,
        "price_in_site_currency": "750.0",
        "base_price": "25.0",
        "old_price": null,
        "price2": null,
        "price": "25.0",
        "base_price_in_site_currency": "750.0",
        "old_price_in_site_currency": null,
        "price2_in_site_currency": null,
        "prices": [

        ],
        "prices_in_site_currency": [

        ],
        "variant_field_values": [

        ],
        "option_values": [

        ]
      }
    ],
    "product_bundle_components": [
      {
        "id": 361433619,
        "variant_id": 2,
        "free": false,
        "quantity": "1.0",
        "discount_amount": null,
        "product_id": 2,
        "discount_type": null
      },
      {
        "id": 620730336,
        "variant_id": 3,
        "free": false,
        "quantity": "1.0",
        "discount_amount": null,
        "product_id": 3,
        "discount_type": null
      }
    ]
  },
  {
    "id": 2,
    "category_id": 1,
    "created_at": "2024-10-05T00:55:42.000+03:00",
    "updated_at": "2015-07-27T00:00:00.000+03:00",
    "is_hidden": false,
    "available": true,
    "archived": false,
    "canonical_url_collection_id": null,
    "custom_template": null,
    "unit": "pce",
    "sort_weight": null,
    "ignore_discounts": null,
    "vat": -1,
    "dimensions": null,
    "fiscal_product_type": 1,
    "title": "shirt",
    "short_description": null,
    "permalink": "shirt",
    "html_title": null,
    "meta_keywords": null,
    "meta_description": null,
    "currency_code": "LVL",
    "collections_ids": [
      1,
      8
    ],
    "sales_channels_id": null,
    "description": null,
    "images": [
      {
        "id": 1,
        "product_id": 2,
        "position": 1,
        "created_at": "2024-10-05T00:55:41.000+03:00",
        "image_processing": null,
        "external_id": null,
        "title": null,
        "url": "http://minio.insales.io:9000/insales-test-sber/images/products/1/1/1/thumb_image_1.jpg",
        "original_url": "http://minio.insales.io:9000/insales-test-sber/images/products/1/1/1/image_1.jpg",
        "medium_url": "http://minio.insales.io:9000/insales-test-sber/images/products/1/1/1/medium_image_1.jpg",
        "small_url": "http://minio.insales.io:9000/insales-test-sber/images/products/1/1/1/micro_image_1.jpg",
        "thumb_url": "http://minio.insales.io:9000/insales-test-sber/images/products/1/1/1/thumb_image_1.jpg",
        "compact_url": "http://minio.insales.io:9000/insales-test-sber/images/products/1/1/1/compact_image_1.jpg",
        "large_url": "http://minio.insales.io:9000/insales-test-sber/images/products/1/1/1/large_image_1.jpg",
        "filename": "image_1.jpg",
        "image_content_type": "image/jpeg"
      }
    ],
    "video_links": [

    ],
    "option_names": [
      {
        "id": 1,
        "position": 1,
        "navigational": true,
        "title": "Вариант"
      },
      {
        "id": 3,
        "position": 2,
        "navigational": true,
        "title": "Цвет"
      }
    ],
    "properties": [
      {
        "id": 4,
        "position": 5,
        "is_hidden": false,
        "is_navigational": true,
        "backoffice": false,
        "permalink": "style",
        "title": "Style"
      }
    ],
    "characteristics": [
      {
        "id": 10,
        "property_id": 4,
        "position": 2,
        "title": "New",
        "permalink": "new"
      }
    ],
    "product_field_values": [

    ],
    "variants": [
      {
        "id": 2,
        "title": "Зеленый / Синий",
        "product_id": 2,
        "sku": "424",
        "barcode": null,
        "dimensions": null,
        "available": true,
        "image_ids": [

        ],
        "image_id": null,
        "weight": "0.3",
        "created_at": "2009-03-18T10:53:14.000+03:00",
        "updated_at": "2009-03-18T10:53:14.000+03:00",
        "quantity": 1,
        "cost_price": null,
        "cost_price_in_site_currency": null,
        "price_in_site_currency": "600.0",
        "base_price": "20.0",
        "old_price": null,
        "price2": null,
        "price": "20.0",
        "base_price_in_site_currency": "600.0",
        "old_price_in_site_currency": null,
        "price2_in_site_currency": null,
        "prices": [

        ],
        "prices_in_site_currency": [

        ],
        "variant_field_values": [

        ],
        "option_values": [
          {
            "id": 2,
            "option_name_id": 1,
            "position": 2,
            "title": "Зеленый",
            "image_url": null
          },
          {
            "id": 4,
            "option_name_id": 3,
            "position": 1,
            "title": "Синий",
            "image_url": null
          }
        ]
      }
    ],
    "product_bundle_components": [

    ]
  },
  {
    "id": 1,
    "category_id": 1,
    "created_at": "2024-10-05T00:55:42.000+03:00",
    "updated_at": "2015-07-27T17:05:35.000+03:00",
    "is_hidden": false,
    "available": false,
    "archived": false,
    "canonical_url_collection_id": 1,
    "custom_template": null,
    "unit": "pce",
    "sort_weight": null,
    "ignore_discounts": null,
    "vat": -1,
    "dimensions": "10x20x30",
    "fiscal_product_type": 1,
    "title": "Cool t-shirt",
    "short_description": "its a cool t-shirt",
    "permalink": "футболка",
    "html_title": null,
    "meta_keywords": null,
    "meta_description": null,
    "currency_code": "LVL",
    "collections_ids": [
      1,
      3,
      8
    ],
    "sales_channels_id": null,
    "description": "guys, its a really cool t-shirt",
    "images": [

    ],
    "video_links": [

    ],
    "option_names": [
      {
        "id": 1,
        "position": 1,
        "navigational": true,
        "title": "Вариант"
      }
    ],
    "properties": [
      {
        "id": 6,
        "position": 1,
        "is_hidden": true,
        "is_navigational": true,
        "backoffice": false,
        "permalink": "hidden",
        "title": "hidden"
      },
      {
        "id": 8,
        "position": 3,
        "is_hidden": false,
        "is_navigational": false,
        "backoffice": false,
        "permalink": "not_navigational",
        "title": "not_navigational"
      },
      {
        "id": 4,
        "position": 5,
        "is_hidden": false,
        "is_navigational": true,
        "backoffice": false,
        "permalink": "style",
        "title": "Style"
      },
      {
        "id": 3,
        "position": 6,
        "is_hidden": false,
        "is_navigational": true,
        "backoffice": false,
        "permalink": "vendor",
        "title": "Vendor"
      }
    ],
    "characteristics": [
      {
        "id": 7,
        "property_id": 3,
        "position": 1,
        "title": "Nike",
        "permalink": "nike"
      },
      {
        "id": 9,
        "property_id": 4,
        "position": 1,
        "title": "Old",
        "permalink": "old"
      },
      {
        "id": 12,
        "property_id": 6,
        "position": 1,
        "title": "Hidden",
        "permalink": "Hidden"
      },
      {
        "id": 13,
        "property_id": 8,
        "position": 1,
        "title": "NotNavigational",
        "permalink": "NotNavigational"
      }
    ],
    "product_field_values": [
      {
        "id": 1,
        "product_field_id": 1,
        "value": "some product field value"
      }
    ],
    "variants": [
      {
        "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,
        "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.0,
        "price": "10.0",
        "base_price_in_site_currency": "300.0",
        "old_price_in_site_currency": null,
        "price2_in_site_currency": "360.0",
        "prices": [
          12.0
        ],
        "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
          }
        ]
      }
    ],
    "product_bundle_components": [

    ]
  },
  {
    "id": 3,
    "category_id": 6,
    "created_at": "2024-10-05T00:55:42.000+03:00",
    "updated_at": "2015-07-28T23:59:59.000+03:00",
    "is_hidden": false,
    "available": true,
    "archived": false,
    "canonical_url_collection_id": null,
    "custom_template": null,
    "unit": "pce",
    "sort_weight": null,
    "ignore_discounts": null,
    "vat": -1,
    "dimensions": null,
    "fiscal_product_type": 1,
    "title": "pants",
    "short_description": null,
    "permalink": "pants",
    "html_title": null,
    "meta_keywords": null,
    "meta_description": null,
    "currency_code": "LVL",
    "collections_ids": [
      8
    ],
    "sales_channels_id": null,
    "description": null,
    "images": [

    ],
    "video_links": [

    ],
    "option_names": [
      {
        "id": 1,
        "position": 1,
        "navigational": true,
        "title": "Вариант"
      }
    ],
    "properties": [

    ],
    "characteristics": [

    ],
    "product_field_values": [

    ],
    "variants": [
      {
        "id": 3,
        "title": "Базовая",
        "product_id": 3,
        "sku": "425",
        "barcode": null,
        "dimensions": null,
        "available": true,
        "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": null,
        "cost_price": null,
        "cost_price_in_site_currency": null,
        "price_in_site_currency": "600.0",
        "base_price": "20.0",
        "old_price": null,
        "price2": null,
        "price": "20.0",
        "base_price_in_site_currency": "600.0",
        "old_price_in_site_currency": null,
        "price2_in_site_currency": null,
        "prices": [

        ],
        "prices_in_site_currency": [

        ],
        "variant_field_values": [

        ],
        "option_values": [
          {
            "id": 3,
            "option_name_id": 1,
            "position": 3,
            "title": "Базовая",
            "image_url": null
          }
        ]
      }
    ],
    "product_bundle_components": [

    ]
  },
  {
    "id": 4,
    "category_id": 3,
    "created_at": "2024-10-05T00:55:42.000+03:00",
    "updated_at": "2015-07-29T00:00:00.000+03:00",
    "is_hidden": false,
    "available": true,
    "archived": false,
    "canonical_url_collection_id": null,
    "custom_template": null,
    "unit": "pce",
    "sort_weight": null,
    "ignore_discounts": null,
    "vat": 10,
    "dimensions": null,
    "fiscal_product_type": 1,
    "title": "shirt & t-short",
    "short_description": null,
    "permalink": "shirt_and_tshort",
    "html_title": null,
    "meta_keywords": null,
    "meta_description": null,
    "currency_code": "LVL",
    "collections_ids": [

    ],
    "sales_channels_id": null,
    "description": null,
    "images": [

    ],
    "video_links": [

    ],
    "option_names": [

    ],
    "properties": [

    ],
    "characteristics": [

    ],
    "product_field_values": [

    ],
    "variants": [
      {
        "id": 4,
        "title": "",
        "product_id": 4,
        "sku": "426",
        "barcode": null,
        "dimensions": null,
        "available": true,
        "image_ids": [

        ],
        "image_id": null,
        "weight": "0.3",
        "created_at": "2009-03-18T12:53:14.000+03:00",
        "updated_at": "2009-03-18T11:53:14.000+03:00",
        "quantity": null,
        "cost_price": null,
        "cost_price_in_site_currency": null,
        "price_in_site_currency": "600.0",
        "base_price": "20.0",
        "old_price": null,
        "price2": null,
        "price": "20.0",
        "base_price_in_site_currency": "600.0",
        "old_price_in_site_currency": null,
        "price2_in_site_currency": null,
        "prices": [

        ],
        "prices_in_site_currency": [

        ],
        "variant_field_values": [

        ],
        "option_values": [

        ]
      }
    ],
    "product_bundle_components": [
      {
        "id": 989437296,
        "variant_id": 2,
        "free": true,
        "quantity": "1.0",
        "discount_amount": null,
        "product_id": 2,
        "discount_type": null
      },
      {
        "id": 579560919,
        "variant_id": 1,
        "free": false,
        "quantity": "1.0",
        "discount_amount": null,
        "product_id": 1,
        "discount_type": null
      }
    ]
  }
]

Update bundle

Endpoint

PUT /admin/products/4.json

Parameters

Name Description
product[title] title
product[ignore_discounts] set to 1 to make this product ignore discounts
product[vat] do not set VAT for bundle because order lines will be created with its components, which have their own VAT
product[product_bundle_components_attributes] component without the specified identifier (id) will be created (variant_id is required); component with id will be updated (variant_id is optional); component with id and (_destroy: true) attribute will be destroyed;

Request

Route

PUT /admin/products/4.json

Headers

Content-Type: application/json
Authorization: Basic ZGlnaXRhbC1nb29kczpjNTFjOTA3MDdhMTNjZTNmZmYyMTNhZmJiNWNkMTI3MA==

Body

{
  "product": {
    "product_bundle_components_attributes": [
      {
        "variant_id": 3,
        "quantity": 2,
        "free": false
      },
      {
        "id": 1,
        "quantity": 4
      },
      {
        "id": 2,
        "_destroy": true
      }
    ]
  }
}

Response

Simulated Response

Status

200

Headers

API-Usage-Limit: 1/500
Content-Type: application/json; charset=utf-8

Body

{
  "id": 4,
  "category_id": 3,
  "created_at": "2024-10-05T00:55:42.000+03:00",
  "updated_at": "2024-10-05T00:56:58.000+03:00",
  "is_hidden": false,
  "available": false,
  "archived": false,
  "canonical_url_collection_id": null,
  "custom_template": null,
  "unit": "pce",
  "sort_weight": null,
  "ignore_discounts": null,
  "vat": 10,
  "dimensions": null,
  "fiscal_product_type": 1,
  "title": "shirt & t-short",
  "short_description": null,
  "permalink": "shirt_and_tshort",
  "html_title": null,
  "meta_keywords": null,
  "meta_description": null,
  "currency_code": "LVL",
  "collections_ids": [

  ],
  "sales_channels_id": null,
  "description": null,
  "images": [

  ],
  "video_links": [

  ],
  "option_names": [

  ],
  "properties": [

  ],
  "characteristics": [

  ],
  "product_field_values": [

  ],
  "variants": [
    {
      "id": 4,
      "title": "",
      "product_id": 4,
      "sku": "426",
      "barcode": null,
      "dimensions": null,
      "available": false,
      "image_ids": [

      ],
      "image_id": null,
      "weight": "0.3",
      "created_at": "2009-03-18T12:53:14.000+03:00",
      "updated_at": "2024-10-05T00:56:58.000+03:00",
      "quantity": 0,
      "cost_price": null,
      "cost_price_in_site_currency": null,
      "price_in_site_currency": "600.0",
      "base_price": "20.0",
      "old_price": null,
      "price2": null,
      "price": "20.0",
      "base_price_in_site_currency": "600.0",
      "old_price_in_site_currency": null,
      "price2_in_site_currency": null,
      "prices": [

      ],
      "prices_in_site_currency": [

      ],
      "variant_field_values": [

      ],
      "option_values": [

      ]
    }
  ],
  "product_bundle_components": [
    {
      "id": 989437296,
      "variant_id": 2,
      "free": true,
      "quantity": "1.0",
      "discount_amount": null,
      "product_id": 2,
      "discount_type": 0
    },
    {
      "id": 579560919,
      "variant_id": 1,
      "free": false,
      "quantity": "1.0",
      "discount_amount": null,
      "product_id": 1,
      "discount_type": 0
    },
    {
      "id": 1058167310,
      "variant_id": 3,
      "free": false,
      "quantity": "2.0",
      "discount_amount": null,
      "product_id": 3,
      "discount_type": 0
    }
  ]
}

Update product

Endpoint

PUT /admin/products/:product_id.json

Parameters

Name Description
product[title] title
product[ignore_discounts] set to 1 to make this product ignore discounts
product[vat] integer, default value is set in account settings, if default in account set as 'No VAT' you cannot change VAT of products through API; possible values depend on country, set to -1 if this product is not a subject to VAT
product[product_field_values_attributes] product field values attributes

Request

Route

PUT /admin/products/1.json

Headers

Content-Type: application/json
Authorization: Basic ZGlnaXRhbC1nb29kczpjNTFjOTA3MDdhMTNjZTNmZmYyMTNhZmJiNWNkMTI3MA==

Body

{
  "product": {
    "title": "Van Gogh Notebook",
    "ignore_discounts": 1,
    "vat": 10,
    "product_field_values_attributes": [
      {
        "handle": "handle",
        "value": 12345
      }
    ]
  }
}

Response

Simulated Response

Status

200

Headers

API-Usage-Limit: 1/500
Content-Type: application/json; charset=utf-8

Body

{
  "id": 1,
  "category_id": 1,
  "created_at": "2024-10-05T00:55:42.000+03:00",
  "updated_at": "2024-10-05T00:56:58.000+03:00",
  "is_hidden": false,
  "available": false,
  "archived": false,
  "canonical_url_collection_id": 1,
  "custom_template": null,
  "unit": "pce",
  "sort_weight": null,
  "ignore_discounts": true,
  "vat": 10,
  "dimensions": "10x20x30",
  "fiscal_product_type": 1,
  "title": "Van Gogh Notebook",
  "short_description": "its a cool t-shirt",
  "permalink": "футболка",
  "html_title": null,
  "meta_keywords": null,
  "meta_description": null,
  "currency_code": "LVL",
  "collections_ids": [
    1,
    3,
    8
  ],
  "sales_channels_id": null,
  "description": "guys, its a really cool t-shirt",
  "images": [

  ],
  "video_links": [

  ],
  "option_names": [
    {