# Receive stock (positive) or correct it (negative), idempotent on the key

`POST /shop/stock` · Rivier · shop

Receive stock (positive) or correct it (negative), idempotent on the key.

- Scope: shop:admin
- Mcp: rivier_shop_stock_adjust
- Sdk: shop.stock.adjust
- Cli: shop stock adjust

## Request body

`application/json`

```json
{
  "type": "object",
  "properties": {
    "variantId": {
      "type": "string",
      "format": "uuid"
    },
    "locationId": {
      "type": "string",
      "format": "uuid"
    },
    "quantity": {
      "type": "integer",
      "minimum": -1000000,
      "maximum": 1000000
    },
    "key": {
      "type": "string",
      "minLength": 1,
      "maxLength": 200
    },
    "reason": {
      "type": "string",
      "maxLength": 200,
      "default": ""
    }
  },
  "required": [
    "variantId",
    "locationId",
    "quantity"
  ],
  "additionalProperties": false
}
```

## Responses

- `200`: Success
- `400`: The request was malformed
- `401`: No valid credential
- `403`: The credential lacks the scope, origin or address
- `429`: Over the key's rate limit; see Retry-After

## Example

```sh
curl -X POST 'https://api.rivier.ai/shop/stock' \
  -H 'Authorization: Bearer $KEY' \
  -H 'Content-Type: application/json' \
  -d '{
  "variantId": "string",
  "locationId": "string",
  "quantity": 0
}'
```
