JSON Import API Reference
Bizzkit PIM provides JSON import API endpoints which are designed to import products into PIM and which are optimized for importing large amounts of data.
Purpose and scope
The main purpose of the JSON import API is to provide a way to import large amounts of data. Example use cases of this are:
- Product data migration from another system to Bizzkit PIM
- Synchronizing product data in Bizzkit PIM with data from an external system
Currently, the following functionality is supported by the JSON import API:
- Creation of new products which do not exist in Bizzkit PIM yet
- Updating existing products
- Setting/changing the primary category of products (new or existing)
- Placing products (new or existing) in additional categories
Endpoints
The JSON import API endpoints are JSON based endpoints for importing product data.
Info
Please see PIM API Reference for more details on the actual API endpoints.
Inserting new products
Adding new product data can be done by calling the /api/products/import/json/new-products
endpoint with a JSON file in the request body. This endpoint for inserting new product data assume that the provided products don't exist yet in PIM, which allows for high-performance bulk loading of data.
Updating existing products
The /api/products/import/json
endpoint can be used for updating products already existing in PIM, as well as inserting new products. It has a slight overhead compared to the /api/products/import/json/new-products
endpoint, so for maximum performance regarding importing new products this endpoint should be used instead.
Data schema
The following schema definitions describe the data model which is used to interact with the JSON import API endpoints:
Examples
Here are some simple examples of using the model.
Attribute with a single field and single value
Given a single value attribute called ATTR1
with one field named VALUE
of type PString
, the following JSON will create a product with a unique name PRODUCT1
:
Attribute with a multiple fields and a single value
Given a single value attribute called ATTR2
with a field named VALUE1
of type PString
, a field named VALUE2
of type PDateTime
, and a field named VALUE2
of type PInt32
, the following JSON will create a product with a unique name PRODUCT2
:
Attribute with a single field and segmented value
Given a single value attribute called ATTR3
with a field named VALUE
of type PChannelSpecificString
, the following JSON will create a product with a unique name PRODUCT3
:
Attribute with a single field and multiple values
Given a multiple value attribute called ATTR4
with one field named VALUE
of type PString
, the following JSON will create a product with a unique name PRODUCT4
:
For removing values from a multi-valued attribute the same syntax can be used, as the provided array of values overwrites the current value of the attribute. In order to remove all of the values set in the previous example, the following JSON should be used:
Add product to category
Given a single value attribute called ATTR1
with one field named VALUE
of type PString
, the following JSON will create a product with a unique name PRODUCT5
and add the product to a category called CATEGORY1
:
Attribute with a reference to a global list
Given an attribute called ATTR5
with a reference to a global list called LIST1
, the following JSON will create a product with a unique name PRODUCT6
and the ATTR5
attribute with a reference to an item with system name LIST1_K_0
in the global list:
Please note that you need to reference the key of the item, not the value.
Response from the endpoints
From both /api/products/import/json
and /api/products/import/json/new-products
endpoints, the response model is the same. The response will contain a model with the following properties:
where the statusUri
is the URI to the API endpoint to check the status of the import task and the resultUri
is the URI to view the result of the import task. An example of a response could be:
Making a request to /api/tasks/{taskId}/status
will return the current status of the import task. Here is an example of a response:
Making a request to /api/tasks/{taskId}/result
will return the result of the import task. Here is an example of a response:
If you need to see the input file used for the import task, you can make a request to /api/tasks/{taskId}/input-file
.