> This is a page from the ElevenLabs documentation. For a complete page index, fetch https://elevenlabs.io/docs/llms.txt. For the full documentation in a single file, fetch https://elevenlabs.io/docs/llms-full.txt.

# Adjust Product Stock

POST https://api.elevenlabs.io/v1/reception/products/{product_id}/stock/adjust
Content-Type: application/json

Add to or subtract from the on-hand quantity of a counted product at one location, without overwriting orders taken at the same time.

Reference: https://elevenlabs.io/docs/api-reference/reception/products/stock/adjust

## Servers

- `https://api.elevenlabs.io` (Production, default)
- `https://api.us.elevenlabs.io` (Production US)
- `https://api.eu.residency.elevenlabs.io` (Production EU)
- `https://api.in.residency.elevenlabs.io` (Production India)
- `https://api.sg.residency.elevenlabs.io` (Production Singapore)

## Request

### Path parameters

- `product_id` (string, required)

### Headers

- `xi-workspace-id` (string, optional, nullable) — The customer workspace a reseller's API key acts on.

### Body (application/json)

This endpoint expects a SMBAdjustProductStockRequest.

- `location_id` (string, required) — Location whose count changes.
- `delta` (integer, required) — Signed change to apply to on-hand. Prefer this over an absolute write whenever the intent is 'a few more/fewer'.

## Response

### 200

成功响应

- `name` (string, required) — Name of the product.
- `_id` (string, required)
- `pricing_mode` (enum, optional, default: fixed) — 'fixed' (default): the item has a known price the agent can quote, and customers can book or order it directly. 'quote': the price depends on the job (renovation, catering, custom work), so no price or slot is offered; the agent collects the intake_questions and files a quote request instead. Takes effect only while quotes are enabled for the business. Group services cannot use 'quote'.
  - Allowed values: `fixed`, `quote`
- `intake_questions` (list of SMBIntakeQuestion, optional) — Questions the agent asks before booking or ordering this item. Required for a useful `pricing_mode='quote'` item -- without them a quote request arrives with nothing to price -- but also valid on fixed-price items that need extra detail (current hair color before a dye job, allergies before a treatment).
- `groups` (list of SMBGroupMembership, optional) — Group memberships for this item. Each entry carries the group label and the item's 0-based rank within that group.
- `ungrouped_rank` (integer, optional, nullable) — Display position among items with no group; `null` sorts last. Change it with the reorder endpoint.
- `description` (string, optional) — Description of the product.
- `price` (double, optional, nullable) — Price of the product; null for no listed price.
- `is_active` (boolean, optional, default: true) — False hides the product without deleting it.
- `orderable` (boolean, optional, default: true) — False keeps the product listed (callers can ask about it) but not orderable.
- `allowed_fulfillment_types` (list of enum, optional) — Fulfillment options customers may choose when ordering this product.
  - Allowed values: `pickup`, `delivery`, `digital`
- `location_ids` (list of string, optional) — Locations where this product is sold; empty list means all locations.
- `stock` (map from string to integer, optional, nullable) — On-hand quantity by location. None means unlimited. A missing location key means zero.
- `created_at_unix` (integer, optional) — Unix timestamp (seconds since epoch)
- `updated_at_unix` (integer, optional) — Unix timestamp (seconds since epoch)

## Errors

### 422 Unprocessable Entity Error

验证错误。

- `detail` (list of ValidationError, optional)

## Types

### SMBIntakeQuestion

A question the receptionist asks before booking or ordering this item.

- `label` (string, required) — The question as the agent should ask it, e.g. 'How many rooms?'. Phrased by the owner; the agent may rephrase for conversational flow but must not change what is being asked.
- `id` (string, optional) — Stable identifier referenced by stored answers. Survives label edits so history stays attributable to the right question.
- `kind` (enum, optional, default: text) — Answer shape for a per-item intake question.
  - Allowed values: `text`, `number`, `choice`
- `options` (list of string, optional) — Allowed answers for `kind='choice'`. Must be empty for the other kinds.
- `required` (boolean, optional, default: false) — Enforced on the booking page. On calls the receptionist asks, but still books if the caller won't answer.
- `is_active` (boolean, optional, default: true) — Retired questions are deactivated rather than deleted, so answers already stored against them keep resolving.

### SMBGroupMembership

Membership of an item in a single user-defined group, with its display rank inside that group.

- `label` (string, required)
- `rank` (integer, optional, default: 0) — 0-based display position within this group. Change it with the reorder endpoint; send back the value you read to keep the order, a membership sent without it goes to position 0.

### ValidationError

- `loc` (list of ValidationErrorLocItems, required)
- `msg` (string, required)
- `type` (string, required)

### ValidationErrorLocItems

- string
- integer

## Examples

**Request**

```json
{
  "location_id": "string",
  "delta": 1
}
```

**Response**

```json
{
  "name": "string",
  "_id": "string",
  "pricing_mode": "fixed",
  "intake_questions": [
    {
      "label": "string",
      "id": "string",
      "kind": "text",
      "options": [
        "string"
      ],
      "required": false,
      "is_active": true
    }
  ],
  "groups": [
    {
      "label": "string",
      "rank": 0
    }
  ],
  "ungrouped_rank": 1,
  "description": "string",
  "price": 1.1,
  "is_active": true,
  "orderable": true,
  "allowed_fulfillment_types": [
    "pickup"
  ],
  "location_ids": [
    "string"
  ],
  "stock": {},
  "created_at_unix": 1,
  "updated_at_unix": 1
}
```

**SDK Code**

```python
import requests

url = "https://api.elevenlabs.io/v1/reception/products/product_id/stock/adjust"

payload = {
    "location_id": "string",
    "delta": 1
}
headers = {"Content-Type": "application/json"}

response = requests.post(url, json=payload, headers=headers)

print(response.json())
```

```javascript
const url = 'https://api.elevenlabs.io/v1/reception/products/product_id/stock/adjust';
const options = {
  method: 'POST',
  headers: {'Content-Type': 'application/json'},
  body: '{"location_id":"string","delta":1}'
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://api.elevenlabs.io/v1/reception/products/product_id/stock/adjust"

	payload := strings.NewReader("{\n  \"location_id\": \"string\",\n  \"delta\": 1\n}")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby
require 'uri'
require 'net/http'

url = URI("https://api.elevenlabs.io/v1/reception/products/product_id/stock/adjust")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n  \"location_id\": \"string\",\n  \"delta\": 1\n}"

response = http.request(request)
puts response.read_body
```

```java
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://api.elevenlabs.io/v1/reception/products/product_id/stock/adjust")
  .header("Content-Type", "application/json")
  .body("{\n  \"location_id\": \"string\",\n  \"delta\": 1\n}")
  .asString();
```

```php
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.elevenlabs.io/v1/reception/products/product_id/stock/adjust', [
  'body' => '{
  "location_id": "string",
  "delta": 1
}',
  'headers' => [
    'Content-Type' => 'application/json',
  ],
]);

echo $response->getBody();
```

```csharp
using RestSharp;

var client = new RestClient("https://api.elevenlabs.io/v1/reception/products/product_id/stock/adjust");
var request = new RestRequest(Method.POST);
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"location_id\": \"string\",\n  \"delta\": 1\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let headers = ["Content-Type": "application/json"]
let parameters = [
  "location_id": "string",
  "delta": 1
] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://api.elevenlabs.io/v1/reception/products/product_id/stock/adjust")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```