InSales API documentation

Account

Get account

Request

Route

GET admin/account.json

Headers

Authorization: Basic ZGlnaXRhbC1nb29kczpjNTFjOTA3MDdhMTNjZTNmZmYyMTNhZmJiNWNkMTI3
MA==

Response

Status

200

Headers

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

Body

{
  "blocked": false,
  "city": null,
  "contact_phone": null,
  "country": null,
  "enable_cart_discounts": false,
  "enable_client_discounts": false,
  "enable_group_discounts": false,
  "enable_order_discounts": false,
  "hide_items_out_of_stock": false,
  "id": 1,
  "inviter_id": null,
  "notification_email": null,
  "organization": "InSales, ltd",
  "sms_notification_phone": null,
  "state": null,
  "subdomain": "quentin",
  "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.mylocalhost.localdomain:3000",
  "main_host_protocol": "http",
  "next_order_number": 1006,
  "time_zone": null,
  "owner": {
    "created_at": "2017-08-20T13:03:28+03:00",
    "email": "quentin@example.com",
    "id": 1,
    "name": "quentin"
  }
}

Update account

Parameters

Name Description
account[title] shop title
account[phone] phone on site
account[email] email on site
account[icq] icq on site
account[contact_phone] phone for busines contacts, not displayed on site
account[sms_notification_phone] phone for sms notifications, not displayed on site
account[organization] organization name
account[country] country
account[city] city
account[state] region
subdomain[subdomain] subdomain
account[notification_email] emails for nitifications

Request

Route

PUT /admin/account.json

Headers

Content-Type: application/json
Authorization: Basic ZGlnaXRhbC1nb29kczpjNTFjOTA3MDdhMTNjZTNmZmYyMTNhZmJiNWNkMTI3
MA==

Body

{
  "account": {
    "title": "NEW SHOP TITLE",
    "phone": "8(912) 345-78-91",
    "email": "mynewemail@mydomain.com",
    "icq": "98798755",
    "contact_phone": "+7(926)345-67-89",
    "sms_notification_phone": "+79263456789",
    "organization": "new organization name",
    "country": "RU",
    "city": "London",
    "state": "Vermont",
    "notification_email": "new_notif_email1@gmail.com,new_notif_email2@gmail.com"
  },
  "subdomain": {
    "subdomain": "mynewsubdomain"
  }
}

Response

Status

200

Headers

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

Body

{
  "status": "ok"
}

ApplicationCharge

Create application_charge

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 ZGlnaXRhbC1nb29kczpjNTFjOTA3MDdhMTNjZTNmZmYyMTNhZmJiNWNkMTI3
MA==

Body

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

Response

Status

201

Headers

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

Body

{
  "created_at": "2017-01-01T03:00:00+03:00",
  "id": 8,
  "name": "Payment for premium",
  "price": "300.0",
  "return_url": "http://app.my/check_payment_url/%id_in_my_application%",
  "status": "pending",
  "test": true,
  "updated_at": "2017-01-01T03:00:00+03:00",
  "confirmation_url": "http://quentin.mylocalhost.localdomain:3000/admin/application_charges/8"
}

Decline application_charge

Only bill with status 'pending' can be declined.

Request

Route

POST /admin/application_charges/10/decline.json

Headers

Content-Type: application/json
Authorization: Basic ZGlnaXRhbC1nb29kczpjNTFjOTA3MDdhMTNjZTNmZmYyMTNhZmJiNWNkMTI3
MA==

Response

Status

200

Headers

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

Body

{
  "created_at": "2017-01-01T03:00:00+03:00",
  "id": 10,
  "name": "Pay",
  "price": "180.0",
  "return_url": "http://applicaiton.my/check_payment_url/%id_in_my_application%",
  "status": "declined",
  "test": null,
  "updated_at": "2017-01-01T03:00:00+03:00",
  "confirmation_url": "http://quentin.mylocalhost.localdomain:3000/admin/invoices/8"
}

Get application_charge

Request

Route

GET /admin/application_charges/4.json

Headers

Authorization: Basic ZGlnaXRhbC1nb29kczpjNTFjOTA3MDdhMTNjZTNmZmYyMTNhZmJiNWNkMTI3
MA==

Response

Status

200

Headers

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

Body

{
  "created_at": "2017-01-01T03:00:00+03:00",
  "id": 4,
  "name": "Pay",
  "price": "180.0",
  "return_url": "http://applicaiton.my/check_payment_url/%id_in_my_application%",
  "status": "pending",
  "test": null,
  "updated_at": "2017-01-01T03:00:00+03:00",
  "confirmation_url": "http://quentin.mylocalhost.localdomain:3000/admin/invoices/4"
}

Get application_charges

Request

Route

GET /admin/application_charges.json

Headers

Authorization: Basic ZGlnaXRhbC1nb29kczpjNTFjOTA3MDdhMTNjZTNmZmYyMTNhZmJiNWNkMTI3
MA==

Response

Status

200

Headers

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

Body

[
  {
    "created_at": "2017-01-01T03:00:00+03:00",
    "id": 2,
    "name": "Pay",
    "price": "180.0",
    "return_url": "http://applicaiton.my/check_payment_url/%id_in_my_application%",
    "status": "pending",
    "test": null,
    "updated_at": "2017-01-01T03:00:00+03:00",
    "confirmation_url": "http://quentin.mylocalhost.localdomain:3000/admin/invoices/2"
  }
]

ApplicationWidget

Create application_widget

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 ZGlnaXRhbC1nb29kczpjNTFjOTA3MDdhMTNjZTNmZmYyMTNhZmJiNWNkMTI3
MA==

Body

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

Response

Status

201

Headers

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

Body

{
  "code": "some html or javascript code",
  "created_at": "2017-01-01T03:00:00+03:00",
  "height": 70,
  "id": 8,
  "page_type": "order"
}

Destroy application_widget

Request

Route

DELETE /admin/application_widgets/12.json

Headers

Content-Type: application/json
Authorization: Basic ZGlnaXRhbC1nb29kczpjNTFjOTA3MDdhMTNjZTNmZmYyMTNhZmJiNWNkMTI3
MA==

Response

Status

200

Headers

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

Body

{
  "status": "ok"
}

Get application_widget

Request

Route

GET /admin/application_widgets/4.json

Headers

Authorization: Basic ZGlnaXRhbC1nb29kczpjNTFjOTA3MDdhMTNjZTNmZmYyMTNhZmJiNWNkMTI3
MA==

Response

Status

200

Headers

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

Body

{
  "code": "html/js code",
  "created_at": "2017-01-01T03:00:00+03:00",
  "height": 50,
  "id": 4,
  "page_type": "product"
}

Get application_widgets

Request

Route

GET /admin/application_widgets.json

Headers

Authorization: Basic ZGlnaXRhbC1nb29kczpjNTFjOTA3MDdhMTNjZTNmZmYyMTNhZmJiNWNkMTI3
MA==

Response

Status

200

Headers

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

Body

[
  {
    "code": "html/js code",
    "created_at": "2017-01-01T03:00:00+03:00",
    "height": 50,
    "id": 2,
    "page_type": "product"
  }
]

Update application_widget

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 ZGlnaXRhbC1nb29kczpjNTFjOTA3MDdhMTNjZTNmZmYyMTNhZmJiNWNkMTI3
MA==

Body

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

Response

Status

200

Headers

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

Body

{
  "code": "code changed",
  "created_at": "2017-01-01T03:00:00+03:00",
  "height": 80,
  "id": 10,
  "page_type": "order"
}

Article

Create article

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] 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 ZGlnaXRhbC1nb29kczpjNTFjOTA3MDdhMTNjZTNmZmYyMTNhZmJiNWNkMTI3
MA==

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

Response

Status

201

Headers

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

Body

{
  "created_at": "2017-01-01T03:00:00+03:00",
  "id": 6,
  "pinned": true,
  "published_at": "2014-09-09T00:00:00+04:00",
  "updated_at": "2017-01-01T03:00:00+03:00",
  "title": "new article",
  "content": "<p>content of my article<p>",
  "notice": "some notice",
  "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": {
    "created_at": "2017-01-01T03:00:00+03:00",
    "id": 3,
    "original_url": "/images/no_image_original.jpg"
  },
  "tags": [
    {
      "title": "test3"
    },
    {
      "title": "test4"
    }
  ],
  "related_products": [

  ]
}

Delete article

Request

Route

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

Headers

Authorization: Basic ZGlnaXRhbC1nb29kczpjNTFjOTA3MDdhMTNjZTNmZmYyMTNhZmJiNWNkMTI3
MA==

Content-Type: application/x-www-form-urlencoded

Response

Status

200

Headers

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

Body

{
  "status": "ok"
}

Get article

Request

Route

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

Headers

Authorization: Basic ZGlnaXRhbC1nb29kczpjNTFjOTA3MDdhMTNjZTNmZmYyMTNhZmJiNWNkMTI3
MA==

Response

Status

200

Headers

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

Body

{
  "created_at": "2017-08-25T12:59:22+03:00",
  "id": 2,
  "pinned": false,
  "published_at": "2017-03-01T07:53:15+03:00",
  "updated_at": "2017-01-01T03:00:00+03:00",
  "title": "Второая Статья",
  "content": "Привет",
  "notice": "Второй анонс",
  "author": "Ivan",
  "permalink": "статья-2",
  "html_title": null,
  "meta_keywords": null,
  "meta_description": null,
  "image": {
    "created_at": "2017-08-25T12:59:18+03:00",
    "id": 1,
    "original_url": "/images/articles/1/1/1/article_image_1.jpg"
  },
  "tags": [
    {
      "title": "test"
    },
    {
      "title": "test2"
    }
  ],
  "related_products": [
    {
      "account_id": 1,
      "archived": false,
      "available": false,
      "bundle": null,
      "canonical_url_collection_id": 1,
      "category_id": 1,
      "characteristics_id": "{7,9,12,13}",
      "collections_id": "{1,3,8}",
      "cost_price_max_cached": null,
      "cost_price_min_cached": null,
      "created_at": "2017-08-25T12:59:21+03:00",
      "custom_layout": null,
      "custom_template": null,
      "deleted": false,
      "dimensions": null,
      "id": 1,
      "ignore_discounts": null,
      "is_hidden": false,
      "key": null,
      "main_image_id": null,
      "old_price_max_available_cached": null,
      "old_price_max_cached": null,
      "old_price_min_available_cached": null,
      "old_price_min_cached": null,
      "permalink": "футболка",
      "price_max_available_cached": null,
      "price_max_cached": "10.0",
      "price_min_available_cached": null,
      "price_min_cached": "10.0",
      "sort_weight": null,
      "stock_currency_id": 1,
      "title_translations": "{\"Cool t-shirt\"}",
      "unit": "pce",
      "updated_at": "2017-08-25T12:59:21+03:00",
      "vat": -1
    }
  ]
}

Get articles list

Request

Route

GET /admin/blogs/1/articles.json

Headers

Authorization: Basic ZGlnaXRhbC1nb29kczpjNTFjOTA3MDdhMTNjZTNmZmYyMTNhZmJiNWNkMTI3
MA==

Response

Status

200

Headers

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

Body

[
  {
    "created_at": "2017-08-25T12:59:22+03:00",
    "id": 1,
    "pinned": false,
    "published_at": "2009-03-18T07:53:15+03:00",
    "updated_at": "2017-08-25T12:59:22+03:00",
    "title": "Статья",
    "content": "Первая статья",
    "notice": "Первый анонс",
    "author": "Ivan",
    "permalink": "статья",
    "html_title": null,
    "meta_keywords": null,
    "meta_description": null,
    "tags": [

    ],
    "related_products": [

    ]
  },
  {
    "created_at": "2017-08-25T12:59:22+03:00",
    "id": 2,
    "pinned": false,
    "published_at": "2017-03-01T07:53:15+03:00",
    "updated_at": "2017-01-01T03:00:00+03:00",
    "title": "Второая Статья",
    "content": "Привет",
    "notice": "Второй анонс",
    "author": "Ivan",
    "permalink": "статья-2",
    "html_title": null,
    "meta_keywords": null,
    "meta_description": null,
    "image": {
      "created_at": "2017-08-25T12:59:18+03:00",
      "id": 1,
      "original_url": "/images/articles/1/1/1/article_image_1.jpg"
    },
    "tags": [
      {
        "title": "test"
      },
      {
        "title": "test2"
      }
    ],
    "related_products": [
      {
        "account_id": 1,
        "archived": false,
        "available": false,
        "bundle": null,
        "canonical_url_collection_id": 1,
        "category_id": 1,
        "characteristics_id": "{7,9,12,13}",
        "collections_id": "{1,3,8}",
        "cost_price_max_cached": null,
        "cost_price_min_cached": null,
        "created_at": "2017-08-25T12:59:21+03:00",
        "custom_layout": null,
        "custom_template": null,
        "deleted": false,
        "dimensions": null,
        "id": 1,
        "ignore_discounts": null,
        "is_hidden": false,
        "key": null,
        "main_image_id": null,
        "old_price_max_available_cached": null,
        "old_price_max_cached": null,
        "old_price_min_available_cached": null,
        "old_price_min_cached": null,
        "permalink": "футболка",
        "price_max_available_cached": null,
        "price_max_cached": "10.0",
        "price_min_available_cached": null,
        "price_min_cached": "10.0",
        "sort_weight": null,
        "stock_currency_id": 1,
        "title_translations": "{\"Cool t-shirt\"}",
        "unit": "pce",
        "updated_at": "2017-08-25T12:59:21+03:00",
        "vat": -1
      }
    ]
  }
]

Update article

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] 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 ZGlnaXRhbC1nb29kczpjNTFjOTA3MDdhMTNjZTNmZmYyMTNhZmJiNWNkMTI3
MA==

Body

{
  "article": {
    "title": "new title",
    "all_tags": [
      "test",
      "test3"
    ],
    "pinned": true
  }
}

Response

Status

200

Headers

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

Body

{
  "created_at": "2017-08-25T12:59:22+03:00",
  "id": 2,
  "pinned": true,
  "published_at": "2017-03-01T07:53:15+03:00",
  "updated_at": "2017-01-01T03:00:00+03:00",
  "title": "new title",
  "content": "Привет",
  "notice": "Второй анонс",
  "author": "Ivan",
  "permalink": "статья-2",
  "html_title": null,
  "meta_keywords": null,
  "meta_description": null,
  "image": {
    "created_at": "2017-08-25T12:59:18+03:00",
    "id": 1,
    "original_url": "/images/articles/1/1/1/article_image_1.jpg"
  },
  "tags": [
    {
      "title": "test"
    },
    {
      "title": "test3"
    }
  ],
  "related_products": [
    {
      "account_id": 1,
      "archived": false,
      "available": false,
      "bundle": null,
      "canonical_url_collection_id": 1,
      "category_id": 1,
      "characteristics_id": "{7,9,12,13}",
      "collections_id": "{1,3,8}",
      "cost_price_max_cached": null,
      "cost_price_min_cached": null,
      "created_at": "2017-08-25T12:59:21+03:00",
      "custom_layout": null,
      "custom_template": null,
      "deleted": false,
      "dimensions": null,
      "id": 1,
      "ignore_discounts": null,
      "is_hidden": false,
      "key": null,
      "main_image_id": null,
      "old_price_max_available_cached": null,
      "old_price_max_cached": null,
      "old_price_min_available_cached": null,
      "old_price_min_cached": null,
      "permalink": "футболка",
      "price_max_available_cached": null,
      "price_max_cached": "10.0",
      "price_min_available_cached": null,
      "price_min_cached": "10.0",
      "sort_weight": null,
      "stock_currency_id": 1,
      "title_translations": "{\"Cool t-shirt\"}",
      "unit": "pce",
      "updated_at": "2017-08-25T12:59:21+03:00",
      "vat": -1
    }
  ]
}

Blog

Create blog

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 ZGlnaXRhbC1nb29kczpjNTFjOTA3MDdhMTNjZTNmZmYyMTNhZmJiNWNkMTI3
MA==

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

Status

201

Headers

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

Body

{
  "captcha_enabled": false,
  "commentable": "no",
  "disallow_links_in_comments": false,
  "id": 5,
  "notify_about_comment": true,
  "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

Request

Route

DELETE /admin/blogs/1.json

Headers

Content-Type: application/json
Authorization: Basic ZGlnaXRhbC1nb29kczpjNTFjOTA3MDdhMTNjZTNmZmYyMTNhZmJiNWNkMTI3
MA==

Response

Status

200

Headers

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

Body

{
  "status": "ok"
}

Get blog

Request

Route

GET /admin/blogs/1.json

Headers

Authorization: Basic ZGlnaXRhbC1nb29kczpjNTFjOTA3MDdhMTNjZTNmZmYyMTNhZmJiNWNkMTI3
MA==

Response

Status

200

Headers

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

Body

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

Get blogs

Request

Route

GET /admin/blogs.json

Headers

Authorization: Basic ZGlnaXRhbC1nb29kczpjNTFjOTA3MDdhMTNjZTNmZmYyMTNhZmJiNWNkMTI3
MA==

Response

Status

200

Headers

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

Body

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

    ]
  }
]

Update blog

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 ZGlnaXRhbC1nb29kczpjNTFjOTA3MDdhMTNjZTNmZmYyMTNhZmJiNWNkMTI3
MA==

Body

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

Response

Status

200

Headers

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

Body

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

BonusSystemTransaction

Create transaction for client

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/5/bonus_system_transactions.json

Headers

Content-Type: application/json
Authorization: Basic ZGlnaXRhbC1nb29kczpjNTFjOTA3MDdhMTNjZTNmZmYyMTNhZmJiNWNkMTI3
MA==

Body

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

Response

Status

201

Headers

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

Body

{
  "bonus_points": 100,
  "client_id": 5,
  "bonus_system_id": 7,
  "initiator_type": "ApplicationPassword",
  "initiator_id": 1,
  "description": "compliment",
  "status": "charged"
}

Get transaction for client

Request

Route

GET /admin/bonus_system_transactions/7.json

Headers

Authorization: Basic ZGlnaXRhbC1nb29kczpjNTFjOTA3MDdhMTNjZTNmZmYyMTNhZmJiNWNkMTI3
MA==

Response

Status

200

Headers

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

Body

{
  "bonus_points": 100,
  "client_id": 2,
  "bonus_system_id": 5,
  "initiator_type": "Order",
  "initiator_id": 1,
  "description": "test",
  "status": "charged"
}

Get transactions for client

Request

Route

GET /admin/clients/5/bonus_system_transactions.json

Headers

Authorization: Basic ZGlnaXRhbC1nb29kczpjNTFjOTA3MDdhMTNjZTNmZmYyMTNhZmJiNWNkMTI3
MA==

Response

Status

200

Headers

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

Body

[

]

Category

Create category

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 ZGlnaXRhbC1nb29kczpjNTFjOTA3MDdhMTNjZTNmZmYyMTNhZmJiNWNkMTI3
MA==

Body

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

Response

Status

201

Headers

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

Body

{
  "created_at": "2017-01-01T03:00:00+03:00",
  "id": 19,
  "parent_id": 1,
  "position": 1,
  "title": "Reebok",
  "updated_at": "2017-01-01T03:00:00+03:00"
}

Destroy category

Request

Route

DELETE /admin/categories/6.json

Headers

Content-Type: application/json
Authorization: Basic ZGlnaXRhbC1nb29kczpjNTFjOTA3MDdhMTNjZTNmZmYyMTNhZmJiNWNkMTI3
MA==

Response

Status

200

Headers

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

Body

{
  "status": "ok"
}

Get categories

Request

Route

GET /admin/categories.json

Headers

Authorization: Basic ZGlnaXRhbC1nb29kczpjNTFjOTA3MDdhMTNjZTNmZmYyMTNhZmJiNWNkMTI3
MA==

Response

Status

200

Headers

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

Body

[
  {
    "created_at": "2017-08-25T12:59:22+03:00",
    "id": 6,
    "parent_id": 1,
    "position": 0,
    "title": "T-shirts",
    "updated_at": "2017-08-25T12:59:22+03:00"
  },
  {
    "created_at": "2017-08-25T12:59:22+03:00",
    "id": 1,
    "parent_id": null,
    "position": 0,
    "title": "Склад",
    "updated_at": "2017-08-25T12:59:22+03:00"
  },
  {
    "created_at": "2017-08-25T12:59:22+03:00",
    "id": 2,
    "parent_id": 1,
    "position": 1,
    "title": "Trousers",
    "updated_at": "2017-08-25T12:59:22+03:00"
  },
  {
    "created_at": "2017-08-25T12:59:22+03:00",
    "id": 3,
    "parent_id": 1,
    "position": 2,
    "title": "Shirts",
    "updated_at": "2017-08-25T12:59:22+03:00"
  },
  {
    "created_at": "2017-08-25T12:59:22+03:00",
    "id": 4,
    "parent_id": 1,
    "position": 3,
    "title": "Socks",
    "updated_at": "2017-08-25T12:59:22+03:00"
  },
  {
    "created_at": "2017-08-25T12:59:22+03:00",
    "id": 5,
    "parent_id": 1,
    "position": 4,
    "title": "Hats",
    "updated_at": "2017-08-25T12:59:22+03:00"
  },
  {
    "created_at": "2017-08-25T12:59:22+03:00",
    "id": 8,
    "parent_id": 5,
    "position": 1,
    "title": "Top Hat",
    "updated_at": "2017-08-25T12:59:22+03:00"
  }
]

Get category

Request

Route

GET /admin/categories/6.json

Headers

Authorization: Basic ZGlnaXRhbC1nb29kczpjNTFjOTA3MDdhMTNjZTNmZmYyMTNhZmJiNWNkMTI3
MA==

Response

Status

200

Headers

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

Body

{
  "created_at": "2017-08-25T12:59:22+03:00",
  "id": 6,
  "parent_id": 1,
  "position": 0,
  "title": "T-shirts",
  "updated_at": "2017-08-25T12:59:22+03:00"
}

Update category

Parameters

Name Description
category[title] title

Request

Route

PUT /admin/categories/6.json

Headers

Content-Type: application/json
Authorization: Basic ZGlnaXRhbC1nb29kczpjNTFjOTA3MDdhMTNjZTNmZmYyMTNhZmJiNWNkMTI3
MA==

Body

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

Response

Status

200

Headers

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

Body

{
  "created_at": "2017-08-25T12:59:22+03:00",
  "id": 6,
  "parent_id": 1,
  "position": 0,
  "title": "Adidas",
  "updated_at": "2017-01-01T03:00:00+03:00"
}

Characteristic

Create characteristic

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 ZGlnaXRhbC1nb29kczpjNTFjOTA3MDdhMTNjZTNmZmYyMTNhZmJiNWNkMTI3
MA==

Body

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

Response

Status

201

Headers

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

Body

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

Destroy characteristic

Request

Route

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

Headers

Content-Type: application/json
Authorization: Basic ZGlnaXRhbC1nb29kczpjNTFjOTA3MDdhMTNjZTNmZmYyMTNhZmJiNWNkMTI3
MA==

Response

Status

200

Headers

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

Body

{
  "status": "ok"
}

Get characteristic

Request

Route

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

Headers

Authorization: Basic ZGlnaXRhbC1nb29kczpjNTFjOTA3MDdhMTNjZTNmZmYyMTNhZmJiNWNkMTI3
MA==

Response

Status

200

Headers

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

Body

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

Get characteristics

Request

Route

GET /admin/properties/3/characteristics.json

Headers

Authorization: Basic ZGlnaXRhbC1nb29kczpjNTFjOTA3MDdhMTNjZTNmZmYyMTNhZmJiNWNkMTI3
MA==

Response

Status

200

Headers

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

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

Parameters

Name Description
characteristic[title] title

Request

Route

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

Headers

Content-Type: application/json
Authorization: Basic ZGlnaXRhbC1nb29kczpjNTFjOTA3MDdhMTNjZTNmZmYyMTNhZmJiNWNkMTI3
MA==

Body

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

Response

Status

200

Headers

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

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.

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[bonus_points] bonus points quantity
client[progressive_discount] progressive discount
client[group_discount] group discount
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 ZGlnaXRhbC1nb29kczpjNTFjOTA3MDdhMTNjZTNmZmYyMTNhZmJiNWNkMTI3
MA==

Body

{
  "client": {
    "name": "Ivan",
    "surname": "Ivanov",
    "middlename": "Ivanovich",
    "registered": true,
    "email": "test@example.com",
    "password": "123456",
    "type": "Client::Individual",
    "fields_values_attributes": [
      {
        "field_id": 178,
        "value": "text"
      }
    ]
  }
}

Response

Status

201

Headers

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

Body

{
  "bonus_points": 0,
  "client_group_id": 1,
  "correspondent_account": null,
  "created_at": "2017-01-01T03:00:00+03:00",
  "email": "test@example.com",
  "id": 19,
  "ip_addr": null,
  "middlename": "Ivanovich",
  "name": "Ivan",
  "phone": null,
  "registered": true,
  "settlement_account": null,
  "subscribe": true,
  "surname": "Ivanov",
  "type": "Client::Individual",
  "updated_at": "2017-01-01T03:00:00+03:00",
  "progressive_discount": null,
  "group_discount": "25.0",
  "fields_values": [
    {
      "created_at": "2017-01-01T03:00:00+03:00",
      "field_id": 178,
      "id": 8,
      "updated_at": "2017-01-01T03:00:00+03:00",
      "value": "text",
      "type": "Текст",
      "name": "special",
      "handle": null
    }
  ]
}

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.

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[bonus_points] bonus points quantity
client[progressive_discount] progressive discount
client[group_discount] group discount
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 ZGlnaXRhbC1nb29kczpjNTFjOTA3MDdhMTNjZTNmZmYyMTNhZmJiNWNkMTI3
MA==

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

Response

Status

201

Headers

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

Body

{
  "bank_name": null,
  "bik": 123456789,
  "bonus_points": 0,
  "client_group_id": null,
  "correspondent_account": null,
  "created_at": "2017-01-01T03:00:00+03:00",
  "email": null,
  "id": 21,
  "inn": 1234567890,
  "ip_addr": null,
  "juridical_address": "123456, Moscow, Novaya st., 1, 222",
  "kpp": 123456789,
  "name": "OOO 'Company'",
  "ogrn": null,
  "okpo": null,
  "phone": null,
  "registered": false,
  "settlement_account": null,
  "subscribe": true,
  "type": "Client::Juridical",
  "updated_at": "2017-01-01T03:00:00+03:00",
  "progressive_discount": null,
  "group_discount": null,
  "fields_values": [
    {
      "created_at": "2017-01-01T03:00:00+03:00",
      "field_id": 182,
      "id": 12,
      "updated_at": "2017-01-01T03:00:00+03:00",
      "value": "text_value",
      "type": "Текст",
      "name": "field_juridical",
      "handle": null
    }
  ]
}

Destroy client

Request

Route

DELETE /admin/clients/2.json

Headers

Content-Type: application/json
Authorization: Basic ZGlnaXRhbC1nb29kczpjNTFjOTA3MDdhMTNjZTNmZmYyMTNhZmJiNWNkMTI3
MA==

Response

Status

200

Headers

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

Body

{
  "status": "ok"
}

Get client

Request

Route

GET /admin/clients/2.json

Headers

Authorization: Basic ZGlnaXRhbC1nb29kczpjNTFjOTA3MDdhMTNjZTNmZmYyMTNhZmJiNWNkMTI3
MA==

Response

Status

200

Headers

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

Body

{
  "bonus_points": 0,
  "client_group_id": null,
  "correspondent_account": null,
  "created_at": "2009-03-30T04:37:32+04:00",
  "email": "some-one@yandex.ru",
  "id": 2,
  "ip_addr": null,
  "middlename": null,
  "name": "Mortimer Hant",
  "phone": "+7(916)212-85-06",
  "registered": false,
  "settlement_account": null,
  "subscribe": true,
  "surname": null,
  "type": "Client::Individual",
  "updated_at": "2009-03-31T12:20:34+04:00",
  "progressive_discount": null,
  "group_discount": null,
  "fields_values": [
    {
      "created_at": "2017-01-01T03:00:00+03:00",
      "field_id": 176,
      "id": 4,
      "updated_at": "2017-01-01T03:00:00+03:00",
      "value": "old value",
      "type": "Текст",
      "name": "special",
      "handle": null
    }
  ]
}

Get clients

Parameters

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

Request

Route

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

Headers

Authorization: Basic ZGlnaXRhbC1nb29kczpjNTFjOTA3MDdhMTNjZTNmZmYyMTNhZmJiNWNkMTI3
MA==

Query Parameters

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

Response

Status

200

Headers

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

Body

[
  {
    "bonus_points": 0,
    "client_group_id": null,
    "correspondent_account": null,
    "created_at": "2009-03-30T04:37:32+04:00",
    "email": "some-one@yandex.ru",
    "id": 2,
    "ip_addr": null,
    "middlename": null,
    "name": "Mortimer Hant",
    "phone": "+7(916)212-85-06",
    "registered": false,
    "settlement_account": null,
    "subscribe": true,
    "surname": null,
    "type": "Client::Individual",
    "updated_at": "2009-03-31T12:20:34+04:00",
    "progressive_discount": null,
    "group_discount": null,
    "fields_values": [
      {
        "created_at": "2017-01-01T03:00:00+03:00",
        "field_id": 174,
        "id": 2,
        "updated_at": "2017-01-01T03:00:00+03:00",
        "value": "old value",
        "type": "Текст",
        "name": "special",
        "handle": null
      }
    ]
  },
  {
    "bonus_points": 0,
    "client_group_id": 1,
    "correspondent_account": null,
    "created_at": "2009-04-30T04:37:32+04:00",
    "email": "some-one2@yandex.ru",
    "id": 3,
    "ip_addr": null,
    "middlename": null,
    "name": "Just Man",
    "phone": "+7(926)111-22-33",
    "registered": false,
    "settlement_account": null,
    "subscribe": true,
    "surname": null,
    "type": "Client::Individual",
    "updated_at": "2009-04-30T12:20:34+04:00",
    "progressive_discount": null,
    "group_discount": "25.0",
    "fields_values": [

    ]
  },
  {
    "bonus_points": 1000,
    "client_group_id": null,
    "correspondent_account": null,
    "created_at": "2009-04-30T04:37:32+04:00",
    "email": "john@smith.com",
    "id": 5,
    "ip_addr": null,
    "middlename": null,
    "name": "John Smith",
    "phone": "+7(926)111-11-11",
    "registered": true,
    "settlement_account": null,
    "subscribe": true,
    "surname": null,
    "type": "Client::Individual",
    "updated_at": "2009-04-30T12:20:34+04:00",
    "progressive_discount": null,
    "group_discount": null,
    "fields_values": [

    ]
  }
]

Update client

Parameters

Name Description
client[name] name
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[bonus_points] bonus points quantity
client[progressive_discount] progressive discount
client[group_discount] group discount
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
client[skip_send_mail] set it true to skip sending email confirmation

Request

Route

PUT /admin/clients/2.json

Headers

Content-Type: application/json
Authorization: Basic ZGlnaXRhbC1nb29kczpjNTFjOTA3MDdhMTNjZTNmZmYyMTNhZmJiNWNkMTI3
MA==

Body

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

Response

Status

200

Headers

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

Body

{
  "bonus_points": 0,
  "client_group_id": 2,
  "correspondent_account": null,
  "created_at": "2009-03-30T04:37:32+04:00",
  "email": "some-one@yandex.ru",
  "id": 2,
  "ip_addr": null,
  "middlename": null,
  "name": "Mortimer Hant",
  "phone": "+79111111111",
  "registered": false,
  "settlement_account": null,
  "subscribe": false,
  "surname": null,
  "type": "Client::Individual",
  "updated_at": "2017-01-01T03:00:00+03:00",
  "progressive_discount": null,
  "group_discount": null,
  "fields_values": [
    {
      "created_at": "2017-01-01T03:00:00+03:00",
      "field_id": 184,
      "id": 14,
      "updated_at": "2017-01-01T03:00:00+03:00",
      "value": "new value",
      "type": "Текст",
      "name": "special",
      "handle": null
    }
  ]
}

ClientGroup

Create client group

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 ZGlnaXRhbC1nb29kczpjNTFjOTA3MDdhMTNjZTNmZmYyMTNhZmJiNWNkMTI3
MA==

Body

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

Response

Status

201

Headers

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

Body

{
  "id": 19,
  "title": "test group",
  "discount": "0.2",
  "discount_description": "test group discount",
  "is_default": false,
  "created_at": "2017-01-01T03:00:00+03:00",
  "updated_at": "2017-01-01T03:00:00+03:00"
}

Destroy client group

Request

Route

DELETE /admin/client_groups/1.json

Headers

Content-Type: application/json
Authorization: Basic ZGlnaXRhbC1nb29kczpjNTFjOTA3MDdhMTNjZTNmZmYyMTNhZmJiNWNkMTI3
MA==

Response

Status

200

Headers

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

Body

 

Get client group

Request

Route

GET /admin/client_groups/1.json

Headers

Authorization: Basic ZGlnaXRhbC1nb29kczpjNTFjOTA3MDdhMTNjZTNmZmYyMTNhZmJiNWNkMTI3
MA==

Response

Status

200

Headers

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

Body

{
  "id": 1,
  "title": "vip",
  "discount": "25.0",
  "discount_description": null,
  "is_default": true,
  "created_at": "2017-05-17T12:59:20+03:00",
  "updated_at": "2017-08-25T12:59:20+03:00"
}

Get client groups

Request

Route

GET /admin/client_groups.json

Headers

Authorization: Basic ZGlnaXRhbC1nb29kczpjNTFjOTA3MDdhMTNjZTNmZmYyMTNhZmJiNWNkMTI3
MA==

Response

Status

200

Headers

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

Body

[
  {
    "id": 1,
    "title": "vip",
    "discount": "25.0",
    "discount_description": null,
    "is_default": true,
    "created_at": "2017-05-17T12:59:20+03:00",
    "updated_at": "2017-08-25T12:59:20+03:00"
  }
]

Update client group

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 ZGlnaXRhbC1nb29kczpjNTFjOTA3MDdhMTNjZTNmZmYyMTNhZmJiNWNkMTI3
MA==

Body

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

Response

Status

200

Headers

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

Body

{
  "status": "ok"
}

Collect

Add product to collection

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 ZGlnaXRhbC1nb29kczpjNTFjOTA3MDdhMTNjZTNmZmYyMTNhZmJiNWNkMTI3
MA==

Body

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

Response

Status

201

Headers

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

Body

{
  "collection_id": 2,
  "created_at": "2017-01-01T03:00:00+03:00",
  "id": 9854,
  "position": 1,
  "product_id": 1
}

Get collections by product

Request

Route

GET /admin/collects.json?product_id=1

Headers

Authorization: Basic ZGlnaXRhbC1nb29kczpjNTFjOTA3MDdhMTNjZTNmZmYyMTNhZmJiNWNkMTI3
MA==

Query Parameters

product_id=1

Response

Status

200

Headers

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

Body

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

Get collects

Request

Route

GET /admin/collects.json

Headers

Authorization: Basic ZGlnaXRhbC1nb29kczpjNTFjOTA3MDdhMTNjZTNmZmYyMTNhZmJiNWNkMTI3
MA==

Response

Status

200

Headers

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

Body

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

Get products by collection

Request

Route

GET /admin/collects.json?collection_id=1

Headers

Authorization: Basic ZGlnaXRhbC1nb29kczpjNTFjOTA3MDdhMTNjZTNmZmYyMTNhZmJiNWNkMTI3
MA==

Query Parameters

collection_id=1

Response

Status

200

Headers

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

Body

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

Move product to another collection

Parameters

Name Description
collect[collection_id] collection id

Request

Route

PUT /admin/collects/2.json

Headers

Content-Type: application/json
Authorization: Basic ZGlnaXRhbC1nb29kczpjNTFjOTA3MDdhMTNjZTNmZmYyMTNhZmJiNWNkMTI3
MA==

Body

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

Response

Status

200

Headers

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

Body

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

Remove product from collection

Request

Route

DELETE /admin/collects/2.json

Headers

Content-Type: application/json
Authorization: Basic ZGlnaXRhbC1nb29kczpjNTFjOTA3MDdhMTNjZTNmZmYyMTNhZmJiNWNkMTI3
MA==

Response

Status

200

Headers

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

Body

{
  "status": "ok"
}

Update position

Parameters

Name Description
collect[position] position

Request

Route

PUT /admin/collects/2.json

Headers

Content-Type: application/json
Authorization: Basic ZGlnaXRhbC1nb29kczpjNTFjOTA3MDdhMTNjZTNmZmYyMTNhZmJiNWNkMTI3
MA==

Body

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

Response

Status

200

Headers

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

Body

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

Collection

Create collection

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
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][original_url] image url
collection[field_values_attributes] collection field values attributes

Request

Route

POST /admin/collections.json

Headers

Content-Type: application/json
Authorization: Basic ZGlnaXRhbC1nb29kczpjNTFjOTA3MDdhMTNjZTNmZmYyMTNhZmJiNWNkMTI3
MA==

Body

{
  "collection": {
    "title": "T-shirts",
    "parent_id": 1,
    "position": 1,
    "sort_type": 1,
    "description": "text",
    "image_attributes": {
      "original_url": "https://assets3.insales.ru/assets/1/161/647329/v_1467875760/build/slide4.jpg"
    },
    "field_values_attributes": [
      {
        "handle": "handle",
        "value": 12345
      }
    ]
  }
}

Response

Status

201

Headers

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

Body

{
  "created_at": "2017-01-01T03:00:00+03:00",
  "id": 178,
  "is_hidden": false,
  "parent_id": 1,
  "position": 1,
  "recursive": null,
  "sort_type": 1,
  "updated_at": "2017-01-01T03:00:00+03:00",
  "title": "T-shirts",
  "description": "text",
  "html_title": null,
  "meta_description": null,
  "meta_keywords": null,
  "permalink": "t-shirts",
  "url": "/collection/t-shirts",
  "seo_description": null,
  "image": {
    "created_at": "2017-01-01T03:00:00+03:00",
    "id": 2,
    "original_url": "/images/no_image_original.jpg"
  }
}

Destroy collection

Request

Route

DELETE /admin/collections/6.json

Headers

Content-Type: application/json
Authorization: Basic ZGlnaXRhbC1nb29kczpjNTFjOTA3MDdhMTNjZTNmZmYyMTNhZmJiNWNkMTI3
MA==

Response

Status

200

Headers

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

Body

{
  "status": "ok"
}

Get collection

Request

Route

GET /admin/collections/6.json

Headers

Authorization: Basic ZGlnaXRhbC1nb29kczpjNTFjOTA3MDdhMTNjZTNmZmYyMTNhZmJiNWNkMTI3
MA==

Response

Status

200

Headers

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

Body

{
  "created_at": "2017-05-17T12:59:22+03:00",
  "id": 6,
  "is_hidden": false,
  "parent_id": 1,
  "position": 0,
  "recursive": null,
  "sort_type": 7,
  "updated_at": "2017-08-25T12:59:22+03:00",
  "title": "all",
  "description": null,
  "html_title": null,
  "meta_description": null,
  "meta_keywords": null,
  "permalink": "all",
  "url": "/collection/all",
  "seo_description": null
}

Get collections

Parameters

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

Request

Route

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

Headers

Authorization: Basic ZGlnaXRhbC1nb29kczpjNTFjOTA3MDdhMTNjZTNmZmYyMTNhZmJiNWNkMTI3
MA==

Query Parameters

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

Response

Status

200

Headers

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

Body

[
  {
    "created_at": "2017-05-17T12:59:22+03:00",
    "id": 1,
    "is_hidden": false,
    "parent_id": null,
    "position": -1,
    "recursive": null,
    "sort_type": 7,
    "updated_at": "2017-08-25T12:59:22+03:00",
    "title": "T-shirts",
    "description": null,
    "html_title": null,
    "meta_description": null,
    "meta_keywords": null,
    "permalink": "футболка",
    "url": "/collection/футболка",
    "seo_description": null
  },
  {
    "created_at": "2017-05-17T12:59:22+03:00",
    "id": 2,
    "is_hidden": false,
    "parent_id": 1,
    "position": 1,
    "recursive": null,
    "sort_type": 7,
    "updated_at": "2017-08-25T12:59:22+03:00",
    "title": "Shirts",
    "description": null,
    "html_title": null,
    "meta_description": null,
    "meta_keywords": null,
    "permalink": "shirts",
    "url": "/collection/shirts",
    "seo_description": null
  },
  {
    "created_at": "2017-05-17T12:59:22+03:00",
    "id": 3,
    "is_hidden": false,
    "parent_id": 1,
    "position": 2,
    "recursive": null,
    "sort_type": 7,
    "updated_at": "2017-08-25T12:59:22+03:00",
    "title": "Trousers",
    "description": null,
    "html_title": null,
    "meta_description": null,
    "meta_keywords": null,
    "permalink": "trousers",
    "url": "/collection/trousers",
    "seo_description": null
  },
  {
    "created_at": "2017-05-17T12:59:22+03:00",
    "id": 4,
    "is_hidden": false,
    "parent_id": 1,
    "position": 3,
    "recursive": null,
    "sort_type": 7,
    "updated_at": "2017-08-25T12:59:22+03:00",
    "title": "Stylish",
    "description": null,
    "html_title": null,
    "meta_description": null,
    "meta_keywords": null,
    "permalink": "stylish",
    "url": "/collection/stylish",
    "seo_description": null
  },
  {
    "created_at": "2017-05-17T12:59:22+03:00",
    "id": 5,
    "is_hidden": false,
    "parent_id": 1,
    "position": 4,
    "recursive": null,
    "sort_type": 7,
    "updated_at": "2017-08-25T12:59:22+03:00",
    "title": "Sport",
    "description": null,
    "html_title": null,
    "meta_description": null,
    "meta_keywords": null,
    "permalink": "sport",
    "url": "/collection/sport",
    "seo_description": null
  },
  {
    "created_at": "2017-05-17T12:59:22+03:00",
    "id": 6,
    "is_hidden": false,
    "parent_id": 1,
    "position": 0,
    "recursive": null,
    "sort_type": 7,
    "updated_at": "2017-08-25T12:59:22+03:00",
    "title": "all",
    "description": null,
    "html_title": null,
    "meta_description": null,
    "meta_keywords": null,
    "permalink": "all",
    "url": "/collection/all",
    "seo_description": null
  },
  {
    "created_at": "2017-05-17T12:59:22+03:00",
    "id": 8,
    "is_hidden": false,
    "parent_id": 1,
    "position": 4,
    "recursive": null,
    "sort_type": 7,
    "updated_at": "2017-08-25T12:59:22+03:00",
    "title": "sort test",
    "description": null,
    "html_title": null,
    "meta_description": null,
    "meta_keywords": null,
    "permalink": "sort test",
    "url": "/collection/sort test",
    "seo_description": null
  }
]

Update collection

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
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 ZGlnaXRhbC1nb29kczpjNTFjOTA3MDdhMTNjZTNmZmYyMTNhZmJiNWNkMTI3
MA==

Body

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

Response

Status

200

Headers

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

Body

{
  "created_at": "2017-05-17T12:59:22+03:00",
  "id": 6,
  "is_hidden": true,
  "parent_id": 1,
  "position": 2,
  "recursive": null,
  "sort_type": 11,
  "updated_at": "2017-01-01T03:00:00+03:00",
  "title": "Books",
  "description": "Description",
  "html_title": null,
  "meta_description": null,
  "meta_keywords": null,
  "permalink": "books",
  "url": "/collection/books",
  "seo_description": null
}

CollectionField

Create collection_field

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 ZGlnaXRhbC1nb29kczpjNTFjOTA3MDdhMTNjZTNmZmYyMTNhZmJiNWNkMTI3
MA==

Body

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

Response

Status

201

Headers

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

Body

{
  "application_id": 1,
  "handle": "size",
  "id": 5,
  "is_hidden": null,
  "position": 3,
  "type": "CollectionField::TextArea",
  "title": "Size"
}

Destroy collection_field by handle

Request

Route

DELETE /admin/collection_fields/handle2.json

Headers

Content-Type: application/json
Authorization: Basic ZGlnaXRhbC1nb29kczpjNTFjOTA3MDdhMTNjZTNmZmYyMTNhZmJiNWNkMTI3
MA==

Response

Status

200

Headers

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

Body

{
  "status": "ok"
}

Destroy collection_field

Request

Route

DELETE /admin/collection_fields/2.json

Headers

Content-Type: application/json
Authorization: Basic ZGlnaXRhbC1nb29kczpjNTFjOTA3MDdhMTNjZTNmZmYyMTNhZmJiNWNkMTI3
MA==

Response

Status

200

Headers

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

Body

{
  "status": "ok"
}

Get collection_field by handle

Request

Route

GET /admin/collection_fields/handle2.json

Headers

Authorization: Basic ZGlnaXRhbC1nb29kczpjNTFjOTA3MDdhMTNjZTNmZmYyMTNhZmJiNWNkMTI3
MA==

Response

Status

200

Headers

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

Body

{
  "application_id": 1,
  "handle": "handle2",
  "id": 2,
  "is_hidden": null,
  "position": 2,
  "type": "CollectionField::TextArea",
  "title": "title2"
}

Get collection_field

Request

Route

GET /admin/collection_fields/2.json

Headers

Authorization: Basic ZGlnaXRhbC1nb29kczpjNTFjOTA3MDdhMTNjZTNmZmYyMTNhZmJiNWNkMTI3
MA==

Response

Status

200

Headers

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

Body

{
  "application_id": 1,
  "handle": "handle2",
  "id": 2,
  "is_hidden": null,
  "position": 2,
  "type": "CollectionField::TextArea",
  "title": "title2"
}

Get collection_fields

Request

Route

GET /admin/collection_fields.json

Headers

Authorization: Basic ZGlnaXRhbC1nb29kczpjNTFjOTA3MDdhMTNjZTNmZmYyMTNhZmJiNWNkMTI3
MA==

Response

Status

200

Headers

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

Body

[
  {
    "application_id": null,
    "handle": "handle",
    "id": 1,
    "is_hidden": null,
    "position": 1,
    "type": "CollectionField::TextField",
    "title": "title"
  },
  {
    "application_id": 1,
    "handle": "handle2",
    "id": 2,
    "is_hidden": null,
    "position": 2,
    "type": "CollectionField::TextArea",
    "title": "title2"
  }
]

Update collection_field by handle

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 ZGlnaXRhbC1nb29kczpjNTFjOTA3MDdhMTNjZTNmZmYyMTNhZmJiNWNkMTI3
MA==

Body

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

Response

Status

200

Headers

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

Body

{
  "status": "ok"
}

Update collection_field

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 ZGlnaXRhbC1nb29kczpjNTFjOTA3MDdhMTNjZTNmZmYyMTNhZmJiNWNkMTI3
MA==

Body

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

Response

Status

200

Headers

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

Body

{
  "status": "ok"
}

CollectionFieldValue

Get collection field value by handle

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 ZGlnaXRhbC1nb29kczpjNTFjOTA3MDdhMTNjZTNmZmYyMTNhZmJiNWNkMTI3
MA==

Response

Status

200

Headers

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

Body

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

Get collection field value

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 ZGlnaXRhbC1nb29kczpjNTFjOTA3MDdhMTNjZTNmZmYyMTNhZmJiNWNkMTI3
MA==

Response

Status

200

Headers

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

Body

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

Get collection fields values

Parameters

Name Description
collection_id collection id

Request

Route

GET /admin/collections/1/collection_field_values.json

Headers

Authorization: Basic ZGlnaXRhbC1nb29kczpjNTFjOTA3MDdhMTNjZTNmZmYyMTNhZmJiNWNkMTI3
MA==

Response

Status

200

Headers

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

Body

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

Update collection field value by handle

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 ZGlnaXRhbC1nb29kczpjNTFjOTA3MDdhMTNjZTNmZmYyMTNhZmJiNWNkMTI3
MA==

Body

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

Response

Status

200

Headers

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

Body

{
  "status": "ok"
}

Update collection field value

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 ZGlnaXRhbC1nb29kczpjNTFjOTA3MDdhMTNjZTNmZmYyMTNhZmJiNWNkMTI3
MA==

Body

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

Response

Status

200

Headers

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

Body

{
  "status": "ok"
}

CollectionFilter

Create collection filter

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 ZGlnaXRhbC1nb29kczpjNTFjOTA3MDdhMTNjZTNmZmYyMTNhZmJiNWNkMTI3
MA==

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

Status

201

Headers

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

Body

{
  "id": 3,
  "collection_id": 1,
  "description": null,
  "title": "new filter",
  "permalink": "new-filter",
  "html_title": null,
  "meta_keywords": null,
  "meta_description": null,
  "characteristis": [
    {
      "id": 898582778,
      "property_id": 12,
      "position": 1,
      "title": "first prop value",
      "permalink": "first-prop-value"
    },
    {
      "id": 898582779,
      "property_id": 13,
      "position": 1,
      "title": "second property value",
      "permalink": "second-property-value"
    }
  ],
  "option_values": [
    {
      "id": 175,
      "option_name_id": 20,
      "position": 1,
      "title": "first option value"
    },
    {
      "id": 176,
      "option_name_id": 21,
      "position": 1,
      "title": "second option value"
    }
  ]
}

Delete collection filter

Parameters

Name Description
filter[id] required filter id

Request

Route

DELETE /admin/collection_filters/1.json

Headers

Authorization: Basic ZGlnaXRhbC1nb29kczpjNTFjOTA3MDdhMTNjZTNmZmYyMTNhZmJiNWNkMTI3
MA==

Content-Type: application/x-www-form-urlencoded

Response

Status

200

Headers

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

Body

 

Get collection filter

Parameters

Name Description
filter_id filter id

Request

Route

GET /admin/collection_filters/1.json

Headers

Authorization: Basic ZGlnaXRhbC1nb29kczpjNTFjOTA3MDdhMTNjZTNmZmYyMTNhZmJiNWNkMTI3
MA==

Response

Status

200

Headers

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

Body

{
  "id": 1,
  "collection_id": 1,
  "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

Parameters

Name Description
collection_id collection id

Request

Route

GET /admin/collection_filters.json?collection_id=1

Headers

Authorization: Basic ZGlnaXRhbC1nb29kczpjNTFjOTA3MDdhMTNjZTNmZmYyMTNhZmJiNWNkMTI3
MA==

Query Parameters

collection_id=1

Response

Status

200

Headers

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

Body

[
  {
    "id": 1,
    "collection_id": 1,
    "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": [

    ]
  }
]

Update collection filter

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 ZGlnaXRhbC1nb29kczpjNTFjOTA3MDdhMTNjZTNmZmYyMTNhZmJiNWNkMTI3
MA==

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

Status

200

Headers

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

Body

{
  "id": 1,
  "collection_id": 1,
  "description": null,
  "title": "new-seo-filter",
  "permalink": "new-seo-filter",
  "html_title": null,
  "meta_keywords": null,
  "meta_description": null,
  "characteristis": [
    {
      "id": 898582782,
      "property_id": 16,
      "position": 1,
      "title": "first prop value",
      "permalink": "first-prop-value"
    },
    {
      "id": 898582783,
      "property_id": 17,
      "position": 1,
      "title": "second property value",
      "permalink": "second-property-value"
    }
  ],
  "option_values": [
    {
      "id": 179,
      "option_name_id": 24,
      "position": 1,
      "title": "first option value"
    },
    {
      "id": 180,
      "option_name_id": 25,
      "position": 1,
      "title": "second option value"
    }
  ]
}

CustomStatus

Create custom status

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 ZGlnaXRhbC1nb29kczpjNTFjOTA3MDdhMTNjZTNmZmYyMTNhZmJiNWNkMTI3
MA==

Body

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

Response

Status

201

Headers

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

Body

{
  "color": "#DC5F59",
  "created_at": "2017-01-01T03:00:00+03:00",
  "id": 6,
  "is_default": false,
  "permalink": "new-ordered-by-phone",
  "position": 2,
  "system_status": "new",
  "updated_at": "2017-01-01T03:00:00+03:00",
  "title": "New (ordered by phone)"
}

Destroy custom status

Request

Route

DELETE /admin/custom_statuses/novyy.json

Headers

Content-Type: application/json
Authorization: Basic ZGlnaXRhbC1nb29kczpjNTFjOTA3MDdhMTNjZTNmZmYyMTNhZmJiNWNkMTI3
MA==

Response

Status

200

Headers

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

Body

{
  "status": "ok"
}

Get custom status

Request

Route

GET /admin/custom_statuses/novyy.json

Headers

Authorization: Basic ZGlnaXRhbC1nb29kczpjNTFjOTA3MDdhMTNjZTNmZmYyMTNhZmJiNWNkMTI3
MA==

Response

Status

200

Headers

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

Body

{
  "color": "#DC5F59",
  "created_at": "2017-01-01T03:00:00+03:00",
  "id": 2,
  "is_default": true,
  "permalink": "novyy",
  "position": 1,
  "system_status": "new",
  "updated_at": "2017-01-01T03:00:00+03:00",
  "title": "Новый"
}

Get custom statuses

Request

Route

GET /admin/custom_statuses.json

Headers

Authorization: Basic ZGlnaXRhbC1nb29kczpjNTFjOTA3MDdhMTNjZTNmZmYyMTNhZmJiNWNkMTI3
MA==

Response

Status

200

Headers

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

Body

[

]

Update custom status

Parameters

Name Description
custom_status[title] discount

Request

Route

PUT /admin/custom_statuses/novyy.json

Headers

Content-Type: application/json
Authorization: Basic ZGlnaXRhbC1nb29kczpjNTFjOTA3MDdhMTNjZTNmZmYyMTNhZmJiNWNkMTI3
MA==

Body

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

Response

Status

200

Headers

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

Body

{
  "status": "ok"
}

DeliveryVariant

Create delivery_variant External

DeliveryVariant::External is an external delivery variant.

Parameters

Name Description
delivery_variant[title] required title
delivery_variant[type] required DeliveryVariant::External, DeliveryVariant::Fixed, DeliveryVariant::LocationDepend, DeliveryVariant::None, DeliveryVariant::NovaPoshta, DeliveryVariant::OfficialFirstClass, DeliveryVariant::OfficialRussianpost, 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[url] url for sending request on delivery price estimation
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 ZGlnaXRhbC1nb29kczpjNTFjOTA3MDdhMTNjZTNmZmYyMTNhZmJiNWNkMTI3
MA==

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

Status

201

Headers

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

Body

{
  "charge_up_to": "1000.0",
  "created_at": "2017-01-01T03:00:00+03:00",
  "id": 21,
  "inverted": false,
  "position": 1,
  "updated_at": "2017-01-01T03:00:00+03:00",
  "title": "express delivery",
  "description": "text",
  "type": "DeliveryVariant::External",
  "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": [
    {
      "created_at": "2017-01-01T03:00:00+03:00",
      "id": 9,
      "payment_gateway_id": 1
    },
    {
      "created_at": "2017-01-01T03:00:00+03:00",
      "id": 10,
      "payment_gateway_id": 3
    }
  ],
  "delivery_locations": [
    {
      "city": "B",
      "country": "RU",
      "id": 4,
      "region": "A"
    }
  ]
}

Create delivery_variant Fixed

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

Parameters

Name Description
delivery_variant[title] required title
delivery_variant[type] required DeliveryVariant::External, DeliveryVariant::Fixed, DeliveryVariant::LocationDepend, DeliveryVariant::None, DeliveryVariant::NovaPoshta, DeliveryVariant::OfficialFirstClass, DeliveryVariant::OfficialRussianpost, 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

Request

Route

POST /admin/delivery_variants.json

Headers

Content-Type: application/json
Authorization: Basic ZGlnaXRhbC1nb29kczpjNTFjOTA3MDdhMTNjZTNmZmYyMTNhZmJiNWNkMTI3
MA==

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

Response

Status

201

Headers

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

Body

{
  "charge_up_to": "1000.0",
  "created_at": "2017-01-01T03:00:00+03:00",
  "id": 19,
  "inverted": false,
  "position": 1,
  "updated_at": "2017-01-01T03:00:00+03:00",
  "title": "express delivery",
  "description": "text",
  "type": "DeliveryVariant::Fixed",
  "price": 300.0,
  "javascript": null,
  "payment_delivery_variants": [
    {
      "created_at": "2017-01-01T03:00:00+03:00",
      "id": 5,
      "payment_gateway_id": 1
    },
    {
      "created_at": "2017-01-01T03:00:00+03:00",
      "id": 6,
      "payment_gateway_id": 3
    }
  ],
  "delivery_locations": [
    {
      "city": "B",
      "country": "RU",
      "id": 2,
      "region": "A"
    }
  ]
}

Create delivery_variant LocationDepend

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

Parameters

Name Description
delivery_variant[title] required title
delivery_variant[type] required DeliveryVariant::External, DeliveryVariant::Fixed, DeliveryVariant::LocationDepend, DeliveryVariant::None, DeliveryVariant::NovaPoshta, DeliveryVariant::OfficialFirstClass, DeliveryVariant::OfficialRussianpost, 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 ZGlnaXRhbC1nb29kczpjNTFjOTA3MDdhMTNjZTNmZmYyMTNhZmJiNWNkMTI3
MA==

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

Status

201

Headers

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

Body

{
  "charge_up_to": "1000.0",
  "created_at": "2017-01-01T03:00:00+03:00",
  "id": 23,
  "inverted": true,
  "position": 1,
  "updated_at": "2017-01-01T03:00:00+03:00",
  "title": "express delivery",
  "description": "text",
  "type": "DeliveryVariant::LocationDepend",
  "payment_delivery_variants": [
    {
      "created_at": "2017-01-01T03:00:00+03:00",
      "id": 13,
      "payment_gateway_id": 1
    },
    {
      "created_at": "2017-01-01T03:00:00+03:00",
      "id": 14,
      "payment_gateway_id": 3
    }
  ],
  "delivery_locations": [
    {
      "city": "B",
      "country": "RU",
      "id": 7,
      "region": "A"
    }
  ],
  "delivery_zones": [
    {
      "id": 2,
      "title": "test",
      "tariffs": [
        {
          "id": 2,
          "max_weight": "30.0",
          "price": "100.0",
          "step": "2.0",
          "step_price": "50.0"
        }
      ],
      "locations": [
        {
          "city": "D",
          "country": "A",
          "id": 8,
          "region": "C"
        }
      ]
    }
  ]
}

Create delivery_variant PriceDepend

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

Parameters

Name Description
delivery_variant[title] required title
delivery_variant[type] required DeliveryVariant::External, DeliveryVariant::Fixed, DeliveryVariant::LocationDepend, DeliveryVariant::None, DeliveryVariant::NovaPoshta, DeliveryVariant::OfficialFirstClass, DeliveryVariant::OfficialRussianpost, 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 ZGlnaXRhbC1nb29kczpjNTFjOTA3MDdhMTNjZTNmZmYyMTNhZmJiNWNkMTI3
MA==

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

Status

201

Headers

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

Body

{
  "charge_up_to": "1000.0",
  "created_at": "2017-01-01T03:00:00+03:00",
  "id": 25,
  "inverted": false,
  "position": 1,
  "updated_at": "2017-01-01T03:00:00+03:00",
  "title": "express delivery",
  "description": "text",
  "type": "DeliveryVariant::PriceDepend",
  "min_price": 300.0,
  "payment_delivery_variants": [
    {
      "created_at": "2017-01-01T03:00:00+03:00",
      "id": 17,
      "payment_gateway_id": 1
    },
    {
      "created_at": "2017-01-01T03:00:00+03:00",
      "id": 18,
      "payment_gateway_id": 3
    }
  ],
  "delivery_locations": [
    {
      "city": "B",
      "country": "RU",
      "id": 10,
      "region": "A"
    }
  ],
  "rules": [
    {
      "id": 10,
      "order_price": 10.0,
      "price": 300.0,
      "order_weight": 1.0
    }
  ]
}

Destroy delivery_variant

Request

Route

DELETE /admin/delivery_variants/2.json

Headers

Content-Type: application/json
Authorization: Basic ZGlnaXRhbC1nb29kczpjNTFjOTA3MDdhMTNjZTNmZmYyMTNhZmJiNWNkMTI3
MA==

Response

Status

200

Headers

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

Body

{
  "status": "ok"
}

Get delivery_variant

Request

Route

GET /admin/delivery_variants/2.json

Headers

Authorization: Basic ZGlnaXRhbC1nb29kczpjNTFjOTA3MDdhMTNjZTNmZmYyMTNhZmJiNWNkMTI3
MA==

Response

Status

200

Headers

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

Body

{
  "charge_up_to": null,
  "created_at": "2009-03-30T04:37:32+04:00",
  "id": 2,
  "inverted": false,
  "position": 2,
  "updated_at": "2009-03-31T12:20:34+04:00",
  "title": "курьер",
  "description": "",
  "type": "DeliveryVariant::PriceDepend",
  "min_price": 200.0,
  "payment_delivery_variants": [
    {
      "created_at": "2017-08-25T12:59:22+03:00",
      "id": 2,
      "payment_gateway_id": 1
    }
  ],
  "delivery_locations": [

  ],
  "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

Request

Route

GET /admin/delivery_variants.json

Headers

Authorization: Basic ZGlnaXRhbC1nb29kczpjNTFjOTA3MDdhMTNjZTNmZmYyMTNhZmJiNWNkMTI3
MA==

Response

Status

200

Headers

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

Body

[
  {
    "charge_up_to": null,
    "created_at": "2009-03-30T04:37:32+04:00",
    "id": 1,
    "inverted": false,
    "position": 1,
    "updated_at": "2009-03-31T12:20:34+04:00",
    "title": "самовывоз",
    "description": "самовывоз из офиса",
    "type": "DeliveryVariant::Fixed",
    "price": 100.0,
    "javascript": null,
    "payment_delivery_variants": [
      {
        "created_at": "2017-08-25T12:59:22+03:00",
        "id": 1,
        "payment_gateway_id": 1
      }
    ],
    "delivery_locations": [

    ]
  },
  {
    "charge_up_to": null,
    "created_at": "2009-03-30T04:37:32+04:00",
    "id": 2,
    "inverted": false,
    "position": 2,
    "updated_at": "2009-03-31T12:20:34+04:00",
    "title": "курьер",
    "description": "",
    "type": "DeliveryVariant::PriceDepend",
    "min_price": 200.0,
    "payment_delivery_variants": [
      {
        "created_at": "2017-08-25T12:59:22+03:00",
        "id": 2,
        "payment_gateway_id": 1
      }
    ],
    "delivery_locations": [

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

Update delivery variant

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[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 ZGlnaXRhbC1nb29kczpjNTFjOTA3MDdhMTNjZTNmZmYyMTNhZmJiNWNkMTI3
MA==

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

Response

Status

200

Headers

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

Body

{
  "charge_up_to": "2500.0",
  "created_at": "2009-03-30T04:37:32+04:00",
  "id": 2,
  "inverted": false,
  "position": 1,
  "updated_at": "2017-01-01T03:00:00+03:00",
  "title": "new title",
  "description": "new description",
  "type": "DeliveryVariant::PriceDepend",
  "min_price": 200.0,
  "payment_delivery_variants": [
    {
      "created_at": "2017-01-01T03:00:00+03:00",
      "id": 20,
      "payment_gateway_id": 3
    }
  ],
  "delivery_locations": [

  ],
  "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

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 ZGlnaXRhbC1nb29kczpjNTFjOTA3MDdhMTNjZTNmZmYyMTNhZmJiNWNkMTI3
MA==

Body

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

Response

Status

201

Headers

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

Body

{
  "id": 174,
  "code": "BIRTHDAY",
  "type_id": 1,
  "worked": false,
  "discount": "10.0",
  "description": "Birthday discount",
  "disabled": true,
  "act_once": true,
  "act_once_for_client": true,
  "min_price": "500.0",
  "created_at": "2017-01-01T03:00:00+03:00",
  "updated_at": "2017-01-01T03:00:00+03:00",
  "expired_at": "2017-01-08",
  "discount_collections": [

  ]
}

Destroy discount code

Request

Route

DELETE /admin/discount_codes/1.json

Headers

Content-Type: application/json
Authorization: Basic ZGlnaXRhbC1nb29kczpjNTFjOTA3MDdhMTNjZTNmZmYyMTNhZmJiNWNkMTI3
MA==

Response

Status

200

Headers

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

Body

{
  "status": "ok"
}

Get discount code

Request

Route

GET /admin/discount_codes/1.json

Headers

Authorization: Basic ZGlnaXRhbC1nb29kczpjNTFjOTA3MDdhMTNjZTNmZmYyMTNhZmJiNWNkMTI3
MA==

Response

Status

200

Headers

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

Body

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

  ]
}

Get discount codes

Request

Route

GET /admin/discount_codes.json

Headers

Authorization: Basic ZGlnaXRhbC1nb29kczpjNTFjOTA3MDdhMTNjZTNmZmYyMTNhZmJiNWNkMTI3
MA==

Response

Status

200

Headers

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

Body

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

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

    ]
  }
]

Update discount code

Parameters

Name Description
discount_code[discount] discount

Request

Route

PUT /admin/discount_codes/1.json

Headers

Content-Type: application/json
Authorization: Basic ZGlnaXRhbC1nb29kczpjNTFjOTA3MDdhMTNjZTNmZmYyMTNhZmJiNWNkMTI3
MA==

Body

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

Response

Status

200

Headers

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

Body

{
  "status": "ok"
}

Domain

Create domain

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 ZGlnaXRhbC1nb29kczpjNTFjOTA3MDdhMTNjZTNmZmYyMTNhZmJiNWNkMTI3
MA==

Body

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

Response

Status

201

Headers

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

Body

{
  "created_at": "2017-01-01T03:00:00+03:00",
  "domain": "another-domain.ru",
  "id": 8,
  "main": true,
  "updated_at": "2017-01-01T03:00:00+03:00"
}

Destroy domain

Request

Route

DELETE /admin/domains/12.json

Headers

Content-Type: application/json
Authorization: Basic ZGlnaXRhbC1nb29kczpjNTFjOTA3MDdhMTNjZTNmZmYyMTNhZmJiNWNkMTI3
MA==

Response

Status

200

Headers

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

Body

 

Get domain

Request

Route

GET /admin/domains/4.json

Headers

Authorization: Basic ZGlnaXRhbC1nb29kczpjNTFjOTA3MDdhMTNjZTNmZmYyMTNhZmJiNWNkMTI3
MA==

Response

Status

200

Headers

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

Body

{
  "created_at": "2017-01-01T03:00:00+03:00",
  "domain": "some-domain.ru",
  "id": 4,
  "main": true,
  "updated_at": "2017-01-01T03:00:00+03:00"
}

Get domains

Request

Route

GET /admin/domains.json

Headers

Authorization: Basic ZGlnaXRhbC1nb29kczpjNTFjOTA3MDdhMTNjZTNmZmYyMTNhZmJiNWNkMTI3
MA==

Response

Status

200

Headers

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

Body

[
  {
    "created_at": "2017-01-01T03:00:00+03:00",
    "domain": "some-domain.ru",
    "id": 2,
    "main": true,
    "updated_at": "2017-01-01T03:00:00+03:00"
  }
]

Update domain

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/10.json

Headers

Content-Type: application/json
Authorization: Basic ZGlnaXRhbC1nb29kczpjNTFjOTA3MDdhMTNjZTNmZmYyMTNhZmJiNWNkMTI3
MA==

Body

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

Response

Status

200

Headers

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

Body

{
  "created_at": "2017-01-01T03:00:00+03:00",
  "domain": "other-domain.ru",
  "id": 10,
  "main": true,
  "updated_at": "2017-01-01T03:00:00+03:00"
}

Field

Create field

Parameters

Name Description
field[type] required Field::TextField, Field::TextArea, Field::Select, Field::Checkbox, Field::FileField (only for Order), Field::Delivery, Field::PickPoint
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
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[system_name] name for system field
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

Request

Route

POST /admin/fields.json

Headers

Content-Type: application/json
Authorization: Basic ZGlnaXRhbC1nb29kczpjNTFjOTA3MDdhMTNjZTNmZmYyMTNhZmJiNWNkMTI3
MA==

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,
    "system_name": "text_field_test",
    "show_in_result": false,
    "show_in_checkout": false
  }
}

Response

Status

201

Headers

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

Body

{
  "active": false,
  "created_at": "2017-01-01T03:00:00+03:00",
  "destiny": 1,
  "for_buyer": false,
  "handle": "my_awesome_field_1",
  "id": 172,
  "obligatory": false,
  "office_title": "title_for_text_field",
  "position": 5,
  "show_in_checkout": false,
  "show_in_result": false,
  "system_name": "text_field_test",
  "updated_at": "2017-01-01T03:00:00+03:00",
  "title": "title_for_text_field",
  "example": null,
  "type": "Field::TextField"
}

Destroy field

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

Request

Route

DELETE /admin/fields/23.json

Headers

Content-Type: application/json
Authorization: Basic ZGlnaXRhbC1nb29kczpjNTFjOTA3MDdhMTNjZTNmZmYyMTNhZmJiNWNkMTI3
MA==

Response

Status

200

Headers

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

Body

{
  "status": "ok"
}

Get field

Request

Route

GET /admin/fields/23.json

Headers

Authorization: Basic ZGlnaXRhbC1nb29kczpjNTFjOTA3MDdhMTNjZTNmZmYyMTNhZmJiNWNkMTI3
MA==

Response

Status

200

Headers

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

Body

{
  "active": false,
  "created_at": "2010-10-12T13:31:09+04:00",
  "destiny": 2,
  "for_buyer": true,
  "handle": null,
  "id": 23,
  "obligatory": false,
  "office_title": "Селект",
  "position": 6,
  "show_in_checkout": true,
  "show_in_result": true,
  "system_name": null,
  "updated_at": "2010-10-12T13:31:09+04:00",
  "title": "Селект",
  "example": null,
  "type": "Field::Select"
}

Get fields

Request

Route

GET /admin/fields.json

Headers

Authorization: Basic ZGlnaXRhbC1nb29kczpjNTFjOTA3MDdhMTNjZTNmZmYyMTNhZmJiNWNkMTI3
MA==

Response

Status

200

Headers

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

Body

[
  {
    "active": false,
    "created_at": "2010-10-12T13:31:09+04:00",
    "destiny": 1,
    "for_buyer": true,
    "handle": null,
    "id": 1,
    "obligatory": false,
    "office_title": "Страна",
    "position": 0,
    "show_in_checkout": true,
    "show_in_result": true,
    "system_name": "country",
    "updated_at": "2010-10-12T13:31:09+04:00",
    "title": null,
    "example": null,
    "type": "Field::Country"
  },
  {
    "active": true,
    "created_at": "2010-10-12T13:31:09+04:00",
    "destiny": 2,
    "for_buyer": true,
    "handle": null,
    "id": 11,
    "obligatory": true,
    "office_title": "Имя",
    "position": 1,
    "show_in_checkout": true,
    "show_in_result": true,
    "system_name": "name",
    "updated_at": "2010-10-12T13:31:09+04:00",
    "title": null,
    "example": null,
    "type": "Field::ObligatoryTextField"
  },
  {
    "active": false,
    "created_at": "2010-10-12T13:31:09+04:00",
    "destiny": 1,
    "for_buyer": true,
    "handle": null,
    "id": 2,
    "obligatory": false,
    "office_title": "Регион",
    "position": 1,
    "show_in_checkout": true,
    "show_in_result": true,
    "system_name": "state",
    "updated_at": "2010-10-12T13:31:09+04:00",
    "title": null,
    "example": null,
    "type": "Field::SystemTextField"
  },
  {
    "active": true,
    "created_at": "2010-10-12T13:31:09+04:00",
    "destiny": 2,
    "for_buyer": true,
    "handle": null,
    "id": 12,
    "obligatory": true,
    "office_title": "Телефон",
    "position": 2,
    "show_in_checkout": true,
    "show_in_result": true,
    "system_name": "phone",
    "updated_at": "2010-10-12T13:31:09+04:00",
    "title": null,
    "example": null,
    "type": "Field::Phone"
  },
  {
    "active": false,
    "created_at": "2010-10-12T13:31:09+04:00",
    "destiny": 1,
    "for_buyer": true,
    "handle": null,
    "id": 3,
    "obligatory": false,
    "office_title": "Город",
    "position": 2,
    "show_in_checkout": true,
    "show_in_result": true,
    "system_name": "city",
    "updated_at": "2010-10-12T13:31:09+04:00",
    "title": null,
    "example": null,
    "type": "Field::SystemTextField"
  },
  {
    "active": true,
    "created_at": "2010-10-12T13:31:09+04:00",
    "destiny": 2,
    "for_buyer": true,
    "handle": null,
    "id": 13,
    "obligatory": true,
    "office_title": "E-mail",
    "position": 3,
    "show_in_checkout": true,
    "show_in_result": true,
    "system_name": "email",
    "updated_at": "2010-10-12T13:31:09+04:00",
    "title": null,
    "example": null,
    "type": "Field::SystemTextField"
  },
  {
    "active": true,
    "created_at": "2010-10-12T13:31:09+04:00",
    "destiny": 1,
    "for_buyer": true,
    "handle": null,
    "id": 4,
    "obligatory": true,
    "office_title": "Адрес",
    "position": 3,
    "show_in_checkout": true,
    "show_in_result": true,
    "system_name": "address",
    "updated_at": "2010-10-12T13:31:09+04:00",
    "title": null,
    "example": null,
    "type": "Field::SystemTextArea"
  },
  {
    "active": false,
    "created_at": "2010-10-12T13:31:09+04:00",
    "destiny": 2,
    "for_buyer": true,
    "handle": null,
    "id": 21,
    "obligatory": false,
    "office_title": "Фамилия",
    "position": 4,
    "show_in_checkout": true,
    "show_in_result": true,
    "system_name": "surname",
    "updated_at": "2010-10-12T13:31:09+04:00",
    "title": null,
    "example": null,
    "type": "Field::SystemTextField"
  },
  {
    "active": false,
    "created_at": "2010-10-12T13:31:09+04:00",
    "destiny": 1,
    "for_buyer": true,
    "handle": null,
    "id": 5,
    "obligatory": false,
    "office_title": "Почтовый индекс",
    "position": 4,
    "show_in_checkout": true,
    "show_in_result": true,
    "system_name": "zip",
    "updated_at": "2010-10-12T13:31:09+04:00",
    "title": null,
    "example": null,
    "type": "Field::SystemTextField"
  },
  {
    "active": false,
    "created_at": "2010-10-12T13:31:09+04:00",
    "destiny": 2,
    "for_buyer": true,
    "handle": null,
    "id": 14,
    "obligatory": true,
    "office_title": "Подтверждение e-mail",
    "position": 4,
    "show_in_checkout": true,
    "show_in_result": true,
    "system_name": "email_confirmation",
    "updated_at": "2010-10-12T13:31:09+04:00",
    "title": null,
    "example": null,
    "type": "Field::SystemTextField"
  },
  {
    "active": false,
    "created_at": "2010-10-12T13:31:09+04:00",
    "destiny": 2,
    "for_buyer": true,
    "handle": null,
    "id": 22,
    "obligatory": false,
    "office_title": "Отчество",
    "position": 5,
    "show_in_checkout": true,
    "show_in_result": true,
    "system_name": "middlename",
    "updated_at": "2010-10-12T13:31:09+04:00",
    "title": null,
    "example": null,
    "type": "Field::SystemTextField"
  },
  {
    "active": false,
    "created_at": "2010-10-12T13:31:09+04:00",
    "destiny": 2,
    "for_buyer": true,
    "handle": null,
    "id": 23,
    "obligatory": false,
    "office_title": "Селект",
    "position": 6,
    "show_in_checkout": true,
    "show_in_result": true,
    "system_name": null,
    "updated_at": "2010-10-12T13:31:09+04:00",
    "title": "Селект",
    "example": null,
    "type": "Field::Select"
  }
]

Update field

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[system_name] name for system field
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

Request

Route

PUT /admin/fields/23.json

Headers

Content-Type: application/json
Authorization: Basic ZGlnaXRhbC1nb29kczpjNTFjOTA3MDdhMTNjZTNmZmYyMTNhZmJiNWNkMTI3
MA==

Body

{
  "field": {
    "office_title": "state_code",
    "title": "State code",
    "active": true,
    "for_buyer": true,
    "obligatory": true,
    "system_name": "state_code",
    "show_in_result": true,
    "show_in_checkout": true,
    "position": 1
  }
}

Response

Status

200

Headers

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

Body

{
  "active": true,
  "created_at": "2010-10-12T13:31:09+04:00",
  "destiny": 2,
  "for_buyer": true,
  "handle": null,
  "id": 23,
  "obligatory": true,
  "office_title": "state_code",
  "position": 1,
  "show_in_checkout": true,
  "show_in_result": true,
  "system_name": "state_code",
  "updated_at": "2017-01-01T03:00:00+03:00",
  "title": "State code",
  "example": null,
  "type": "Field::Select"
}

File

Create file from attachment

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 ZGlnaXRhbC1nb29kczpjNTFjOTA3MDdhMTNjZTNmZmYyMTNhZmJiNWNkMTI3
MA==

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

Status

201

Headers

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

Body

{
  "id": 5,
  "absolute_url": "https://static-internal.insales.ru/files/1/5/5/original/some_file.?1483228800",
  "created_at": "2017-01-01T03:00:00+03:00"
}

Create file from url

Parameters

Name Description
file[src] required file url

Request

Route

POST /admin/files.json

Headers

Content-Type: application/json
Authorization: Basic ZGlnaXRhbC1nb29kczpjNTFjOTA3MDdhMTNjZTNmZmYyMTNhZmJiNWNkMTI3
MA==

Body

{
  "file": {
    "src": "https://assets3.insales.ru/assets/1/161/647329/v_1467875760/build/slide4.jpg"
  }
}

Response

Status

201

Headers

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

Body

{
  "id": 3,
  "absolute_url": "https://static-internal.insales.ru/files/1/3/3/original/slide4.jpg?1483228800",
  "created_at": "2017-01-01T03:00:00+03:00"
}

Destroy file

Request

Route

DELETE /admin/files/1.json

Headers

Content-Type: application/json
Authorization: Basic ZGlnaXRhbC1nb29kczpjNTFjOTA3MDdhMTNjZTNmZmYyMTNhZmJiNWNkMTI3
MA==

Response

Status

200

Headers

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

Body

{
  "status": "ok"
}

Get file

Request

Route

GET /admin/files/1.json

Headers

Authorization: Basic ZGlnaXRhbC1nb29kczpjNTFjOTA3MDdhMTNjZTNmZmYyMTNhZmJiNWNkMTI3
MA==

Response

Status

200

Headers

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

Body

{
  "id": 1,
  "absolute_url": "https://static-internal.insales.ru/files/1/original/thumb_prayerbeads.jpg",
  "created_at": "2009-03-18T07:53:15+03:00"
}

Get files

Request

Route

GET /admin/files.json

Headers

Authorization: Basic ZGlnaXRhbC1nb29kczpjNTFjOTA3MDdhMTNjZTNmZmYyMTNhZmJiNWNkMTI3
MA==

Response

Status

200

Headers

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

Body

[
  {
    "id": 1,
    "absolute_url": "https://static-internal.insales.ru/files/1/original/thumb_prayerbeads.jpg",
    "created_at": "2009-03-18T07:53:15+03:00"
  }
]

Image

Create image fpom 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 new timestamp.

Parameters

Name Description
image[src] required image url
image[filename] file name
image[title] title
image[position] position

Request

Route

POST /admin/products/1/images.json

Headers

Content-Type: application/json
Authorization: Basic ZGlnaXRhbC1nb29kczpjNTFjOTA3MDdhMTNjZTNmZmYyMTNhZmJiNWNkMTI3
MA==

Body

{
  "image": {
    "src": "https://assets3.insales.ru/assets/1/161/647329/v_1467875760/build/slide4.jpg"
  }
}

Response

Status

201

Headers

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

Body

{
  "created_at": "2017-01-01T03:00:00+03:00",
  "id": 4,
  "image_processing": true,
  "position": 1,
  "product_id": 1,
  "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": "slide4.jpg"
}

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.

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 ZGlnaXRhbC1nb29kczpjNTFjOTA3MDdhMTNjZTNmZmYyMTNhZmJiNWNkMTI3
MA==

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

Response

Status

201

Headers

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

Body

{
  "created_at": "2017-01-01T03:00:00+03:00",
  "id": 6,
  "image_processing": true,
  "position": 1,
  "product_id": 1,
  "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"
}

Destroy image

Request

Route

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

Headers

Content-Type: application/json
Authorization: Basic ZGlnaXRhbC1nb29kczpjNTFjOTA3MDdhMTNjZTNmZmYyMTNhZmJiNWNkMTI3
MA==

Response

Status

200

Headers

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

Body

{
  "status": "ok"
}

Get image

Request

Route

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

Headers

Authorization: Basic ZGlnaXRhbC1nb29kczpjNTFjOTA3MDdhMTNjZTNmZmYyMTNhZmJiNWNkMTI3
MA==

Response

Status

200

Headers

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

Body

{
  "created_at": "2017-01-01T03:00:00+03:00",
  "id": 2,
  "image_processing": true,
  "position": 1,
  "product_id": 1,
  "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"
}

Get images

Request

Route

GET /admin/products/1/images.json

Headers

Authorization: Basic ZGlnaXRhbC1nb29kczpjNTFjOTA3MDdhMTNjZTNmZmYyMTNhZmJiNWNkMTI3
MA==

Response

Status

200

Headers

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

Body

[

]

Update image

Parameters

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

Request

Route

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

Headers

Content-Type: application/json
Authorization: Basic ZGlnaXRhbC1nb29kczpjNTFjOTA3MDdhMTNjZTNmZmYyMTNhZmJiNWNkMTI3
MA==

Body

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

Response

Status

200

Headers

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

Body

{
  "created_at": "2017-01-01T03:00:00+03:00",
  "id": 8,
  "image_processing": true,
  "position": 5,
  "product_id": 1,
  "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"
}

InvitedAccount

List invited accounts

Request

Route

GET /admin/invited_accounts.json

Headers

Authorization: Basic ZGlnaXRhbC1nb29kczpjNTFjOTA3MDdhMTNjZTNmZmYyMTNhZmJiNWNkMTI3
MA==

Response

Status

200

Headers

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

Body

[
  {
    "id": 6,
    "shop_url": "https://test-shop.ru/",
    "registered_at": "2017-08-25T13:03:28+03:00",
    "plan": "Стартовый",
    "paid_till": "2009-03-02",
    "alive": true,
    "royalties": "0.0"
  }
]

Show invited account

Request

Route

GET /admin/invited_accounts/6.json

Headers

Authorization: Basic ZGlnaXRhbC1nb29kczpjNTFjOTA3MDdhMTNjZTNmZmYyMTNhZmJiNWNkMTI3
MA==

Response

Status

200

Headers

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

Body

{
  "id": 6,
  "shop_url": "https://test-shop.ru/",
  "registered_at": "2017-08-25T13:03:28+03:00",
  "plan": "Стартовый",
  "paid_till": "2009-03-02",
  "alive": true,
  "royalties": "0.0"
}

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.

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 ZGlnaXRhbC1nb29kczpjNTFjOTA3MDdhMTNjZTNmZmYyMTNhZmJiNWNkMTI3
MA==

Body

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

Response

Status

201

Headers

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

Body

{
  "content": "alert('test');",
  "created_at": "2017-01-01T03:00:00+03:00",
  "id": 8,
  "name": "alert test",
  "updated_at": "2017-01-01T03:00:00+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.

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 ZGlnaXRhbC1nb29kczpjNTFjOTA3MDdhMTNjZTNmZmYyMTNhZmJiNWNkMTI3
MA==

Body

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

Response

Status

201

Headers

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

Body

{
  "content": "http://code.jquery.com/jquery-1.9.1.min.js",
  "created_at": "2017-01-01T03:00:00+03:00",
  "id": 12,
  "name": "jquery-1.9.1.min",
  "updated_at": "2017-01-01T03:00:00+03:00",
  "type": "JsTag::FileTag"
}

Destroy js_tag

Request

Route

DELETE /admin/js_tags/16.json

Headers

Content-Type: application/json
Authorization: Basic ZGlnaXRhbC1nb29kczpjNTFjOTA3MDdhMTNjZTNmZmYyMTNhZmJiNWNkMTI3
MA==

Response

Status

200

Headers

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

Body

{
  "status": "ok"
}

Get js_tag

Request

Route

GET /admin/js_tags/4.json

Headers

Authorization: Basic ZGlnaXRhbC1nb29kczpjNTFjOTA3MDdhMTNjZTNmZmYyMTNhZmJiNWNkMTI3
MA==

Response

Status

200

Headers

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

Body

{
  "content": "http://code.jquery.com/jquery-1.9.1.min.js",
  "created_at": "2017-01-01T03:00:00+03:00",
  "id": 4,
  "name": "jquery1.9.1",
  "updated_at": "2017-01-01T03:00:00+03:00",
  "type": "JsTag::FileTag"
}

Get js_tags

Request

Route

GET /admin/js_tags.json

Headers

Authorization: Basic ZGlnaXRhbC1nb29kczpjNTFjOTA3MDdhMTNjZTNmZmYyMTNhZmJiNWNkMTI3
MA==

Response

Status

200

Headers

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

Body

[
  {
    "content": "http://code.jquery.com/jquery-1.9.1.min.js",
    "created_at": "2017-01-01T03:00:00+03:00",
    "id": 2,
    "name": "jquery1.9.1",
    "updated_at": "2017-01-01T03:00:00+03:00",
    "type": "JsTag::FileTag"
  }
]

Update js_tag

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 ZGlnaXRhbC1nb29kczpjNTFjOTA3MDdhMTNjZTNmZmYyMTNhZmJiNWNkMTI3
MA==

Body

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

Response

Status

200

Headers

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

Body

{
  "content": "http://code.jquery.com/jquery-2.2.4.min.js",
  "created_at": "2017-01-01T03:00:00+03:00",
  "id": 14,
  "name": "jquery-2.2.4",
  "updated_at": "2017-01-01T03:00:00+03:00",
  "type": "JsTag::FileTag"
}

Marketplace

Create Google Merchant marketplace

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 ZGlnaXRhbC1nb29kczpjNTFjOTA3MDdhMTNjZTNmZmYyMTNhZmJiNWNkMTI3
MA==

Body

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

Response

Status

201

Headers

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

Body

{
  "created_at": "2017-01-01T03:00:00+03:00",
  "id": 10,
  "name": "GM",
  "type": "Marketplace::GoogleMerchant",
  "updated_at": "2017-01-01T03:00:00+03:00",
  "url": "http://quentin.mylocalhost.localdomain:3000/marketplace/10.xml",
  "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

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 ZGlnaXRhbC1nb29kczpjNTFjOTA3MDdhMTNjZTNmZmYyMTNhZmJiNWNkMTI3
MA==

Body

{
  "marketplace": {
    "name": "LYM",
    "type": "Marketplace::LiquidYandexMarket",
    "shop_name": "eBay",
    "use_variants": 1,
    "shop_company": "eBay",
    "page_encoding": "windows-1251",
    "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": [
      8,
      5,
      4,
      3,
      2,
      1,
      6
    ]
  }
}

Response

Status

201

Headers

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

Body

{
  "created_at": "2017-01-01T03:00:00+03:00",
  "id": 16,
  "name": "LYM",
  "type": "Marketplace::LiquidYandexMarket",
  "updated_at": "2017-01-01T03:00:00+03:00",
  "url": "http://quentin.mylocalhost.localdomain:3000/marketplace/16.xml",
  "local_delivery_cost": 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": "windows-1251",
  "shop_company": "eBay",
  "shop_name": "eBay",
  "delivery_new_style": false,
  "use_stock_currency": false,
  "use_variants": true
}

Create Model for Yandex marketplace

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 ZGlnaXRhbC1nb29kczpjNTFjOTA3MDdhMTNjZTNmZmYyMTNhZmJiNWNkMTI3
MA==

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": [
      8,
      5,
      4,
      3,
      2,
      1,
      6
    ]
  }
}

Response

Status

201

Headers

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

Body

{
  "created_at": "2017-01-01T03:00:00+03:00",
  "id": 8,
  "name": "YM",
  "type": "Marketplace::ModelYandexMarket",
  "updated_at": "2017-01-01T03:00:00+03:00",
  "url": "http://quentin.mylocalhost.localdomain:3000/marketplace/8.xml",
  "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,
  "supplementaries": false
}

Destroy marketplace

Request

Route

DELETE /admin/marketplaces/20.json

Headers

Content-Type: application/json
Authorization: Basic ZGlnaXRhbC1nb29kczpjNTFjOTA3MDdhMTNjZTNmZmYyMTNhZmJiNWNkMTI3
MA==

Response

Status

200

Headers

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

Body

{
  "status": "ok"
}

Get marketplace

Request

Route

GET /admin/marketplaces/6.json

Headers

Authorization: Basic ZGlnaXRhbC1nb29kczpjNTFjOTA3MDdhMTNjZTNmZmYyMTNhZmJiNWNkMTI3
MA==

Response

Status

200

Headers

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

Body

{
  "created_at": "2017-01-01T03:00:00+03:00",
  "id": 6,
  "name": "Yandex Model",
  "type": "Marketplace::ModelYandexMarket",
  "updated_at": "2017-01-01T03:00:00+03:00",
  "url": "http://quentin.mylocalhost.localdomain:3000/marketplace/6.xml",
  "delivery_price_kind": null,
  "description_type": null,
  "local_delivery_cost": null,
  "sales_notes": null,
  "utm_label": null,
  "vendor_id": null,
  "page_encoding": null,
  "shop_company": null,
  "shop_name": null,
  "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,
  "supplementaries": false
}

Get marketplaces

Request

Route

GET /admin/marketplaces.json

Headers

Authorization: Basic ZGlnaXRhbC1nb29kczpjNTFjOTA3MDdhMTNjZTNmZmYyMTNhZmJiNWNkMTI3
MA==

Response

Status

200

Headers

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

Body

[
  {
    "created_at": "2017-01-01T03:00:00+03:00",
    "id": 3,
    "name": "Yandex Model",
    "type": "Marketplace::LiquidYandexMarket",
    "updated_at": "2017-01-01T03:00:00+03:00",
    "url": "http://quentin.mylocalhost.localdomain:3000/marketplace/3.xml",
    "local_delivery_cost": null,
    "offer_liquid": null,
    "page_encoding": null,
    "shop_company": null,
    "shop_name": null,
    "delivery_new_style": false,
    "use_stock_currency": false,
    "use_variants": false
  },
  {
    "created_at": "2017-01-01T03:00:00+03:00",
    "id": 4,
    "name": "Google Model",
    "type": "Marketplace::GoogleMerchant",
    "updated_at": "2017-01-01T03:00:00+03:00",
    "url": "http://quentin.mylocalhost.localdomain:3000/marketplace/4.xml",
    "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

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 ZGlnaXRhbC1nb29kczpjNTFjOTA3MDdhMTNjZTNmZmYyMTNhZmJiNWNkMTI3
MA==

Body

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

Response

Status

200

Headers

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

Body

{
  "created_at": "2017-01-01T03:00:00+03:00",
  "id": 14,
  "name": "New GM",
  "type": "Marketplace::GoogleMerchant",
  "updated_at": "2017-01-01T03:00:00+03:00",
  "url": "http://quentin.mylocalhost.localdomain:3000/marketplace/14.xml",
  "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

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 ZGlnaXRhbC1nb29kczpjNTFjOTA3MDdhMTNjZTNmZmYyMTNhZmJiNWNkMTI3
MA==

Body

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

Response

Status

200

Headers

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

Body

{
  "created_at": "2017-01-01T03:00:00+03:00",
  "id": 18,
  "name": "New LYM",
  "type": "Marketplace::LiquidYandexMarket",
  "updated_at": "2017-01-01T03:00:00+03:00",
  "url": "http://quentin.mylocalhost.localdomain:3000/marketplace/18.xml",
  "local_delivery_cost": null,
  "offer_liquid": null,
  "page_encoding": null,
  "shop_company": null,
  "shop_name": null,
  "delivery_new_style": false,
  "use_stock_currency": false,
  "use_variants": false
}

Update Model for Yandex marketplace

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 ZGlnaXRhbC1nb29kczpjNTFjOTA3MDdhMTNjZTNmZmYyMTNhZmJiNWNkMTI3
MA==

Body

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

Response

Status

200

Headers

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

Body

{
  "created_at": "2017-01-01T03:00:00+03:00",
  "id": 12,
  "name": "New YM",
  "type": "Marketplace::ModelYandexMarket",
  "updated_at": "2017-01-01T03:00:00+03:00",
  "url": "http://quentin.mylocalhost.localdomain:3000/marketplace/12.xml",
  "delivery_price_kind": null,
  "description_type": null,
  "local_delivery_cost": null,
  "sales_notes": null,
  "utm_label": null,
  "vendor_id": 4,
  "page_encoding": null,
  "shop_company": null,
  "shop_name": null,
  "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,
  "supplementaries": false
}

OptionName

Create option_name

Parameters

Name Description
option_name[title] required title
option_name[position] position in option names list

Request

Route

POST /admin/option_names.json

Headers

Content-Type: application/json
Authorization: Basic ZGlnaXRhbC1nb29kczpjNTFjOTA3MDdhMTNjZTNmZmYyMTNhZmJiNWNkMTI3
MA==

Body

{
  "option_name": {
    "title": "Colour"
  }
}

Response

Status

201

Headers

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

Body

{
  "id": 27,
  "position": 3,
  "title": "Colour"
}

Destroy option_name

Request

Route

DELETE /admin/option_names/1.json

Headers

Content-Type: application/json
Authorization: Basic ZGlnaXRhbC1nb29kczpjNTFjOTA3MDdhMTNjZTNmZmYyMTNhZmJiNWNkMTI3
MA==

Response

Status

200

Headers

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

Body

{
  "status": "ok"
}

Get option_name

Request

Route

GET /admin/option_names/1.json

Headers

Authorization: Basic ZGlnaXRhbC1nb29kczpjNTFjOTA3MDdhMTNjZTNmZmYyMTNhZmJiNWNkMTI3
MA==

Response

Status

200

Headers

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

Body

{
  "id": 1,
  "position": 1,
  "title": "Модификация"
}

Get option_names

Request

Route

GET /admin/option_names.json

Headers

Authorization: Basic ZGlnaXRhbC1nb29kczpjNTFjOTA3MDdhMTNjZTNmZmYyMTNhZmJiNWNkMTI3
MA==

Response

Status

200

Headers

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

Body

[
  {
    "id": 1,
    "position": 1,
    "title": "Модификация"
  },
  {
    "id": 3,
    "position": 2,
    "title": "Цвет"
  }
]

Update option_name

Parameters

Name Description
option_name[title] title
option_name[position] position

Request

Route

PUT /admin/option_names/1.json

Headers

Content-Type: application/json
Authorization: Basic ZGlnaXRhbC1nb29kczpjNTFjOTA3MDdhMTNjZTNmZmYyMTNhZmJiNWNkMTI3
MA==

Body

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

Response

Status

200

Headers

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

Body

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

OptionValue

Create option_value

Parameters

Name Description
option_value[title] required title
option_value[position] position in option_values list

Request

Route

POST /admin/option_names/1/option_values.json

Headers

Content-Type: application/json
Authorization: Basic ZGlnaXRhbC1nb29kczpjNTFjOTA3MDdhMTNjZTNmZmYyMTNhZmJiNWNkMTI3
MA==

Body

{
  "option_value": {
    "title": "Blue"
  }
}

Response

Status

201

Headers

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

Body

{
  "id": 182,
  "option_name_id": 1,
  "position": 4,
  "title": "Blue"
}

Destroy option_value

Request

Route

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

Headers

Content-Type: application/json
Authorization: Basic ZGlnaXRhbC1nb29kczpjNTFjOTA3MDdhMTNjZTNmZmYyMTNhZmJiNWNkMTI3
MA==

Response

Status

200

Headers

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

Body

{
  "status": "ok"
}

Get option_value

Request

Route

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

Headers

Authorization: Basic ZGlnaXRhbC1nb29kczpjNTFjOTA3MDdhMTNjZTNmZmYyMTNhZmJiNWNkMTI3
MA==

Response

Status

200

Headers

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

Body

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

Get option_values for all options

Request

Route

GET /admin/option_values.json

Headers

Authorization: Basic ZGlnaXRhbC1nb29kczpjNTFjOTA3MDdhMTNjZTNmZmYyMTNhZmJiNWNkMTI3
MA==

Response

Status

200

Headers

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

Body

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

Get option_values for specific option

Request

Route

GET /admin/option_names/1/option_values.json

Headers

Authorization: Basic ZGlnaXRhbC1nb29kczpjNTFjOTA3MDdhMTNjZTNmZmYyMTNhZmJiNWNkMTI3
MA==

Response

Status

200

Headers

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

Body

[
  {
    "id": 1,
    "option_name_id": 1,
    "position": 1,
    "title": "Red"
  },
  {
    "id": 2,
    "option_name_id": 1,
    "position": 2,
    "title": "Зеленый"
  },
  {
    "id": 3,
    "option_name_id": 1,
    "position": 3,
    "title": "Базовая"
  }
]

Update option_value

Parameters

Name Description
option_value[position] position

Request

Route

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

Headers

Content-Type: application/json
Authorization: Basic ZGlnaXRhbC1nb29kczpjNTFjOTA3MDdhMTNjZTNmZmYyMTNhZmJiNWNkMTI3
MA==

Body

{
  "option_value": {
    "position": 3
  }
}

Response

Status

200

Headers

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

Body

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

Order

Create discount

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 ZGlnaXRhbC1nb29kczpjNTFjOTA3MDdhMTNjZTNmZmYyMTNhZmJiNWNkMTI3
MA==

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

Status

200

Headers

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

Body

{
  "fields_values": [
    {
      "created_at": "2017-01-01T03:00:00+03:00",
      "field_id": 267,
      "id": 97,
      "updated_at": "2017-01-01T03:00:00+03:00",
      "value": "old value",
      "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": null,
      "variant_id": 1,
      "product_id": 1,
      "sku": "423",
      "barcode": null,
      "title": "Cool t-shirt (Red)",
      "unit": "pce",
      "comment": null,
      "updated_at": "2017-01-01T03:00:00+03:00",
      "created_at": "2017-01-01T03:00:00+03:00",
      "vat": -1
    },
    {
      "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": "2017-01-01T03:00:00+03:00",
      "created_at": "2017-01-01T03:00:00+03:00",
      "vat": -1
    }
  ],
  "order_changes": [
    {
      "id": 67,
      "created_at": "2017-01-01T03:00:00+03:00",
      "action": "discount_created",
      "value_was": null,
      "value_is": {
        "type_id": 1,
        "discount": "10.0",
        "description": "10% only for first order line"
      },
      "user_name": "Цифровые товары"
    },
    {
      "id": 66,
      "created_at": "2017-01-01T03:00:00+03:00",
      "action": "discount_created",
      "value_was": null,
      "value_is": {
        "type_id": 2,
        "discount": "100.0",
        "description": "-100 (absolute)"
      },
      "user_name": "Цифровые товары"
    },
    {
      "id": 65,
      "created_at": "2017-01-01T03:00:00+03:00",
      "action": "discount_created",
      "value_was": null,
      "value_is": {
        "type_id": 2,
        "discount": "20.0",
        "description": "-20 (absolute)"
      },
      "user_name": null
    },
    {
      "id": 64,
      "created_at": "2017-01-01T03:00:00+03:00",
      "action": "order_line_created",
      "value_was": null,
      "value_is": {
        "sale_price": 150.0,
        "title": "shirt (Зеленый / Синий)",
        "quantity": 1
      },
      "user_name": null
    },
    {
      "id": 63,
      "created_at": "2017-01-01T03:00:00+03:00",
      "action": "order_line_created",
      "value_was": null,
      "value_is": {
        "sale_price": 100.0,
        "title": "Cool t-shirt (Red)",
        "quantity": 2
      },
      "user_name": null
    },
    {
      "id": 62,
      "created_at": "2017-01-01T03:00:00+03:00",
      "action": "order_line_deleted",
      "value_was": {
        "sale_price": 600.0,
        "title": "shirt",
        "quantity": 2
      },
      "value_is": null,
      "user_name": null
    },
    {
      "id": 61,
      "created_at": "2017-01-01T03:00:00+03:00",
      "action": "order_line_deleted",
      "value_was": {
        "sale_price": 300.0,
        "title": "Cool t-shirt",
        "quantity": 1
      },
      "value_is": null,
      "user_name": null
    }
  ],
  "discount": {
    "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": "2017-01-01T03:00:00+03:00",
    "updated_at": "2017-01-01T03:00:00+03:00"
  },
  "shipping_address": {
    "id": 1,
    "fields_values": [
      {
        "created_at": "2017-01-01T03:00:00+03:00",
        "field_id": 266,
        "id": 96,
        "updated_at": "2017-01-01T03:00:00+03:00",
        "value": "old value",
        "type": "Текст",
        "name": "special",
        "handle": null
      }
    ],
    "name": "Tom Dellay",
    "surname": null,
    "middlename": null,
    "phone": "+7(495)212-85-06",
    "full_name": "Tom Dellay",
    "full_locality_name": null,
    "full_delivery_address": "123456, state, London, address, old value",
    "address": "address",
    "country": "RU",
    "state": "state",
    "city": "London",
    "zip": "123456",
    "street": null,
    "house": null,
    "flat": null,
    "location": {
      "kladr_code": null,
      "zip": "123456",
      "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
    }
  },
  "client": {
    "bonus_points": 0,
    "client_group_id": null,
    "correspondent_account": null,
    "created_at": "2009-03-30T04:37:32+04:00",
    "email": "some-one@yandex.ru",
    "id": 2,
    "ip_addr": null,
    "middlename": null,
    "name": "Mortimer Hant",
    "phone": "+7(916)212-85-06",
    "registered": false,
    "settlement_account": null,
    "subscribe": true,
    "surname": null,
    "type": "Client::Individual",
    "updated_at": "2009-03-31T12:20:34+04:00",
    "progressive_discount": null,
    "group_discount": null,
    "fields_values": [
      {
        "created_at": "2017-01-01T03:00:00+03:00",
        "field_id": 265,
        "id": 95,
        "updated_at": "2017-01-01T03:00:00+03:00",
        "value": "old value",
        "type": "Текст",
        "name": "special",
        "handle": null
      }
    ]
  },
  "discounts": [
    {
      "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": "2017-01-01T03:00:00+03:00",
      "updated_at": "2017-01-01T03:00:00+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": "2017-01-01T03:00:00+03:00",
      "updated_at": "2017-01-01T03:00:00+03:00"
    },
    {
      "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": "2017-01-01T03:00:00+03:00",
      "updated_at": "2017-01-01T03:00:00+03:00"
    }
  ],
  "total_price": 310.0,
  "items_price": 210.0,
  "id": 1,
  "key": "teest",
  "number": 1001,
  "comment": "comment",
  "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+03:00",
  "updated_at": "2017-01-01T03:00:00+03:00",
  "financial_status": "pending",
  "delivery_date": null,
  "delivery_from_hour": null,
  "delivery_to_hour": null,
  "paid_at": null,
  "delivery_variant_id": 1,
  "payment_gateway_id": 1,
  "margin": "0.0",
  "client_transaction_id": 1,
  "currency_code": "RUR",
  "cookies": null,
  "account_id": 1,
  "manager_comment": "manager comment1",
  "locale": "ru",
  "ya_id": null
}

Create order line by product_id

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 ZGlnaXRhbC1nb29kczpjNTFjOTA3MDdhMTNjZTNmZmYyMTNhZmJiNWNkMTI3
MA==

Body

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

Response

Status

200

Headers

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

Body

{
  "fields_values": [
    {
      "created_at": "2017-01-01T03:00:00+03:00",
      "field_id": 258,
      "id": 88,
      "updated_at": "2017-01-01T03:00:00+03:00",
      "value": "old value",
      "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": null,
      "variant_id": 1,
      "product_id": 1,
      "sku": "423",
      "barcode": null,
      "title": "Cool t-shirt (Red)",
      "unit": "pce",
      "comment": null,
      "updated_at": "2017-01-01T03:00:00+03:00",
      "created_at": "2017-01-01T03:00:00+03:00",
      "vat": 18
    }
  ],
  "order_changes": [
    {
      "id": 57,
      "created_at": "2017-01-01T03:00:00+03:00",
      "action": "order_line_created",
      "value_was": null,
      "value_is": {
        "sale_price": 300.0,
        "title": "Cool t-shirt (Red)",
        "quantity": 1
      },
      "user_name": "Цифровые товары"
    },
    {
      "id": 56,
      "created_at": "2017-01-01T03:00:00+03:00",
      "action": "order_line_deleted",
      "value_was": {
        "sale_price": 600.0,
        "title": "shirt",
        "quantity": 2
      },
      "value_is": null,
      "user_name": null
    },
    {
      "id": 55,
      "created_at": "2017-01-01T03:00:00+03:00",
      "action": "order_line_deleted",
      "value_was": {
        "sale_price": 300.0,
        "title": "Cool t-shirt",
        "quantity": 1
      },
      "value_is": null,
      "user_name": null
    }
  ],
  "discount": null,
  "shipping_address": {
    "id": 1,
    "fields_values": [
      {
        "created_at": "2017-01-01T03:00:00+03:00",
        "field_id": 257,
        "id": 87,
        "updated_at": "2017-01-01T03:00:00+03:00",
        "value": "old value",
        "type": "Текст",
        "name": "special",
        "handle": null
      }
    ],
    "name": "Tom Dellay",
    "surname": null,
    "middlename": null,
    "phone": "+7(495)212-85-06",
    "full_name": "Tom Dellay",
    "full_locality_name": null,
    "full_delivery_address": "123456, state, London, address, old value",
    "address": "address",
    "country": "RU",
    "state": "state",
    "city": "London",
    "zip": "123456",
    "street": null,
    "house": null,
    "flat": null,
    "location": {
      "kladr_code": null,
      "zip": "123456",
      "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
    }
  },
  "client": {
    "bonus_points": 0,
    "client_group_id": null,
    "correspondent_account": null,
    "created_at": "2009-03-30T04:37:32+04:00",
    "email": "some-one@yandex.ru",
    "id": 2,
    "ip_addr": null,
    "middlename": null,
    "name": "Mortimer Hant",
    "phone": "+7(916)212-85-06",
    "registered": false,
    "settlement_account": null,
    "subscribe": true,
    "surname": null,
    "type": "Client::Individual",
    "updated_at": "2009-03-31T12:20:34+04:00",
    "progressive_discount": null,
    "group_discount": null,
    "fields_values": [
      {
        "created_at": "2017-01-01T03:00:00+03:00",
        "field_id": 256,
        "id": 86,
        "updated_at": "2017-01-01T03:00:00+03:00",
        "value": "old value",
        "type": "Текст",
        "name": "special",
        "handle": null
      }
    ]
  },
  "discounts": [

  ],
  "total_price": 400.0,
  "items_price": 300.0,
  "id": 1,
  "key": "teest",
  "number": 1001,
  "comment": "comment",
  "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+03:00",
  "updated_at": "2017-01-01T03:00:00+03:00",
  "financial_status": "pending",
  "delivery_date": null,
  "delivery_from_hour": null,
  "delivery_to_hour": null,
  "paid_at": null,
  "delivery_variant_id": 1,
  "payment_gateway_id": 1,
  "margin": "0.0",
  "client_transaction_id": 1,
  "currency_code": "RUR",
  "cookies": null,
  "account_id": 1,
  "manager_comment": "manager comment1",
  "locale": "ru",
  "ya_id": null
}

Create order line by variant_id

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 ZGlnaXRhbC1nb29kczpjNTFjOTA3MDdhMTNjZTNmZmYyMTNhZmJiNWNkMTI3
MA==

Body

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

Response

Status

200

Headers

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

Body

{
  "fields_values": [
    {
      "created_at": "2017-01-01T03:00:00+03:00",
      "field_id": 255,
      "id": 85,
      "updated_at": "2017-01-01T03:00:00+03:00",
      "value": "old value",
      "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": null,
      "variant_id": 1,
      "product_id": 1,
      "sku": "423",
      "barcode": null,
      "title": "Cool t-shirt (Red)",
      "unit": "pce",
      "comment": null,
      "updated_at": "2017-01-01T03:00:00+03:00",
      "created_at": "2017-01-01T03:00:00+03:00",
      "vat": -1
    }
  ],
  "order_changes": [
    {
      "id": 54,
      "created_at": "2017-01-01T03:00:00+03:00",
      "action": "order_line_created",
      "value_was": null,
      "value_is": {
        "sale_price": 300.0,
        "title": "Cool t-shirt (Red)",
        "quantity": 1
      },
      "user_name": "Цифровые товары"
    },
    {
      "id": 53,
      "created_at": "2017-01-01T03:00:00+03:00",
      "action": "order_line_deleted",
      "value_was": {
        "sale_price": 600.0,
        "title": "shirt",
        "quantity": 2
      },
      "value_is": null,
      "user_name": null
    },
    {
      "id": 52,
      "created_at": "2017-01-01T03:00:00+03:00",
      "action": "order_line_deleted",
      "value_was": {
        "sale_price": 300.0,
        "title": "Cool t-shirt",
        "quantity": 1
      },
      "value_is": null,
      "user_name": null
    }
  ],
  "discount": null,
  "shipping_address": {
    "id": 1,
    "fields_values": [
      {
        "created_at": "2017-01-01T03:00:00+03:00",
        "field_id": 254,
        "id": 84,
        "updated_at": "2017-01-01T03:00:00+03:00",
        "value": "old value",
        "type": "Текст",
        "name": "special",
        "handle": null
      }
    ],
    "name": "Tom Dellay",
    "surname": null,
    "middlename": null,
    "phone": "+7(495)212-85-06",
    "full_name": "Tom Dellay",
    "full_locality_name": null,
    "full_delivery_address": "123456, state, London, address, old value",
    "address": "address",
    "country": "RU",
    "state": "state",
    "city": "London",
    "zip": "123456",
    "street": null,
    "house": null,
    "flat": null,
    "location": {
      "kladr_code": null,
      "zip": "123456",
      "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
    }
  },
  "client": {
    "bonus_points": 0,
    "client_group_id": null,
    "correspondent_account": null,
    "created_at": "2009-03-30T04:37:32+04:00",
    "email": "some-one@yandex.ru",
    "id": 2,
    "ip_addr": null,
    "middlename": null,
    "name": "Mortimer Hant",
    "phone": "+7(916)212-85-06",
    "registered": false,
    "settlement_account": null,
    "subscribe": true,
    "surname": null,
    "type": "Client::Individual",
    "updated_at": "2009-03-31T12:20:34+04:00",
    "progressive_discount": null,
    "group_discount": null,
    "fields_values": [
      {
        "created_at": "2017-01-01T03:00:00+03:00",
        "field_id": 253,
        "id": 83,
        "updated_at": "2017-01-01T03:00:00+03:00",
        "value": "old value",
        "type": "Текст",
        "name": "special",
        "handle": null
      }
    ]
  },
  "discounts": [

  ],
  "total_price": 400.0,
  "items_price": 300.0,
  "id": 1,
  "key": "teest",
  "number": 1001,
  "comment": "comment",
  "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+03:00",
  "updated_at": "2017-01-01T03:00:00+03:00",
  "financial_status": "pending",
  "delivery_date": null,
  "delivery_from_hour": null,
  "delivery_to_hour": null,
  "paid_at": null,
  "delivery_variant_id": 1,
  "payment_gateway_id": 1,
  "margin": "0.0",
  "client_transaction_id": 1,
  "currency_code": "RUR",
  "cookies": null,
  "account_id": 1,
  "manager_comment": "manager comment1",
  "locale": "ru",
  "ya_id": null
}

Create order with bundle

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[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 ZGlnaXRhbC1nb29kczpjNTFjOTA3MDdhMTNjZTNmZmYyMTNhZmJiNWNkMTI3
MA==

Body

{
  "order": {
    "order_lines_attributes": [
      {
        "variant_id": 5,
        "quantity": 2
      }
    ],
    "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

Status

201

Headers

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

Body

{
  "fields_values": [

  ],
  "order_lines": [
    {
      "id": 13,
      "order_id": 9,
      "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": "2017-01-01T03:00:00+03:00",
      "created_at": "2017-01-01T03:00:00+03:00",
      "vat": -1
    },
    {
      "id": 14,
      "order_id": 9,
      "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": "2017-01-01T03:00:00+03:00",
      "created_at": "2017-01-01T03:00:00+03:00",
      "vat": -1
    }
  ],
  "order_changes": [
    {
      "id": 8,
      "created_at": "2017-01-01T03:00:00+03:00",
      "action": "order_created",
      "value_was": null,
      "value_is": null,
      "user_name": "Цифровые товары"
    },
    {
      "id": 7,
      "created_at": "2017-01-01T03:00:00+03:00",
      "action": "discount_created",
      "value_was": null,
      "value_is": {
        "type_id": 1,
        "discount": "20.0",
        "description": "Скидка по купону 20% discount"
      },
      "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": "2017-01-01T03:00:00+03:00",
    "updated_at": "2017-01-01T03:00:00+03:00"
  },
  "shipping_address": {
    "id": 21,
    "fields_values": [

    ],
    "name": "Vasya",
    "surname": null,
    "middlename": null,
    "phone": "79111112233",
    "full_name": "Vasya",
    "full_locality_name": null,
    "full_delivery_address": "Moscow, Krasnaya Presna 24",
    "address": "Moscow, Krasnaya Presna 24",
    "country": null,
    "state": null,
    "city": null,
    "zip": null,
    "street": null,
    "house": null,
    "flat": null,
    "location": {
      "kladr_code": null,
      "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
    }
  },
  "client": {
    "bonus_points": 0,
    "client_group_id": null,
    "correspondent_account": null,
    "created_at": "2017-01-01T03:00:00+03:00",
    "email": "vasya@example.com",
    "id": 25,
    "ip_addr": null,
    "middlename": null,
    "name": "Vasya",
    "phone": "79111112233",
    "registered": false,
    "settlement_account": null,
    "subscribe": true,
    "surname": null,
    "type": "Client::Individual",
    "updated_at": "2017-01-01T03:00:00+03:00",
    "progressive_discount": null,
    "group_discount": null,
    "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": "2017-01-01T03:00:00+03:00",
      "updated_at": "2017-01-01T03:00:00+03:00"
    }
  ],
  "total_price": 1300.0,
  "items_price": 1200.0,
  "id": 9,
  "key": "8a61edd67bb69c3c403046de1c993203",
  "number": 1006,
  "comment": null,
  "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": "2017-01-01T03:00:00+03:00",
  "updated_at": "2017-01-01T03:00:00+03:00",
  "financial_status": "pending",
  "delivery_date": null,
  "delivery_from_hour": null,
  "delivery_to_hour": null,
  "paid_at": null,
  "delivery_variant_id": 1,
  "payment_gateway_id": 1,
  "margin": "0.0",
  "client_transaction_id": null,
  "currency_code": "RUR",
  "cookies": {
  },
  "account_id": 1,
  "manager_comment": null,
  "locale": "ru",
  "ya_id": null
}

Create order with product

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 ZGlnaXRhbC1nb29kczpjNTFjOTA3MDdhMTNjZTNmZmYyMTNhZmJiNWNkMTI3
MA==

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

Status

201

Headers

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

Body

{
  "fields_values": [

  ],
  "order_lines": [
    {
      "id": 10,
      "order_id": 7,
      "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": "2017-01-01T03:00:00+03:00",
      "created_at": "2017-01-01T03:00:00+03:00",
      "vat": 10
    }
  ],
  "order_changes": [
    {
      "id": 4,
      "created_at": "2017-01-01T03:00:00+03:00",
      "action": "order_created",
      "value_was": null,
      "value_is": null,
      "user_name": "Цифровые товары"
    },
    {
      "id": 3,
      "created_at": "2017-01-01T03:00:00+03:00",
      "action": "discount_created",
      "value_was": null,
      "value_is": {
        "type_id": 1,
        "discount": "20.0",
        "description": "Скидка по купону 20% discount"
      },
      "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": "2017-01-01T03:00:00+03:00",
    "updated_at": "2017-01-01T03:00:00+03:00"
  },
  "shipping_address": {
    "id": 19,
    "fields_values": [

    ],
    "name": "Vasya",
    "surname": null,
    "middlename": null,
    "phone": "79111112233",
    "full_name": "Vasya",
    "full_locality_name": null,
    "full_delivery_address": "Moscow, Krasnaya Presna 24",
    "address": "Moscow, Krasnaya Presna 24",
    "country": null,
    "state": null,
    "city": null,
    "zip": null,
    "street": null,
    "house": null,
    "flat": null,
    "location": {
      "kladr_code": null,
      "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
    }
  },
  "client": {
    "bonus_points": 0,
    "client_group_id": null,
    "correspondent_account": null,
    "created_at": "2017-01-01T03:00:00+03:00",
    "email": "vasya@example.com",
    "id": 23,
    "ip_addr": null,
    "middlename": null,
    "name": "Vasya",
    "phone": "79111112233",
    "registered": false,
    "settlement_account": null,
    "subscribe": true,
    "surname": null,
    "type": "Client::Individual",
    "updated_at": "2017-01-01T03:00:00+03:00",
    "progressive_discount": null,
    "group_discount": null,
    "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": "2017-01-01T03:00:00+03:00",
      "updated_at": "2017-01-01T03:00:00+03:00"
    }
  ],
  "total_price": 1060.0,
  "items_price": 960.0,
  "id": 7,
  "key": "abd24111cee8f7d5f8c607a19f6404ae",
  "number": 1006,
  "comment": null,
  "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": "2017-01-01T03:00:00+03:00",
  "updated_at": "2017-01-01T03:00:00+03:00",
  "financial_status": "pending",
  "delivery_date": null,
  "delivery_from_hour": null,
  "delivery_to_hour": null,
  "paid_at": null,
  "delivery_variant_id": 1,
  "payment_gateway_id": 1,
  "margin": "0.0",
  "client_transaction_id": null,
  "currency_code": "RUR",
  "cookies": {
  },
  "account_id": 1,
  "manager_comment": null,
  "locale": "ru",
  "ya_id": null
}

Get order

Request

Route

GET /admin/orders/1.json

Headers

Authorization: Basic ZGlnaXRhbC1nb29kczpjNTFjOTA3MDdhMTNjZTNmZmYyMTNhZmJiNWNkMTI3
MA==

Response

Status

200

Headers

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

Body

{
  "fields_values": [
    {
      "created_at": "2017-01-01T03:00:00+03:00",
      "field_id": 192,
      "id": 22,
      "updated_at": "2017-01-01T03:00:00+03:00",
      "value": "old value",
      "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+03:00",
      "created_at": "2009-03-18T10:53:14+03:00",
      "vat": -1
    },
    {
      "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+03:00",
      "created_at": "2009-03-18T10:53:14+03:00",
      "vat": 18
    }
  ],
  "order_changes": [

  ],
  "discount": null,
  "shipping_address": {
    "id": 1,
    "fields_values": [
      {
        "created_at": "2017-01-01T03:00:00+03:00",
        "field_id": 191,
        "id": 21,
        "updated_at": "2017-01-01T03:00:00+03:00",
        "value": "old value",
        "type": "Текст",
        "name": "special",
        "handle": null
      }
    ],
    "name": "Tom Dellay",
    "surname": null,
    "middlename": null,
    "phone": "+7(495)212-85-06",
    "full_name": "Tom Dellay",
    "full_locality_name": null,
    "full_delivery_address": "123456, state, London, address, old value",
    "address": "address",
    "country": "RU",
    "state": "state",
    "city": "London",
    "zip": "123456",
    "street": null,
    "house": null,
    "flat": null,
    "location": {
      "kladr_code": null,
      "zip": "123456",
      "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
    }
  },
  "client": {
    "bonus_points": 0,
    "client_group_id": null,
    "correspondent_account": null,
    "created_at": "2009-03-30T04:37:32+04:00",
    "email": "some-one@yandex.ru",
    "id": 2,
    "ip_addr": null,
    "middlename": null,
    "name": "Mortimer Hant",
    "phone": "+7(916)212-85-06",
    "registered": false,
    "settlement_account": null,
    "subscribe": true,
    "surname": null,
    "type": "Client::Individual",
    "updated_at": "2009-03-31T12:20:34+04:00",
    "progressive_discount": null,
    "group_discount": null,
    "fields_values": [
      {
        "created_at": "2017-01-01T03:00:00+03:00",
        "field_id": 190,
        "id": 20,
        "updated_at": "2017-01-01T03:00:00+03:00",
        "value": "old value",
        "type": "Текст",
        "name": "special",
        "handle": null
      }
    ]
  },
  "discounts": [

  ],
  "total_price": 1600.0,
  "items_price": 1500.0,
  "id": 1,
  "key": "teest",
  "number": 1001,
  "comment": "comment",
  "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+03:00",
  "updated_at": "2017-01-01T03:00:00+03:00",
  "financial_status": "pending",
  "delivery_date": null,
  "delivery_from_hour": null,
  "delivery_to_hour": null,
  "paid_at": null,
  "delivery_variant_id": 1,
  "payment_gateway_id": 1,
  "margin": "0.0",
  "client_transaction_id": 1,
  "currency_code": "RUR",
  "cookies": null,
  "account_id": 1,
  "manager_comment": "manager comment1",
  "locale": "ru",
  "ya_id": null
}

Get orders count

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 ZGlnaXRhbC1nb29kczpjNTFjOTA3MDdhMTNjZTNmZmYyMTNhZmJiNWNkMTI3
MA==

Response

Status

200

Headers

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

Body

{
  "count": 4
}

Get orders

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.json?fulfillment_status[]=new&fulfillment_status[]=delivered&delivery_variant[]=1&delivery_variant[]=2&payment_gateway_id[]=1&payment_gateway_id[]=3

Headers

Authorization: Basic ZGlnaXRhbC1nb29kczpjNTFjOTA3MDdhMTNjZTNmZmYyMTNhZmJiNWNkMTI3
MA==

Query Parameters

fulfillment_status[]=delivered
delivery_variant[]=2
payment_gateway_id[]=3

Response

Status

200

Headers

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

Body

[
  {
    "fields_values": [

    ],
    "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+03:00",
        "created_at": "2011-03-18T10:53:14+03:00",
        "vat": -1
      },
      {
        "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+03:00",
        "created_at": "2009-03-18T10:53:14+03:00",
        "vat": -1
      }
    ],
    "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+03:00",
      "updated_at": "2009-03-18T10:53:15+03:00"
    },
    "shipping_address": null,
    "client": {
      "bonus_points": 0,
      "client_group_id": 1,
      "correspondent_account": null,
      "created_at": "2009-04-30T04:37:32+04:00",
      "email": "some-one2@yandex.ru",
      "id": 3,
      "ip_addr": null,
      "middlename": null,
      "name": "Just Man",
      "phone": "+7(926)111-22-33",
      "registered": false,
      "settlement_account": null,
      "subscribe": true,
      "surname": null,
      "type": "Client::Individual",
      "updated_at": "2009-04-30T12:20:34+04:00",
      "progressive_discount": null,
      "group_discount": "25.0",
      "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+03:00",
        "updated_at": "2009-03-18T10:53:15+03:00"
      }
    ],
    "total_price": 804.0,
    "items_price": 804.0,
    "id": 4,
    "key": null,
    "number": 1005,
    "comment": "comment",
    "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+03:00",
    "updated_at": "2011-03-18T10:53:15+03:00",
    "financial_status": "paid",
    "delivery_date": null,
    "delivery_from_hour": null,
    "delivery_to_hour": null,
    "paid_at": null,
    "delivery_variant_id": 1,
    "payment_gateway_id": 3,
    "margin": "20.0",
    "client_transaction_id": null,
    "currency_code": "RUR",
    "cookies": null,
    "account_id": 1,
    "manager_comment": null,
    "locale": "ru",
    "ya_id": null
  },
  {
    "fields_values": [

    ],
    "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+03:00",
        "created_at": "2011-03-18T10:53:14+03:00",
        "vat": -1
      },
      {
        "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+03:00",
        "created_at": "2009-03-18T10:53:14+03:00",
        "vat": 0
      }
    ],
    "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+03:00",
      "updated_at": "2009-03-18T10:53:15+03:00"
    },
    "shipping_address": null,
    "client": {
      "bonus_points": 0,
      "client_group_id": 1,
      "correspondent_account": null,
      "created_at": "2009-04-30T04:37:32+04:00",
      "email": "some-one2@yandex.ru",
      "id": 3,
      "ip_addr": null,
      "middlename": null,
      "name": "Just Man",
      "phone": "+7(926)111-22-33",
      "registered": false,
      "settlement_account": null,
      "subscribe": true,
      "surname": null,
      "type": "Client::Individual",
      "updated_at": "2009-04-30T12:20:34+04:00",
      "progressive_discount": null,
      "group_discount": "25.0",
      "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+03:00",
        "updated_at": "2009-03-18T10:53:15+03:00"
      }
    ],
    "total_price": 840.0,
    "items_price": 840.0,
    "id": 3,
    "key": null,
    "number": 1004,
    "comment": "comment",
    "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+03:00",
    "updated_at": "2011-03-18T10:53:15+03:00",
    "financial_status": "paid",
    "delivery_date": null,
    "delivery_from_hour": null,
    "delivery_to_hour": null,
    "paid_at": null,
    "delivery_variant_id": 1,
    "payment_gateway_id": 3,
    "margin": "20.0",
    "client_transaction_id": null,
    "currency_code": "RUR",
    "cookies": null,
    "account_id": 1,
    "manager_comment": null,
    "locale": "ru",
    "ya_id": null
  },
  {
    "fields_values": [
      {
        "created_at": "2017-01-01T03:00:00+03:00",
        "field_id": 204,
        "id": 34,
        "updated_at": "2017-01-01T03:00:00+03:00",
        "value": "old value",
        "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+03:00",
        "created_at": "2009-03-18T10:53:14+03:00",
        "vat": -1
      },
      {
        "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+03:00",
        "created_at": "2009-03-18T10:53:14+03:00",
        "vat": 18
      }
    ],
    "order_changes": [

    ],
    "discount": null,
    "shipping_address": {
      "id": 1,
      "fields_values": [
        {
          "created_at": "2017-01-01T03:00:00+03:00",
          "field_id": 203,
          "id": 33,
          "updated_at": "2017-01-01T03:00:00+03:00",
          "value": "old value",
          "type": "Текст",
          "name": "special",
          "handle": null
        }
      ],
      "name": "Tom Dellay",
      "surname": null,
      "middlename": null,
      "phone": "+7(495)212-85-06",
      "full_name": "Tom Dellay",
      "full_locality_name": null,
      "full_delivery_address": "123456, state, London, address, old value",
      "address": "address",
      "country": "RU",
      "state": "state",
      "city": "London",
      "zip": "123456",
      "street": null,
      "house": null,
      "flat": null,
      "location": {
        "kladr_code": null,
        "zip": "123456",
        "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
      }
    },
    "client": {
      "bonus_points": 0,
      "client_group_id": null,
      "correspondent_account": null,
      "created_at": "2009-03-30T04:37:32+04:00",
      "email": "some-one@yandex.ru",
      "id": 2,
      "ip_addr": null,
      "middlename": null,
      "name": "Mortimer Hant",
      "phone": "+7(916)212-85-06",
      "registered": false,
      "settlement_account": null,
      "subscribe": true,
      "surname": null,
      "type": "Client::Individual",
      "updated_at": "2009-03-31T12:20:34+04:00",
      "progressive_discount": null,
      "group_discount": null,
      "fields_values": [
        {
          "created_at": "2017-01-01T03:00:00+03:00",
          "field_id": 202,
          "id": 32,
          "updated_at": "2017-01-01T03:00:00+03:00",
          "value": "old value",
          "type": "Текст",
          "name": "special",
          "handle": null
        }
      ]
    },
    "discounts": [

    ],
    "total_price": 1600.0,
    "items_price": 1500.0,
    "id": 1,
    "key": "teest",
    "number": 1001,
    "comment": "comment",
    "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+03:00",
    "updated_at": "2017-01-01T03:00:00+03:00",
    "financial_status": "pending",
    "delivery_date": null,
    "delivery_from_hour": null,
    "delivery_to_hour": null,
    "paid_at": null,
    "delivery_variant_id": 1,
    "payment_gateway_id": 1,
    "margin": "0.0",
    "client_transaction_id": 1,
    "currency_code": "RUR",
    "cookies": null,
    "account_id": 1,
    "manager_comment": "manager comment1",
    "locale": "ru",
    "ya_id": null
  }
]

Remove discount

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 ZGlnaXRhbC1nb29kczpjNTFjOTA3MDdhMTNjZTNmZmYyMTNhZmJiNWNkMTI3
MA==

Body

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

Response

Status

200

Headers

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

Body

{
  "fields_values": [
    {
      "created_at": "2017-01-01T03:00:00+03:00",
      "field_id": 270,
      "id": 100,
      "updated_at": "2017-01-01T03:00:00+03:00",
      "value": "old value",
      "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": null,
      "variant_id": 1,
      "product_id": 1,
      "sku": "423",
      "barcode": null,
      "title": "Cool t-shirt (Red)",
      "unit": "pce",
      "comment": null,
      "updated_at": "2017-01-01T03:00:00+03:00",
      "created_at": "2017-01-01T03:00:00+03:00",
      "vat": -1
    },
    {
      "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": "2017-01-01T03:00:00+03:00",
      "created_at": "2017-01-01T03:00:00+03:00",
      "vat": -1
    }
  ],
  "order_changes": [
    {
      "id": 73,
      "created_at": "2017-01-01T03:00:00+03:00",
      "action": "discount_deleted",
      "value_was": {
        "type_id": 2,
        "discount": "20.0",
        "description": "-20 (absolute)"
      },
      "value_is": null,
      "user_name": "Цифровые товары"
    },
    {
      "id": 72,
      "created_at": "2017-01-01T03:00:00+03:00",
      "action": "discount_created",
      "value_was": null,
      "value_is": {
        "type_id": 2,
        "discount": "20.0",
        "description": "-20 (absolute)"
      },
      "user_name": null
    },
    {
      "id": 71,
      "created_at": "2017-01-01T03:00:00+03:00",
      "action": "order_line_created",
      "value_was": null,
      "value_is": {
        "sale_price": 150.0,
        "title": "shirt (Зеленый / Синий)",
        "quantity": 1
      },
      "user_name": null
    },
    {
      "id": 70,
      "created_at": "2017-01-01T03:00:00+03:00",
      "action": "order_line_created",
      "value_was": null,
      "value_is": {
        "sale_price": 100.0,
        "title": "Cool t-shirt (Red)",
        "quantity": 2
      },
      "user_name": null
    },
    {
      "id": 69,
      "created_at": "2017-01-01T03:00:00+03:00",
      "action": "order_line_deleted",
      "value_was": {
        "sale_price": 600.0,
        "title": "shirt",
        "quantity": 2
      },
      "value_is": null,
      "user_name": null
    },
    {
      "id": 68,
      "created_at": "2017-01-01T03:00:00+03:00",
      "action": "order_line_deleted",
      "value_was": {
        "sale_price": 300.0,
        "title": "Cool t-shirt",
        "quantity": 1
      },
      "value_is": null,
      "user_name": null
    }
  ],
  "discount": null,
  "shipping_address": {
    "id": 1,
    "fields_values": [
      {
        "created_at": "2017-01-01T03:00:00+03:00",
        "field_id": 269,
        "id": 99,
        "updated_at": "2017-01-01T03:00:00+03:00",
        "value": "old value",
        "type": "Текст",
        "name": "special",
        "handle": null
      }
    ],
    "name": "Tom Dellay",
    "surname": null,
    "middlename": null,
    "phone": "+7(495)212-85-06",
    "full_name": "Tom Dellay",
    "full_locality_name": null,
    "full_delivery_address": "123456, state, London, address, old value",
    "address": "address",
    "country": "RU",
    "state": "state",
    "city": "London",
    "zip": "123456",
    "street": null,
    "house": null,
    "flat": null,
    "location": {
      "kladr_code": null,
      "zip": "123456",
      "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
    }
  },
  "client": {
    "bonus_points": 0,
    "client_group_id": null,
    "correspondent_account": null,
    "created_at": "2009-03-30T04:37:32+04:00",
    "email": "some-one@yandex.ru",
    "id": 2,
    "ip_addr": null,
    "middlename": null,
    "name": "Mortimer Hant",
    "phone": "+7(916)212-85-06",
    "registered": false,
    "settlement_account": null,
    "subscribe": true,
    "surname": null,
    "type": "Client::Individual",
    "updated_at": "2009-03-31T12:20:34+04:00",
    "progressive_discount": null,
    "group_discount": null,
    "fields_values": [
      {
        "created_at": "2017-01-01T03:00:00+03:00",
        "field_id": 268,
        "id": 98,
        "updated_at": "2017-01-01T03:00:00+03:00",
        "value": "old value",
        "type": "Текст",
        "name": "special",
        "handle": null
      }
    ]
  },
  "discounts": [

  ],
  "total_price": 450.0,
  "items_price": 350.0,
  "id": 1,
  "key": "teest",
  "number": 1001,
  "comment": "comment",
  "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+03:00",
  "updated_at": "2017-01-01T03:00:00+03:00",
  "financial_status": "pending",
  "delivery_date": null,
  "delivery_from_hour": null,
  "delivery_to_hour": null,
  "paid_at": null,
  "delivery_variant_id": 1,
  "payment_gateway_id": 1,
  "margin": "0.0",
  "client_transaction_id": 1,
  "currency_code": "RUR",
  "cookies": null,
  "account_id": 1,
  "manager_comment": "manager comment1",
  "locale": "ru",
  "ya_id": null
}

Remove order line

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 ZGlnaXRhbC1nb29kczpjNTFjOTA3MDdhMTNjZTNmZmYyMTNhZmJiNWNkMTI3
MA==

Body

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

Response

Status

200

Headers

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

Body

{
  "fields_values": [
    {
      "created_at": "2017-01-01T03:00:00+03:00",
      "field_id": 261,
      "id": 91,
      "updated_at": "2017-01-01T03:00:00+03:00",
      "value": "old value",
      "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": "2009-03-18T10:53:15+03:00",
      "created_at": "2009-03-18T10:53:14+03:00",
      "vat": 18
    }
  ],
  "order_changes": [
    {
      "id": 58,
      "created_at": "2017-01-01T03:00:00+03:00",
      "action": "order_line_deleted",
      "value_was": {
        "sale_price": 300.0,
        "title": "Cool t-shirt",
        "quantity": 1
      },
      "value_is": null,
      "user_name": "Цифровые товары"
    }
  ],
  "discount": null,
  "shipping_address": {
    "id": 1,
    "fields_values": [
      {
        "created_at": "2017-01-01T03:00:00+03:00",
        "field_id": 260,
        "id": 90,
        "updated_at": "2017-01-01T03:00:00+03:00",
        "value": "old value",
        "type": "Текст",
        "name": "special",
        "handle": null
      }
    ],
    "name": "Tom Dellay",
    "surname": null,
    "middlename": null,
    "phone": "+7(495)212-85-06",
    "full_name": "Tom Dellay",
    "full_locality_name": null,
    "full_delivery_address": "123456, state, London, address, old value",
    "address": "address",
    "country": "RU",
    "state": "state",
    "city": "London",
    "zip": "123456",
    "street": null,
    "house": null,
    "flat": null,
    "location": {
      "kladr_code": null,
      "zip": "123456",
      "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
    }
  },
  "client": {
    "bonus_points": 0,
    "client_group_id": null,
    "correspondent_account": null,
    "created_at": "2009-03-30T04:37:32+04:00",
    "email": "some-one@yandex.ru",
    "id": 2,
    "ip_addr": null,
    "middlename": null,
    "name": "Mortimer Hant",
    "phone": "+7(916)212-85-06",
    "registered": false,
    "settlement_account": null,
    "subscribe": true,
    "surname": null,
    "type": "Client::Individual",
    "updated_at": "2009-03-31T12:20:34+04:00",
    "progressive_discount": null,
    "group_discount": null,
    "fields_values": [
      {
        "created_at": "2017-01-01T03:00:00+03:00",
        "field_id": 259,
        "id": 89,
        "updated_at": "2017-01-01T03:00:00+03:00",
        "value": "old value",
        "type": "Текст",
        "name": "special",
        "handle": null
      }
    ]
  },
  "discounts": [

  ],
  "total_price": 1300.0,
  "items_price": 1200.0,
  "id": 1,
  "key": "teest",
  "number": 1001,
  "comment": "comment",
  "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+03:00",
  "updated_at": "2017-01-01T03:00:00+03:00",
  "financial_status": "pending",
  "delivery_date": null,
  "delivery_from_hour": null,
  "delivery_to_hour": null,
  "paid_at": null,
  "delivery_variant_id": 1,
  "payment_gateway_id": 1,
  "margin": "0.0",
  "client_transaction_id": 1,
  "currency_code": "RUR",
  "cookies": null,
  "account_id": 1,
  "manager_comment": "manager comment1",
  "locale": "ru",
  "ya_id": null
}

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.

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 ZGlnaXRhbC1nb29kczpjNTFjOTA3MDdhMTNjZTNmZmYyMTNhZmJiNWNkMTI3
MA==

Body

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

Response

Status

200

Headers

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

Body

{
  "fields_values": [
    {
      "created_at": "2017-01-01T03:00:00+03:00",
      "field_id": 252,
      "id": 82,
      "updated_at": "2017-01-01T03:00:00+03:00",
      "value": "old value",
      "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+03:00",
      "created_at": "2009-03-18T10:53:14+03:00",
      "vat": -1
    },
    {
      "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+03:00",
      "created_at": "2009-03-18T10:53:14+03:00",
      "vat": 18
    }
  ],
  "order_changes": [
    {
      "id": 51,
      "created_at": "2017-01-01T03:00:00+03:00",
      "action": "fulfillment_status_changed",
      "value_was": "new",
      "value_is": "accepted",
      "user_name": "Цифровые товары"
    },
    {
      "id": 50,
      "created_at": "2017-01-01T03:00:00+03:00",
      "action": "custom_status_changed",
      "value_was": "Новый",
      "value_is": "В обработке",
      "user_name": "Цифровые товары"
    },
    {
      "id": 49,
      "created_at": "2017-01-01T03:00:00+03:00",
      "action": "custom_status_changed",
      "value_was": null,
      "value_is": "Новый",
      "user_name": null
    }
  ],
  "discount": null,
  "shipping_address": {
    "id": 1,
    "fields_values": [
      {
        "created_at": "2017-01-01T03:00:00+03:00",
        "field_id": 251,
        "id": 81,
        "updated_at": "2017-01-01T03:00:00+03:00",
        "value": "old value",
        "type": "Текст",
        "name": "special",
        "handle": null
      }
    ],
    "name": "Tom Dellay",
    "surname": null,
    "middlename": null,
    "phone": "+7(495)212-85-06",
    "full_name": "Tom Dellay",
    "full_locality_name": null,
    "full_delivery_address": "123456, state, London, address, old value",
    "address": "address",
    "country": "RU",
    "state": "state",
    "city": "London",
    "zip": "123456",
    "street": null,
    "house": null,
    "flat": null,
    "location": {
      "kladr_code": null,
      "zip": "123456",
      "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
    }
  },
  "client": {
    "bonus_points": 0,
    "client_group_id": null,
    "correspondent_account": null,
    "created_at": "2009-03-30T04:37:32+04:00",
    "email": "some-one@yandex.ru",
    "id": 2,
    "ip_addr": null,
    "middlename": null,
    "name": "Mortimer Hant",
    "phone": "+7(916)212-85-06",
    "registered": false,
    "settlement_account": null,
    "subscribe": true,
    "surname": null,
    "type": "Client::Individual",
    "updated_at": "2009-03-31T12:20:34+04:00",
    "progressive_discount": null,
    "group_discount": null,
    "fields_values": [
      {
        "created_at": "2017-01-01T03:00:00+03:00",
        "field_id": 250,
        "id": 80,
        "updated_at": "2017-01-01T03:00:00+03:00",
        "value": "old value",
        "type": "Текст",
        "name": "special",
        "handle": null
      }
    ]
  },
  "discounts": [

  ],
  "total_price": 1600.0,
  "items_price": 1500.0,
  "id": 1,
  "key": "teest",
  "number": 1001,
  "comment": "comment",
  "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": "2017-01-01T03:00:00+03:00",
  "created_at": "2009-03-18T10:53:14+03:00",
  "updated_at": "2017-01-01T03:00:00+03:00",
  "financial_status": "pending",
  "delivery_date": null,
  "delivery_from_hour": null,
  "delivery_to_hour": null,
  "paid_at": null,
  "delivery_variant_id": 1,
  "payment_gateway_id": 1,
  "margin": "0.0",
  "client_transaction_id": 1,
  "currency_code": "RUR",
  "cookies": null,
  "account_id": 1,
  "manager_comment": "manager comment1",
  "locale": "ru",
  "ya_id": null
}

Update discount

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 ZGlnaXRhbC1nb29kczpjNTFjOTA3MDdhMTNjZTNmZmYyMTNhZmJiNWNkMTI3
MA==

Body

{
  "order": {
    "discounts_attributes": [
      {
        "id": 18,
        "discount_order_lines_ids": [
          29
        ]
      }
    ]
  }
}

Response

Status

200

Headers

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

Body

{
  "fields_values": [
    {
      "created_at": "2017-01-01T03:00:00+03:00",
      "field_id": 273,
      "id": 103,
      "updated_at": "2017-01-01T03:00:00+03:00",
      "value": "old value",
      "type": "Текст",
      "name": "special",
      "handle": "my_awesome_field"
    }
  ],
  "order_lines": [
    {
      "id": 29,
      "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": null,
      "variant_id": 1,
      "product_id": 1,
      "sku": "423",
      "barcode": null,
      "title": "Cool t-shirt (Red)",
      "unit": "pce",
      "comment": null,
      "updated_at": "2017-01-01T03:00:00+03:00",
      "created_at": "2017-01-01T03:00:00+03:00",
      "vat": -1
    },
    {
      "id": 30,
      "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": "2017-01-01T03:00:00+03:00",
      "created_at": "2017-01-01T03:00:00+03:00",
      "vat": -1
    }
  ],
  "order_changes": [
    {
      "id": 78,
      "created_at": "2017-01-01T03:00:00+03:00",
      "action": "discount_created",
      "value_was": null,
      "value_is": {
        "type_id": 2,
        "discount": "20.0",
        "description": "-20 (absolute)"
      },
      "user_name": null
    },
    {
      "id": 77,
      "created_at": "2017-01-01T03:00:00+03:00",
      "action": "order_line_created",
      "value_was": null,
      "value_is": {
        "sale_price": 150.0,
        "title": "shirt (Зеленый / Синий)",
        "quantity": 1
      },
      "user_name": null
    },
    {
      "id": 76,
      "created_at": "2017-01-01T03:00:00+03:00",
      "action": "order_line_created",
      "value_was": null,
      "value_is": {
        "sale_price": 100.0,
        "title": "Cool t-shirt (Red)",
        "quantity": 2
      },
      "user_name": null
    },
    {
      "id": 75,
      "created_at": "2017-01-01T03:00:00+03:00",
      "action": "order_line_deleted",
      "value_was": {
        "sale_price": 600.0,
        "title": "shirt",
        "quantity": 2
      },
      "value_is": null,
      "user_name": null
    },
    {
      "id": 74,
      "created_at": "2017-01-01T03:00:00+03:00",
      "action": "order_line_deleted",
      "value_was": {
        "sale_price": 300.0,
        "title": "Cool t-shirt",
        "quantity": 1
      },
      "value_is": null,
      "user_name": null
    }
  ],
  "discount": {
    "id": 18,
    "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": [
      29
    ],
    "discount_code_id": null,
    "created_at": "2017-01-01T03:00:00+03:00",
    "updated_at": "2017-01-01T03:00:00+03:00"
  },
  "shipping_address": {
    "id": 1,
    "fields_values": [
      {
        "created_at": "2017-01-01T03:00:00+03:00",
        "field_id": 272,
        "id": 102,
        "updated_at": "2017-01-01T03:00:00+03:00",
        "value": "old value",
        "type": "Текст",
        "name": "special",
        "handle": null
      }
    ],
    "name": "Tom Dellay",
    "surname": null,
    "middlename": null,
    "phone": "+7(495)212-85-06",
    "full_name": "Tom Dellay",
    "full_locality_name": null,
    "full_delivery_address": "123456, state, London, address, old value",
    "address": "address",
    "country": "RU",
    "state": "state",
    "city": "London",
    "zip": "123456",
    "street": null,
    "house": null,
    "flat": null,
    "location": {
      "kladr_code": null,
      "zip": "123456",
      "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
    }
  },
  "client": {
    "bonus_points": 0,
    "client_group_id": null,
    "correspondent_account": null,
    "created_at": "2009-03-30T04:37:32+04:00",
    "email": "some-one@yandex.ru",
    "id": 2,
    "ip_addr": null,
    "middlename": null,
    "name": "Mortimer Hant",
    "phone": "+7(916)212-85-06",
    "registered": false,
    "settlement_account": null,
    "subscribe": true,
    "surname": null,
    "type": "Client::Individual",
    "updated_at": "2009-03-31T12:20:34+04:00",
    "progressive_discount": null,
    "group_discount": null,
    "fields_values": [
      {
        "created_at": "2017-01-01T03:00:00+03:00",
        "field_id": 271,
        "id": 101,
        "updated_at": "2017-01-01T03:00:00+03:00",
        "value": "old value",
        "type": "Текст",
        "name": "special",
        "handle": null
      }
    ]
  },
  "discounts": [
    {
      "id": 18,
      "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": [
        29
      ],
      "discount_code_id": null,
      "created_at": "2017-01-01T03:00:00+03:00",
      "updated_at": "2017-01-01T03:00:00+03:00"
    }
  ],
  "total_price": 430.0,
  "items_price": 330.0,
  "id": 1,
  "key": "teest",
  "number": 1001,
  "comment": "comment",
  "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+03:00",
  "updated_at": "2017-01-01T03:00:00+03:00",
  "financial_status": "pending",
  "delivery_date": null,
  "delivery_from_hour": null,
  "delivery_to_hour": null,
  "paid_at": null,
  "delivery_variant_id": 1,
  "payment_gateway_id": 1,
  "margin": "0.0",
  "client_transaction_id": 1,
  "currency_code": "RUR",
  "cookies": null,
  "account_id": 1,
  "manager_comment": "manager comment1",
  "locale": "ru",
  "ya_id": null
}

Update order

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

Request

Route

PUT /admin/orders/1.json

Headers

Content-Type: application/json
Authorization: Basic ZGlnaXRhbC1nb29kczpjNTFjOTA3MDdhMTNjZTNmZmYyMTNhZmJiNWNkMTI3
MA==

Body

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

Response

Status

200

Headers

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

Body

{
  "fields_values": [
    {
      "created_at": "2017-01-01T03:00:00+03:00",
      "field_id": 249,
      "id": 79,
      "updated_at": "2017-01-01T03:00:00+03:00",
      "value": "new value",
      "type": "Текст",
      "name": "special",
      "handle": "my_awesome_field"
    }
  ],
  "order_lines": [
    {
      "id": 1,
      "order_id": 1,
      "sale_price": 300.0,
      "full_sale_price": 288.0,
      "total_price": 300.0,
      "full_total_price": 288.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+03:00",
      "created_at": "2009-03-18T10:53:14+03:00",
      "vat": -1
    },
    {
      "id": 2,
      "order_id": 1,
      "sale_price": 600.0,
      "full_sale_price": 576.0,
      "total_price": 1200.0,
      "full_total_price": 1152.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+03:00",
      "created_at": "2009-03-18T10:53:14+03:00",
      "vat": 18
    }
  ],
  "order_changes": [
    {
      "id": 48,
      "created_at": "2017-01-01T03:00:00+03:00",
      "action": "payment_gateway_changed",
      "value_was": "наличными курьеру",
      "value_is": "Выставление счета для юр. лиц.",
      "user_name": "Цифровые товары"
    },
    {
      "id": 47,
      "created_at": "2017-01-01T03:00:00+03:00",
      "action": "delivery_price_changed",
      "value_was": 100.0,
      "value_is": 600.0,
      "user_name": "Цифровые товары"
    },
    {
      "id": 46,
      "created_at": "2017-01-01T03:00:00+03:00",
      "action": "delivery_variant_changed",
      "value_was": "самовывоз",
      "value_is": "курьер",
      "user_name": "Цифровые товары"
    },
    {
      "id": 45,
      "created_at": "2017-01-01T03:00:00+03:00",
      "action": "financial_status_changed",
      "value_was": "pending",
      "value_is": "paid",
      "user_name": "Цифровые товары"
    },
    {
      "id": 44,
      "created_at": "2017-01-01T03:00:00+03:00",
      "action": "discount_created",
      "value_was": null,
      "value_is": {
        "type_id": 1,
        "discount": "20.0",
        "description": "Скидка по купону 20% discount"
      },
      "user_name": "Цифровые товары"
    }
  ],
  "discount": {
    "id": 13,
    "description": "Скидка по купону 20% discount",
    "type_id": 1,
    "amount": 300.0,
    "full_amount": 360.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": "2017-01-01T03:00:00+03:00",
    "updated_at": "2017-01-01T03:00:00+03:00"
  },
  "shipping_address": {
    "id": 1,
    "fields_values": [
      {
        "created_at": "2017-01-01T03:00:00+03:00",
        "field_id": 248,
        "id": 78,
        "updated_at": "2017-01-01T03:00:00+03:00",
        "value": "new value!",
        "type": "Текст",
        "name": "special",
        "handle": null
      }
    ],
    "name": "Tom Dellay",
    "surname": null,
    "middlename": null,
    "phone": "+74952128506",
    "full_name": "Tom Dellay",
    "full_locality_name": null,
    "full_delivery_address": "123456, state, London, address, new value!",
    "address": "address",
    "country": "RU",
    "state": "state",
    "city": "London",
    "zip": "123456",
    "street": null,
    "house": null,
    "flat": null,
    "location": {
      "kladr_code": null,
      "zip": "123456",
      "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
    }
  },
  "client": {
    "bonus_points": 0,
    "client_group_id": null,
    "correspondent_account": null,
    "created_at": "2009-03-30T04:37:32+04:00",
    "email": "ivan@example.com",
    "id": 2,
    "ip_addr": null,
    "middlename": null,
    "name": "Ivan",
    "phone": "79111113344",
    "registered": false,
    "settlement_account": null,
    "subscribe": true,
    "surname": null,
    "type": "Client::Individual",
    "updated_at": "2017-01-01T03:00:00+03:00",
    "progressive_discount": null,
    "group_discount": null,
    "fields_values": [
      {
        "created_at": "2017-01-01T03:00:00+03:00",
        "field_id": 247,
        "id": 77,
        "updated_at": "2017-01-01T03:00:00+03:00",
        "value": "new!",
        "type": "Текст",
        "name": "special",
        "handle": null
      }
    ]
  },
  "discounts": [
    {
      "id": 13,
      "description": "Скидка по купону 20% discount",
      "type_id": 1,
      "amount": 300.0,
      "full_amount": 360.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": "2017-01-01T03:00:00+03:00",
      "updated_at": "2017-01-01T03:00:00+03:00"
    }
  ],
  "total_price": 2520.0,
  "items_price": 1800.0,
  "id": 1,
  "key": "teest",
  "number": 1001,
  "comment": "Please call from 9 to 18",
  "delivery_title": "курьер",
  "delivery_description": "курьер ()",
  "delivery_price": 600.0,
  "full_delivery_price": 720.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+03:00",
  "updated_at": "2017-01-01T03:00:00+03:00",
  "financial_status": "paid",
  "delivery_date": null,
  "delivery_from_hour": null,
  "delivery_to_hour": null,
  "paid_at": "2017-01-01T03:00:00+03:00",
  "delivery_variant_id": 2,
  "payment_gateway_id": 3,
  "margin": "20.0",
  "client_transaction_id": 1,
  "currency_code": "RUR",
  "cookies": null,
  "account_id": 1,
  "manager_comment": "New client",
  "locale": "ru",
  "ya_id": null
}

Update order line

Parameters

Name Description
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

Request

Route

PUT /admin/orders/1.json

Headers

Content-Type: application/json
Authorization: Basic ZGlnaXRhbC1nb29kczpjNTFjOTA3MDdhMTNjZTNmZmYyMTNhZmJiNWNkMTI3
MA==

Body

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

Response

Status

200

Headers

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

Body

{
  "fields_values": [
    {
      "created_at": "2017-01-01T03:00:00+03:00",
      "field_id": 264,
      "id": 94,
      "updated_at": "2017-01-01T03:00:00+03:00",
      "value": "old value",
      "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": "2017-01-01T03:00:00+03:00",
      "created_at": "2009-03-18T10:53:14+03:00",
      "vat": 0
    },
    {
      "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+03:00",
      "created_at": "2009-03-18T10:53:14+03:00",
      "vat": 18
    }
  ],
  "order_changes": [
    {
      "id": 60,
      "created_at": "2017-01-01T03:00:00+03:00",
      "action": "order_line_quantity_changed",
      "value_was": {
        "title": "Cool t-shirt",
        "quantity": 1
      },
      "value_is": {
        "title": "Cool t-shirt",
        "quantity": 2
      },
      "user_name": "Цифровые товары"
    },
    {
      "id": 59,
      "created_at": "2017-01-01T03:00:00+03:00",
      "action": "order_line_price_changed",
      "value_was": {
        "title": "Cool t-shirt",
        "sale_price": "300.0"
      },
      "value_is": {
        "title": "Cool t-shirt",
        "sale_price": 100.0
      },
      "user_name": "Цифровые товары"
    }
  ],
  "discount": null,
  "shipping_address": {
    "id": 1,
    "fields_values": [
      {
        "created_at": "2017-01-01T03:00:00+03:00",
        "field_id": 263,
        "id": 93,
        "updated_at": "2017-01-01T03:00:00+03:00",
        "value": "old value",
        "type": "Текст",
        "name": "special",
        "handle": null
      }
    ],
    "name": "Tom Dellay",
    "surname": null,
    "middlename": null,
    "phone": "+7(495)212-85-06",
    "full_name": "Tom Dellay",
    "full_locality_name": null,
    "full_delivery_address": "123456, state, London, address, old value",
    "address": "address",
    "country": "RU",
    "state": "state",
    "city": "London",
    "zip": "123456",
    "street": null,
    "house": null,
    "flat": null,
    "location": {
      "kladr_code": null,
      "zip": "123456",
      "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
    }
  },
  "client": {
    "bonus_points": 0,
    "client_group_id": null,
    "correspondent_account": null,
    "created_at": "2009-03-30T04:37:32+04:00",
    "email": "some-one@yandex.ru",
    "id": 2,
    "ip_addr": null,
    "middlename": null,
    "name": "Mortimer Hant",
    "phone": "+7(916)212-85-06",
    "registered": false,
    "settlement_account": null,
    "subscribe": true,
    "surname": null,
    "type": "Client::Individual",
    "updated_at": "2009-03-31T12:20:34+04:00",
    "progressive_discount": null,
    "group_discount": null,
    "fields_values": [
      {
        "created_at": "2017-01-01T03:00:00+03:00",
        "field_id": 262,
        "id": 92,
        "updated_at": "2017-01-01T03:00:00+03:00",
        "value": "old value",
        "type": "Текст",
        "name": "special",
        "handle": null
      }
    ]
  },
  "discounts": [

  ],
  "total_price": 1500.0,
  "items_price": 1400.0,
  "id": 1,
  "key": "teest",
  "number": 1001,
  "comment": "comment",
  "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+03:00",
  "updated_at": "2017-01-01T03:00:00+03:00",
  "financial_status": "pending",
  "delivery_date": null,
  "delivery_from_hour": null,
  "delivery_to_hour": null,
  "paid_at": null,
  "delivery_variant_id": 1,
  "payment_gateway_id": 1,
  "margin": "0.0",
  "client_transaction_id": 1,
  "currency_code": "RUR",
  "cookies": null,
  "account_id": 1,
  "manager_comment": "manager comment1",
  "locale": "ru",
  "ya_id": null
}

Update shipping address

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 ZGlnaXRhbC1nb29kczpjNTFjOTA3MDdhMTNjZTNmZmYyMTNhZmJiNWNkMTI3
MA==

Body

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

Response

Status

200

Headers

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

Body

{
  "fields_values": [
    {
      "created_at": "2017-01-01T03:00:00+03:00",
      "field_id": 276,
      "id": 106,
      "updated_at": "2017-01-01T03:00:00+03:00",
      "value": "old value",
      "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+03:00",
      "created_at": "2009-03-18T10:53:14+03:00",
      "vat": -1
    },
    {
      "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+03:00",
      "created_at": "2009-03-18T10:53:14+03:00",
      "vat": 18
    }
  ],
  "order_changes": [

  ],
  "discount": null,
  "shipping_address": {
    "id": 1,
    "fields_values": [
      {
        "created_at": "2017-01-01T03:00:00+03:00",
        "field_id": 275,
        "id": 105,
        "updated_at": "2017-01-01T03:00:00+03:00",
        "value": "old value",
        "type": "Текст",
        "name": "special",
        "handle": null
      }
    ],
    "name": "Tom Dellay",
    "surname": null,
    "middlename": null,
    "phone": "+74952128506",
    "full_name": "Tom Dellay",
    "full_locality_name": null,
    "full_delivery_address": "123456, state, London, Moscow, Znamenka 12, old value",
    "address": "Moscow, Znamenka 12",
    "country": "RU",
    "state": "state",
    "city": "London",
    "zip": "123456",
    "street": null,
    "house": null,
    "flat": null,
    "location": {
      "kladr_code": null,
      "zip": "123456",
      "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
    }
  },
  "client": {
    "bonus_points": 0,
    "client_group_id": null,
    "correspondent_account": null,
    "created_at": "2009-03-30T04:37:32+04:00",
    "email": "some-one@yandex.ru",
    "id": 2,
    "ip_addr": null,
    "middlename": null,
    "name": "Mortimer Hant",
    "phone": "+7(916)212-85-06",
    "registered": false,
    "settlement_account": null,
    "subscribe": true,
    "surname": null,
    "type": "Client::Individual",
    "updated_at": "2009-03-31T12:20:34+04:00",
    "progressive_discount": null,
    "group_discount": null,
    "fields_values": [
      {
        "created_at": "2017-01-01T03:00:00+03:00",
        "field_id": 274,
        "id": 104,
        "updated_at": "2017-01-01T03:00:00+03:00",
        "value": "old value",
        "type": "Текст",
        "name": "special",
        "handle": null
      }
    ]
  },
  "discounts": [

  ],
  "total_price": 1600.0,
  "items_price": 1500.0,
  "id": 1,
  "key": "teest",
  "number": 1001,
  "comment": "comment",
  "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+03:00",
  "updated_at": "2017-01-01T03:00:00+03:00",
  "financial_status": "pending",
  "delivery_date": null,
  "delivery_from_hour": null,
  "delivery_to_hour": null,
  "paid_at": null,
  "delivery_variant_id": 1,
  "payment_gateway_id": 1,
  "margin": "0.0",
  "client_transaction_id": 1,
  "currency_code": "RUR",
  "cookies": null,
  "account_id": 1,
  "manager_comment": "manager comment1",
  "locale": "ru",
  "ya_id": null
}

Page

Create page

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 ZGlnaXRhbC1nb29kczpjNTFjOTA3MDdhMTNjZTNmZmYyMTNhZmJiNWNkMTI3
MA==

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

Status

201

Headers

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

Body

{
  "id": 4,
  "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": "2017-01-01T03:00:00+03:00",
  "updated_at": "2017-01-01T03:00:00+03:00"
}

Delete page

Request

Route

DELETE /admin/pages/1.json

Headers

Authorization: Basic ZGlnaXRhbC1nb29kczpjNTFjOTA3MDdhMTNjZTNmZmYyMTNhZmJiNWNkMTI3
MA==

Content-Type: application/x-www-form-urlencoded

Response

Status

200

Headers

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

Body

{
  "status": "ok"
}

Get page

Request

Route

GET /admin/pages/1.json

Headers

Authorization: Basic ZGlnaXRhbC1nb29kczpjNTFjOTA3MDdhMTNjZTNmZmYyMTNhZmJiNWNkMTI3
MA==

Response

Status

200

Headers

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

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": "2017-08-25T12:59:20+03:00",
  "updated_at": "2017-08-25T12:59:20+03:00"
}

Get pages list

Request

Route

GET /admin/pages.json

Headers

Authorization: Basic ZGlnaXRhbC1nb29kczpjNTFjOTA3MDdhMTNjZTNmZmYyMTNhZmJiNWNkMTI3
MA==

Response

Status

200

Headers

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

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": "2017-08-25T12:59:20+03:00",
    "updated_at": "2017-08-25T12:59:20+03:00"
  }
]

Update page

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 ZGlnaXRhbC1nb29kczpjNTFjOTA3MDdhMTNjZTNmZmYyMTNhZmJiNWNkMTI3
MA==

Body

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

Response

Status

200

Headers

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

Body

{
  "status": "ok"
}

PaymentGateway

Create Cod or Custom payment_gateway

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 ZGlnaXRhbC1nb29kczpjNTFjOTA3MDdhMTNjZTNmZmYyMTNhZmJiNWNkMTI3
MA==

Body

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

Response

Status

201

Headers

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

Body

{
  "created_at": "2017-01-01T03:00:00+03:00",
  "id": 19,
  "margin": "10.0",
  "position": 3,
  "type": "PaymentGateway::Cod",
  "updated_at": "2017-01-01T03:00:00+03:00",
  "title": "cash on delivery",
  "description": "text",
  "payment_delivery_variants": [
    {
      "created_at": "2017-01-01T03:00:00+03:00",
      "delivery_variant_id": 1,
      "id": 22
    }
  ]
}

Create External payment_gateway

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

Request

Route

POST /admin/payment_gateways.json

Headers

Content-Type: application/json
Authorization: Basic ZGlnaXRhbC1nb29kczpjNTFjOTA3MDdhMTNjZTNmZmYyMTNhZmJiNWNkMTI3
MA==

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

Response

Status

201

Headers

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

Body

{
  "created_at": "2017-01-01T03:00:00+03:00",
  "id": 21,
  "margin": "10.0",
  "position": 3,
  "type": "PaymentGateway::External",
  "updated_at": "2017-01-01T03:00:00+03:00",
  "title": "external payment gateway",
  "description": "text",
  "password": "49aac67478d56756",
  "url": "payment-gateway.ru/transactions/create",
  "shop_id": "123",
  "send_order": null,
  "success_url": "http://quentin.mylocalhost.localdomain:3000/payments/external/21/success",
  "fail_url": "http://quentin.mylocalhost.localdomain:3000/payments/external/21/fail",
  "server_url": "http://quentin.mylocalhost.localdomain:3000/payments/external/21/server",
  "payment_delivery_variants": [
    {
      "created_at": "2017-01-01T03:00:00+03:00",
      "delivery_variant_id": 1,
      "id": 24
    }
  ]
}

Destroy payment_gateway

Request

Route

DELETE /admin/payment_gateways/1.json

Headers

Content-Type: application/json
Authorization: Basic ZGlnaXRhbC1nb29kczpjNTFjOTA3MDdhMTNjZTNmZmYyMTNhZmJiNWNkMTI3
MA==

Response

Status

200

Headers

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

Body

 

Get payment_gateway

Request

Route

GET /admin/payment_gateways/1.json

Headers

Authorization: Basic ZGlnaXRhbC1nb29kczpjNTFjOTA3MDdhMTNjZTNmZmYyMTNhZmJiNWNkMTI3
MA==

Response

Status

200

Headers

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

Body

{
  "created_at": "2009-03-30T04:37:32+04:00",
  "id": 1,
  "margin": "0.0",
  "position": 1,
  "type": "PaymentGateway::Cod",
  "updated_at": "2009-03-31T12:20:34+04:00",
  "title": "Наличными курьеру",
  "description": "",
  "payment_delivery_variants": [
    {
      "created_at": "2017-08-25T12:59:22+03:00",
      "delivery_variant_id": 1,
      "id": 1
    },
    {
      "created_at": "2017-08-25T12:59:22+03:00",
      "delivery_variant_id": 2,
      "id": 2
    }
  ]
}

Get payment_gateways

Request

Route

GET /admin/payment_gateways.json

Headers

Authorization: Basic ZGlnaXRhbC1nb29kczpjNTFjOTA3MDdhMTNjZTNmZmYyMTNhZmJiNWNkMTI3
MA==

Response

Status

200

Headers

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

Body

[
  {
    "created_at": "2009-03-30T04:37:32+04:00",
    "id": 1,
    "margin": "0.0",
    "position": 1,
    "type": "PaymentGateway::Cod",
    "updated_at": "2009-03-31T12:20:34+04:00",
    "title": "Наличными курьеру",
    "description": "",
    "payment_delivery_variants": [
      {
        "created_at": "2017-08-25T12:59:22+03:00",
        "delivery_variant_id": 1,
        "id": 1
      },
      {
        "created_at": "2017-08-25T12:59:22+03:00",
        "delivery_variant_id": 2,
        "id": 2
      }
    ]
  },
  {
    "created_at": "2009-03-17T10:55:14+03:00",
    "id": 3,
    "margin": "20.0",
    "position": 2,
    "type": "PaymentGateway::JuridicalPersonBill",
    "updated_at": "2009-03-17T10:55:15+03:00",
    "title": "Выставление счета для юр. лиц.",
    "description": "",
    "payment_delivery_variants": [

    ]
  }
]

Update payment_gateway

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 ZGlnaXRhbC1nb29kczpjNTFjOTA3MDdhMTNjZTNmZmYyMTNhZmJiNWNkMTI3
MA==

Body

{
  "payment_gateway": {
    "title": "cash",
    "margin": 10,
    "description": "description",
    "payment_delivery_variants_attributes": [
      {
        "_destroy": 1,
        "id": 2
      },
      {
        "delivery_variant_id": 2
      }
    ]
  }
}

Response

Status

200

Headers

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

Body

{
  "created_at": "2009-03-30T04:37:32+04:00",
  "id": 1,
  "margin": "10.0",
  "position": 1,
  "type": "PaymentGateway::Cod",
  "updated_at": "2017-01-01T03:00:00+03:00",
  "title": "cash",
  "description": "description",
  "payment_delivery_variants": [
    {
      "created_at": "2017-08-25T12:59:22+03:00",
      "delivery_variant_id": 1,
      "id": 1
    },
    {
      "created_at": "2017-01-01T03:00:00+03:00",
      "delivery_variant_id": 2,
      "id": 26
    }
  ]
}

PriceKind

Create price kind

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 ZGlnaXRhbC1nb29kczpjNTFjOTA3MDdhMTNjZTNmZmYyMTNhZmJiNWNkMTI3
MA==

Body

{
  "price_kind": {
    "title": "large quantity price"
  }
}

Response

Status

201

Headers

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

Body

{
  "id": 179,
  "price_index": 2,
  "show_in_lists": true,
  "title": "large quantity price",
  "variant_price_method_name": "price3"
}

Destroy price kind

Request

Route

DELETE /admin/price_kinds/1.json

Headers

Content-Type: application/json
Authorization: Basic ZGlnaXRhbC1nb29kczpjNTFjOTA3MDdhMTNjZTNmZmYyMTNhZmJiNWNkMTI3
MA==

Response

Status

200

Headers

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

Body

{
  "status": "ok"
}

Get price kind

Request

Route

GET /admin/price_kinds/1.json

Headers

Authorization: Basic ZGlnaXRhbC1nb29kczpjNTFjOTA3MDdhMTNjZTNmZmYyMTNhZmJiNWNkMTI3
MA==

Response

Status

200

Headers

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

Body

{
  "id": 1,
  "price_index": 1,
  "show_in_lists": true,
  "title": "от 100",
  "variant_price_method_name": "price2"
}

Get price kinds

Request

Route

GET /admin/price_kinds.json

Headers

Authorization: Basic ZGlnaXRhbC1nb29kczpjNTFjOTA3MDdhMTNjZTNmZmYyMTNhZmJiNWNkMTI3
MA==

Response

Status

200

Headers

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

Body

[
  {
    "id": 1,
    "price_index": 1,
    "show_in_lists": true,
    "title": "от 100",
    "variant_price_method_name": "price2"
  }
]

Update price kind

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 ZGlnaXRhbC1nb29kczpjNTFjOTA3MDdhMTNjZTNmZmYyMTNhZmJiNWNkMTI3
MA==

Body

{
  "price_kind": {
    "title": "price for 10+ quantity"
  }
}

Response

Status

200

Headers

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

Body

{
  "id": 1,
  "price_index": 1,
  "show_in_lists": true,
  "title": "price for 10+ quantity",
  "variant_price_method_name": "price2"
}

Product

Create bundle

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 ZGlnaXRhbC1nb29kczpjNTFjOTA3MDdhMTNjZTNmZmYyMTNhZmJiNWNkMTI3
MA==

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

Status

201

Headers

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

Body

{
  "archived": false,
  "available": false,
  "canonical_url_collection_id": null,
  "category_id": 1,
  "created_at": "2017-01-01T03:00:00+03:00",
  "id": 9856,
  "ignore_discounts": null,
  "is_hidden": false,
  "sort_weight": null,
  "unit": "pce",
  "updated_at": "2017-01-01T03:00:00+03:00",
  "vat": 10,
  "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": [

  ],
  "images": [

  ],
  "option_names": [

  ],
  "properties": [

  ],
  "characteristics": [

  ],
  "product_field_values": [

  ],
  "variants": [
    {
      "barcode": null,
      "cost_price": null,
      "created_at": "2017-01-01T03:00:00+03:00",
      "id": 31096,
      "image_id": null,
      "old_price": null,
      "price": "100.0",
      "product_id": 9856,
      "sku": null,
      "updated_at": "2017-01-01T03:00:00+03:00",
      "weight": null,
      "available": false,
      "title": "",
      "base_price": "100.0",
      "prices": [

      ],
      "price2": null,
      "variant_field_values": [

      ],
      "option_values": [

      ],
      "quantity": 0
    }
  ],
  "product_bundle_components": [
    {
      "free": false,
      "id": 1058167308,
      "quantity": "2.0",
      "variant_id": 1
    }
  ],
  "description": null
}

Create product

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[dimensions] Length x Width x Height (Ш x Г x В)
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 ZGlnaXRhbC1nb29kczpjNTFjOTA3MDdhMTNjZTNmZmYyMTNhZmJiNWNkMTI3
MA==

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

Status

201

Headers

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

Body

{
  "archived": false,
  "available": null,
  "canonical_url_collection_id": null,
  "category_id": 1,
  "created_at": "2017-01-01T03:00:00+03:00",
  "id": 9854,
  "ignore_discounts": true,
  "is_hidden": false,
  "sort_weight": null,
  "unit": "pce",
  "updated_at": "2017-01-01T03:00:00+03:00",
  "vat": -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": [

  ],
  "images": [

  ],
  "option_names": [

  ],
  "properties": [

  ],
  "characteristics": [

  ],
  "product_field_values": [
    {
      "id": 7,
      "product_field_id": 1,
      "value": 12345
    }
  ],
  "variants": [
    {
      "barcode": null,
      "cost_price": null,
      "created_at": "2017-01-01T03:00:00+03:00",
      "id": 31094,
      "image_id": null,
      "old_price": null,
      "price": "740.0",
      "product_id": 9854,
      "sku": "QP021MVEN-r",
      "updated_at": "2017-01-01T03:00:00+03:00",
      "weight": null,
      "available": true,
      "title": "",
      "base_price": "740.0",
      "prices": [

      ],
      "price2": null,
      "variant_field_values": [

      ],
      "option_values": [

      ],
      "quantity": 1
    }
  ],
  "product_bundle_components": [

  ],
  "description": null
}

Destroy product

Request

Route

DELETE /admin/products/1.json

Headers

Content-Type: application/json
Authorization: Basic ZGlnaXRhbC1nb29kczpjNTFjOTA3MDdhMTNjZTNmZmYyMTNhZmJiNWNkMTI3
MA==

Response

Status

200

Headers

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

Body

{
  "status": "ok"
}

Get product

Request

Route

GET /admin/products/1.json

Headers

Authorization: Basic ZGlnaXRhbC1nb29kczpjNTFjOTA3MDdhMTNjZTNmZmYyMTNhZmJiNWNkMTI3
MA==

Response

Status

200

Headers

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

Body

{
  "archived": false,
  "available": false,
  "canonical_url_collection_id": 1,
  "category_id": 1,
  "created_at": "2017-08-25T12:59:21+03:00",
  "id": 1,
  "ignore_discounts": null,
  "is_hidden": false,
  "sort_weight": null,
  "unit": "pce",
  "updated_at": "2017-08-25T12:59:21+03:00",
  "vat": -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
  ],
  "images": [

  ],
  "option_names": [
    {
      "id": 1,
      "position": 1,
      "title": "Модификация"
    }
  ],
  "properties": [
    {
      "backoffice": false,
      "id": 6,
      "is_hidden": true,
      "is_navigational": true,
      "position": 1,
      "permalink": "hidden",
      "title": "hidden"
    },
    {
      "backoffice": false,
      "id": 8,
      "is_hidden": false,
      "is_navigational": false,
      "position": 3,
      "permalink": "not_navigational",
      "title": "not_navigational"
    },
    {
      "backoffice": false,
      "id": 4,
      "is_hidden": false,
      "is_navigational": true,
      "position": 5,
      "permalink": "style",
      "title": "Style"
    },
    {
      "backoffice": false,
      "id": 3,
      "is_hidden": false,
      "is_navigational": true,
      "position": 6,
      "permalink": "vendor",
      "title": "Vendor"
    }
  ],
  "characteristics": [
    {
      "id": 7,
      "position": 1,
      "property_id": 3,
      "title": "Nike",
      "permalink": "nike"
    },
    {
      "id": 9,
      "position": 1,
      "property_id": 4,
      "title": "Old",
      "permalink": "old"
    },
    {
      "id": 12,
      "position": 1,
      "property_id": 6,
      "title": "Hidden",
      "permalink": "Hidden"
    },
    {
      "id": 13,
      "position": 1,
      "property_id": 8,
      "title": "NotNavigational",
      "permalink": "NotNavigational"
    }
  ],
  "product_field_values": [
    {
      "id": 1,
      "product_field_id": 1,
      "value": "some product field value"
    }
  ],
  "variants": [
    {
      "barcode": null,
      "cost_price": "3.0",
      "created_at": "2009-03-18T10:53:14+03:00",
      "id": 1,
      "image_id": null,
      "old_price": null,
      "price": "10.0",
      "product_id": 1,
      "sku": "423",
      "updated_at": "2009-03-18T10:53:14+03:00",
      "weight": null,
      "available": false,
      "title": "Red",
      "base_price": "10.0",
      "prices": [
        12.0
      ],
      "price2": 12.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"
        }
      ],
      "quantity": 0
    }
  ],
  "product_bundle_components": [

  ],
  "description": "guys, its a really cool t-shirt"
}

Get products count

Request

Route

GET /admin/products/count.json

Headers

Authorization: Basic ZGlnaXRhbC1nb29kczpjNTFjOTA3MDdhMTNjZTNmZmYyMTNhZmJiNWNkMTI3
MA==

Response

Status

200

Headers

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

Body

{
  "count": 5
}

Get products

Request

Route

GET /admin/products.json

Headers

Authorization: Basic ZGlnaXRhbC1nb29kczpjNTFjOTA3MDdhMTNjZTNmZmYyMTNhZmJiNWNkMTI3
MA==

Response

Status

200

Headers

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

Body

[
  {
    "archived": false,
    "available": false,
    "canonical_url_collection_id": 1,
    "category_id": 1,
    "created_at": "2017-08-25T12:59:21+03:00",
    "id": 1,
    "ignore_discounts": null,
    "is_hidden": false,
    "sort_weight": null,
    "unit": "pce",
    "updated_at": "2017-08-25T12:59:21+03:00",
    "vat": -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
    ],
    "images": [

    ],
    "option_names": [
      {
        "id": 1,
        "position": 1,
        "title": "Модификация"
      }
    ],
    "properties": [
      {
        "backoffice": false,
        "id": 6,
        "is_hidden": true,
        "is_navigational": true,
        "position": 1,
        "permalink": "hidden",
        "title": "hidden"
      },
      {
        "backoffice": false,
        "id": 8,
        "is_hidden": false,
        "is_navigational": false,
        "position": 3,
        "permalink": "not_navigational",
        "title": "not_navigational"
      },
      {
        "backoffice": false,
        "id": 4,
        "is_hidden": false,
        "is_navigational": true,
        "position": 5,
        "permalink": "style",
        "title": "Style"
      },
      {
        "backoffice": false,
        "id": 3,
        "is_hidden": false,
        "is_navigational": true,
        "position": 6,
        "permalink": "vendor",
        "title": "Vendor"
      }
    ],
    "characteristics": [
      {
        "id": 7,
        "position": 1,
        "property_id": 3,
        "title": "Nike",
        "permalink": "nike"
      },
      {
        "id": 9,
        "position": 1,
        "property_id": 4,
        "title": "Old",
        "permalink": "old"
      },
      {
        "id": 12,
        "position": 1,
        "property_id": 6,
        "title": "Hidden",
        "permalink": "Hidden"
      },
      {
        "id": 13,
        "position": 1,
        "property_id": 8,
        "title": "NotNavigational",
        "permalink": "NotNavigational"
      }
    ],
    "product_field_values": [
      {
        "id": 1,
        "product_field_id": 1,
        "value": "some product field value"
      }
    ],
    "variants": [
      {
        "barcode": null,
        "cost_price": "3.0",
        "created_at": "2009-03-18T10:53:14+03:00",
        "id": 1,
        "image_id": null,
        "old_price": null,
        "price": "10.0",
        "product_id": 1,
        "sku": "423",
        "updated_at": "2009-03-18T10:53:14+03:00",
        "weight": null,
        "available": false,
        "title": "Red",
        "base_price": "10.0",
        "prices": [
          12.0
        ],
        "price2": 12.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"
          }
        ],
        "quantity": 0
      }
    ],
    "product_bundle_components": [

    ],
    "description": "guys, its a really cool t-shirt"
  },
  {
    "archived": false,
    "available": true,
    "canonical_url_collection_id": null,
    "category_id": 1,
    "created_at": "2017-08-25T12:59:21+03:00",
    "id": 2,
    "ignore_discounts": null,
    "is_hidden": false,
    "sort_weight": null,
    "unit": "pce",
    "updated_at": "2017-08-25T12:59:21+03:00",
    "vat": -1,
    "title": "shirt",
    "short_description": null,
    "permalink": "shirt",
    "html_title": null,
    "meta_keywords": null,
    "meta_description": null,
    "currency_code": "LVL",
    "collections_ids": [
      1,
      8
    ],
    "images": [

    ],
    "option_names": [
      {
        "id": 1,
        "position": 1,
        "title": "Модификация"
      },
      {
        "id": 3,
        "position": 2,
        "title": "Цвет"
      }
    ],
    "properties": [
      {
        "backoffice": false,
        "id": 4,
        "is_hidden": false,
        "is_navigational": true,
        "position": 5,
        "permalink": "style",
        "title": "Style"
      }
    ],
    "characteristics": [
      {
        "id": 10,
        "position": 2,
        "property_id": 4,
        "title": "New",
        "permalink": "new"
      }
    ],
    "product_field_values": [

    ],
    "variants": [
      {
        "barcode": null,
        "cost_price": null,
        "created_at": "2009-03-18T10:53:14+03:00",
        "id": 2,
        "image_id": null,
        "old_price": null,
        "price": "20.0",
        "product_id": 2,
        "sku": "424",
        "updated_at": "2009-03-18T10:53:14+03:00",
        "weight": "0.3",
        "available": true,
        "title": "Зеленый / Синий",
        "base_price": "20.0",
        "prices": [

        ],
        "price2": null,
        "variant_field_values": [

        ],
        "option_values": [
          {
            "id": 2,
            "option_name_id": 1,
            "position": 2,
            "title": "Зеленый"
          },
          {
            "id": 4,
            "option_name_id": 3,
            "position": 1,
            "title": "Синий"
          }
        ],
        "quantity": 1
      }
    ],
    "product_bundle_components": [

    ],
    "description": null
  },
  {
    "archived": false,
    "available": true,
    "canonical_url_collection_id": null,
    "category_id": 6,
    "created_at": "2017-08-25T12:59:21+03:00",
    "id": 3,
    "ignore_discounts": null,
    "is_hidden": false,
    "sort_weight": null,
    "unit": "pce",
    "updated_at": "2017-08-25T12:59:21+03:00",
    "vat": -1,
    "title": "pants",
    "short_description": null,
    "permalink": "pants",
    "html_title": null,
    "meta_keywords": null,
    "meta_description": null,
    "currency_code": "LVL",
    "collections_ids": [
      8
    ],
    "images": [

    ],
    "option_names": [
      {
        "id": 1,
        "position": 1,
        "title": "Модификация"
      }
    ],
    "properties": [

    ],
    "characteristics": [

    ],
    "product_field_values": [

    ],
    "variants": [
      {
        "barcode": null,
        "cost_price": null,
        "created_at": "2009-03-18T10:53:14+03:00",
        "id": 3,
        "image_id": null,
        "old_price": null,
        "price": "20.0",
        "product_id": 3,
        "sku": "425",
        "updated_at": "2009-03-18T10:53:14+03:00",
        "weight": null,
        "available": true,
        "title": "Базовая",
        "base_price": "20.0",
        "prices": [

        ],
        "price2": null,
        "variant_field_values": [

        ],
        "option_values": [
          {
            "id": 3,
            "option_name_id": 1,
            "position": 3,
            "title": "Базовая"
          }
        ],
        "quantity": null
      }
    ],
    "product_bundle_components": [

    ],
    "description": null
  },
  {
    "archived": false,
    "available": true,
    "canonical_url_collection_id": null,
    "category_id": 3,
    "created_at": "2017-08-25T12:59:21+03:00",
    "id": 4,
    "ignore_discounts": null,
    "is_hidden": false,
    "sort_weight": null,
    "unit": "pce",
    "updated_at": "2017-08-25T12:59:21+03:00",
    "vat": 10,
    "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": [

    ],
    "images": [

    ],
    "option_names": [

    ],
    "properties": [

    ],
    "characteristics": [

    ],
    "product_field_values": [

    ],
    "variants": [
      {
        "barcode": null,
        "cost_price": null,
        "created_at": "2009-03-18T12:53:14+03:00",
        "id": 4,
        "image_id": null,
        "old_price": null,
        "price": "20.0",
        "product_id": 4,
        "sku": "426",
        "updated_at": "2009-03-18T11:53:14+03:00",
        "weight": null,
        "available": true,
        "title": "",
        "base_price": "20.0",
        "prices": [

        ],
        "price2": null,
        "variant_field_values": [

        ],
        "option_values": [

        ],
        "quantity": null
      }
    ],
    "product_bundle_components": [
      {
        "free": true,
        "id": 989437296,
        "quantity": "1.0",
        "variant_id": 2
      },
      {
        "free": false,
        "id": 579560919,
        "quantity": "1.0",
        "variant_id": 1
      }
    ],
    "description": null
  },
  {
    "archived": false,
    "available": true,
    "canonical_url_collection_id": null,
    "category_id": 3,
    "created_at": "2017-08-25T12:59:21+03:00",
    "id": 5,
    "ignore_discounts": null,
    "is_hidden": false,
    "sort_weight": null,
    "unit": "pce",
    "updated_at": "2017-08-25T12:59:21+03:00",
    "vat": 18,
    "title": "shirt & pants",
    "short_description": null,
    "permalink": "shirt_and_pants",
    "html_title": null,
    "meta_keywords": null,
    "meta_description": null,
    "currency_code": "LVL",
    "collections_ids": [

    ],
    "images": [

    ],
    "option_names": [

    ],
    "properties": [

    ],
    "characteristics": [

    ],
    "product_field_values": [

    ],
    "variants": [
      {
        "barcode": null,
        "cost_price": null,
        "created_at": "2009-03-18T12:58:14+03:00",
        "id": 5,
        "image_id": null,
        "old_price": null,
        "price": "25.0",
        "product_id": 5,
        "sku": "427",
        "updated_at": "2009-03-18T13:53:14+03:00",
        "weight": null,
        "available": true,
        "title": "",
        "base_price": "25.0",
        "prices": [

        ],
        "price2": null,
        "variant_field_values": [

        ],
        "option_values": [

        ],
        "quantity": null
      }
    ],
    "product_bundle_components": [
      {
        "free": false,
        "id": 361433619,
        "quantity": "1.0",
        "variant_id": 2
      },
      {
        "free": false,
        "id": 620730336,
        "quantity": "1.0",
        "variant_id": 3
      }
    ],
    "description": null
  }
]

Update bundle

Parameters

Name Description
product[title] title
product[ignore_discounts] set to 1 to make this product ignore discounts
product[dimensions] Length x Width x Height (Ш x Г x В)
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 ZGlnaXRhbC1nb29kczpjNTFjOTA3MDdhMTNjZTNmZmYyMTNhZmJiNWNkMTI3
MA==

Body

{
  "product": {
    "product_bundle_components_attributes": [
      {
        "variant_id": 3,
        "quantity": 2,
        "free": false
      },
      {
        "id": 1,
        "quantity": 4
      },
      {
        "id": 2,
        "_destroy": true
      }
    ]
  }
}

Response

Status

200

Headers

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

Body

{
  "archived": false,
  "available": false,
  "canonical_url_collection_id": null,
  "category_id": 3,
  "created_at": "2017-08-25T12:59:21+03:00",
  "id": 4,
  "ignore_discounts": null,
  "is_hidden": false,
  "sort_weight": null,
  "unit": "pce",
  "updated_at": "2017-01-01T03:00:00+03:00",
  "vat": 10,
  "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": [

  ],
  "images": [

  ],
  "option_names": [

  ],
  "properties": [

  ],
  "characteristics": [

  ],
  "product_field_values": [

  ],
  "variants": [
    {
      "barcode": null,
      "cost_price": null,
      "created_at": "2009-03-18T12:53:14+03:00",
      "id": 4,
      "image_id": null,
      "old_price": null,
      "price": "20.0",
      "product_id": 4,
      "sku": "426",
      "updated_at": "2017-01-01T03:00:00+03:00",
      "weight": null,
      "available": false,
      "title": "",
      "base_price": "20.0",
      "prices": [

      ],
      "price2": null,
      "variant_field_values": [

      ],
      "option_values": [

      ],
      "quantity": 0
    }
  ],
  "product_bundle_components": [
    {
      "free": true,
      "id": 989437296,
      "quantity": "1.0",
      "variant_id": 2
    },
    {
      "free": false,
      "id": 579560919,
      "quantity": "1.0",
      "variant_id": 1
    },
    {
      "free": false,
      "id": 1058167310,
      "quantity": "2.0",
      "variant_id": 3
    }
  ],
  "description": null
}

Update product

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 ZGlnaXRhbC1nb29kczpjNTFjOTA3MDdhMTNjZTNmZmYyMTNhZmJiNWNkMTI3
MA==

Body

{
  "product": {
    "title": "Van Gogh Notebook",
    "ignore_discounts": 1,
    "vat": 10,
    "product_field_values_attributes": [
      {
        "handle": "handle",
        "value": 12345
      }
    ]
  }
}

Response

Status

200

Headers

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

Body

{
  "archived": false,
  "available": false,
  "canonical_url_collection_id": 1,
  "category_id": 1,
  "created_at": "2017-08-25T12:59:21+03:00",
  "id": 1,
  "ignore_discounts": true,
  "is_hidden": false,
  "sort_weight": null,
  "unit": "pce",
  "updated_at": "2017-01-01T03:00:00+03:00",
  "vat": 10,
  "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
  ],
  "images": [

  ],
  "option_names": [
    {
      "id": 1,
      "position": 1,
      "title": "Модификация"
    }
  ],
  "properties": [
    {
      "backoffice": false,
      "id": 6,
      "is_hidden": true,
      "is_navigational": true,
      "position": 1,
      "permalink": "hidden",
      "title": "hidden"
    },
    {
      "backoffice": false,
      "id": 8,
      "is_hidden": false,
      "is_navigational": false,
      "position": 3,
      "permalink": "not_navigational",
      "title": "not_navigational"
    },
    {
      "backoffice": false,
      "id": 4,
      "is_hidden": false,
      "is_navigational": true,
      "position": 5,
      "permalink": "style",
      "title": "Style"
    },
    {
      "backoffice": false,
      "id": 3,
      "is_hidden": false,
      "is_navigational": true,
      "position": 6,
      "permalink": "vendor",
      "title": "Vendor"
    }
  ],
  "characteristics": [
    {
      "id": 7,
      "position": 1,
      "property_id": 3,
      "title": "Nike",
      "permalink": "nike"
    },
    {
      "id": 9,
      "position": 1,
      "property_id": 4,
      "title": "Old",
      "permalink": "old"
    },
    {
      "id": 12,
      "position": 1,
      "property_id": 6,
      "title": "Hidden",
      "permalink": "Hidden"
    },
    {
      "id": 13,
      "position": 1,
      "property_id": 8,
      "title": "NotNavigational",
      "permalink": "NotNavigational"
    }
  ],
  "product_field_values": [
    {
      "id": 1,
      "product_field_id": 1,
      "value": 12345
    }
  ],
  "variants": [
    {
      "barcode": null,
      "cost_price": "3.0",
      "created_at": "2009-03-18T10:53:14+03:00",
      "id": 1,
      "image_id": null,
      "old_price": null,
      "price": "10.0",
      "product_id": 1,
      "sku": "423",
      "updated_at": "2009-03-18T10:53:14+03:00",
      "weight": null,
      "available": false,
      "title": "Red",
      "base_price": "10.0",
      "prices": [
        12.0
      ],
      "price2": 12.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"
        }
      ],
      "quantity": 0
    }
  ],
  "product_bundle_components": [

  ],
  "description": "guys, its a really cool t-shirt"
}

ProductField

Create product_field

Parameters

Name Description
product_field[title] required title
product_field[handle] required handle used in liquid
product_field[type] required ProductField::TextArea - textarea, ProductField::TextField - textfield
product_field[position] position in product_fields list
product_field[is_hidden] boolean

Request

Route

POST /admin/product_fields.json

Headers

Content-Type: application/json
Authorization: Basic ZGlnaXRhbC1nb29kczpjNTFjOTA3MDdhMTNjZTNmZmYyMTNhZmJiNWNkMTI3
MA==

Body

{
  "product_field": {
    "title": "Size",
    "handle": "size",
    "type": "ProductField::TextArea"
  }
}

Response

Status

201

Headers

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

Body

{
  "application_id": 1,
  "handle": "size",
  "id": 6,
  "is_hidden": null,
  "position": 3,
  "type": "ProductField::TextArea",
  "title": "Size"
}

Destroy product_field by handle

Request

Route

DELETE /admin/product_fields/handle2.json

Headers

Content-Type: application/json
Authorization: Basic ZGlnaXRhbC1nb29kczpjNTFjOTA3MDdhMTNjZTNmZmYyMTNhZmJiNWNkMTI3
MA==

Response

Status

200

Headers

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

Body

{
  "status": "ok"
}

Destroy product_field

Request

Route

DELETE /admin/product_fields/2.json

Headers

Content-Type: application/json
Authorization: Basic ZGlnaXRhbC1nb29kczpjNTFjOTA3MDdhMTNjZTNmZmYyMTNhZmJiNWNkMTI3
MA==

Response

Status

200

Headers

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

Body

{
  "status": "ok"
}

Get product_field by handle

Request

Route

GET /admin/product_fields/handle2.json

Headers

Authorization: Basic ZGlnaXRhbC1nb29kczpjNTFjOTA3MDdhMTNjZTNmZmYyMTNhZmJiNWNkMTI3
MA==

Response

Status

200

Headers

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

Body

{
  "application_id": 1,
  "handle": "handle2",
  "id": 2,
  "is_hidden": null,
  "position": 2,
  "type": "ProductField::TextArea",
  "title": "title2"
}

Get product_field

Request

Route

GET /admin/product_fields/2.json

Headers

Authorization: Basic ZGlnaXRhbC1nb29kczpjNTFjOTA3MDdhMTNjZTNmZmYyMTNhZmJiNWNkMTI3
MA==

Response

Status

200

Headers

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

Body

{
  "application_id": 1,
  "handle": "handle2",
  "id": 2,
  "is_hidden": null,
  "position": 2,
  "type": "ProductField::TextArea",
  "title": "title2"
}

Get product_fields

Request

Route

GET /admin/product_fields.json

Headers

Authorization: Basic ZGlnaXRhbC1nb29kczpjNTFjOTA3MDdhMTNjZTNmZmYyMTNhZmJiNWNkMTI3
MA==

Response

Status

200

Headers

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

Body

[
  {
    "application_id": null,
    "handle": "handle",
    "id": 1,
    "is_hidden": null,
    "position": 1,
    "type": "ProductField::TextField",
    "title": "title"
  },
  {
    "application_id": null,
    "handle": "yml_import",
    "id": 4,
    "is_hidden": null,
    "position": 1,
    "type": "ProductField::YmlImportField",
    "title": "import field"
  },
  {
    "application_id": 1,
    "handle": "handle2",
    "id": 2,
    "is_hidden": null,
    "position": 2,
    "type": "ProductField::TextArea",
    "title": "title2"
  }
]

Update product_field by handle

Parameters

Name Description method
product_field[title] title
product_field[handle] handle used in liquid new_handle
product_field[position] position in product_fields list
product_field[is_hidden] boolean

Request

Route

PUT /admin/product_fields/handle2.json

Headers

Content-Type: application/json
Authorization: Basic ZGlnaXRhbC1nb29kczpjNTFjOTA3MDdhMTNjZTNmZmYyMTNhZmJiNWNkMTI3
MA==

Body

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

Response

Status

200

Headers

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

Body

{
  "application_id": 1,
  "handle": "handle2",
  "id": 2,
  "is_hidden": null,
  "position": 2,
  "type": "ProductField::TextArea",
  "title": "Volume"
}

Update product_field

Parameters

Name Description
product_field[title] title
product_field[handle] handle used in liquid
product_field[position] position in product_fields list
product_field[is_hidden] boolean

Request

Route

PUT /admin/product_fields/2.json

Headers

Content-Type: application/json
Authorization: Basic ZGlnaXRhbC1nb29kczpjNTFjOTA3MDdhMTNjZTNmZmYyMTNhZmJiNWNkMTI3
MA==

Body

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

Response

Status

200

Headers

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

Body

{
  "application_id": 1,
  "handle": "volume",
  "id": 2,
  "is_hidden": null,
  "position": 2,
  "type": "ProductField::TextArea",
  "title": "Volume"
}

ProductFieldValue

Create product_field_value by handle

Parameters

Name Description
product_field_value[product_field_handle] required product field handle
product_field_value[value] product field value

Request

Route

POST /admin/products/1/product_field_values.json

Headers

Content-Type: application/json
Authorization: Basic ZGlnaXRhbC1nb29kczpjNTFjOTA3MDdhMTNjZTNmZmYyMTNhZmJiNWNkMTI3
MA==

Body

{
  "product_field_value": {
    "product_field_handle": "handle2",
    "value": "test value"
  }
}

Response

Status

201

Headers

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

Body

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

Create product_field_value

Parameters

Name Description
product_field_value[product_field_id] required product field id
product_field_value[value] product field value

Request

Route

POST /admin/products/1/product_field_values.json

Headers

Content-Type: application/json
Authorization: Basic ZGlnaXRhbC1nb29kczpjNTFjOTA3MDdhMTNjZTNmZmYyMTNhZmJiNWNkMTI3
MA==

Body

{
  "product_field_value": {
    "product_field_id": 2,
    "value": "test value"
  }
}

Response

Status

201

Headers

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

Body

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

Destroy product_field_value by handle

Request

Route

DELETE /admin/products/1/product_field_values/handle.json

Headers

Content-Type: application/json
Authorization: Basic ZGlnaXRhbC1nb29kczpjNTFjOTA3MDdhMTNjZTNmZmYyMTNhZmJiNWNkMTI3
MA==

Response

Status

200

Headers

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

Body

{
  "status": "ok"
}

Destroy product_field_value

Request

Route

DELETE /admin/products/1/product_field_values/1.json

Headers

Content-Type: application/json
Authorization: Basic ZGlnaXRhbC1nb29kczpjNTFjOTA3MDdhMTNjZTNmZmYyMTNhZmJiNWNkMTI3
MA==

Response

Status

200

Headers

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

Body

{
  "status": "ok"
}

Get product_field_value by handle

Request

Route

GET /admin/products/1/product_field_values/handle.json

Headers

Authorization: Basic ZGlnaXRhbC1nb29kczpjNTFjOTA3MDdhMTNjZTNmZmYyMTNhZmJiNWNkMTI3
MA==

Response

Status

200

Headers

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

Body

{
  "id": 1,
  "product_field_id": 1,
  "value": "some product field value"
}

Get product_field_value

Request

Route

GET /admin/products/1/product_field_values/1.json

Headers

Authorization: Basic ZGlnaXRhbC1nb29kczpjNTFjOTA3MDdhMTNjZTNmZmYyMTNhZmJiNWNkMTI3
MA==

Response

Status

200

Headers

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

Body

{
  "id": 1,
  "product_field_id": 1,
  "value": "some product field value"
}

Get product_field_values

Request

Route

GET /admin/products/1/product_field_values.json

Headers

Authorization: Basic ZGlnaXRhbC1nb29kczpjNTFjOTA3MDdhMTNjZTNmZmYyMTNhZmJiNWNkMTI3
MA==

Response

Status

200

Headers

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

Body

[
  {
    "id": 1,
    "product_field_id": 1,
    "value": "some product field value"
  }
]

Update product_field_value by handle

Parameters

Name Description
product_field_value[value] product field value

Request

Route

PUT /admin/products/1/product_field_values/handle.json

Headers

Content-Type: application/json
Authorization: Basic ZGlnaXRhbC1nb29kczpjNTFjOTA3MDdhMTNjZTNmZmYyMTNhZmJiNWNkMTI3
MA==

Body

{
  "product_field_value": {
    "value": "new value"
  }
}

Response

Status

200

Headers

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

Body

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

Update product_field_value

Parameters

Name Description
product_field_value[value] product field value

Request

Route

PUT /admin/products/1/product_field_values/1.json

Headers

Content-Type: application/json
Authorization: Basic ZGlnaXRhbC1nb29kczpjNTFjOTA3MDdhMTNjZTNmZmYyMTNhZmJiNWNkMTI3
MA==

Body

{
  "product_field_value": {
    "value": "new value"
  }
}

Response

Status

200

Headers

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

Body

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

Property

Create property

Parameters

Name Description
property[title] required title
property[permalink] permalink
property[position] position in property list
property[backoffice] show in backoffice
property[is_hidden] hide in product page on site
property[is_navigational] show in products filter on category page

Request

Route

POST /admin/properties.json

Headers

Content-Type: application/json
Authorization: Basic ZGlnaXRhbC1nb29kczpjNTFjOTA3MDdhMTNjZTNmZmYyMTNhZmJiNWNkMTI3
MA==

Body

{
  "property": {
    "title": "Country",
    "permalink": "country",
    "backoffice": true,
    "is_navigational": true
  }
}

Response

Status

201

Headers

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

Body

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

Destroy property

Request

Route

DELETE /admin/properties/1.json

Headers

Content-Type: application/json
Authorization: Basic ZGlnaXRhbC1nb29kczpjNTFjOTA3MDdhMTNjZTNmZmYyMTNhZmJiNWNkMTI3
MA==

Response

Status

200

Headers

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

Body

{
  "status": "ok"
}

Get properties

Request

Route

GET /admin/properties.json

Headers

Authorization: Basic ZGlnaXRhbC1nb29kczpjNTFjOTA3MDdhMTNjZTNmZmYyMTNhZmJiNWNkMTI3
MA==

Response

Status

200

Headers

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

Body

[
  {
    "backoffice": false,
    "id": -1,
    "is_hidden": false,
    "is_navigational": true,
    "position": 1,
    "permalink": "kategoriya-yandeks-marketa",
    "title": "Категория Яндекс Маркета"
  },
  {
    "backoffice": false,
    "id": 6,
    "is_hidden": true,
    "is_navigational": true,
    "position": 1,
    "permalink": "hidden",
    "title": "hidden"
  },
  {
    "backoffice": false,
    "id": 7,
    "is_hidden": false,
    "is_navigational": true,
    "position": 2,
    "permalink": "visible",
    "title": "visible"
  },
  {
    "backoffice": false,
    "id": 8,
    "is_hidden": false,
    "is_navigational": false,
    "position": 3,
    "permalink": "not_navigational",
    "title": "not_navigational"
  },
  {
    "backoffice": false,
    "id": 9,
    "is_hidden": false,
    "is_navigational": false,
    "position": 3,
    "permalink": "numeric",
    "title": "numeric"
  },
  {
    "backoffice": false,
    "id": 5,
    "is_hidden": false,
    "is_navigational": true,
    "position": 4,
    "permalink": "параметр",
    "title": "параметр"
  },
  {
    "backoffice": false,
    "id": 4,
    "is_hidden": false,
    "is_navigational": true,
    "position": 5,
    "permalink": "style",
    "title": "Style"
  },
  {
    "backoffice": false,
    "id": 3,
    "is_hidden": false,
    "is_navigational": true,
    "position": 6,
    "permalink": "vendor",
    "title": "Vendor"
  },
  {
    "backoffice": false,
    "id": 2,
    "is_hidden": false,
    "is_navigational": true,
    "position": 7,
    "permalink": "importer",
    "title": "Importer"
  },
  {
    "backoffice": false,
    "id": 1,
    "is_hidden": false,
    "is_navigational": true,
    "position": 8,
    "permalink": "producer",
    "title": "Producer"
  }
]

Get property

Request

Route

GET /admin/properties/1.json

Headers

Authorization: Basic ZGlnaXRhbC1nb29kczpjNTFjOTA3MDdhMTNjZTNmZmYyMTNhZmJiNWNkMTI3
MA==

Response

Status

200

Headers

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

Body

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

Update property

Parameters

Name Description
property[title] title

Request

Route

PUT /admin/properties/1.json

Headers

Content-Type: application/json
Authorization: Basic ZGlnaXRhbC1nb29kczpjNTFjOTA3MDdhMTNjZTNmZmYyMTNhZmJiNWNkMTI3
MA==

Body

{
  "property": {
    "title": "Brand country"
  }
}

Response

Status

200

Headers

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

Body

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

RecurringApplicationCharge

Create recurring_application_charge

Application can have only one recurring charge at any given time.

Parameters

Name Description
recurring_application_charge[monthly] required amount of monthly payment

Request

Route

POST /admin/recurring_application_charge.json

Headers

Content-Type: application/json
Authorization: Basic ZGlnaXRhbC1nb29kczpjNTFjOTA3MDdhMTNjZTNmZmYyMTNhZmJiNWNkMTI3
MA==

Body

{
  "recurring_application_charge": {
    "monthly": 200
  }
}

Response

Status

201

Headers

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

Body

{
  "id": 4,
  "monthly": "200.0",
  "blocked": false,
  "paid_till": "2017-01-08",
  "trial_expired_at": "2017-01-08",
  "created_at": "2017-01-01T03:00:00+03:00",
  "updated_at": "2017-01-01T03:00:00+03:00"
}

Destroy recurring_application_charge

Request

Route

DELETE /admin/recurring_application_charge.json

Headers

Content-Type: application/json
Authorization: Basic ZGlnaXRhbC1nb29kczpjNTFjOTA3MDdhMTNjZTNmZmYyMTNhZmJiNWNkMTI3
MA==

Response

Status

200

Headers

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

Body

{
  "status": "ok"
}

Get recurring_application_charge

Request

Route

GET /admin/recurring_application_charge.json

Headers

Authorization: Basic ZGlnaXRhbC1nb29kczpjNTFjOTA3MDdhMTNjZTNmZmYyMTNhZmJiNWNkMTI3
MA==

Response

Status

200

Headers

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

Body

{
  "id": 2,
  "monthly": "1190.0",
  "blocked": false,
  "paid_till": "2017-01-08",
  "trial_expired_at": "2017-01-08",
  "created_at": "2017-01-01T03:00:00+03:00",
  "updated_at": "2017-01-01T03:00:00+03:00"
}

Update recurring_application_charge

Parameters

Name Description
recurring_application_charge[monthly] amount of monthly payment

Request

Route

PUT /admin/recurring_application_charge.json

Headers

Content-Type: application/json
Authorization: Basic ZGlnaXRhbC1nb29kczpjNTFjOTA3MDdhMTNjZTNmZmYyMTNhZmJiNWNkMTI3
MA==

Body

{
  "recurring_application_charge": {
    "monthly": 300
  }
}

Response

Status

200

Headers

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

Body

{
  "id": 6,
  "monthly": "300.0",
  "blocked": false,
  "paid_till": "2017-01-08",
  "trial_expired_at": "2017-01-08",
  "created_at": "2017-01-01T03:00:00+03:00",
  "updated_at": "2017-01-01T03:00:00+03:00"
}

Redirect

Create redirect

Parameters

Name Description
redirect[old_url] required old url
redirect[new_url] required new url

Request

Route

POST /admin/redirects.json

Headers

Content-Type: application/json
Authorization: Basic ZGlnaXRhbC1nb29kczpjNTFjOTA3MDdhMTNjZTNmZmYyMTNhZmJiNWNkMTI3
MA==

Body

{
  "redirect": {
    "old_url": "/old_url",
    "new_url": "/new_url"
  }
}

Response

Status

201

Headers

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

Body

{
  "created_at": "2017-01-01T03:00:00+03:00",
  "id": 8,
  "new_url": "/new_url",
  "old_url": "/old_url"
}

Create redirect with removing redirect chains

Parameters

Name Description
redirect[old_url] required old url
redirect[new_url] required new url
redirect[remove_redirect_chains] if set to 1 and given a redirect A=>B when creating a new redirect B=>C, it will destroy old redirect (A=>B) and create new one (A=>C)

Request

Route

POST /admin/redirects.json

Headers

Content-Type: application/json
Authorization: Basic ZGlnaXRhbC1nb29kczpjNTFjOTA3MDdhMTNjZTNmZmYyMTNhZmJiNWNkMTI3
MA==

Body

{
  "redirect": {
    "old_url": "/like_new_url",
    "new_url": "/so_new_url",
    "remove_redirect_chains": 1
  }
}

Response

Status

201

Headers

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

Body

{
  "created_at": "2017-01-01T03:00:00+03:00",
  "id": 12,
  "new_url": "/so_new_url",
  "old_url": "/like_new_url"
}

Destroy redirect

Request

Route

DELETE /admin/redirects/14.json

Headers

Content-Type: application/json
Authorization: Basic ZGlnaXRhbC1nb29kczpjNTFjOTA3MDdhMTNjZTNmZmYyMTNhZmJiNWNkMTI3
MA==

Response

Status

200

Headers

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

Body

{
  "status": "ok"
}

Get redirect

Request

Route

GET /admin/redirects/4.json

Headers

Authorization: Basic ZGlnaXRhbC1nb29kczpjNTFjOTA3MDdhMTNjZTNmZmYyMTNhZmJiNWNkMTI3
MA==

Response

Status

200

Headers

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

Body

{
  "created_at": "2017-01-01T03:00:00+03:00",
  "id": 4,
  "new_url": "/like_new_url",
  "old_url": "/so_old_url"
}

Get redirects

Request

Route

GET /admin/redirects.json

Headers

Authorization: Basic ZGlnaXRhbC1nb29kczpjNTFjOTA3MDdhMTNjZTNmZmYyMTNhZmJiNWNkMTI3
MA==

Response

Status

200

Headers

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

Body

[
  {
    "created_at": "2017-01-01T03:00:00+03:00",
    "id": 2,
    "new_url": "/like_new_url",
    "old_url": "/so_old_url"
  }
]

Review

Create review

Parameters

Name Description
review[product_id] required product id
review[author] required author
review[content] content
review[email] email
review[published] should be published?
review[rating] product rating (1-10)

Request

Route

POST /admin/reviews.json

Headers

Content-Type: application/json
Authorization: Basic ZGlnaXRhbC1nb29kczpjNTFjOTA3MDdhMTNjZTNmZmYyMTNhZmJiNWNkMTI3
MA==

Body

{
  "review": {
    "product_id": 1,
    "author": "Bob",
    "content": "Nice product! I'd like to buy it!",
    "email": "bob@gmail.com",
    "published": true,
    "rating": 7
  }
}

Response

Status

201

Headers

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

Body

{
  "id": 3,
  "product_id": 1,
  "author": "Bob",
  "content": "Nice product! I'd like to buy it!",
  "email": "bob@gmail.com",
  "rating": 7,
  "published": true,
  "created_at": "2017-01-01T03:00:00+03:00",
  "updated_at": "2017-01-01T03:00:00+03:00"
}

Destroy review

Request

Route

DELETE /admin/reviews/1.json

Headers

Content-Type: application/json
Authorization: Basic ZGlnaXRhbC1nb29kczpjNTFjOTA3MDdhMTNjZTNmZmYyMTNhZmJiNWNkMTI3
MA==

Response

Status

200

Headers

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

Body

{
  "status": "ok"
}

Get review

Request

Route

GET /admin/reviews/1.json

Headers

Authorization: Basic ZGlnaXRhbC1nb29kczpjNTFjOTA3MDdhMTNjZTNmZmYyMTNhZmJiNWNkMTI3
MA==

Response

Status

200

Headers

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

Body

{
  "id": 1,
  "product_id": 1,
  "author": "Автор",
  "content": "Комментарий",
  "email": "email@email.com",
  "rating": 5,
  "published": true,
  "created_at": "2017-08-25T12:59:20+03:00",
  "updated_at": "2017-08-25T12:59:20+03:00"
}

Get reviews

Request

Route

GET /admin/reviews.json

Headers

Authorization: Basic ZGlnaXRhbC1nb29kczpjNTFjOTA3MDdhMTNjZTNmZmYyMTNhZmJiNWNkMTI3
MA==

Response

Status

200

Headers

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

Body

[
  {
    "id": 1,
    "product_id": 1,
    "author": "Автор",
    "content": "Комментарий",
    "email": "email@email.com",
    "rating": 5,
    "published": true,
    "created_at": "2017-08-25T12:59:20+03:00",
    "updated_at": "2017-08-25T12:59:20+03:00"
  }
]

Update review

Parameters

Name Description
review[content] content

Request

Route

PUT /admin/reviews/1.json

Headers

Content-Type: application/json
Authorization: Basic ZGlnaXRhbC1nb29kczpjNTFjOTA3MDdhMTNjZTNmZmYyMTNhZmJiNWNkMTI3
MA==

Body

{
  "review": {
    "content": "Sweet product!"
  }
}

Response

Status

200

Headers

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

Body

{
  "id": 1,
  "product_id": 1,
  "author": "Автор",
  "content": "Sweet product!",
  "email": "email@email.com",
  "rating": 5,
  "published": true,
  "created_at": "2017-08-25T12:59:20+03:00",
  "updated_at": "2017-01-01T03:00:00+03:00"
}

Similar

Create similar

Parameters

Name Description
similar_ids required similar ids array

Request

Route

POST /admin/products/1/similars.json

Headers

Content-Type: application/json
Authorization: Basic ZGlnaXRhbC1nb29kczpjNTFjOTA3MDdhMTNjZTNmZmYyMTNhZmJiNWNkMTI3
MA==

Body

{
  "similar_ids": [
    2
  ]
}

Response

Status

200

Headers

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

Body

{
  "status": "ok"
}

Destroy similar

Request

Route

DELETE /admin/products/1/similars/1.json

Headers

Content-Type: application/json
Authorization: Basic ZGlnaXRhbC1nb29kczpjNTFjOTA3MDdhMTNjZTNmZmYyMTNhZmJiNWNkMTI3
MA==

Response

Status

200

Headers

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

Body

{
  "status": "ok"
}

Get similars

Request

Route

GET /admin/products/1/similars.json

Headers

Authorization: Basic ZGlnaXRhbC1nb29kczpjNTFjOTA3MDdhMTNjZTNmZmYyMTNhZmJiNWNkMTI3
MA==

Response

Status

200

Headers

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

Body

[
  {
    "id": 3
  }
]

Stock Currency

Create stock_currency

Maximal quantity of currencies per account is 5.

Parameters

Name Description
stock_currency[code] required Available codes:LVL, BYR, USD, EUR, EEK, LTL, AMD, KGS, MDL, EGP, CAD, JPY, TNB, TRY, AZN, PLN, ILS, CNY, BGN, GBP, RUR, UAH, AUD, GEL, AED, CHF, KZT, UZS, TJS, VND, TMT, MXN
stock_currency[is_default] false by default, set it true to make this currency default for account
stock_currency[exchange_rate_use_cb] true by default, set it false to use manual exchange rate
stock_currency[exchange_rate_manual] manual exchange rate
stock_currency[exchange_rate_percent] 0 by default, deviation as a percentage from defined exchange rate

Request

Route

POST /admin/stock_currencies.json

Headers

Content-Type: application/json
Authorization: Basic ZGlnaXRhbC1nb29kczpjNTFjOTA3MDdhMTNjZTNmZmYyMTNhZmJiNWNkMTI3
MA==

Body

{
  "stock_currency": {
    "code": "KZT",
    "exchange_rate_percent": 10
  }
}

Response

Status

201

Headers

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

Body

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

Get stock currencies

Request

Route

GET /admin/stock_currencies.json

Headers

Authorization: Basic ZGlnaXRhbC1nb29kczpjNTFjOTA3MDdhMTNjZTNmZmYyMTNhZmJiNWNkMTI3
MA==

Response

Status

200

Headers

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

Body

[
  {
    "exchange_rate_manual": "30.0",
    "exchange_rate_percent": "0.0",
    "exchange_rate_use_cb": false,
    "id": 1,
    "is_default": true,
    "code": "LVL",
    "name": "Латвийский лат",
    "cb_rate": 30.0,
    "unit": "Ls"
  }
]

Get stock currency

Request

Route

GET /admin/stock_currencies/1.json

Headers

Authorization: Basic ZGlnaXRhbC1nb29kczpjNTFjOTA3MDdhMTNjZTNmZmYyMTNhZmJiNWNkMTI3
MA==

Response

Status

200

Headers

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

Body

{
  "exchange_rate_manual": "30.0",
  "exchange_rate_percent": "0.0",
  "exchange_rate_use_cb": false,
  "id": 1,
  "is_default": true,
  "code": "LVL",
  "name": "Латвийский лат",
  "cb_rate": 30.0,
  "unit": "Ls"
}

Update stock_currency

Parameters

Name Description
stock_currency[code] Available codes:LVL, BYR, USD, EUR, EEK, LTL, AMD, KGS, MDL, EGP, CAD, JPY, TNB, TRY, AZN, PLN, ILS, CNY, BGN, GBP, RUR, UAH, AUD, GEL, AED, CHF, KZT, UZS, TJS, VND, TMT, MXN
stock_currency[is_default] false by default, set it true to make this currency default for account
stock_currency[exchange_rate_use_cb] true by default, set it false to use manual exchange rate
stock_currency[exchange_rate_manual] manual exchange rate
stock_currency[exchange_rate_percent] 0 by default, deviation as a percentage from defined exchange rate

Request

Route

PUT /admin/stock_currencies/1.json

Headers

Content-Type: application/json
Authorization: Basic ZGlnaXRhbC1nb29kczpjNTFjOTA3MDdhMTNjZTNmZmYyMTNhZmJiNWNkMTI3
MA==

Body

{
  "stock_currency": {
    "code": "UAH",
    "is_default": true,
    "exchange_rate_use_cb": false,
    "exchange_rate_manual": 40,
    "exchange_rate_percent": 0
  }
}

Response

Status

200

Headers

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

Body

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

Supplementary

Create supplementary

Parameters

Name Description
supplementary_ids required supplementary ids array

Request

Route

POST /admin/products/1/supplementaries.json

Headers

Content-Type: application/json
Authorization: Basic ZGlnaXRhbC1nb29kczpjNTFjOTA3MDdhMTNjZTNmZmYyMTNhZmJiNWNkMTI3
MA==

Body

{
  "supplementary_ids": [
    2,
    3
  ]
}

Response

Status

200

Headers

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

Body

{
  "status": "ok"
}

Destroy supplementary

Request

Route

DELETE /admin/products/1/supplementaries/1.json

Headers

Content-Type: application/json
Authorization: Basic ZGlnaXRhbC1nb29kczpjNTFjOTA3MDdhMTNjZTNmZmYyMTNhZmJiNWNkMTI3
MA==

Response

Status

200

Headers

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

Body

{
  "status": "ok"
}

Get supplementaries

Request

Route

GET /admin/products/1/supplementaries.json

Headers

Authorization: Basic ZGlnaXRhbC1nb29kczpjNTFjOTA3MDdhMTNjZTNmZmYyMTNhZmJiNWNkMTI3
MA==

Response

Status

200

Headers

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

Body

[
  {
    "id": 3
  }
]

Variant

Create variant

Parameters

Name Description
variant[price] required price
variant[quantity] required quantity
variant[options] options
variant[variant_field_values_attributes] variant field values attributes

Request

Route

POST /admin/products/1/variants.json

Headers

Content-Type: application/json
Authorization: Basic ZGlnaXRhbC1nb29kczpjNTFjOTA3MDdhMTNjZTNmZmYyMTNhZmJiNWNkMTI3
MA==

Body

{
  "variant": {
    "price": 100,
    "quantity": 1,
    "options": [
      {
        "option_name_id": 1,
        "value": "Black"
      }
    ],
    "variant_field_values_attributes": [
      {
        "handle": "handle",
        "value": 12345
      }
    ]
  }
}

Response

Status

201

Headers

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

Body

{
  "id": 31098,
  "available": true,
  "product_id": 1,
  "image_id": null,
  "title": "Black",
  "base_price": "3000.0",
  "prices": [

  ],
  "price": "3000.0",
  "old_price": null,
  "sku": null,
  "barcode": null,
  "option_values": [
    {
      "id": 184,
      "option_name_id": 1,
      "position": 4,
      "title": "Black"
    }
  ],
  "variant_field_values": [
    {
      "id": 7,
      "variant_field_id": 1,
      "value": 12345
    }
  ],
  "quantity": 1,
  "weight": null,
  "created_at": "2017-01-01T03:00:00+03:00",
  "updated_at": "2017-01-01T03:00:00+03:00",
  "cost_price": null
}

Destroy variant

Request

Route

DELETE /admin/products/1/variants/1.json

Headers

Content-Type: application/json
Authorization: Basic ZGlnaXRhbC1nb29kczpjNTFjOTA3MDdhMTNjZTNmZmYyMTNhZmJiNWNkMTI3
MA==

Response

Status

200

Headers

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

Body

{
  "status": "ok"
}

Get variant

Request

Route

GET /admin/products/1/variants/1.json

Headers

Authorization: Basic ZGlnaXRhbC1nb29kczpjNTFjOTA3MDdhMTNjZTNmZmYyMTNhZmJiNWNkMTI3
MA==

Response

Status

200

Headers

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

Body

{
  "id": 1,
  "available": false,
  "product_id": 1,
  "image_id": null,
  "title": "Red",
  "base_price": "300.0",
  "prices": [
    "360.0"
  ],
  "price": "300.0",
  "old_price": null,
  "sku": "423",
  "barcode": null,
  "option_values": [
    {
      "id": 1,
      "option_name_id": 1,
      "position": 1,
      "title": "Red"
    }
  ],
  "variant_field_values": [
    {
      "id": 1,
      "variant_field_id": 1,
      "value": "some variant field value"
    }
  ],
  "quantity": 0,
  "weight": null,
  "created_at": "2009-03-18T10:53:14+03:00",
  "updated_at": "2009-03-18T10:53:14+03:00",
  "cost_price": "90.0",
  "price2": "360.0"
}

Get variants

Request

Route

GET /admin/products/1/variants.json

Headers

Authorization: Basic ZGlnaXRhbC1nb29kczpjNTFjOTA3MDdhMTNjZTNmZmYyMTNhZmJiNWNkMTI3
MA==

Response

Status

200

Headers

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

Body

[
  {
    "id": 1,
    "available": false,
    "product_id": 1,
    "image_id": null,
    "title": "Red",
    "base_price": "300.0",
    "prices": [
      "360.0"
    ],
    "price": "300.0",
    "old_price": null,
    "sku": "423",
    "barcode": null,
    "option_values": [
      {
        "id": 1,
        "option_name_id": 1,
        "position": 1,
        "title": "Red"
      }
    ],
    "variant_field_values": [
      {
        "id": 1,
        "variant_field_id": 1,
        "value": "some variant field value"
      }
    ],
    "quantity": 0,
    "weight": null,
    "created_at": "2009-03-18T10:53:14+03:00",
    "updated_at": "2009-03-18T10:53:14+03:00",
    "cost_price": "90.0",
    "price2": "360.0"
  }
]

Update variant

Parameters

Name Description
variant[price] price
variant[quantity] quantity
variant[variant_field_values_attributes] variant field values attributes

Request

Route

PUT /admin/products/1/variants/1.json

Headers

Content-Type: application/json
Authorization: Basic ZGlnaXRhbC1nb29kczpjNTFjOTA3MDdhMTNjZTNmZmYyMTNhZmJiNWNkMTI3
MA==

Body

{
  "variant": {
    "price": 150,
    "quantity": 2,
    "variant_field_values_attributes": [
      {
        "handle": "handle",
        "value": 12345
      }
    ]
  }
}

Response

Status

200

Headers

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

Body

{
  "id": 1,
  "available": true,
  "product_id": 1,
  "image_id": null,
  "title": "Red",
  "base_price": "4500.0",
  "prices": [
    "360.0"
  ],
  "price": "4500.0",
  "old_price": null,
  "sku": "423",
  "barcode": null,
  "option_values": [
    {
      "id": 1,
      "option_name_id": 1,
      "position": 1,
      "title": "Red"
    }
  ],
  "variant_field_values": [
    {
      "id": 1,
      "variant_field_id": 1,
      "value": 12345
    }
  ],
  "quantity": 2,
  "weight": null,
  "created_at": "2009-03-18T10:53:14+03:00",
  "updated_at": "2017-01-01T03:00:00+03:00",
  "cost_price": "90.0",
  "price2": "360.0"
}

VariantField

Create variant_field

Parameters

Name Description
variant_field[title] required title
variant_field[handle] required handle used in liquid
variant_field[type] required VariantField::TextArea - textarea, VariantField::TextField - textfield
variant_field[position] position in variant_fields list
variant_field[is_hidden] boolean

Request

Route

POST /admin/variant_fields.json

Headers

Content-Type: application/json
Authorization: Basic ZGlnaXRhbC1nb29kczpjNTFjOTA3MDdhMTNjZTNmZmYyMTNhZmJiNWNkMTI3
MA==

Body

{
  "variant_field": {
    "title": "Size",
    "handle": "size",
    "type": "VariantField::TextArea"
  }
}

Response

Status

201

Headers

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

Body

{
  "application_id": 1,
  "handle": "size",
  "id": 5,
  "is_hidden": null,
  "position": 3,
  "type": "VariantField::TextArea",
  "title": "Size"
}

Destroy variant_field by handle

Request

Route

DELETE /admin/variant_fields/handle2.json

Headers

Content-Type: application/json
Authorization: Basic ZGlnaXRhbC1nb29kczpjNTFjOTA3MDdhMTNjZTNmZmYyMTNhZmJiNWNkMTI3
MA==

Response

Status

200

Headers

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

Body

{
  "status": "ok"
}

Destroy variant_field

Request

Route

DELETE /admin/variant_fields/2.json

Headers

Content-Type: application/json
Authorization: Basic ZGlnaXRhbC1nb29kczpjNTFjOTA3MDdhMTNjZTNmZmYyMTNhZmJiNWNkMTI3
MA==

Response

Status

200

Headers

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

Body

{
  "status": "ok"
}

Get variant_field by handle

Request

Route

GET /admin/variant_fields/handle2.json

Headers

Authorization: Basic ZGlnaXRhbC1nb29kczpjNTFjOTA3MDdhMTNjZTNmZmYyMTNhZmJiNWNkMTI3
MA==

Response

Status

200

Headers

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

Body

{
  "application_id": 1,
  "handle": "handle2",
  "id": 2,
  "is_hidden": null,
  "position": 2,
  "type": "VariantField::TextArea",
  "title": "title2"
}

Get variant_field

Request

Route

GET /admin/variant_fields/2.json

Headers

Authorization: Basic ZGlnaXRhbC1nb29kczpjNTFjOTA3MDdhMTNjZTNmZmYyMTNhZmJiNWNkMTI3
MA==

Response

Status

200

Headers

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

Body

{
  "application_id": 1,
  "handle": "handle2",
  "id": 2,
  "is_hidden": null,
  "position": 2,
  "type": "VariantField::TextArea",
  "title": "title2"
}

Get variant_fields

Request

Route

GET /admin/variant_fields.json

Headers

Authorization: Basic ZGlnaXRhbC1nb29kczpjNTFjOTA3MDdhMTNjZTNmZmYyMTNhZmJiNWNkMTI3
MA==

Response

Status

200

Headers

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

Body

[
  {
    "application_id": null,
    "handle": "handle",
    "id": 1,
    "is_hidden": null,
    "position": 1,
    "type": "VariantField::TextField",
    "title": "title"
  },
  {
    "application_id": 1,
    "handle": "handle2",
    "id": 2,
    "is_hidden": null,
    "position": 2,
    "type": "VariantField::TextArea",
    "title": "title2"
  }
]

Update variant_field by handle

Parameters

Name Description method
variant_field[title] title
variant_field[handle] handle used in liquid new_handle
variant_field[position] position in variant_fields list
variant_field[is_hidden] boolean

Request

Route

PUT /admin/variant_fields/handle2.json

Headers

Content-Type: application/json
Authorization: Basic ZGlnaXRhbC1nb29kczpjNTFjOTA3MDdhMTNjZTNmZmYyMTNhZmJiNWNkMTI3
MA==

Body

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

Response

Status

200

Headers

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

Body

{
  "application_id": 1,
  "handle": "handle2",
  "id": 2,
  "is_hidden": null,
  "position": 2,
  "type": "VariantField::TextArea",
  "title": "Volume"
}

Update variant_field

Parameters

Name Description
variant_field[title] title
variant_field[handle] handle used in liquid
variant_field[position] position in variant_fields list
variant_field[is_hidden] boolean

Request

Route

PUT /admin/variant_fields/2.json

Headers

Content-Type: application/json
Authorization: Basic ZGlnaXRhbC1nb29kczpjNTFjOTA3MDdhMTNjZTNmZmYyMTNhZmJiNWNkMTI3
MA==

Body

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

Response

Status

200

Headers

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

Body

{
  "application_id": 1,
  "handle": "volume",
  "id": 2,
  "is_hidden": null,
  "position": 2,
  "type": "VariantField::TextArea",
  "title": "Volume"
}

VariantFieldValue

Create variant_field_value by handle

Parameters

Name Description
variant_field_value[variant_field_handle] required variant field handle
variant_field_value[value] variant field value

Request

Route

POST /admin/variants/1/variant_field_values.json

Headers

Content-Type: application/json
Authorization: Basic ZGlnaXRhbC1nb29kczpjNTFjOTA3MDdhMTNjZTNmZmYyMTNhZmJiNWNkMTI3
MA==

Body

{
  "variant_field_value": {
    "variant_field_handle": "handle2",
    "value": "test value"
  }
}

Response

Status

201

Headers

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

Body

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

Create variant_field_value

Parameters

Name Description
variant_field_value[variant_field_id] required variant field id
variant_field_value[value] variant field value

Request

Route

POST /admin/variants/1/variant_field_values.json

Headers

Content-Type: application/json
Authorization: Basic ZGlnaXRhbC1nb29kczpjNTFjOTA3MDdhMTNjZTNmZmYyMTNhZmJiNWNkMTI3
MA==

Body

{
  "variant_field_value": {
    "variant_field_id": 2,
    "value": "test value"
  }
}

Response

Status

201

Headers

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

Body

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

Destroy variant_field_value by handle

Request

Route

DELETE /admin/variants/1/variant_field_values/1.json

Headers

Content-Type: application/json
Authorization: Basic ZGlnaXRhbC1nb29kczpjNTFjOTA3MDdhMTNjZTNmZmYyMTNhZmJiNWNkMTI3
MA==

Response

Status

200

Headers

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

Body

{
  "status": "ok"
}

Destroy variant_field_value

Request

Route

DELETE /admin/variants/1/variant_field_values/1.json

Headers

Content-Type: application/json
Authorization: Basic ZGlnaXRhbC1nb29kczpjNTFjOTA3MDdhMTNjZTNmZmYyMTNhZmJiNWNkMTI3
MA==

Response

Status

200

Headers

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

Body

{
  "status": "ok"
}

Get variant_field_value by handle

Request

Route

GET /admin/variants/1/variant_field_values/handle.json

Headers

Authorization: Basic ZGlnaXRhbC1nb29kczpjNTFjOTA3MDdhMTNjZTNmZmYyMTNhZmJiNWNkMTI3
MA==

Response

Status

200

Headers

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

Body

{
  "id": 1,
  "variant_field_id": 1,
  "value": "some variant field value"
}

Get variant_field_value

Request

Route

GET /admin/variants/1/variant_field_values/1.json

Headers

Authorization: Basic ZGlnaXRhbC1nb29kczpjNTFjOTA3MDdhMTNjZTNmZmYyMTNhZmJiNWNkMTI3
MA==

Response

Status

200

Headers

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

Body

{
  "id": 1,
  "variant_field_id": 1,
  "value": "some variant field value"
}

Get variant_field_values

Request

Route

GET /admin/variants/1/variant_field_values.json

Headers

Authorization: Basic ZGlnaXRhbC1nb29kczpjNTFjOTA3MDdhMTNjZTNmZmYyMTNhZmJiNWNkMTI3
MA==

Response

Status

200

Headers

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

Body

[
  {
    "id": 1,
    "variant_field_id": 1,
    "value": "some variant field value"
  }
]

Update variant_field_value by handle

Parameters

Name Description
variant_field_value[value] variant field value

Request

Route

PUT /admin/variants/1/variant_field_values/handle.json

Headers

Content-Type: application/json
Authorization: Basic ZGlnaXRhbC1nb29kczpjNTFjOTA3MDdhMTNjZTNmZmYyMTNhZmJiNWNkMTI3
MA==

Body

{
  "variant_field_value": {
    "value": "new value"
  }
}

Response

Status

200

Headers

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

Body

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

Update variant_field_value

Parameters

Name Description
variant_field_value[value] variant field value

Request

Route

PUT /admin/variants/1/variant_field_values/1.json

Headers

Content-Type: application/json
Authorization: Basic ZGlnaXRhbC1nb29kczpjNTFjOTA3MDdhMTNjZTNmZmYyMTNhZmJiNWNkMTI3
MA==

Body

{
  "variant_field_value": {
    "value": "new value"
  }
}

Response

Status

200

Headers

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

Body

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

Webhook

Create webhook

Parameters

Name Description
webhook[address] required address
webhook[topic] required For now only 'orders/update' and 'orders/create' are available
webhook[format_type] format of data sent by webhook: 'json' or 'xml'

Request

Route

POST /admin/webhooks.json

Headers

Content-Type: application/json
Authorization: Basic ZGlnaXRhbC1nb29kczpjNTFjOTA3MDdhMTNjZTNmZmYyMTNhZmJiNWNkMTI3
MA==

Body

{
  "webhook": {
    "address": "http://application.com/orders/create",
    "topic": "orders/create",
    "format_type": "json"
  }
}

Response

Status

201

Headers

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

Body

{
  "address": "http://application.com/orders/create",
  "created_at": "2017-01-01T03:00:00+03:00",
  "id": 8,
  "topic": "orders/create",
  "format_type": "json"
}

Destroy webhook

Request

Route

DELETE /admin/webhooks/12.json

Headers

Content-Type: application/json
Authorization: Basic ZGlnaXRhbC1nb29kczpjNTFjOTA3MDdhMTNjZTNmZmYyMTNhZmJiNWNkMTI3
MA==

Response

Status

200

Headers

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

Body

{
  "status": "ok"
}

Get webhook

Request

Route

GET /admin/webhooks/4.json

Headers

Authorization: Basic ZGlnaXRhbC1nb29kczpjNTFjOTA3MDdhMTNjZTNmZmYyMTNhZmJiNWNkMTI3
MA==

Response

Status

200

Headers

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

Body

{
  "address": "http://app.ru/orders/create",
  "created_at": "2017-01-01T03:00:00+03:00",
  "id": 4,
  "topic": "orders/create",
  "format_type": "xml"
}

Get webhooks

Request

Route

GET /admin/webhooks.json

Headers

Authorization: Basic ZGlnaXRhbC1nb29kczpjNTFjOTA3MDdhMTNjZTNmZmYyMTNhZmJiNWNkMTI3
MA==

Response

Status

200

Headers

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

Body

[
  {
    "address": "http://app.ru/orders/create",
    "created_at": "2017-01-01T03:00:00+03:00",
    "id": 2,
    "topic": "orders/create",
    "format_type": "xml"
  }
]

Update webhook

Parameters

Name Description
webhook[address] address
webhook[topic] For now only 'orders/update' and 'orders/create' are available
webhook[format_type] format of data sent by webhook: json or xml

Request

Route

PUT /admin/webhooks/10.json

Headers

Content-Type: application/json
Authorization: Basic ZGlnaXRhbC1nb29kczpjNTFjOTA3MDdhMTNjZTNmZmYyMTNhZmJiNWNkMTI3
MA==

Body

{
  "webhook": {
    "format_type": "xml"
  }
}

Response

Status

200

Headers

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

Body

{
  "address": "http://app.ru/orders/create",
  "created_at": "2017-01-01T03:00:00+03:00",
  "id": 10,
  "topic": "orders/create",
  "format_type": "xml"
}