Edit single product

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/id
Productionhttps://api.ananas.rs/product/api/v1/merchant-integration/product/id
URL Parameters
Parameter nameParameter value
idProduct id
HTTP Headers
Header nameHeader value
AuthorizationBearer {access_token}
Request Body:
Fields nameTypeDescription
packageWeightValueBigDecimal/DoublePackage weight of product
packageWeightUnitStringProduct weight package unit
basePriceBigDecimal/DoubleProduct price with VAT included
vat BigDecimal/DoubleProduct VAT
stockLevelIntegerProduct available stock level
serviceableboolean Serviceable flag
skuString SKU value

Example of request body:

Click to copy
Success!
{
  "packageWeightValue": 2.55,
  "packageWeightUnit": "kg",
  "basePrice": 155.3,
  "vat": 0,
  "stockLevel": 10,
  "serviceable": true,
  "sku": "00280106"
}

Response Body:

Fields nameTypeDescription
grantTypeStringAlways “CLIENT_CREDENTIALS”
clientIdStringReceived via Merchant Portal
clientSecretStringReceived via Merchant Portal
scopeStringAlways “public_api/full_access”

Example of request body:

Click to copy
Success!
{
    "packageWeightValue": 2.55,  
    "packageWeightUnit": "kg",  
    "basePrice": 155.3,  
    "vat": 0,  
    "stockLevel": 10,  
    "serviceable": true,  
    "sku":00280106}

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:
Fields nameTypeDescription
statusString Action 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  
}
Copyright © Ananas 2023. All right reserved.