Я хочу с помощью API добавить новые товары на продажу в Магазине на Kaspi.kz. Как получить схему JSON?
Обновлен
12.06.2024
Для этого отправьте API-запрос. Можно использовать любой сервис, например, Postman, Insomnia, Paw, Swagger, SoapUI или настроить интеграцию с вашей системой учета.
Посмотреть пример запроса
Скопировано
GET
https://kaspi.kz/shop/api/products/import/schema?HTTP/1.1=&Host= kaspi.kz
Accept: application/json
X-Auth-Token: token
В ответе вы получите параметры, которые можно использовать при работе с API в Магазине на Kaspi.kz, и описание данных для них.
Посмотреть пример ответа
Скопировано
{
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "Product attributes import scheme",
"description": "Used to validate JSON documents with product attribute values and images.",
"type": "array",
"minItems": 1,
"maxItems": 10000,
"items": {
"title": "Array of products",
"description": "Contains individual products with their attributes and images.",
"type": "object",
"properties": {
"sku": {
"title": "SKU",
"description": "Unique identifier used to find products in catalog.",
"type": "string",
"maxLength": 64,
"minLength": 1,
"example": "00167PVS"
},
"title": {
"title": "Product title",
"description": "Contains product title that would be shown on storefront, without category prefix (eg. Smartphone, Fridge etc.).",
"type": "string",
"maxLength": 1024,
"minLength": 1,
"example": "Sony Alpha A6100 Kit 16-50 мм OSS черный"
},
"brand": {
"title": "Product brand",
"description": "Contains product brand name that would be used in 'Brand' facet on product listing pages of storefront.",
"type": "string",
"maxLength": 256,
"minLength": 1,
"example": "Sony"
},
"category": {
"title": "Category code",
"description": "This code would be used to assign the product to a category. It also defines the scope of available attributes. Only leaf categories are accepted",
"type": "string",
"maxLength": 512,
"minLength": 1,
"example": "Master - Photo cameras",
"pattern": "^Master ?-[a-zA-Z_\\s\\d-]+$"
},
"description": {
"title": "Short product definition",
"description": "Contains small product definition used on item page. Usually defaults to some major specs.",
"type": "string",
"maxLength": 1024,
"minLength": 1,
"example": "- тип: беззеркальная со сменной оптикой\n- число эффективных пикселов: 24 Мпикс\n- объектив в комплекте: да\n- диагональ жк-экрана: 3 дюйм\n- ручная настройка выдержки и диафрагмы: да"
},
"weight": {
"title": "Product's weight (optional)",
"description": "Contains double value, but type is string",
"type": "string",
"maxLength": 256,
"minLength": 1
},
"attributes": {
"title": "List of attributes",
"description": "Array of attributes available for the assigned category.",
"type": "array",
"minItems": 1,
"maxItems": 256,
"items": {
"title": "Individual attribute",
"description": "Contains data for individual attribute.",
"type": "object",
"properties": {
"code": {
"title": "Attribute code",
"description": "Identifies attribute within category. Unique inside category.",
"type": "string",
"maxLength": 256,
"minLength": 1,
"example": "Photo cameras*Camera matrix.photo cameras*type",
"pattern": "^([a-zA-Z_\\s\\d&.\\-#%\/,]+\\*)+[a-zA-Z_\\s\\d&.\\-#%\/,]+$"
},
"value": {
"title": "Attribute value",
"description": "Array could be used for multivalued attributes only.",
"example": [
"[\"зеркальный фотоаппарат (TTL)\", \"фотоаппарат с оптическим видоискателем\"]",
"\"6000x4000\"",
"24"
],
"oneOf": [
{
"type": "array",
"minItems": 1,
"maxItems": 32,
"uniqueItems": true,
"items": {
"type": "string",
"maxLength": 256,
"minLength": 1
}
},
{
"type": "string",
"maxLength": 256,
"minLength": 1
},
{
"type": "number"
},
{
"type": "boolean"
}
]
}
},
"required": [
"code",
"value"
],
"additionalProperties": false
}
},
"images": {
"title": "Product images",
"description": "Must contain at least one valid image url. Valid means downloadable and having valid picture as content. Redirects are supported.",
"type": "array",
"minItems": 1,
"uniqueItems": true,
"items": {
"type": "object",
"properties": {
"url": {
"title": "Image url",
"description": "Individual image url.",
"type": "string",
"maxLength": 1024,
"minLength": 1,
"format": "uri",
"pattern": "^https?://",
"example": "https://cdn-kaspi.kz/shop/medias/sys_master/images/images/h5d/h37/16008607399966/sony-alpha-a6600-kit-16-50mm-cernyj-100692376-1.jpg"
}
},
"required": [
"url"
],
"additionalProperties": false
}
}
},
"required": [
"sku",
"title",
"brand",
"category",
"attributes",
"images"
],
"additionalProperties": false
}
}