Skip to main content

Bulk Categories by sourceId

POST 

/categories/bulk/sourceId

The bulk endpoints offer an efficient way of importing/updating large amounts of categories with just a single API call. When using the bulk sourceId endpoint, the categories are identified by sourceId, source and language. If a category doesn't already exist, it will be created. If it does exist, the category will be updated.

Category Bulk endpoints support bulk change of category attributes for multiple categories as well. To learn more about Attributes, go here.

A single category's attributes can be modified as explained in Bulk resource attribute values by resource lookup key, but if it's needed to modify attributes for multiple categories, this endpoint should be used.

Fields

NameRequired
categories (array of category objects)yes
sourceIdyes
sourceyes
languageyes
namesyes
descriptionsno
shortDescriptionsno
attributes

Read more about attributes
no
parentyes

For more details on attributes field, read this.

Directives

NameDescriptionFields
skipIfNotEmptyOn update, skip updating fields of an existing category that are not emptyarray of field names
e.g. names, descriptions, etc.
skipMoveOnUpdateOn update, skip moving an existing category in the parent category providedempty array
mergeTranslationsOnUpdateOn update, delete all translation for a category that are not provided in the payloadempty array

What are directives?

Request

Body

    categories

    object[]

  • Array [

  • descriptions

    object[]

  • Array [

  • language string
    value string
  • ]

  • language string

    name

    object[]

  • Array [

  • language string
    value string
  • ]

  • names

    object[]

  • Array [

  • language string
    value string
  • ]

  • parent

    object

    sourceId string

    shortDescriptions

    object[]

  • Array [

  • language string
    value string
  • ]

  • source string
    sourceId string
  • ]

  • directives

    object[]

  • Array [

  • fields string[]
    operation string
  • ]

Responses

Bulk Categories by sourceId - 200

Response Headers

  • Alt-Svc

    string

  • Via

    string

  • alt-svc

    string

  • content-length

    string

  • date

    string

  • return-format

    string

  • server

    string

  • x-request-id

    string

Schema

    data

    object[]

  • Array [

  • action string
    id number
    key string
    lookupKey string
    success boolean
  • ]

  • messages string[]
    total number
Loading...