Inventory

Create Inventory Item

Create a new inventory row owned by the caller.

Either product_id or name must be set (Pydantic validates this). If product_id is set, the referenced product must exist; we don't check whether the caller "should" be able to reference it — Partle products are public and any user can mark themselves as owning one.

post/v1/inventory/

Request

  • Base URL: http://localhost:8000
  • URL: http://localhost:8000/v1/inventory/
  • Auth: HTTP bearer

Headers

X-API-Keystring nullable

Request body

product_idinteger nullable

Link to a canonical Partle product. Use this when the user has a known product in mind. Either product_id or name must be set.

namestring nullable

Freeform name for items with no Partle product yet (e.g. one-off purchases from AliExpress, gifts). Either product_id or name must be set.

status'owned' | 'wanted' | 'for_sale' | 'sold' | 'discarded'
notesstring nullable

Freeform multi-line text — the dumping ground for anything not modeled as a column: extra URLs, comments, where stored, condition narrative, purpose, source, history, log entries, etc. Markdown is fine. Don't ask for a 'second_url' or 'comment' field — put it here.

acquisition_currencystring nullable
purchased_atstring date nullable

When you acquired it.

asking_currencystring nullable
conditionstring nullable

Free string — typical values: new, like_new, good, fair, poor.

external_linkstring nullable

Primary click-through URL for this item (one of: source listing, vendor page, manufacturer page). Exactly one — for additional URLs, drop them in notes as markdown links. UIs and cards display this one inline.

external_idstring nullable

Stable identifier from the source system, used as a dedup key. Per-user unique when set: same external_id can't appear twice for the same user. Format is up to the importer (e.g. aliexpress:1005004714348221, amazon:order/3024.../line/1, or a content hash). Leave null for handwritten items with no source.

projectstring nullable

Tag for grouping (e.g. 'kitchen-renovation', 'formula-student'). Not strictly enforced.

recipient_idinteger nullable

If the item is for someone else (e.g. a gift, a household member's item), their user ID. Most items leave this null.

Response

Successful Response

idinteger required
user_idinteger required
product_idinteger nullable
status'owned' | 'wanted' | 'for_sale' | 'sold' | 'discarded' required
namestring nullable
quantitystring required
notesstring nullable
acquisition_pricestring nullable
acquisition_currencystring nullable
purchased_atstring date-time nullable
asking_pricestring nullable
asking_currencystring nullable
conditionstring nullable
external_linkstring nullable
external_idstring nullable
projectstring nullable
recipient_idinteger nullable
created_atstring date-time required
updated_atstring date-time required

Changes

No recorded changes to this operation across all 2 revisions of this API.