Batch Update Articles
POST
/v1/articles/{companyId}/{brandId}/batch-update
const url = 'https://api.dev.caspeco.net/api/am/v1/articles/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0/batch-update';const options = { method: 'POST', headers: {'Content-Type': 'application/json'}, body: '{"items":[{"articleId":"2489E9AD-2EE2-8E00-8EC9-32D5F69181C0","name":"example","description":"example","customerFacingName":"example","customerFacingDescription":"example","prices":{"regular":{"inclVat":1,"exclVat":1},"takeAway":{"inclVat":1,"exclVat":1},"conference":{"inclVat":1,"exclVat":1}},"attributes":{"colorHexValue":"example","resetColor":true,"allowDiscount":true,"resetAllowDiscount":true,"allowPriceOverride":true,"resetAllowPriceOverride":true,"salesUnit":"Piece","resetSalesUnit":true,"keepStockBalance":true,"resetKeepStockBalance":true,"isLoyaltyContributing":true,"resetIsLoyaltyContributing":true,"ageRestriction":1,"resetAgeRestriction":true,"nonSale":true,"resetNonSale":true}}]}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://api.dev.caspeco.net/api/am/v1/articles/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0/batch-update \ --header 'Content-Type: application/json' \ --data '{ "items": [ { "articleId": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "name": "example", "description": "example", "customerFacingName": "example", "customerFacingDescription": "example", "prices": { "regular": { "inclVat": 1, "exclVat": 1 }, "takeAway": { "inclVat": 1, "exclVat": 1 }, "conference": { "inclVat": 1, "exclVat": 1 } }, "attributes": { "colorHexValue": "example", "resetColor": true, "allowDiscount": true, "resetAllowDiscount": true, "allowPriceOverride": true, "resetAllowPriceOverride": true, "salesUnit": "Piece", "resetSalesUnit": true, "keepStockBalance": true, "resetKeepStockBalance": true, "isLoyaltyContributing": true, "resetIsLoyaltyContributing": true, "ageRestriction": 1, "resetAgeRestriction": true, "nonSale": true, "resetNonSale": true } } ] }'Updates up to 50 articles in a single all-or-nothing batch. Only provided fields are updated. Setting an attribute Reset flag to true resets that attribute to the inherited value.
Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”companyId
required
string format: uuid
brandId
required
string format: uuid
Request Body
Section titled “Request Body”object
items
required
Array<object>
object
articleId
required
string format: uuid
name
string
description
string
customerFacingName
string
customerFacingDescription
string
prices
object
regular
object
inclVat
number format: double
exclVat
number format: double
takeAway
object
inclVat
number format: double
exclVat
number format: double
conference
object
inclVat
number format: double
exclVat
number format: double
attributes
object
colorHexValue
string
resetColor
boolean
allowDiscount
boolean
resetAllowDiscount
boolean
allowPriceOverride
boolean
resetAllowPriceOverride
boolean
salesUnit
string
resetSalesUnit
boolean
keepStockBalance
boolean
resetKeepStockBalance
boolean
isLoyaltyContributing
boolean
resetIsLoyaltyContributing
boolean
ageRestriction
integer format: int32
resetAgeRestriction
boolean
nonSale
boolean
resetNonSale
boolean
object
items
required
Array<object>
object
articleId
required
string format: uuid
name
string
description
string
customerFacingName
string
customerFacingDescription
string
prices
object
regular
object
inclVat
number format: double
exclVat
number format: double
takeAway
object
inclVat
number format: double
exclVat
number format: double
conference
object
inclVat
number format: double
exclVat
number format: double
attributes
object
colorHexValue
string
resetColor
boolean
allowDiscount
boolean
resetAllowDiscount
boolean
allowPriceOverride
boolean
resetAllowPriceOverride
boolean
salesUnit
string
resetSalesUnit
boolean
keepStockBalance
boolean
resetKeepStockBalance
boolean
isLoyaltyContributing
boolean
resetIsLoyaltyContributing
boolean
ageRestriction
integer format: int32
resetAgeRestriction
boolean
nonSale
boolean
resetNonSale
boolean
object
items
required
Array<object>
object
articleId
required
string format: uuid
name
string
description
string
customerFacingName
string
customerFacingDescription
string
prices
object
regular
object
inclVat
number format: double
exclVat
number format: double
takeAway
object
inclVat
number format: double
exclVat
number format: double
conference
object
inclVat
number format: double
exclVat
number format: double
attributes
object
colorHexValue
string
resetColor
boolean
allowDiscount
boolean
resetAllowDiscount
boolean
allowPriceOverride
boolean
resetAllowPriceOverride
boolean
salesUnit
string
resetSalesUnit
boolean
keepStockBalance
boolean
resetKeepStockBalance
boolean
isLoyaltyContributing
boolean
resetIsLoyaltyContributing
boolean
ageRestriction
integer format: int32
resetAgeRestriction
boolean
nonSale
boolean
resetNonSale
boolean
Responses
Section titled “Responses”Returns updated articles
object
items
required
Array<object>
object
articleId
required
string format: uuid
categoryId
required
string format: uuid
externalId
string
articleNumber
required
integer format: int64
categoryExternalId
string
name
required
string
description
required
string
customerFacingName
required
string
customerFacingDescription
required
string
publicationStatus
required
string
prices
required
object
priceSource
required
string
regular
required
object
inclVat
number format: double
exclVat
number format: double
takeAway
required
object
inclVat
number format: double
exclVat
number format: double
conference
required
object
inclVat
number format: double
exclVat
number format: double
images
required
object
imageIdOneByOneUrl
string
imageIdSixteenByNineUrl
string
attributes
required
object
color
object
name
required
string
hexValue
required
string
allowDiscount
boolean
allowPriceOverride
boolean
salesUnit
string
keepStockBalance
boolean
isLoyaltyContributing
boolean
ageRestriction
integer format: int32
nonSale
boolean
object
items
required
Array<object>
object
articleId
required
string format: uuid
categoryId
required
string format: uuid
externalId
string
articleNumber
required
integer format: int64
categoryExternalId
string
name
required
string
description
required
string
customerFacingName
required
string
customerFacingDescription
required
string
publicationStatus
required
string
prices
required
object
priceSource
required
string
regular
required
object
inclVat
number format: double
exclVat
number format: double
takeAway
required
object
inclVat
number format: double
exclVat
number format: double
conference
required
object
inclVat
number format: double
exclVat
number format: double
images
required
object
imageIdOneByOneUrl
string
imageIdSixteenByNineUrl
string
attributes
required
object
color
object
name
required
string
hexValue
required
string
allowDiscount
boolean
allowPriceOverride
boolean
salesUnit
string
keepStockBalance
boolean
isLoyaltyContributing
boolean
ageRestriction
integer format: int32
nonSale
boolean
Example
{ "items": [ { "publicationStatus": "Draft", "prices": { "priceSource": "IncludingVat" }, "attributes": { "salesUnit": "Piece" } } ]}object
items
required
Array<object>
object
articleId
required
string format: uuid
categoryId
required
string format: uuid
externalId
string
articleNumber
required
integer format: int64
categoryExternalId
string
name
required
string
description
required
string
customerFacingName
required
string
customerFacingDescription
required
string
publicationStatus
required
string
prices
required
object
priceSource
required
string
regular
required
object
inclVat
number format: double
exclVat
number format: double
takeAway
required
object
inclVat
number format: double
exclVat
number format: double
conference
required
object
inclVat
number format: double
exclVat
number format: double
images
required
object
imageIdOneByOneUrl
string
imageIdSixteenByNineUrl
string
attributes
required
object
color
object
name
required
string
hexValue
required
string
allowDiscount
boolean
allowPriceOverride
boolean
salesUnit
string
keepStockBalance
boolean
isLoyaltyContributing
boolean
ageRestriction
integer format: int32
nonSale
boolean
Example
{ "items": [ { "publicationStatus": "Draft", "prices": { "priceSource": "IncludingVat" }, "attributes": { "salesUnit": "Piece" } } ]}Bad Request
object
statusCode
integer format: int32
message
string
validationErrors
Array<object>
object
field
required
string
errorId
required
string
entity
string
object
statusCode
integer format: int32
message
string
validationErrors
Array<object>
object
field
required
string
errorId
required
string
entity
string
Examplegenerated
{ "statusCode": 1, "message": "example", "validationErrors": [ { "field": "example", "errorId": "example" } ], "entity": "example"}object
statusCode
integer format: int32
message
string
validationErrors
Array<object>
object
field
required
string
errorId
required
string
entity
string
Examplegenerated
{ "statusCode": 1, "message": "example", "validationErrors": [ { "field": "example", "errorId": "example" } ], "entity": "example"}Unauthorized
Forbidden
Internal Server Error