# Record what received stock cost

`POST /accounting/stock/receipts` · Rivier · accounting

Record what received stock cost.

- Scope: accounting:write
- Sdk: accounting.stock.receive
- Cli: accounting stock receive

## Request body

`application/json`

```json
{
  "type": "object",
  "properties": {
    "variantId": {
      "type": "string",
      "format": "uuid"
    },
    "quantity": {
      "type": "integer",
      "exclusiveMinimum": 0,
      "maximum": 10000000
    },
    "unitCostMinor": {
      "type": "integer",
      "minimum": 0,
      "maximum": 99999999999
    },
    "receivedOn": {
      "type": "string",
      "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
    },
    "ref": {
      "type": "string",
      "maxLength": 120,
      "default": ""
    },
    "idempotencyKey": {
      "type": "string",
      "minLength": 1,
      "maxLength": 120
    }
  },
  "required": [
    "variantId",
    "quantity",
    "unitCostMinor",
    "idempotencyKey"
  ],
  "additionalProperties": false
}
```

## Responses

- `201`: 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/accounting/stock/receipts' \
  -H 'Authorization: Bearer $KEY' \
  -H 'Content-Type: application/json' \
  -d '{
  "variantId": "string",
  "quantity": 0,
  "unitCostMinor": 0,
  "idempotencyKey": "string"
}'
```
