# Create stock transaction Creates a new Stock Transaction record. Stock Transaction resource in the Animal Health Data Store Endpoint: POST /site/{siteId}/ahds/v1/stock-transaction Version: 1.0 Security: bearer ## Path parameters: - `siteId` (number, required) Site identifier ## Request fields (application/json): - `extensions` (object) Vendor- or practice-specific extensions. - `isActive` (boolean, required) Whether this stock transaction is active in the source system. Example: true - `productId` (string, required) Identifier of the product whose stock is affected. Example: "123e4567-e89b-12d3-a456-426614174000" - `quantity` (object, required) Quantity of stock affected by this transaction. - `quantity.value` (number, required) Numeric value Example: 1.5 - `quantity.unit` (string, required) Unit of measure Example: "km" - `quantity.system` (string) Unit system URI Example: "http://unitsofmeasure.org" - `separationId` (string) Identifier for the stock separation/batch/location if applicable. Example: "123e4567-e89b-12d3-a456-426614174000" - `shouldAlterStock` (boolean) Indicates whether this transaction should alter on-hand stock levels. Example: true - `status` (string) Status of the stock transaction. Enum: "pending", "completed", "cancelled", "reversed", "unknown" - `stockTransactionId` (string) Canonical identifier for this stock transaction. Example: "123e4567-e89b-12d3-a456-426614174000" - `subject` (object) Entity this stock transaction is for (e.g., invoice, order, procedure). - `transactedAt` (string, required) Effective date and time of the stock transaction. Example: "2025-01-01T00:00:00.000Z" ## Response 201 fields (application/json): - `createdAt` (string, required) Timestamp when the stock transaction record was created. Example: "2025-01-01T00:00:00.000Z" - `extensions` (object, required) Vendor- or practice-specific extensions. - `isActive` (boolean, required) Whether this stock transaction is active in the source system. Example: true - `productId` (string, required) Identifier of the product whose stock is affected. Example: "123e4567-e89b-12d3-a456-426614174000" - `quantity` (object, required) Quantity of stock affected by this transaction. - `quantity.value` (number, required) Numeric value Example: 1.5 - `quantity.unit` (string, required) Unit of measure Example: "km" - `quantity.system` (string) Unit system URI Example: "http://unitsofmeasure.org" - `separationId` (string, required) Identifier for the stock separation/batch/location if applicable. Example: "123e4567-e89b-12d3-a456-426614174000" - `shouldAlterStock` (boolean, required) Indicates whether this transaction should alter on-hand stock levels. Example: true - `status` (string, required) Status of the stock transaction. Enum: "pending", "completed", "cancelled", "reversed", "unknown" - `stockTransactionId` (string, required) Canonical identifier for this stock transaction. Example: "123e4567-e89b-12d3-a456-426614174000" - `subject` (object, required) Entity this stock transaction is for (e.g., invoice, order, procedure). - `updatedAt` (string, required) Timestamp when the stock transaction record was last updated. Example: "2025-01-01T00:00:00.000Z" - `transactedAt` (string, required) Effective date and time of the stock transaction. Example: "2025-01-01T00:00:00.000Z" ## Response 400 fields ## Response 401 fields ## Response 409 fields