---
updatedAt: 2026-06-09T10:44:05.000Z
agentTools:
  projectIndex: https://developer.phorest.com/llms.txt
---

# Adjust stock quantity

Adjust stock quantity for the specified business id and branch id. Currently only stock increase and deduction are supported

# OpenAPI definition

```json
{
  "openapi": "3.0.1",
  "info": {
    "title": "Third Party API",
    "description": "This API allow third parties to integrate with Phorest internal core services such as core, online-booking, planner, etc. Please, see the <a href=\"http://dev-changelog.s3-website-eu-west-1.amazonaws.com/?prefix=/third-party-api-server/\" target=\"_blank\">CHANGELOG</a> for further information on API updates.",
    "license": {
      "name": "Apache 2.0",
      "url": "http://www.apache.org/licenses/LICENSE-2.0.html"
    },
    "version": "1.39.0"
  },
  "servers": [
    {
      "url": "http://api-gateway-eu.phorest.com/third-party-api-server",
      "description": "If you are from Europe, use this server"
    },
    {
      "url": "http://api-gateway-us.phorest.com/third-party-api-server",
      "description": "If you are from United States, Canada or Australia, use this server"
    }
  ],
  "security": [
    {
      "basicAuth": []
    }
  ],
  "tags": [
    {
      "name": "Stock",
      "description": "Stock Controller"
    }
  ],
  "paths": {
    "/api/business/{businessId}/branch/{branchId}/stock/adjustment": {
      "post": {
        "tags": [
          "Stock"
        ],
        "summary": "Adjust stock quantity",
        "description": "Adjust stock quantity for the specified business id and branch id. Currently only stock increase and deduction are supported",
        "operationId": "performStockAdjustment",
        "parameters": [
          {
            "name": "businessId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "branchId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/StockAdjustmentRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "204": {
            "description": "Stock quantity adjusted successfully"
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Business or branch with the specified ids don't exist",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Request rate limit exceeded. Current limit set to 100 rps.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "ErrorResponse": {
        "type": "object",
        "properties": {
          "statusCode": {
            "type": "integer",
            "format": "int32"
          },
          "id": {
            "type": "string"
          },
          "detail": {
            "type": "string"
          },
          "errorCode": {
            "type": "string"
          }
        }
      },
      "Stock": {
        "required": [
          "barcode",
          "operationType",
          "quantity"
        ],
        "type": "object",
        "properties": {
          "barcode": {
            "type": "string",
            "description": "This represent the barcode for the product",
            "example": "ab123"
          },
          "quantity": {
            "type": "integer",
            "description": "This represent the amount to either be added or deducted from the stock",
            "format": "int32",
            "example": 2
          },
          "operationType": {
            "type": "string",
            "description": "Represents the type of action to be performed. Currently only increase and deduction from stock are supported",
            "example": "DEDUCT",
            "enum": [
              "DEDUCT",
              "INCREASE"
            ]
          }
        },
        "description": "The items to be processed"
      },
      "StockAdjustmentRequest": {
        "type": "object",
        "properties": {
          "stocks": {
            "maxItems": 2147483647,
            "minItems": 1,
            "type": "array",
            "description": "The items to be processed",
            "items": {
              "$ref": "#/components/schemas/Stock"
            }
          },
          "barcodes": {
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        }
      }
    },
    "securitySchemes": {
      "basicAuth": {
        "type": "http",
        "scheme": "basic"
      }
    }
  }
}
```