Edit products in bulk

PUT REST API request that requires a JSON body with authorization token in order to acquire, edit desired product.

Request

Request:

HTTP MethodPUT
URLStagehttps://api.stage.ananastest.com/product/api/v1/merchant- integration/product/bulk
Productionhttps://api.ananas.rs/product/api/v1/merchant-integration/product/bulk
HTTP Headers
Header nameHeader value
AuthorizationBearer {access_token}
Request Body

The request body represents an array of elements that have the following fields:

Fields nameTypeDescription
idLongProduct id
packageWeightValueBigDecimal/DoublePackage weight of product
packageWeightUnitStringProduct weight package unit
basePriceBigDecimal/DoubleProduct price with VAT included
stockLevelintegerProduct available stock level
serviceablebooleanServiceable flag
skuStringSKU value

Example of request body:

Click to copy
Success!
[
  {
    "id": 1770663,
    "stockLevel": 11,
    "basePrice": 155.3,
    "vat": 0,
    "packageWeightValue": 2.55,
    "packageWeightUnit": "kg",
    "serviceable": true,
    "sku": "00280106"
  },
  {
    "id": 123,
    "stockLevel": 11,
    "basePrice": 155.3,
    "vat": 0,
    "packageWeightValue": 2.55,
    "packageWeightUnit": "kg",
    "serviceable": true,
    "sku": "00280107"
  },
  {
    "id": 1770662,
    "stockLevel": 11,
    "basePrice": 155.3,
    "vat": 4,
    "packageWeightValue": 2.55,
    "packageWeightUnit": "kg",
    "serviceable": true,
    "sku": "00280108"
  }
]

Response

If the product with the ID does not exist, the endpoint will return a status of 404. Otherwise, it returns status 200 with the corresponding message

Response Body:

The response body represents an array of elements that have the following fields:

Fields nameTypeDescription
statusStringAction status. Values: “SUCCESS” or “FAIL”
errorsArray of stringErrors if action failed
myProductIdLongProduct id

Example of response:

Click to copy
Success!
[
  {
    status: "SUCCESS",
    errors: [],
    myProductId: 1770663,
  },
  {
    status: "FAIL",
    errors: ["Proizvod ne postoji"],
    myProductId: 123,
  },
  {
    status: "FAIL",
    errors: [
      "PDV mora biti jedan od sledecih vrednosti: 0, 10, 20. Prosleđena vrednost je 4",
    ],
    myProductId: 1770662,
  },
];
Copyright © Ananas 2023. All right reserved.