{"components":{"headers":{"ETag":{"description":"The record version in quotes, such as `\"3\"`. Send it back as If-Match.","schema":{"type":"string"}},"Location":{"description":"URL of the created record.","schema":{"type":"string"}},"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"type":"integer"}},"WWW-Authenticate":{"description":"Bearer challenge.","schema":{"type":"string"}},"X-RateLimit-Limit":{"description":"Requests allowed per window.","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"Requests left in this window.","schema":{"type":"integer"}}},"parameters":{"after":{"description":"Opaque cursor from the previous page's `next_cursor`. It holds the list, the sort, the direction, and the last record's sort value and id, so the next page starts right after that record. Send it to the same list with the same `sort`: another `sort` of that list answers `422 validation_failed` with detail code `cursor_mismatch`, and a cursor of another list, or a changed or invented one, answers `422 validation_failed` with detail code `invalid`. Cursors of id order (the default) never expire and stay valid across releases.","in":"query","name":"after","schema":{"type":"string"}},"dryRun":{"description":"Validate and compute the quantity impact without writing. The response has `dry_run: true` and `impact`.","in":"query","name":"dry_run","schema":{"default":false,"type":"boolean"}},"idempotencyKey":{"description":"A unique key per intended write (a UUID). A retry with the same key and body replays the first response with `Idempotent-Replayed: true` and writes nothing. A request that never finished frees its key for a retry with the same body after a 105 second lease. Keys last 24 hours.","in":"header","name":"Idempotency-Key","schema":{"maxLength":255,"type":"string"}},"ifMatch":{"description":"The record version this write is based on (the `ETag` you read). Alternative to `lock_version` in the body; the body wins when both are sent.","in":"header","name":"If-Match","schema":{"example":"\"3\"","type":"string"}},"limit":{"description":"Page size (default 50, at most 200).","in":"query","name":"limit","schema":{"default":50,"maximum":200,"minimum":1,"type":"integer"}}},"responses":{"BadRequest":{"content":{"application/json":{"example":{"error":{"code":"bad_request","details":[],"message":"Refused: bad_request."}},"schema":{"properties":{"error":{"allOf":[{"$ref":"#/components/schemas/ErrorBody"}],"properties":{"code":{"enum":["bad_request","unknown_parameter"],"type":"string"}},"type":"object"}},"required":["error"],"type":"object"}}},"description":"The request cannot be read as sent. `bad_request`: malformed JSON, an invalid query string, or an invalid Idempotency-Key. `unknown_parameter`: a query parameter this operation does not declare; each `details` entry names one in `field` and lists the declared names in `allowed`. A declared parameter with a bad value is `422 validation_failed` instead."},"Busy":{"content":{"application/json":{"example":{"error":{"code":"busy","details":[],"message":"Refused: busy."}},"schema":{"properties":{"error":{"allOf":[{"$ref":"#/components/schemas/ErrorBody"}],"properties":{"code":{"enum":["busy"],"type":"string"}},"type":"object"}},"required":["error"],"type":"object"}}},"description":"Other writes of this account ran too long, so this write waited too long for its turn. Nothing was written unless the message says the request stopped part way.","headers":{"Retry-After":{"$ref":"#/components/headers/Retry-After"}}},"Conflict":{"content":{"application/json":{"example":{"error":{"code":"conflict","details":[{"code":"stale","field":"lock_version","message":"current version is 4"}],"message":"The record changed since the version you sent."}},"schema":{"properties":{"error":{"allOf":[{"$ref":"#/components/schemas/ErrorBody"}],"properties":{"code":{"enum":["conflict","idempotency_in_progress"],"type":"string"}},"type":"object"}},"required":["error"],"type":"object"}}},"description":"The record changed since the version you sent. `error.current` holds the stored record; reapply your change to it and retry with its lock_version."},"IdempotencyKeyReused":{"content":{"application/json":{"example":{"error":{"code":"idempotency_key_reused","details":[],"message":"Refused: idempotency_key_reused."}},"schema":{"properties":{"error":{"allOf":[{"$ref":"#/components/schemas/ErrorBody"}],"properties":{"code":{"enum":["idempotency_key_reused","validation_failed"],"type":"string"}},"type":"object"}},"required":["error"],"type":"object"}}},"description":"The Idempotency-Key was used for a different request."},"NotFound":{"content":{"application/json":{"example":{"error":{"code":"not_found","details":[],"message":"No such record, or it belongs to another account."}},"schema":{"properties":{"error":{"allOf":[{"$ref":"#/components/schemas/ErrorBody"}],"properties":{"code":{"enum":["not_found"],"type":"string"}},"type":"object"}},"required":["error"],"type":"object"}}},"description":"No such record, or it belongs to another account."},"PreconditionFailed":{"content":{"application/json":{"example":{"error":{"code":"precondition_failed","details":[],"message":"Refused: precondition_failed."}},"schema":{"properties":{"error":{"allOf":[{"$ref":"#/components/schemas/ErrorBody"}],"properties":{"code":{"enum":["precondition_failed"],"type":"string"}},"type":"object"}},"required":["error"],"type":"object"}}},"description":"If-Match holds a weak entity tag, or disagrees with lock_version in the body."},"RateLimited":{"content":{"application/json":{"example":{"error":{"code":"rate_limited","details":[],"message":"Too many requests for this token. Retry after 12 seconds."}},"schema":{"properties":{"error":{"allOf":[{"$ref":"#/components/schemas/ErrorBody"}],"properties":{"code":{"enum":["rate_limited"],"type":"string"}},"type":"object"}},"required":["error"],"type":"object"}}},"description":"Too many requests for this token.","headers":{"Retry-After":{"$ref":"#/components/headers/Retry-After"}}},"Unauthorized":{"content":{"application/json":{"example":{"error":{"code":"unauthorized","details":[],"message":"The API token is unknown or revoked."}},"schema":{"properties":{"error":{"allOf":[{"$ref":"#/components/schemas/ErrorBody"}],"properties":{"code":{"enum":["unauthorized"],"type":"string"}},"type":"object"}},"required":["error"],"type":"object"}}},"description":"Missing, malformed, unknown, or revoked token.","headers":{"WWW-Authenticate":{"$ref":"#/components/headers/WWW-Authenticate"}}},"UnsupportedMediaType":{"content":{"application/json":{"example":{"error":{"code":"unsupported_media_type","details":[],"message":"Refused: unsupported_media_type."}},"schema":{"properties":{"error":{"allOf":[{"$ref":"#/components/schemas/ErrorBody"}],"properties":{"code":{"enum":["unsupported_media_type","request_too_large"],"type":"string"}},"type":"object"}},"required":["error"],"type":"object"}}},"description":"The body is not application/json."},"ValidationFailed":{"content":{"application/json":{"example":{"error":{"code":"validation_failed","details":[{"allowed":["purchase","on_hand","salvaged","fabricated","supplied","kit"],"code":"invalid","field":"supply","message":"is invalid"}],"message":"The request has invalid fields."}},"schema":{"properties":{"error":{"allOf":[{"$ref":"#/components/schemas/ErrorBody"}],"properties":{"code":{"enum":["validation_failed"],"type":"string"}},"type":"object"}},"required":["error"],"type":"object"}}},"description":"Invalid fields, or a declared query parameter with a bad value. `details` has one entry per problem with a dotted `field` path; enum errors list `allowed` values. A cursor (`after`) of this list written for another `sort` has detail code `cursor_mismatch`; any other unusable cursor has detail code `invalid`."}},"schemas":{"RevisionInput":{"properties":{"name":{"type":"string"},"note":{"type":["string","null"]}},"required":["name"],"type":"object"},"DuplicateGroup":{"properties":{"key":{"type":"string"},"parts":{"items":{"$ref":"#/components/schemas/Part"},"type":"array"},"reason":{"enum":["same_mpn","same_name_and_manufacturer"],"type":"string"}},"required":[],"type":"object"},"SupplierCategories":{"properties":{"categories":{"items":{"properties":{"label":{"type":"string"},"slug":{"type":"string"}},"required":[],"type":"object"},"type":"array"},"kinds":{"items":{"properties":{"heading":{"description":"The plural heading.","type":"string"},"label":{"description":"The kind of one supplier, as the maker sees it.","type":"string"},"note":{"description":"What the kind means for a buyer.","type":"string"},"value":{"type":"string"}},"required":["value","label","heading","note"],"type":"object"},"type":"array"}},"required":["categories","kinds"],"type":"object"},"ErrorDetail":{"properties":{"allowed":{"items":{"type":"string"},"type":"array"},"code":{"description":"required, invalid, invalid_value, out_of_range, invalid_length, invalid_format, taken, over_allocation, stale, ...","type":"string"},"field":{"description":"Dotted path such as `items[0].quantity`.","type":["string","null"]},"message":{"type":"string"}},"required":["field","code","message"],"type":"object"},"BomWithCost":{"allOf":[{"$ref":"#/components/schemas/Bom"},{"properties":{"cost":{"$ref":"#/components/schemas/CostSummary"}},"required":[],"type":"object"}]},"OrderLinesInput":{"properties":{"entries":{"items":{"properties":{"description":{"type":["string","null"]},"line_id":{"type":"integer"},"quantity":{"description":"Units to order. A string or a number.","type":["string","number","null"]},"unit_price":{"description":"Per unit. A string or a number.","type":["string","number","null"]}},"required":["line_id","quantity"],"type":"object"},"type":"array"},"order":{"$ref":"#/components/schemas/OrderInput"},"order_id":{"type":"integer"}},"required":["entries"],"type":"object"},"BomInput":{"properties":{"build_count":{"default":1,"minimum":1,"type":"integer"},"build_label":{"type":["string","null"]},"name":{"maxLength":255,"type":"string"},"purpose":{"type":["string","null"]}},"required":["name"],"type":"object"},"SharedBuild":{"properties":{"access":{"enum":["link","code"],"type":"string"},"access_code":{"description":"The access code for a link with a code (owner only), such as `K7QM-4XRT-9WPA-ZH3C`; null otherwise.","type":["string","null"]},"author_name":{"type":["string","null"]},"bom_id":{"type":["integer","null"]},"changed_since_shared":{"type":"boolean"},"description":{"type":["string","null"]},"id":{"type":"integer"},"include_notes":{"type":"boolean"},"include_prices":{"type":"boolean"},"license":{"description":"Optional terms or credit line.","type":["string","null"]},"links":{"additionalProperties":{"type":["string","null"]},"description":"Related URLs.","type":"object"},"lock_version":{"description":"Optimistic lock version; send it back on writes.","minimum":1,"type":"integer"},"object":{"const":"shared_build"},"requirement_count":{"type":"integer"},"revision_id":{"type":["integer","null"]},"revision_label":{"type":["string","null"]},"shared_at":{"format":"date-time","type":["string","null"]},"slug":{"type":"string"},"stop_reason":{"enum":["stopped","trashed","deleted","taken_down",null],"type":["string","null"]},"stopped_at":{"format":"date-time","type":["string","null"]},"takedown_reason":{"type":["string","null"]},"title":{"type":"string"},"url":{"format":"uri","type":"string"}},"required":["id","object","slug","url","access","title","include_notes","include_prices","requirement_count","lock_version","links"],"type":"object"},"ReorderGroupsInput":{"properties":{"ordered_ids":{"items":{"type":"integer"},"type":"array"},"parent_id":{"type":["integer","null"]}},"required":["ordered_ids"],"type":"object"},"Comparison":{"description":"`from`, `to`, `added`, `removed`, `modified` ([{line_id, name, group_path, changes: {field: [old, new]}}]), `unchanged_count`, `bom_changes`, `groups` {added, removed, modified}, `open_orders` (line id to active order allocations).","type":"object"},"UndoResult":{"properties":{"event_id":{"type":"integer"},"record":{"description":"The record as the undo wrote it.","type":"object"}},"required":[],"type":"object"},"ImportCommitInput":{"allOf":[{"$ref":"#/components/schemas/ImportInput"},{"properties":{"mode":{"enum":["all_or_nothing","valid_rows"],"type":"string"},"remove_unmatched":{"type":"boolean"}},"required":[],"type":"object"}]},"ListingUpdate":{"properties":{"availability":{"type":["string","null"]},"confidence":{"enum":["verified","reported","unknown"],"type":"string"},"currency":{"default":"USD","type":"string"},"min_order_quantity":{"description":"Minimum packs. A string or a number.","type":["string","number","null"]},"notes":{"type":["string","null"]},"observed_at":{"format":"date-time","type":["string","null"]},"order_increment":{"description":"Pack increment. A string or a number.","type":["string","number","null"]},"pack_size":{"description":"Units per pack (default 1). A string or a number.","type":["string","number"]},"preferred":{"type":"boolean"},"price":{"description":"Price per pack. A string or a number.","type":["string","number","null"]},"sku":{"type":["string","null"]},"supplier":{"type":"string"},"url":{"type":["string","null"]}},"required":[],"type":"object"},"Revision":{"properties":{"author":{"properties":{"kind":{"enum":["user","agent"],"type":"string"},"name":{"type":["string","null"]}},"type":"object"},"bom_id":{"type":"integer"},"id":{"type":"integer"},"inserted_at":{"format":"date-time","type":["string","null"]},"links":{"additionalProperties":{"type":["string","null"]},"description":"Related URLs.","type":"object"},"name":{"type":["string","null"]},"note":{"type":["string","null"]},"number":{"type":"integer"},"object":{"const":"revision"}},"required":["id","bom_id","number","links"],"type":"object"},"NextStepItem":{"properties":{"allocation_id":{"type":["integer","null"]},"estimate":{"description":"Purchase estimate of the uncovered units (order), or null.","type":["object","null"]},"line":{"properties":{"group_id":{"type":["integer","null"]},"id":{"type":"integer"},"lock_version":{"description":"Optimistic lock version; send it back on writes.","minimum":1,"type":"integer"},"name":{"type":["string","null"]},"unit":{"type":["string","null"]}},"required":[],"type":"object"},"listing":{"oneOf":[{"$ref":"#/components/schemas/Listing"},{"type":"null"}]},"note":{"description":"`kind`: purchase (with estimate), no_listing, no_price, partly_received (accepted, quantity, receipt), not_placed, or text; null when there is nothing to say.","type":["object","null"]},"order":{"oneOf":[{"properties":{"id":{"type":"integer"},"status":{"enum":["planned","ordered","shipped","received","canceled"],"type":"string"},"supplier":{"type":["string","null"]}},"required":[],"type":"object"},{"type":"null"}]},"order_item_id":{"type":["integer","null"]},"quantity":{"description":"Units this step covers; null when the quantity is unknown.","pattern":"^-?[0-9]+(\\.[0-9]+)?$","type":["string","null"]},"reason":{"enum":["unresolved","needs_part","substitute_proposed","open_question",null],"type":["string","null"]},"reasons":{"items":{"type":"string"},"type":"array"},"source":{"enum":["order","stock","salvaged","fabricated","supplied","kit",null],"type":["string","null"]},"step":{"enum":["decide","order","place","receive","make","set_aside"],"type":"string"},"supplier":{"type":["string","null"]}},"required":[],"type":"object"},"AlternateImpact":{"description":"`alternate`, `line`, `current_part`, `candidate_part`, `allocations` ([{allocation, accepted, active}]), `orders`, `receipts`, `active_order_quantity`, `accepted_quantity`, `requires_allocation_decision`.","type":"object"},"ReceiptVoid":{"properties":{"replacement":{"oneOf":[{"$ref":"#/components/schemas/Receipt"},{"type":"null"}]},"voided":{"$ref":"#/components/schemas/Receipt"}},"required":[],"type":"object"},"ImportInput":{"properties":{"derive_source_ref":{"type":"boolean"},"format":{"enum":["auto","csv","tsv","json"],"type":"string"},"mapping":{"additionalProperties":{"type":"string"},"description":"Header to target, `attribute:<name>`, or `ignore`.","type":"object"},"text":{"description":"CSV, TSV, semicolon-separated text, or a Maker BOM JSON export.","type":"string"}},"required":["text"],"type":"object"},"OrderItemCreate":{"allOf":[{"$ref":"#/components/schemas/OrderItemInput"},{"properties":{"allocations":{"items":{"properties":{"line_id":{"type":"integer"},"note":{"type":["string","null"]},"quantity":{"description":"Units. A string or a number.","type":["string","number","null"]}},"required":["line_id","quantity"],"type":"object"},"type":"array"}},"required":[],"type":"object"}]},"Comment":{"properties":{"author":{"properties":{"kind":{"enum":["user","agent"],"type":"string"},"name":{"type":["string","null"]}},"type":"object"},"body":{"type":"string"},"bom_id":{"type":["integer","null"]},"edited_at":{"format":"date-time","type":["string","null"]},"group_id":{"type":["integer","null"]},"id":{"type":"integer"},"kind":{"enum":["note","question"],"type":"string"},"line_id":{"type":["integer","null"]},"links":{"additionalProperties":{"type":["string","null"]},"description":"Related URLs.","type":"object"},"object":{"const":"comment"},"order_id":{"type":["integer","null"]},"parent_id":{"type":["integer","null"]},"replies":{"items":{"$ref":"#/components/schemas/Comment"},"type":"array"},"resolved":{"type":"boolean"},"resolved_at":{"format":"date-time","type":["string","null"]},"resolved_by":{"type":["string","null"]},"target":{"enum":["bom","group","line","order"],"type":"string"}},"required":["id","target","kind","body","resolved","links"],"type":"object"},"MergePartInput":{"properties":{"lock_version":{"description":"Optimistic lock version; send it back on writes.","minimum":1,"type":"integer"},"merged_lock_version":{"description":"Optimistic lock version; send it back on writes.","minimum":1,"type":"integer"},"merged_part_id":{"type":"integer"}},"required":["merged_part_id"],"type":"object"},"ReplyInput":{"properties":{"body":{"type":"string"}},"required":["body"],"type":"object"},"AllocationUpdate":{"properties":{"note":{"type":["string","null"]},"order_item_id":{"description":"Required for and only for source `order`.","type":["integer","null"]},"quantity":{"description":"Units. A string or a number.","type":["string","number","null"]},"ready_quantity":{"description":"Non-order sources: units usable now. Refused on an order allocation. A string or a number.","type":["string","number"]},"source":{"enum":["order","stock","salvaged","fabricated","supplied","kit"],"type":"string"}},"required":[],"type":"object"},"OpenApiDocument":{"description":"An OpenAPI 3.1 document.","type":"object"},"CostSummary":{"properties":{"committed":{"description":"Ordered cost, with prorated shipping and tax.","type":"object"},"committed_missing":{"type":"boolean"},"committed_missing_count":{"type":"integer"},"committed_missing_item_ids":{"items":{"type":"integer"},"type":"array"},"estimate":{"description":"Currency to decimal string: what the build costs, priced per part.","type":"object"},"estimate_missing_line_ids":{"items":{"type":"integer"},"type":"array"},"estimated":{"description":"Per-line sum of estimates (the group rollups use this).","type":"object"},"missing_price_line_ids":{"items":{"type":"integer"},"type":"array"},"order_overhead":{"description":"Shipping and tax prorated to this BOM.","type":"object"},"overhead_partly_unpriced_order_ids":{"items":{"type":"integer"},"type":"array"},"planned_cost":{"description":"Cost on orders still planned.","type":"object"},"to_buy":{"description":"Currency to decimal string: what is still to buy, priced per part.","type":"object"},"to_source":{"description":"Per-line sum for uncovered units.","type":"object"}},"required":[],"type":"object"},"ImportNewBomInput":{"allOf":[{"$ref":"#/components/schemas/ImportCommitInput"},{"properties":{"bom":{"$ref":"#/components/schemas/BomInput"}},"required":[],"type":"object"}]},"Receipt":{"properties":{"exception":{"enum":["none","damaged","wrong_item","shortage","returned"],"type":"string"},"id":{"type":"integer"},"links":{"additionalProperties":{"type":["string","null"]},"description":"Related URLs.","type":"object"},"note":{"type":["string","null"]},"object":{"const":"receipt"},"order_item_id":{"type":"integer"},"quantity_accepted":{"description":"Decimal as a string.","pattern":"^-?[0-9]+(\\.[0-9]+)?$","type":["string","null"]},"quantity_received":{"description":"Decimal as a string.","pattern":"^-?[0-9]+(\\.[0-9]+)?$","type":["string","null"]},"received_on":{"format":"date","type":["string","null"]},"replaces_id":{"type":["integer","null"]},"voided":{"type":"boolean"},"voided_at":{"format":"date-time","type":["string","null"]}},"required":["id","order_item_id","quantity_received","quantity_accepted","exception","voided","links"],"type":"object"},"Order":{"properties":{"currency":{"type":"string"},"expected_on":{"format":"date","type":["string","null"]},"id":{"type":"integer"},"items":{"items":{"$ref":"#/components/schemas/OrderItem"},"type":"array"},"links":{"additionalProperties":{"type":["string","null"]},"description":"Related URLs.","type":"object"},"lock_version":{"description":"Optimistic lock version; send it back on writes.","minimum":1,"type":"integer"},"notes":{"type":["string","null"]},"object":{"const":"order"},"ordered_on":{"format":"date","type":["string","null"]},"reference":{"type":["string","null"]},"shipping_cost":{"description":"Decimal as a string.","pattern":"^-?[0-9]+(\\.[0-9]+)?$","type":["string","null"]},"status":{"enum":["planned","ordered","shipped","received","canceled"],"type":"string"},"supplier":{"type":"string"},"tax":{"description":"Decimal as a string.","pattern":"^-?[0-9]+(\\.[0-9]+)?$","type":["string","null"]},"url":{"type":["string","null"]}},"required":["id","supplier","status","currency","lock_version","links"],"type":"object"},"Analysis":{"properties":{"bom":{"$ref":"#/components/schemas/Bom"},"build_count":{"type":"integer"},"checks":{"items":{"properties":{"code":{"enum":["missing_quantity","duplicate_reference","no_supply_path","no_selected_part","missing_price","stale_price"],"type":"string"},"line_ids":{"items":{"type":"integer"},"type":"array"},"message":{"type":["string","null"]},"severity":{"type":["string","null"]}},"required":[],"type":"object"},"type":"array"},"groups":{"items":{"description":"Group rollup: group_id, parent_id, name, quantity, multiplier, depth, line_ids, line_count, status, status_counts, needs_part_count, purchase_counts, estimated, to_source, committed, missing_price_count.","type":"object"},"type":"array"},"lines":{"items":{"allOf":[{"$ref":"#/components/schemas/Breakdown"},{"properties":{"group_id":{"type":["integer","null"]},"id":{"type":"integer"},"name":{"type":["string","null"]},"references":{"items":{"type":"string"},"type":"array"}},"required":[],"type":"object"}]},"type":"array"},"order_items":{"items":{"description":"Order item summary.","type":"object"},"type":"array"},"parts":{"items":{"description":"Identical-part rollup: part_id, part, line_ids, references, units, required, covered, ready, on_order, uncovered, estimate.","type":"object"},"type":"array"},"summary":{"description":"line_count, status, status_counts, needs_part_count, purchase_counts, the cost fields of `CostSummary` (`estimate` and `to_buy` priced per part; `estimated` and `to_source` per-line sums), unresolved_line_ids, ready.","type":"object"},"tree":{"items":{"description":"{group_id, children, line_ids}","type":"object"},"type":"array"}},"required":[],"type":"object"},"PartInput":{"properties":{"attributes":{"description":"Custom fields.","type":"object"},"category":{"type":["string","null"]},"description":{"type":["string","null"]},"external_links":{"items":{"properties":{"label":{"type":["string","null"]},"url":{"format":"uri","type":"string"}},"required":["url"],"type":"object"},"type":"array"},"internal_ref":{"type":["string","null"]},"manufacturer":{"type":["string","null"]},"mpn":{"type":["string","null"]},"name":{"type":"string"}},"required":["name"],"type":"object"},"MergeGroupInput":{"properties":{"lock_version":{"description":"Optimistic lock version; send it back on writes.","minimum":1,"type":"integer"},"target_id":{"type":"integer"},"target_lock_version":{"description":"Optimistic lock version; send it back on writes.","minimum":1,"type":"integer"}},"required":["target_id"],"type":"object"},"OrderItemInput":{"properties":{"description":{"type":["string","null"]},"pack_count":{"description":"Packs. A string or a number.","type":["string","number","null"]},"pack_size":{"description":"Units per pack. A string or a number.","type":["string","number","null"]},"part_id":{"type":["integer","null"]},"quantity":{"description":"Usable units. A string or a number.","type":["string","number","null"]},"status":{"enum":["active","backordered","canceled"],"type":"string"},"unit":{"default":"pcs","type":"string"},"unit_price":{"description":"Per unit. A string or a number.","type":["string","number","null"]}},"required":["quantity"],"type":"object"},"BomExport":{"description":"The Maker BOM format: format (builderbom), version (1), exported_at, build, assemblies, requirements, parts, and the private sections records, status, orders, comments, revision. Schema: /schemas/builderbom/v1.json.","type":"object"},"Checklist":{"properties":{"bom_id":{"type":"integer"},"counts":{"additionalProperties":{"type":"integer"},"type":"object"},"filters":{"properties":{"group_id":{"type":["integer","null"]},"step":{"type":["string","null"]},"supplier":{"type":["string","null"]}},"required":[],"type":"object"},"item_count":{"type":"integer"},"line_count":{"description":"Distinct lines in the shown steps.","type":"integer"},"steps":{"items":{"properties":{"items":{"items":{"$ref":"#/components/schemas/NextStepItem"},"type":"array"},"step":{"enum":["decide","order","place","receive","make","set_aside"],"type":"string"}},"required":[],"type":"object"},"type":"array"},"suppliers":{"items":{"type":"string"},"type":"array"}},"required":[],"type":"object"},"OrderList":{"description":"bom_id, suppliers ([{supplier, items, totals, missing_price_count}]), needs_part, kit_supplied, line_names.","type":"object"},"VoidReceiptInput":{"properties":{"replacement":{"$ref":"#/components/schemas/ReceiptInput"}},"required":[],"type":"object"},"ImportNewBomResult":{"properties":{"bom":{"$ref":"#/components/schemas/Bom"},"import":{"$ref":"#/components/schemas/ImportResult"}},"required":[],"type":"object"},"Line":{"properties":{"attributes":{"description":"Custom fields.","type":"object"},"bom_id":{"type":"integer"},"category":{"type":["string","null"]},"deleted":{"type":"boolean"},"deleted_at":{"format":"date-time","type":["string","null"]},"external_links":{"items":{"properties":{"label":{"type":["string","null"]},"url":{"format":"uri","type":"string"}},"required":["url"],"type":"object"},"type":"array"},"group_id":{"type":["integer","null"]},"id":{"type":"integer"},"inclusion":{"enum":["required","optional","dnp"],"type":"string"},"inclusion_reason":{"type":["string","null"]},"inserted_at":{"format":"date-time","type":["string","null"]},"links":{"additionalProperties":{"type":["string","null"]},"description":"Related URLs.","type":"object"},"lock_version":{"description":"Optimistic lock version; send it back on writes.","minimum":1,"type":"integer"},"name":{"type":"string"},"notes":{"type":["string","null"]},"object":{"const":"line"},"part":{"oneOf":[{"$ref":"#/components/schemas/Part"},{"type":"null"}]},"part_id":{"type":["integer","null"]},"position":{"type":"integer"},"purpose":{"type":["string","null"]},"quantity":{"description":"Units per group instance; null means unknown.","pattern":"^-?[0-9]+(\\.[0-9]+)?$","type":["string","null"]},"references":{"items":{"type":"string"},"type":"array"},"source_ref":{"type":["string","null"]},"spares":{"description":"Decimal as a string.","pattern":"^-?[0-9]+(\\.[0-9]+)?$","type":["string","null"]},"supply":{"enum":["purchase","on_hand","salvaged","fabricated","supplied","kit"],"type":"string"},"tags":{"items":{"type":"string"},"type":"array"},"unit":{"type":"string"},"updated_at":{"format":"date-time","type":["string","null"]}},"required":["id","bom_id","name","unit","inclusion","supply","lock_version","links"],"type":"object"},"ErrorBody":{"properties":{"code":{"type":"string"},"current":{"description":"On `conflict`: the stored record.","type":"object"},"details":{"items":{"$ref":"#/components/schemas/ErrorDetail"},"type":"array"},"message":{"type":"string"},"preview":{"description":"On an invalid bulk edit or import: the preview.","type":"object"},"retry_after":{"description":"On `rate_limited`: seconds.","type":"integer"}},"required":["code","message","details"],"type":"object"},"Allocation":{"properties":{"id":{"type":"integer"},"line_id":{"type":"integer"},"links":{"additionalProperties":{"type":["string","null"]},"description":"Related URLs.","type":"object"},"note":{"type":["string","null"]},"object":{"const":"allocation"},"order_id":{"type":["integer","null"]},"order_item_id":{"type":["integer","null"]},"quantity":{"description":"Decimal as a string.","pattern":"^-?[0-9]+(\\.[0-9]+)?$","type":["string","null"]},"ready_quantity":{"description":"For non-order sources: assigned units usable now.","pattern":"^-?[0-9]+(\\.[0-9]+)?$","type":["string","null"]},"source":{"enum":["order","stock","salvaged","fabricated","supplied","kit"],"type":"string"}},"required":["id","line_id","source","quantity","links"],"type":"object"},"AlternateInput":{"properties":{"part_id":{"type":"integer"},"rationale":{"type":["string","null"]},"trade_offs":{"type":["string","null"]}},"required":["part_id"],"type":"object"},"Part":{"properties":{"attributes":{"description":"Custom fields.","type":"object"},"category":{"type":["string","null"]},"description":{"type":["string","null"]},"external_links":{"items":{"properties":{"label":{"type":["string","null"]},"url":{"format":"uri","type":"string"}},"required":["url"],"type":"object"},"type":"array"},"id":{"type":"integer"},"internal_ref":{"type":["string","null"]},"links":{"additionalProperties":{"type":["string","null"]},"description":"Related URLs.","type":"object"},"listings":{"items":{"$ref":"#/components/schemas/Listing"},"type":"array"},"lock_version":{"description":"Optimistic lock version; send it back on writes.","minimum":1,"type":"integer"},"manufacturer":{"type":["string","null"]},"mpn":{"type":["string","null"]},"name":{"type":"string"},"object":{"const":"part"},"retired":{"type":"boolean"},"retired_at":{"format":"date-time","type":["string","null"]}},"required":["id","name","lock_version","links"],"type":"object"},"Me":{"properties":{"api_version":{"type":"string"},"owner":{"properties":{"email":{"type":["string","null"]},"id":{"type":"integer"}},"required":[],"type":"object"},"permissions":{"items":{"enum":["boms:read","boms:write","groups:write","lines:write","alternates:write","revisions:write","parts:read","parts:write","orders:read","orders:write","comments:read","comments:write","events:read","imports:write","exports:read"],"type":"string"},"type":"array"},"rate_limit":{"properties":{"enabled":{"type":"boolean"},"limit":{"type":"integer"},"window_seconds":{"type":"integer"}},"required":[],"type":"object"},"server_time":{"format":"date-time","type":["string","null"]},"token":{"properties":{"default":{"type":"boolean"},"id":{"type":"integer"},"last_used_at":{"format":"date-time","type":["string","null"]},"name":{"type":["string","null"]},"prefix":{"type":["string","null"]}},"required":[],"type":"object"}},"required":[],"type":"object"},"ImportPreview":{"description":"bom_id, format, headers, mapping, targets, rows ([{row, action: add|update|unchanged|error, line_id, source_ref, name, attrs, group_path, part, listing, changes, errors}]), unmatched, summary {total, additions, updates, unchanged, errors, unmatched}.","type":"object"},"ListingInput":{"properties":{"availability":{"type":["string","null"]},"confidence":{"enum":["verified","reported","unknown"],"type":"string"},"currency":{"default":"USD","type":"string"},"min_order_quantity":{"description":"Minimum packs. A string or a number.","type":["string","number","null"]},"notes":{"type":["string","null"]},"observed_at":{"format":"date-time","type":["string","null"]},"order_increment":{"description":"Pack increment. A string or a number.","type":["string","number","null"]},"pack_size":{"description":"Units per pack (default 1). A string or a number.","type":["string","number"]},"preferred":{"type":"boolean"},"price":{"description":"Price per pack. A string or a number.","type":["string","number","null"]},"sku":{"type":["string","null"]},"supplier":{"type":"string"},"url":{"type":["string","null"]}},"required":["supplier"],"type":"object"},"CancelImpact":{"properties":{"lines":{"items":{"properties":{"bom_id":{"type":"integer"},"bom_name":{"type":["string","null"]},"line_id":{"type":"integer"},"line_name":{"type":["string","null"]},"stays_ready":{"description":"Accepted units that stay ready.","pattern":"^-?[0-9]+(\\.[0-9]+)?$","type":["string","null"]},"stops":{"description":"Units that go back to uncovered.","pattern":"^-?[0-9]+(\\.[0-9]+)?$","type":["string","null"]},"unit":{"type":["string","null"]}},"required":[],"type":"object"},"type":"array"},"stays_ready":{"description":"Total accepted units that stay ready.","pattern":"^-?[0-9]+(\\.[0-9]+)?$","type":["string","null"]},"stops":{"description":"Total units that go back to uncovered.","pattern":"^-?[0-9]+(\\.[0-9]+)?$","type":["string","null"]}},"required":[],"type":"object"},"LineWithBreakdown":{"allOf":[{"$ref":"#/components/schemas/Line"},{"properties":{"breakdown":{"oneOf":[{"$ref":"#/components/schemas/Breakdown"},{"type":"null"}]}},"required":[],"type":"object"}]},"UndoCheckManyInput":{"properties":{"event_ids":{"items":{"type":"integer"},"type":"array"}},"required":["event_ids"],"type":"object"},"CommentUpdate":{"properties":{"body":{"type":"string"},"kind":{"enum":["note","question"],"type":"string"}},"required":[],"type":"object"},"RejectAlternateInput":{"properties":{"decision_reason":{"type":["string","null"]}},"required":[],"type":"object"},"AllocatableItem":{"properties":{"item":{"$ref":"#/components/schemas/OrderItem"},"order":{"$ref":"#/components/schemas/Order"},"summary":{"description":"Order item summary; `unallocated` is the free capacity.","type":"object"}},"required":[],"type":"object"},"GroupUpdate":{"properties":{"description":{"type":["string","null"]},"lock_version":{"description":"Optimistic lock version; send it back on writes.","minimum":1,"type":"integer"},"name":{"type":"string"},"parent_id":{"type":["integer","null"]},"quantity":{"minimum":1,"type":"integer"}},"required":["lock_version"],"type":"object"},"OrderInput":{"properties":{"currency":{"default":"USD","type":"string"},"expected_on":{"format":"date","type":["string","null"]},"notes":{"type":["string","null"]},"ordered_on":{"format":"date","type":["string","null"]},"reference":{"type":["string","null"]},"shipping_cost":{"description":"Shipping. A string or a number.","type":["string","number","null"]},"status":{"enum":["planned","ordered","shipped","received","canceled"],"type":"string"},"supplier":{"type":"string"},"tax":{"description":"Tax. A string or a number.","type":["string","number","null"]},"url":{"type":["string","null"]}},"required":["supplier"],"type":"object"},"GroupInput":{"properties":{"description":{"type":["string","null"]},"name":{"type":"string"},"parent_id":{"type":["integer","null"]},"quantity":{"minimum":1,"type":"integer"}},"required":["name"],"type":"object"},"DeletionImpact":{"description":"`line_count`, `group_count`, `revision_count`, `comment_count`, `allocation_count`, `order_allocation_count`, `order_ids`, and the `bom`.","type":"object"},"ShareInput":{"properties":{"access":{"description":"`link`: anyone with the link. `code`: the link and an access code the app generates.","enum":["link","code"],"type":"string"},"author_name":{"description":"Shown as the author; stored on the shared build only.","type":["string","null"]},"description":{"description":"Default: the build's purpose.","type":["string","null"]},"include_notes":{"default":true,"description":"Include requirement notes and purpose.","type":"boolean"},"include_prices":{"default":false,"description":"Include observed prices with their date and currency.","type":"boolean"},"license":{"description":"Optional terms or credit line. It states no legal effect.","type":["string","null"]},"revision_id":{"description":"Share this saved revision instead of saving a new one.","type":["integer","null"]},"revision_name":{"description":"Name of the revision saved now. Default: Shared copy.","type":["string","null"]},"title":{"description":"Default: the build's name.","type":"string"}},"required":[],"type":"object"},"OrderCreate":{"properties":{"currency":{"default":"USD","type":"string"},"expected_on":{"format":"date","type":["string","null"]},"items":{"items":{"$ref":"#/components/schemas/OrderItemCreate"},"type":"array"},"notes":{"type":["string","null"]},"ordered_on":{"format":"date","type":["string","null"]},"reference":{"type":["string","null"]},"shipping_cost":{"description":"Shipping. A string or a number.","type":["string","number","null"]},"status":{"enum":["planned","ordered","shipped","received","canceled"],"type":"string"},"supplier":{"type":"string"},"tax":{"description":"Tax. A string or a number.","type":["string","number","null"]},"url":{"type":["string","null"]}},"required":["supplier"],"type":"object"},"BomUpdate":{"properties":{"build_count":{"minimum":1,"type":"integer"},"build_label":{"type":["string","null"]},"lock_version":{"description":"Optimistic lock version; send it back on writes.","minimum":1,"type":"integer"},"name":{"type":"string"},"purpose":{"type":["string","null"]}},"required":["lock_version"],"type":"object"},"OrderDetail":{"allOf":[{"$ref":"#/components/schemas/Order"},{"properties":{"summary":{"description":"Item value, `missing_price_count` (items without a unit price), shipping, tax, total, `total_complete` (false while a price is missing, so `total` is a lower bound), and per item `canceled`, `closed` (canceled, or on an order closed as received), `capacity`, allocated, `inactive_allocated`, unallocated, received, accepted, outstanding, and `unreceived` (ordered units a closed item will no longer deliver) quantities.","type":"object"}},"required":[],"type":"object"}]},"Listing":{"properties":{"availability":{"type":["string","null"]},"confidence":{"enum":["verified","reported","unknown"],"type":"string"},"currency":{"description":"ISO 4217.","type":"string"},"directory_supplier_id":{"description":"The published directory supplier whose host matches `url` (`GET /suppliers/{id}`), or null. It describes the supplier only; `confidence` and `observed_at` still say how far the price can be trusted.","type":["integer","null"]},"id":{"type":"integer"},"links":{"additionalProperties":{"type":["string","null"]},"description":"Related URLs.","type":"object"},"min_order_quantity":{"description":"Minimum packs.","pattern":"^-?[0-9]+(\\.[0-9]+)?$","type":["string","null"]},"notes":{"type":["string","null"]},"object":{"const":"listing"},"observed_at":{"format":"date-time","type":["string","null"]},"order_increment":{"description":"Pack increment.","pattern":"^-?[0-9]+(\\.[0-9]+)?$","type":["string","null"]},"pack_size":{"description":"Units per pack.","pattern":"^-?[0-9]+(\\.[0-9]+)?$","type":["string","null"]},"part_id":{"type":"integer"},"preferred":{"type":"boolean"},"price":{"description":"Price per pack; null when unknown.","pattern":"^-?[0-9]+(\\.[0-9]+)?$","type":["string","null"]},"sku":{"type":["string","null"]},"stale":{"description":"Observation missing or older than 30 days.","type":"boolean"},"supplier":{"type":"string"},"url":{"type":["string","null"]}},"required":["id","part_id","supplier","currency","preferred","links"],"type":"object"},"SupplierSuggestionResult":{"properties":{"outcome":{"enum":["queued","reason_added","already_suggested","already_published","not_listed"],"type":"string"},"suggestion":{"description":"Null for `already_published` unless this account suggested it earlier.","oneOf":[{"$ref":"#/components/schemas/SupplierSuggestion"},{"type":"null"}]},"supplier":{"description":"The directory entry, for `already_published` only.","oneOf":[{"$ref":"#/components/schemas/Supplier"},{"type":"null"}]}},"required":["outcome","suggestion","supplier"],"type":"object"},"LineUpdate":{"properties":{"attributes":{"description":"Custom fields such as value, tolerance, package, footprint.","type":"object"},"category":{"type":["string","null"]},"external_links":{"items":{"properties":{"label":{"type":["string","null"]},"url":{"format":"uri","type":"string"}},"required":["url"],"type":"object"},"type":"array"},"group_id":{"type":["integer","null"]},"inclusion":{"enum":["required","optional","dnp"],"type":"string"},"inclusion_reason":{"type":["string","null"]},"lock_version":{"description":"Optimistic lock version; send it back on writes.","minimum":1,"type":"integer"},"name":{"maxLength":255,"type":"string"},"notes":{"type":["string","null"]},"part_id":{"description":"Selected part; null while open.","type":["integer","null"]},"purpose":{"type":["string","null"]},"quantity":{"description":"Units per one instance of the group; null means unknown (the line is unresolved). A string or a number.","type":["string","number","null"]},"references":{"description":"Reference designators; ranges such as R1-R4 are kept as sent.","items":{"type":"string"},"type":["array","string"]},"source_ref":{"type":["string","null"]},"spares":{"description":"Absolute extra units (default 0). A string or a number.","type":["string","number","null"]},"supply":{"enum":["purchase","on_hand","salvaged","fabricated","supplied","kit"],"type":"string"},"tags":{"description":"List or comma-separated string.","items":{"type":"string"},"type":["array","string"]},"unit":{"default":"pcs","type":"string"}},"required":["lock_version"],"type":"object"},"GroupNode":{"allOf":[{"$ref":"#/components/schemas/Group"},{"properties":{"children":{"items":{"$ref":"#/components/schemas/GroupNode"},"type":"array"}},"required":[],"type":"object"}]},"MoveLineInput":{"properties":{"group_id":{"type":["integer","null"]},"lock_version":{"description":"Optimistic lock version; send it back on writes.","minimum":1,"type":"integer"},"position":{"type":["integer","null"]}},"required":["group_id"],"type":"object"},"BulkInput":{"properties":{"attrs":{"description":"For `update`: fields among quantity, unit, spares, inclusion, inclusion_reason, supply, category, part_id, purpose, notes.","type":"object"},"expected_versions":{"additionalProperties":{"type":"integer"},"description":"Apply only: line id to lock_version.","type":"object"},"group_id":{"description":"For `move` and `copy`.","type":["integer","null"]},"line_ids":{"items":{"type":"integer"},"type":"array"},"operation":{"enum":["update","add_tags","remove_tags","move","copy","delete","restore"],"type":"string"},"tags":{"items":{"type":"string"},"type":"array"}},"required":["line_ids","operation"],"type":"object"},"MoveGroupInput":{"properties":{"lock_version":{"description":"Optimistic lock version; send it back on writes.","minimum":1,"type":"integer"},"parent_id":{"type":["integer","null"]},"position":{"type":["integer","null"]}},"required":["parent_id"],"type":"object"},"ShareUpdate":{"properties":{"access":{"description":"`link`: anyone with the link. `code`: the link and an access code the app generates.","enum":["link","code"],"type":"string"},"author_name":{"description":"Shown as the author; stored on the shared build only.","type":["string","null"]},"description":{"description":"Default: the build's purpose.","type":["string","null"]},"include_notes":{"default":true,"description":"Include requirement notes and purpose.","type":"boolean"},"include_prices":{"default":false,"description":"Include observed prices with their date and currency.","type":"boolean"},"license":{"description":"Optional terms or credit line. It states no legal effect.","type":["string","null"]},"lock_version":{"description":"Optimistic lock version; send it back on writes.","minimum":1,"type":"integer"},"revision_id":{"description":"Share this saved revision instead of saving a new one.","type":["integer","null"]},"revision_name":{"description":"Name of the revision saved now. Default: Shared copy.","type":["string","null"]},"snapshot":{"default":true,"description":"Take a new snapshot (true) or change only the settings (false).","type":"boolean"},"title":{"description":"Default: the build's name.","type":"string"}},"required":[],"type":"object"},"Breakdown":{"properties":{"allocations":{"items":{"description":"allocation_id, source, order_item_id, order_id, active, quantity, ready, on_order, in_progress","type":"object"},"type":"array"},"committed":{"description":"Currency to decimal string.","type":"object"},"committed_missing_price":{"type":"boolean"},"covered":{"description":"Decimal as a string.","pattern":"^-?[0-9]+(\\.[0-9]+)?$","type":["string","null"]},"estimate":{"description":"Cost estimate from the preferred listing, or null.","type":["object","null"]},"estimate_missing":{"enum":["no_part","no_listing","no_price","unresolved",null],"type":["string","null"]},"excess":{"description":"Decimal as a string.","pattern":"^-?[0-9]+(\\.[0-9]+)?$","type":["string","null"]},"in_progress":{"description":"Decimal as a string.","pattern":"^-?[0-9]+(\\.[0-9]+)?$","type":["string","null"]},"line_id":{"type":"integer"},"multiplier":{"type":"integer"},"needs_part":{"type":"boolean"},"on_order":{"description":"Decimal as a string.","pattern":"^-?[0-9]+(\\.[0-9]+)?$","type":["string","null"]},"ordered":{"description":"Decimal as a string.","pattern":"^-?[0-9]+(\\.[0-9]+)?$","type":["string","null"]},"planned":{"description":"Part of on_order on orders still planned.","pattern":"^-?[0-9]+(\\.[0-9]+)?$","type":["string","null"]},"planned_cost":{"description":"Currency to decimal string: cost of allocations on orders still planned, kept apart from committed.","type":"object"},"purchase":{"enum":["no_purchase_needed","unordered","partly_ordered","fully_ordered"],"type":"string"},"purchase_demand":{"description":"Units still to buy: required minus active non-order coverage; null when unresolved.","pattern":"^-?[0-9]+(\\.[0-9]+)?$","type":["string","null"]},"ready":{"description":"Decimal as a string.","pattern":"^-?[0-9]+(\\.[0-9]+)?$","type":["string","null"]},"required":{"description":"quantity × group multipliers × build_count + spares; 0 for dnp; null when unresolved.","pattern":"^-?[0-9]+(\\.[0-9]+)?$","type":["string","null"]},"stale_price":{"type":"boolean"},"status":{"enum":["excluded","unresolved","to_source","in_progress","ready"],"type":"string"},"to_source_estimate":{"description":"Estimate for the uncovered units, or null.","type":["object","null"]},"uncovered":{"description":"Decimal as a string.","pattern":"^-?[0-9]+(\\.[0-9]+)?$","type":["string","null"]}},"required":[],"type":"object"},"ReceiptInput":{"properties":{"exception":{"enum":["none","damaged","wrong_item","shortage","returned"],"type":"string"},"note":{"type":["string","null"]},"quantity_accepted":{"description":"Usable units (default: received). A string or a number.","type":["string","number","null"]},"quantity_received":{"description":"Units that arrived. A string or a number.","type":["string","number","null"]},"received_on":{"format":"date","type":["string","null"]}},"required":["quantity_received"],"type":"object"},"OrderUpdate":{"properties":{"currency":{"default":"USD","type":"string"},"expected_on":{"format":"date","type":["string","null"]},"lock_version":{"description":"Optimistic lock version; send it back on writes.","minimum":1,"type":"integer"},"notes":{"type":["string","null"]},"ordered_on":{"format":"date","type":["string","null"]},"reference":{"type":["string","null"]},"shipping_cost":{"description":"Shipping. A string or a number.","type":["string","number","null"]},"status":{"enum":["planned","ordered","shipped","received","canceled"],"type":"string"},"supplier":{"type":"string"},"tax":{"description":"Tax. A string or a number.","type":["string","number","null"]},"url":{"type":["string","null"]}},"required":["lock_version"],"type":"object"},"LineDetail":{"allOf":[{"$ref":"#/components/schemas/Line"},{"properties":{"allocations":{"items":{"$ref":"#/components/schemas/Allocation"},"type":"array"},"alternates":{"items":{"$ref":"#/components/schemas/Alternate"},"type":"array"},"breakdown":{"oneOf":[{"$ref":"#/components/schemas/Breakdown"},{"type":"null"}]},"open_questions":{"items":{"$ref":"#/components/schemas/Comment"},"type":"array"}},"required":[],"type":"object"}]},"BulkResult":{"properties":{"lines":{"items":{"$ref":"#/components/schemas/Line"},"type":"array"},"preview":{"$ref":"#/components/schemas/BulkPreview"}},"required":[],"type":"object"},"Group":{"properties":{"bom_id":{"type":"integer"},"description":{"type":["string","null"]},"id":{"type":"integer"},"inserted_at":{"format":"date-time","type":["string","null"]},"links":{"additionalProperties":{"type":["string","null"]},"description":"Related URLs.","type":"object"},"lock_version":{"description":"Optimistic lock version; send it back on writes.","minimum":1,"type":"integer"},"name":{"type":"string"},"object":{"const":"group"},"parent_id":{"type":["integer","null"]},"position":{"type":"integer"},"quantity":{"description":"Instances of this assembly per parent; multiplies the lines inside.","minimum":1,"type":"integer"},"updated_at":{"format":"date-time","type":["string","null"]}},"required":["id","bom_id","name","quantity","position","lock_version","links"],"type":"object"},"BulkPreview":{"description":"`operation`, `lines` (line_id, name, changes, errors, required_before/after, status_before/after), `missing_line_ids`, `affected_count`, `valid`, `summary_before`, `summary_after`.","type":"object"},"RevisionRestoreImpact":{"description":"The reconciliation a restore applies: lines and groups added, removed, and changed, and allocation adjustments.","type":"object"},"Index":{"description":"Version and links to every collection, the OpenAPI document, and the guide.","type":"object"},"ImportResult":{"properties":{"created":{"items":{"$ref":"#/components/schemas/Line"},"type":"array"},"preview":{"$ref":"#/components/schemas/ImportPreview"},"removed":{"items":{"$ref":"#/components/schemas/Line"},"type":"array"},"skipped_rows":{"items":{"type":"integer"},"type":"array"},"unchanged":{"type":"integer"},"updated":{"items":{"$ref":"#/components/schemas/Line"},"type":"array"}},"required":[],"type":"object"},"UndoCheckMany":{"properties":{"results":{"additionalProperties":{"$ref":"#/components/schemas/UndoCheck"},"description":"Event id to `{undoable, reason}`.","type":"object"}},"required":[],"type":"object"},"AccountExport":{"description":"Everything one account owns. A bom is a build, a group an assembly, a line a requirement. Never holds the password hash, session tokens, token secrets or hashes, events' session references, stored idempotency responses, or another account's records. The last member, complete, is true; without it the document is cut short.","properties":{"account":{"properties":{"admin":{"type":"boolean"},"confirmed_at":{"format":"date-time","type":["string","null"]},"email":{"type":"string"},"id":{"type":"integer"},"inserted_at":{"format":"date-time","type":["string","null"]},"marketing_consent_at":{"format":"date-time","type":["string","null"]},"sharing_held_at":{"format":"date-time","type":["string","null"]},"sharing_hold_reason":{"type":["string","null"]},"updated_at":{"format":"date-time","type":["string","null"]}},"required":["id","email","admin","inserted_at"],"type":"object"},"allocations":{"items":{"description":"Rows of the allocations table with every column, in id order.","type":"object"},"type":"array"},"alternates":{"items":{"description":"Rows of the alternates table with every column, in id order.","type":"object"},"type":"array"},"api_tokens":{"items":{"properties":{"default":{"type":"boolean"},"id":{"type":"integer"},"inserted_at":{"format":"date-time","type":["string","null"]},"last_used_at":{"format":"date-time","type":["string","null"]},"name":{"type":"string"},"revoked_at":{"format":"date-time","type":["string","null"]},"token_prefix":{"type":"string"},"updated_at":{"format":"date-time","type":["string","null"]}},"required":["id","name","token_prefix"],"type":"object"},"type":"array"},"bom_exports":{"items":{"$ref":"#/components/schemas/BomExport"},"type":"array"},"bom_views":{"items":{"description":"Rows of the bom_views table with every column, in id order.","type":"object"},"type":"array"},"boms":{"items":{"description":"Rows of the boms table with every column, in id order.","type":"object"},"type":"array"},"comments":{"items":{"description":"Rows of the comments table with every column, in id order.","type":"object"},"type":"array"},"complete":{"const":true,"description":"Always the last member. A document without it was cut short; fetch it again."},"events":{"items":{"description":"Rows of the events table with every column, in id order.","type":"object"},"type":"array"},"exported_at":{"format":"date-time","type":"string"},"format":{"const":"builder_bom_account"},"groups":{"items":{"description":"Rows of the groups table with every column, in id order.","type":"object"},"type":"array"},"lines":{"items":{"description":"Rows of the lines table with every column, in id order.","type":"object"},"type":"array"},"listings":{"items":{"description":"Rows of the listings table with every column, in id order.","type":"object"},"type":"array"},"marketing_consent_events":{"items":{"description":"Rows of the marketing_consent_events table with every column, in id order.","type":"object"},"type":"array"},"order_items":{"items":{"description":"Rows of the order_items table with every column, in id order.","type":"object"},"type":"array"},"orders":{"items":{"description":"Rows of the orders table with every column, in id order.","type":"object"},"type":"array"},"parts":{"items":{"description":"Rows of the parts table with every column, in id order.","type":"object"},"type":"array"},"receipts":{"items":{"description":"Rows of the receipts table with every column, in id order.","type":"object"},"type":"array"},"reviewed_suppliers":{"items":{"description":"Suppliers this account reviewed as an admin: id, name, host, status, reviewed_at.","type":"object"},"type":"array"},"revisions":{"items":{"description":"Rows of the revisions table with every column, in id order.","type":"object"},"type":"array"},"shared_builds":{"items":{"properties":{"access":{"enum":["link","code"],"type":"string"},"bom_id":{"type":["integer","null"]},"document":{"description":"The stored Maker BOM document; null once sharing stopped.","type":["object","null"]},"inserted_at":{"format":"date-time","type":["string","null"]},"shared_at":{"format":"date-time","type":["string","null"]},"slug":{"type":"string"},"stop_reason":{"type":["string","null"]},"stopped_at":{"format":"date-time","type":["string","null"]},"takedown_reason":{"type":["string","null"]},"title":{"type":["string","null"]},"url":{"format":"uri","type":"string"}},"required":["slug","url","access"],"type":"object"},"type":"array"},"supplier_suggestions":{"items":{"description":"The account's suggestions with categories, supplier_status, supplier_name, and supplier_host.","type":"object"},"type":"array"},"version":{"const":1}},"required":["account","allocations","alternates","api_tokens","bom_exports","bom_views","boms","comments","complete","events","exported_at","format","groups","lines","listings","marketing_consent_events","order_items","orders","parts","receipts","reviewed_suppliers","revisions","shared_builds","supplier_suggestions","version"],"type":"object"},"SupplierSuggestionInput":{"properties":{"categories":{"items":{"enum":["electronic_components","boards_and_modules","connectors_and_cable","batteries_and_power","motors_and_motion","hardware_and_fasteners","raw_materials","printing_supplies","tools_and_equipment","pcb_fabrication","custom_fabrication","kits","surplus_and_salvage"],"type":"string"},"type":"array"},"name":{"type":["string","null"]},"reason":{"description":"Why the supplier is good for makers. The admin reads it.","type":"string"},"url":{"description":"The supplier's web address. Only its host is kept as the key; http(s) with a public host.","type":"string"}},"required":["url","reason"],"type":"object"},"Supplier":{"properties":{"account_required":{"description":"Null: not recorded.","type":["boolean","null"]},"agent_notes":{"description":"How to search the site, how its part numbers look, and what its terms say about automated access. Follow them.","type":["string","null"]},"api_docs_url":{"type":["string","null"]},"availability_rating":{"description":"Availability. 5 means things are in stock. Maker BOM's own judgment from 1 to 5; 5 is best for the buyer. Null: not assessed.","maximum":5,"minimum":1,"type":["integer","null"]},"base_url":{"description":"The site's address.","type":"string"},"best_for":{"type":["string","null"]},"categories":{"items":{"enum":["electronic_components","boards_and_modules","connectors_and_cable","batteries_and_power","motors_and_motion","hardware_and_fasteners","raw_materials","printing_supplies","tools_and_equipment","pcb_fabrication","custom_fabrication","kits","surplus_and_salvage"],"type":"string"},"type":"array"},"currencies":{"type":["string","null"]},"description":{"type":["string","null"]},"ease_rating":{"description":"Ease of use. 5 means little hassle. Maker BOM's own judgment from 1 to 5; 5 is best for the buyer. Null: not assessed.","maximum":5,"minimum":1,"type":["integer","null"]},"host":{"description":"The supplier's key: the host lowercased, without `www.`, in ASCII form. Different hosts are different suppliers.","type":"string"},"id":{"type":"integer"},"kind":{"enum":["distributor","manufacturer","retailer","marketplace","surplus","service"],"type":"string"},"links":{"additionalProperties":{"type":["string","null"]},"description":"Related URLs.","type":"object"},"minimum_order":{"type":["string","null"]},"name":{"type":"string"},"object":{"const":"supplier"},"price_rating":{"description":"Price. 5 means low prices. Maker BOM's own judgment from 1 to 5; 5 is best for the buyer. Null: not assessed.","maximum":5,"minimum":1,"type":["integer","null"]},"provides_datasheets":{"description":"Null: not recorded.","type":["boolean","null"]},"published_at":{"format":"date-time","type":["string","null"]},"review_stale":{"description":"The entry was last reviewed more than 365 days ago.","type":"boolean"},"reviewed_at":{"format":"date-time","type":["string","null"]},"search_url_template":{"description":"A search address on the site with `{query}` where the URL-encoded search words go.","type":["string","null"]},"sells_single_units":{"description":"Null: not recorded.","type":["boolean","null"]},"shipping_notes":{"type":["string","null"]},"ships_from":{"type":["string","null"]},"ships_to":{"type":["string","null"]},"shows_stock":{"description":"Null: not recorded.","type":["boolean","null"]},"summary":{"description":"One line.","type":"string"},"updated_at":{"format":"date-time","type":["string","null"]},"variety_rating":{"description":"Variety. 5 means a wide range. Maker BOM's own judgment from 1 to 5; 5 is best for the buyer. Null: not assessed.","maximum":5,"minimum":1,"type":["integer","null"]},"watch_out_for":{"description":"Caveats, up to two sentences.","type":["string","null"]}},"required":["id","object","name","host","base_url","kind","categories","summary","review_stale","links"],"type":"object"},"AcceptAlternateInput":{"properties":{"allocations":{"enum":["keep","release"],"type":"string"},"decision_reason":{"type":["string","null"]}},"required":[],"type":"object"},"ReorderLinesInput":{"properties":{"group_id":{"type":["integer","null"]},"ordered_ids":{"items":{"type":"integer"},"type":"array"}},"required":["ordered_ids"],"type":"object"},"OrderReceiptsInput":{"properties":{"receipts":{"items":{"allOf":[{"$ref":"#/components/schemas/ReceiptInput"},{"properties":{"order_item_id":{"type":"integer"}},"required":["order_item_id"],"type":"object"}]},"type":"array"}},"required":["receipts"],"type":"object"},"AllocationInput":{"properties":{"note":{"type":["string","null"]},"order_item_id":{"description":"Required for and only for source `order`.","type":["integer","null"]},"quantity":{"description":"Units, > 0. A string or a number.","type":["string","number","null"]},"ready_quantity":{"description":"Non-order sources: units usable now. A string or a number.","type":["string","number"]},"source":{"enum":["order","stock","salvaged","fabricated","supplied","kit"],"type":"string"}},"required":["source","quantity"],"type":"object"},"Event":{"properties":{"action":{"description":"Dotted action such as line.updated, order.created, receipt.recorded, alternate.accepted, line.deleted.","type":"string"},"actor":{"properties":{"api_token_id":{"type":["integer","null"]},"kind":{"enum":["user","agent"],"type":"string"},"name":{"type":["string","null"]}},"required":[],"type":"object"},"bom_id":{"type":["integer","null"]},"bom_ids":{"items":{"type":"integer"},"type":"array"},"changes":{"description":"Field to [old, new].","type":"object"},"cursor":{"type":"string"},"id":{"type":"integer"},"line_ids":{"description":"Lines the change touched.","items":{"type":"integer"},"type":"array"},"metadata":{"description":"Extra details.","type":"object"},"object":{"const":"event"},"occurred_at":{"format":"date-time","type":["string","null"]},"part_of":{"description":"The larger operation this event was a step of, such as `bom.imported`; such steps cannot be undone alone.","type":["string","null"]},"subject":{"properties":{"id":{"type":["integer","null"]},"type":{"type":"string"}},"required":[],"type":"object"},"subject_version":{"description":"The subject's lock_version after the change; null for unversioned records.","type":["integer","null"]},"summary":{"type":"string"},"undo_supported":{"description":"This kind of change has an undo (never for a `part_of` step); `GET /events/{id}/undo` says whether it applies now.","type":"boolean"}},"required":["id","cursor","action","subject","actor","summary","occurred_at"],"type":"object"},"CommentInput":{"properties":{"body":{"type":"string"},"bom_id":{"type":"integer"},"group_id":{"type":"integer"},"kind":{"enum":["note","question"],"type":"string"},"line_id":{"type":"integer"},"order_id":{"type":"integer"}},"required":["body"],"type":"object"},"Alternate":{"properties":{"author":{"properties":{"kind":{"enum":["user","agent"],"type":"string"},"name":{"type":["string","null"]}},"type":"object"},"decided_at":{"format":"date-time","type":["string","null"]},"decision_reason":{"type":["string","null"]},"id":{"type":"integer"},"inserted_at":{"format":"date-time","type":["string","null"]},"line_id":{"type":"integer"},"links":{"additionalProperties":{"type":["string","null"]},"description":"Related URLs.","type":"object"},"object":{"const":"alternate"},"part":{"oneOf":[{"$ref":"#/components/schemas/Part"},{"type":"null"}]},"part_id":{"type":"integer"},"rationale":{"type":["string","null"]},"replaced_part":{"oneOf":[{"$ref":"#/components/schemas/Part"},{"type":"null"}]},"replaced_part_id":{"type":["integer","null"]},"status":{"enum":["proposed","accepted","rejected"],"type":"string"},"trade_offs":{"type":["string","null"]}},"required":["id","line_id","part_id","status","links"],"type":"object"},"RevisionRestore":{"properties":{"allocation_adjustments":{"items":{"description":"{allocation_id, order_item_id, action: reduced | removed, from, to}","type":"object"},"type":"array"},"bom":{"$ref":"#/components/schemas/Bom"},"reconciliation":{"description":"As in the restore impact.","type":"object"}},"required":[],"type":"object"},"OrderItemUpdate":{"properties":{"description":{"type":["string","null"]},"lock_version":{"description":"Optimistic lock version; send it back on writes.","minimum":1,"type":"integer"},"pack_count":{"description":"Packs. A string or a number.","type":["string","number","null"]},"pack_size":{"description":"Units per pack. A string or a number.","type":["string","number","null"]},"part_id":{"type":["integer","null"]},"quantity":{"description":"Usable units. A string or a number.","type":["string","number","null"]},"status":{"enum":["active","backordered","canceled"],"type":"string"},"unit":{"type":"string"},"unit_price":{"description":"Per unit. A string or a number.","type":["string","number","null"]}},"required":["lock_version"],"type":"object"},"LineInput":{"properties":{"attributes":{"description":"Custom fields such as value, tolerance, package, footprint.","type":"object"},"category":{"type":["string","null"]},"external_links":{"items":{"properties":{"label":{"type":["string","null"]},"url":{"format":"uri","type":"string"}},"required":["url"],"type":"object"},"type":"array"},"group_id":{"type":["integer","null"]},"inclusion":{"enum":["required","optional","dnp"],"type":"string"},"inclusion_reason":{"type":["string","null"]},"name":{"maxLength":255,"type":"string"},"notes":{"type":["string","null"]},"part_id":{"description":"Selected part; null while open.","type":["integer","null"]},"purpose":{"type":["string","null"]},"quantity":{"description":"Units per one instance of the group; null means unknown (the line is unresolved). A string or a number.","type":["string","number","null"]},"references":{"description":"Reference designators; ranges such as R1-R4 are kept as sent.","items":{"type":"string"},"type":["array","string"]},"source_ref":{"type":["string","null"]},"spares":{"description":"Absolute extra units (default 0). A string or a number.","type":["string","number","null"]},"supply":{"enum":["purchase","on_hand","salvaged","fabricated","supplied","kit"],"type":"string"},"tags":{"description":"List or comma-separated string.","items":{"type":"string"},"type":["array","string"]},"unit":{"default":"pcs","type":"string"}},"required":["name"],"type":"object"},"SupplierSuggestion":{"properties":{"actor_kind":{"enum":["user","agent"],"type":"string"},"actor_name":{"type":"string"},"categories":{"items":{"type":"string"},"type":"array"},"host":{"type":"string"},"id":{"type":"integer"},"inserted_at":{"format":"date-time","type":["string","null"]},"links":{"additionalProperties":{"type":["string","null"]},"description":"Related URLs.","type":"object"},"object":{"const":"supplier_suggestion"},"reason":{"type":"string"},"submitted_url":{"type":"string"},"suggested_name":{"type":["string","null"]},"supplier":{"properties":{"directory_id":{"type":["integer","null"]},"name":{"type":["string","null"]},"published_at":{"format":"date-time","type":["string","null"]},"status":{"enum":["suggested","published","rejected","retired"],"type":"string"},"status_changed_at":{"format":"date-time","type":["string","null"]},"status_reason":{"description":"Why it was rejected or retired; null otherwise.","type":["string","null"]}},"required":[],"type":"object"},"updated_at":{"format":"date-time","type":["string","null"]}},"required":["id","host","reason","supplier"],"type":"object"},"OrderItem":{"properties":{"allocations":{"items":{"$ref":"#/components/schemas/Allocation"},"type":"array"},"description":{"type":"string"},"id":{"type":"integer"},"links":{"additionalProperties":{"type":["string","null"]},"description":"Related URLs.","type":"object"},"lock_version":{"description":"Optimistic lock version; send it back on writes.","minimum":1,"type":"integer"},"object":{"const":"order_item"},"order_id":{"type":"integer"},"pack_count":{"description":"Decimal as a string.","pattern":"^-?[0-9]+(\\.[0-9]+)?$","type":["string","null"]},"pack_size":{"description":"Decimal as a string.","pattern":"^-?[0-9]+(\\.[0-9]+)?$","type":["string","null"]},"part_id":{"type":["integer","null"]},"quantity":{"description":"Usable units ordered.","pattern":"^-?[0-9]+(\\.[0-9]+)?$","type":["string","null"]},"receipts":{"items":{"$ref":"#/components/schemas/Receipt"},"type":"array"},"status":{"enum":["active","backordered","canceled"],"type":"string"},"unit":{"type":"string"},"unit_price":{"description":"Per unit.","pattern":"^-?[0-9]+(\\.[0-9]+)?$","type":["string","null"]}},"required":["id","order_id","description","quantity","status","lock_version","links"],"type":"object"},"WhereUsed":{"properties":{"alternates":{"items":{"$ref":"#/components/schemas/Alternate"},"type":"array"},"bom_count":{"type":"integer"},"lines":{"items":{"$ref":"#/components/schemas/Line"},"type":"array"},"order_items":{"items":{"$ref":"#/components/schemas/OrderItem"},"type":"array"}},"required":[],"type":"object"},"LineDeletionImpact":{"description":"`line`, `allocations` (active, with order item and order), `orders`, `open_questions`.","type":"object"},"Bom":{"properties":{"archived_at":{"format":"date-time","type":["string","null"]},"build_count":{"minimum":1,"type":"integer"},"build_label":{"type":["string","null"]},"id":{"type":"integer"},"inserted_at":{"format":"date-time","type":["string","null"]},"links":{"additionalProperties":{"type":["string","null"]},"description":"Related URLs.","type":"object"},"lock_version":{"description":"Optimistic lock version; send it back on writes.","minimum":1,"type":"integer"},"name":{"type":"string"},"object":{"const":"bom"},"purpose":{"type":["string","null"]},"state":{"enum":["active","archived","trashed"],"type":"string"},"trashed_at":{"format":"date-time","type":["string","null"]},"updated_at":{"format":"date-time","type":["string","null"]}},"required":["id","name","build_count","state","lock_version","links"],"type":"object"},"PartUpdate":{"properties":{"attributes":{"description":"Custom fields.","type":"object"},"category":{"type":["string","null"]},"description":{"type":["string","null"]},"external_links":{"items":{"properties":{"label":{"type":["string","null"]},"url":{"format":"uri","type":"string"}},"required":["url"],"type":"object"},"type":"array"},"internal_ref":{"type":["string","null"]},"lock_version":{"description":"Optimistic lock version; send it back on writes.","minimum":1,"type":"integer"},"manufacturer":{"type":["string","null"]},"mpn":{"type":["string","null"]},"name":{"type":"string"}},"required":["lock_version"],"type":"object"},"DuplicateBomInput":{"properties":{"attrs":{"$ref":"#/components/schemas/BomInput"},"group_ids":{"items":{"type":"integer"},"type":"array"},"include_ungrouped":{"type":"boolean"},"keep_parts":{"type":"boolean"},"revision_id":{"description":"Copy this revision's snapshot instead of the draft.","type":"integer"}},"required":[],"type":"object"},"UndoCheck":{"properties":{"event_id":{"type":"integer"},"reason":{"enum":["not_undoable","changed_since",null],"type":["string","null"]},"undoable":{"type":"boolean"}},"required":[],"type":"object"},"RevisionDetail":{"allOf":[{"$ref":"#/components/schemas/Revision"},{"properties":{"snapshot":{"description":"BOM, groups, lines, and selected-part details at save time (string keys, decimal strings).","type":"object"}},"required":[],"type":"object"}]}},"securitySchemes":{"bearerAuth":{"description":"An API token (`bbom_...`) from the account's API token settings. Every change is attributed to the token's name.","scheme":"bearer","type":"http"}}},"info":{"description":"The agent API of Maker BOM. A token acts for its owner; every change is attributed to the token's name and appears live in the web UI.\n\nConventions:\n\n- Authenticate with `Authorization: Bearer <token>`.\n- Ids are integers. Timestamps are ISO 8601 UTC; dates are `YYYY-MM-DD`.\n- **Decimals (quantities, prices, money) are JSON strings** such as `\"12\"` or `\"0.25\"`, so no precision is lost. Inputs accept a string or a number.\n- Enums are lowercase strings; validation errors list the allowed values.\n- Single records return `{\"data\": {...}}`; lists return `{\"data\": [...], \"next_cursor\": ...}`. Lists page with a cursor: pass `next_cursor` as `after`; `limit` defaults to 50, at most 200. Lists are ordered by id, ascending, by default; that order never moves a record, so a record changed between two pages is never skipped or repeated. Use it to sync everything. BOMs, parts, orders, and lines also take `sort`: one field, `name` ascending or `-name` descending, ties broken by id, null values last ascending and first descending. In another order a record whose value changes between pages can move. Sorts are named as the records show the field (`inserted_at`), and text sorts by the database collation. A cursor works only with the list and the `sort` that wrote it. Lines without `limit`, `after`, or `sort` come in outline order, unpaginated (at most 2000). The change feed pages by event id; BOM history pages newest first with `before`.\n- **Query parameters are checked**, on every method: a parameter the operation does not declare in this document answers `400 unknown_parameter` with the declared names in `details[].allowed`; a declared parameter with a bad value (a `limit` out of range, an unknown `sort`, an unusable `after`) answers `422 validation_failed`. A rejected request writes nothing and stores nothing under its Idempotency-Key.\n- Write bodies are `application/json` (the import routes also take `multipart/form-data` with a `file`); other content types are `415 unsupported_media_type`. Only the fields of the request schema are accepted: `id`, `object`, `links`, `inserted_at`, and `updated_at` are ignored, any other field is `422 validation_failed` with code `unknown_field`, and a value of the wrong JSON type has code `invalid_type`. Strings are at most 10,000 characters, lists 1,000 items, objects 200 keys; text may not contain NUL.\n- Every record has `links` with related URLs. A line's or part's own document links are `external_links`.\n- Versioned records (BOMs, groups, lines, parts, orders, order items) carry `lock_version` and an `ETag`. Updates of them require the version as `lock_version` in the body or `If-Match`; a stale version returns `409 conflict` with the stored record in `error.current`. Deletes, lifecycle actions, and moves check a version when one is sent. `If-Match` takes one strong entity tag (`\"3\"`); a weak tag (`W/\"3\"`) never matches and a body `lock_version` that disagrees with `If-Match` is refused, both with `412 precondition_failed`.\n- Every POST accepts `Idempotency-Key`. A retry with the same key and body replays the first response with `Idempotent-Replayed: true`; the same key with another body returns `422 idempotency_key_reused`. Server errors are stored and replayed too, because a 500 can come after the write committed: after a 500, read the record or the change feed, then use a new key. A response over 1 MB is not stored (`Idempotency-Stored: false`); a retry gets `409 idempotency_response_not_stored` with the first status. Previews and dry runs store nothing.\n- Imports accept at most 2,000 data rows per request (`413 import_too_large`), counted before any work.\n- An unsupported method on a known path is `405 method_not_allowed` with an `Allow` header.\n- Besides the per-token limit, each client address has a limit that applies before authentication.\n- **Archived and trashed BOMs are read-only.** Writes to their contents (BOM fields, groups, lines, bulk edits, alternates, revisions, imports, comments) return `409 bom_archived` or `409 bom_trashed`. Reads and exports work. Allocations to lines of an archived BOM stay allowed; a trashed BOM refuses them.\n- Canceling an order or order item sends only the units not yet received back to uncovered; accepted units stay ready.\n- Allocations of soft-deleted lines are kept but inactive: they cover nothing, take no received units, and free their order item's capacity.\n- Line create and update accept `dry_run=true`; bulk edits and imports have preview endpoints.\n- Errors use one envelope: `{\"error\": {\"code\", \"message\", \"details\": [{\"field\", \"code\", \"message\"}]}}`.\n- Requests are rate limited per token; see `X-RateLimit-*` headers and `429 rate_limited` with `Retry-After`.\n\nStart with `GET /me`, then read `GET /guide`.\n","summary":"Work on bills of materials as an agent of their owner.","title":"Maker BOM agent API","version":"1.0.0"},"openapi":"3.1.0","paths":{"/openapi.json":{"get":{"description":"This document. No token needed.","operationId":"getOpenApi","parameters":[],"responses":{"200":{"content":{"application/json":{"example":{"openapi":"3.1.0"},"schema":{"$ref":"#/components/schemas/OpenApiDocument"}}},"description":"JSON document (no data envelope)."},"400":{"$ref":"#/components/responses/BadRequest"}},"security":[],"summary":"OpenAPI document","tags":["Discovery"]}},"/order-items/allocatable":{"get":{"description":"Items whose units are not all allocated yet, each with its order and summary (`summary.unallocated` is the free capacity), to pick an `order_item_id` for an allocation. Not paginated: `limit` caps the result.","operationId":"listAllocatableOrderItems","parameters":[{"description":"Matches supplier, reference, and item description.","in":"query","name":"search","required":false,"schema":{"type":"string"}},{"description":"Only items of this part.","in":"query","name":"part_id","required":false,"schema":{"type":"integer"}},{"description":"Include items already fully received.","in":"query","name":"include_received","required":false,"schema":{"type":"boolean"}},{"$ref":"#/components/parameters/limit"}],"responses":{"200":{"content":{"application/json":{"example":{"data":[{"item":{"id":200,"object":"order_item","quantity":"10"},"order":{"id":20,"object":"order","supplier":"DigiKey"},"summary":{"unallocated":"2"}}],"next_cursor":null},"schema":{"properties":{"data":{"items":{"$ref":"#/components/schemas/AllocatableItem"},"type":"array"},"next_cursor":{"description":"Pass as `after` for the next page; null on the last page.","type":["string","null"]}},"required":["data","next_cursor"],"type":"object"}}},"description":"A page of records.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"}},"summary":"Order items with free units","tags":["Order items"]}},"/parts/{id}/retire":{"post":{"description":"Hides the part from default listings; existing lines and orders keep it. A stated version is checked.","operationId":"retirePart","parameters":[{"description":"Record id.","in":"path","name":"id","required":true,"schema":{"type":"integer"}},{"$ref":"#/components/parameters/ifMatch"},{"$ref":"#/components/parameters/idempotencyKey"}],"responses":{"200":{"content":{"application/json":{"example":{"data":{"attributes":{"tolerance":"1%"},"external_links":[],"id":42,"links":{"listings":"/api/v1/parts/42/listings","self":"/api/v1/parts/42"},"listings":[{"confidence":"verified","currency":"USD","id":50,"links":{"self":"/api/v1/listings/50"},"object":"listing","pack_size":"100","part_id":42,"preferred":true,"price":"1.2","sku":"311-10.0KHRCT-ND","stale":false,"supplier":"DigiKey"}],"lock_version":1,"manufacturer":"Yageo","mpn":"RC0603FR-0710KL","name":"10k resistor 0603","object":"part","retired":false}},"schema":{"properties":{"data":{"$ref":"#/components/schemas/Part"}},"required":["data"],"type":"object"}}},"description":"The record.","headers":{"ETag":{"$ref":"#/components/headers/ETag"},"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"content":{"application/json":{"example":{"error":{"code":"conflict","details":[{"code":"stale","field":"lock_version","message":"current version is 4"}],"message":"The record changed since the version you sent."}},"schema":{"properties":{"error":{"allOf":[{"$ref":"#/components/schemas/ErrorBody"}],"properties":{"code":{"enum":["conflict","idempotency_in_progress","idempotency_response_not_stored"],"type":"string"}},"type":"object"}},"required":["error"],"type":"object"}}},"description":"The record changed since the version you sent. `error.current` holds the stored record; reapply your change to it and retry with its lock_version. Also: idempotency_response_not_stored."},"412":{"$ref":"#/components/responses/PreconditionFailed"},"422":{"$ref":"#/components/responses/IdempotencyKeyReused"},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Busy"}},"summary":"Retire a part","tags":["Parts"]}},"/lines/{id}/move":{"post":{"description":"Moves the line to `group_id` (null for top level) at `position` (0-based; omitted appends).","operationId":"moveLine","parameters":[{"description":"Record id.","in":"path","name":"id","required":true,"schema":{"type":"integer"}},{"$ref":"#/components/parameters/idempotencyKey"}],"requestBody":{"content":{"application/json":{"example":{"group_id":11,"lock_version":3,"position":0},"schema":{"$ref":"#/components/schemas/MoveLineInput"}}},"required":true},"responses":{"200":{"content":{"application/json":{"example":{"data":{"attributes":{"footprint":"R_0603","value":"10k"},"bom_id":7,"deleted":false,"external_links":[],"group_id":10,"id":100,"inclusion":"required","links":{"alternates":"/api/v1/lines/100/alternates","bom":"/api/v1/boms/7","self":"/api/v1/lines/100"},"lock_version":3,"name":"10k pull-up","object":"line","part_id":42,"position":0,"quantity":"3","references":["R1","R2","R3"],"spares":"2","supply":"purchase","tags":["passive"],"unit":"pcs"}},"schema":{"properties":{"data":{"$ref":"#/components/schemas/Line"}},"required":["data"],"type":"object"}}},"description":"The record.","headers":{"ETag":{"$ref":"#/components/headers/ETag"},"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"content":{"application/json":{"example":{"error":{"code":"conflict","details":[{"code":"stale","field":"lock_version","message":"current version is 4"}],"message":"The record changed since the version you sent."}},"schema":{"properties":{"error":{"allOf":[{"$ref":"#/components/schemas/ErrorBody"}],"properties":{"code":{"enum":["conflict","idempotency_in_progress","bom_archived","bom_trashed","idempotency_response_not_stored"],"type":"string"}},"type":"object"}},"required":["error"],"type":"object"}}},"description":"The record changed since the version you sent. `error.current` holds the stored record; reapply your change to it and retry with its lock_version. Also: bom_archived, bom_trashed."},"415":{"$ref":"#/components/responses/UnsupportedMediaType"},"422":{"content":{"application/json":{"example":{"error":{"code":"validation_failed","details":[{"allowed":["purchase","on_hand","salvaged","fabricated","supplied","kit"],"code":"invalid","field":"supply","message":"is invalid"}],"message":"The request has invalid fields."}},"schema":{"properties":{"error":{"allOf":[{"$ref":"#/components/schemas/ErrorBody"}],"properties":{"code":{"enum":["validation_failed","idempotency_key_reused"],"type":"string"}},"type":"object"}},"required":["error"],"type":"object"}}},"description":"Invalid fields, or a declared query parameter with a bad value. `details` has one entry per problem with a dotted `field` path; enum errors list `allowed` values. A cursor (`after`) of this list written for another `sort` has detail code `cursor_mismatch`; any other unusable cursor has detail code `invalid`. Also: idempotency_key_reused."},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Busy"}},"summary":"Move a line","tags":["Lines"]}},"/parts/{id}":{"delete":{"description":"Deletes a part no line, alternate, or order item references; otherwise `in_use` (retire or merge instead).","operationId":"deletePart","parameters":[{"description":"Record id.","in":"path","name":"id","required":true,"schema":{"type":"integer"}},{"$ref":"#/components/parameters/ifMatch"}],"responses":{"204":{"description":"Done; no body."},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"content":{"application/json":{"example":{"error":{"code":"conflict","details":[{"code":"stale","field":"lock_version","message":"current version is 4"}],"message":"The record changed since the version you sent."}},"schema":{"properties":{"error":{"allOf":[{"$ref":"#/components/schemas/ErrorBody"}],"properties":{"code":{"enum":["conflict","idempotency_in_progress","in_use"],"type":"string"}},"type":"object"}},"required":["error"],"type":"object"}}},"description":"The record changed since the version you sent. `error.current` holds the stored record; reapply your change to it and retry with its lock_version. Also: in_use."},"412":{"$ref":"#/components/responses/PreconditionFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Busy"}},"summary":"Delete a part","tags":["Parts"],"x-example":{"request":"DELETE /api/v1/parts/42","response":{"body":null,"status":204}}},"get":{"description":"One part with its listings.","operationId":"getPart","parameters":[{"description":"Record id.","in":"path","name":"id","required":true,"schema":{"type":"integer"}}],"responses":{"200":{"content":{"application/json":{"example":{"data":{"attributes":{"tolerance":"1%"},"external_links":[],"id":42,"links":{"listings":"/api/v1/parts/42/listings","self":"/api/v1/parts/42"},"listings":[{"confidence":"verified","currency":"USD","id":50,"links":{"self":"/api/v1/listings/50"},"object":"listing","pack_size":"100","part_id":42,"preferred":true,"price":"1.2","sku":"311-10.0KHRCT-ND","stale":false,"supplier":"DigiKey"}],"lock_version":1,"manufacturer":"Yageo","mpn":"RC0603FR-0710KL","name":"10k resistor 0603","object":"part","retired":false}},"schema":{"properties":{"data":{"$ref":"#/components/schemas/Part"}},"required":["data"],"type":"object"}}},"description":"The record.","headers":{"ETag":{"$ref":"#/components/headers/ETag"},"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"}},"summary":"Get a part","tags":["Parts"]},"patch":{"description":"Changes part fields. Requires the version.","operationId":"updatePart","parameters":[{"description":"Record id.","in":"path","name":"id","required":true,"schema":{"type":"integer"}},{"$ref":"#/components/parameters/ifMatch"}],"requestBody":{"content":{"application/json":{"example":{"description":"Thick film, 1%","lock_version":1},"schema":{"$ref":"#/components/schemas/PartUpdate"}}},"required":true},"responses":{"200":{"content":{"application/json":{"example":{"data":{"attributes":{"tolerance":"1%"},"external_links":[],"id":42,"links":{"listings":"/api/v1/parts/42/listings","self":"/api/v1/parts/42"},"listings":[{"confidence":"verified","currency":"USD","id":50,"links":{"self":"/api/v1/listings/50"},"object":"listing","pack_size":"100","part_id":42,"preferred":true,"price":"1.2","sku":"311-10.0KHRCT-ND","stale":false,"supplier":"DigiKey"}],"lock_version":1,"manufacturer":"Yageo","mpn":"RC0603FR-0710KL","name":"10k resistor 0603","object":"part","retired":false}},"schema":{"properties":{"data":{"$ref":"#/components/schemas/Part"}},"required":["data"],"type":"object"}}},"description":"The record.","headers":{"ETag":{"$ref":"#/components/headers/ETag"},"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"412":{"$ref":"#/components/responses/PreconditionFailed"},"415":{"$ref":"#/components/responses/UnsupportedMediaType"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Busy"}},"summary":"Update a part","tags":["Parts"]}},"/boms/{bom_id}/revisions":{"get":{"description":"Revisions newest first, without snapshots.","operationId":"listRevisions","parameters":[{"description":"Record id.","in":"path","name":"bom_id","required":true,"schema":{"type":"integer"}},{"$ref":"#/components/parameters/limit"},{"$ref":"#/components/parameters/after"}],"responses":{"200":{"content":{"application/json":{"example":{"data":[{"author":{"kind":"user","name":"maker@example.com"},"bom_id":7,"id":70,"links":{"self":"/api/v1/revisions/70"},"name":"Sent to fab","number":3,"object":"revision"}],"next_cursor":null},"schema":{"properties":{"data":{"items":{"$ref":"#/components/schemas/Revision"},"type":"array"},"next_cursor":{"description":"Pass as `after` for the next page; null on the last page.","type":["string","null"]}},"required":["data","next_cursor"],"type":"object"}}},"description":"A page of records.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"}},"summary":"List revisions","tags":["Revisions"]},"post":{"description":"Saves a named snapshot with the next per-BOM number.","operationId":"createRevision","parameters":[{"description":"Record id.","in":"path","name":"bom_id","required":true,"schema":{"type":"integer"}},{"$ref":"#/components/parameters/idempotencyKey"}],"requestBody":{"content":{"application/json":{"example":{"name":"Sent to fab","note":"Gerbers v3"},"schema":{"$ref":"#/components/schemas/RevisionInput"}}},"required":true},"responses":{"201":{"content":{"application/json":{"example":{"data":{"author":{"kind":"user","name":"maker@example.com"},"bom_id":7,"id":70,"links":{"self":"/api/v1/revisions/70"},"name":"Sent to fab","number":3,"object":"revision"}},"schema":{"properties":{"data":{"$ref":"#/components/schemas/Revision"}},"required":["data"],"type":"object"}}},"description":"Created.","headers":{"Location":{"$ref":"#/components/headers/Location"},"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"content":{"application/json":{"example":{"error":{"code":"bom_archived","details":[],"message":"Refused: bom_archived."}},"schema":{"properties":{"error":{"allOf":[{"$ref":"#/components/schemas/ErrorBody"}],"properties":{"code":{"enum":["bom_archived","bom_trashed","idempotency_in_progress","idempotency_response_not_stored"],"type":"string"}},"type":"object"}},"required":["error"],"type":"object"}}},"description":"Refused by a domain rule: bom_archived, bom_trashed."},"415":{"$ref":"#/components/responses/UnsupportedMediaType"},"422":{"content":{"application/json":{"example":{"error":{"code":"validation_failed","details":[{"allowed":["purchase","on_hand","salvaged","fabricated","supplied","kit"],"code":"invalid","field":"supply","message":"is invalid"}],"message":"The request has invalid fields."}},"schema":{"properties":{"error":{"allOf":[{"$ref":"#/components/schemas/ErrorBody"}],"properties":{"code":{"enum":["validation_failed","idempotency_key_reused"],"type":"string"}},"type":"object"}},"required":["error"],"type":"object"}}},"description":"Invalid fields, or a declared query parameter with a bad value. `details` has one entry per problem with a dotted `field` path; enum errors list `allowed` values. A cursor (`after`) of this list written for another `sort` has detail code `cursor_mismatch`; any other unusable cursor has detail code `invalid`. Also: idempotency_key_reused."},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Busy"}},"summary":"Save a revision","tags":["Revisions"]}},"/parts/{id}/unretire":{"post":{"description":"Brings a retired part back. A stated version is checked.","operationId":"unretirePart","parameters":[{"description":"Record id.","in":"path","name":"id","required":true,"schema":{"type":"integer"}},{"$ref":"#/components/parameters/ifMatch"},{"$ref":"#/components/parameters/idempotencyKey"}],"responses":{"200":{"content":{"application/json":{"example":{"data":{"attributes":{"tolerance":"1%"},"external_links":[],"id":42,"links":{"listings":"/api/v1/parts/42/listings","self":"/api/v1/parts/42"},"listings":[{"confidence":"verified","currency":"USD","id":50,"links":{"self":"/api/v1/listings/50"},"object":"listing","pack_size":"100","part_id":42,"preferred":true,"price":"1.2","sku":"311-10.0KHRCT-ND","stale":false,"supplier":"DigiKey"}],"lock_version":1,"manufacturer":"Yageo","mpn":"RC0603FR-0710KL","name":"10k resistor 0603","object":"part","retired":false}},"schema":{"properties":{"data":{"$ref":"#/components/schemas/Part"}},"required":["data"],"type":"object"}}},"description":"The record.","headers":{"ETag":{"$ref":"#/components/headers/ETag"},"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"content":{"application/json":{"example":{"error":{"code":"conflict","details":[{"code":"stale","field":"lock_version","message":"current version is 4"}],"message":"The record changed since the version you sent."}},"schema":{"properties":{"error":{"allOf":[{"$ref":"#/components/schemas/ErrorBody"}],"properties":{"code":{"enum":["conflict","idempotency_in_progress","idempotency_response_not_stored"],"type":"string"}},"type":"object"}},"required":["error"],"type":"object"}}},"description":"The record changed since the version you sent. `error.current` holds the stored record; reapply your change to it and retry with its lock_version. Also: idempotency_response_not_stored."},"412":{"$ref":"#/components/responses/PreconditionFailed"},"422":{"$ref":"#/components/responses/IdempotencyKeyReused"},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Busy"}},"summary":"Unretire a part","tags":["Parts"]}},"/boms/{id}/order-list.csv":{"get":{"description":"The order list as CSV, one row per supplier item.","operationId":"getOrderListCsv","parameters":[{"description":"Record id.","in":"path","name":"id","required":true,"schema":{"type":"integer"}}],"responses":{"200":{"content":{"text/csv":{"example":"group,name,quantity,unit,required,status\nPower,M3x8 screw,4,pcs,14,to_source\n","schema":{"type":"string"}}},"description":"text/csv document."},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"}},"summary":"Order list as CSV","tags":["Import and export"]}},"/boms/{id}/questions":{"get":{"description":"Unresolved question threads of the BOM, oldest first, with the line or group they concern.","operationId":"listBomQuestions","parameters":[{"description":"Record id.","in":"path","name":"id","required":true,"schema":{"type":"integer"}},{"$ref":"#/components/parameters/limit"},{"$ref":"#/components/parameters/after"}],"responses":{"200":{"content":{"application/json":{"example":{"data":[{"author":{"kind":"agent","name":"Claude (sourcing agent)"},"body":"Is 5% tolerance acceptable here?","bom_id":7,"id":500,"kind":"question","line_id":100,"links":{"self":"/api/v1/comments/500"},"object":"comment","replies":[],"resolved":false,"target":"line"}],"next_cursor":null},"schema":{"properties":{"data":{"items":{"$ref":"#/components/schemas/Comment"},"type":"array"},"next_cursor":{"description":"Pass as `after` for the next page; null on the last page.","type":["string","null"]}},"required":["data","next_cursor"],"type":"object"}}},"description":"A page of records.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"}},"summary":"Open questions","tags":["Comments"]}},"/boms/{bom_id}/lines/bulk":{"post":{"description":"Applies the operation to all lines in one transaction, or to none. Send `expected_versions` (the preview's `versions`) and the whole batch fails with `conflict`, the changed line in `error.current`, if any of those lines changed since.","operationId":"applyBulk","parameters":[{"description":"Record id.","in":"path","name":"bom_id","required":true,"schema":{"type":"integer"}},{"$ref":"#/components/parameters/idempotencyKey"}],"requestBody":{"content":{"application/json":{"example":{"attrs":{"supply":"on_hand"},"expected_versions":{"100":3},"line_ids":[100,101],"operation":"update"},"schema":{"$ref":"#/components/schemas/BulkInput"}}},"required":true},"responses":{"200":{"content":{"application/json":{"example":{"data":{"lines":[{"attributes":{"footprint":"R_0603","value":"10k"},"bom_id":7,"deleted":false,"external_links":[],"group_id":10,"id":100,"inclusion":"required","links":{"alternates":"/api/v1/lines/100/alternates","bom":"/api/v1/boms/7","self":"/api/v1/lines/100"},"lock_version":3,"name":"10k pull-up","object":"line","part_id":42,"position":0,"quantity":"3","references":["R1","R2","R3"],"spares":"2","supply":"purchase","tags":["passive"],"unit":"pcs"}],"preview":{"valid":true}}},"schema":{"properties":{"data":{"$ref":"#/components/schemas/BulkResult"}},"required":["data"],"type":"object"}}},"description":"The record.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"content":{"application/json":{"example":{"error":{"code":"conflict","details":[{"code":"stale","field":"lock_version","message":"current version is 4"}],"message":"The record changed since the version you sent."}},"schema":{"properties":{"error":{"allOf":[{"$ref":"#/components/schemas/ErrorBody"}],"properties":{"code":{"enum":["conflict","idempotency_in_progress","bom_archived","bom_trashed","idempotency_response_not_stored"],"type":"string"}},"type":"object"}},"required":["error"],"type":"object"}}},"description":"The record changed since the version you sent. `error.current` holds the stored record; reapply your change to it and retry with its lock_version. Also: bom_archived, bom_trashed."},"415":{"$ref":"#/components/responses/UnsupportedMediaType"},"422":{"content":{"application/json":{"example":{"error":{"code":"validation_failed","details":[{"allowed":["purchase","on_hand","salvaged","fabricated","supplied","kit"],"code":"invalid","field":"supply","message":"is invalid"}],"message":"The request has invalid fields."}},"schema":{"properties":{"error":{"allOf":[{"$ref":"#/components/schemas/ErrorBody"}],"properties":{"code":{"enum":["validation_failed","invalid_operation","idempotency_key_reused"],"type":"string"}},"type":"object"}},"required":["error"],"type":"object"}}},"description":"Invalid fields, or a declared query parameter with a bad value. `details` has one entry per problem with a dotted `field` path; enum errors list `allowed` values. A cursor (`after`) of this list written for another `sort` has detail code `cursor_mismatch`; any other unusable cursor has detail code `invalid`. Also: invalid_operation."},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Busy"}},"summary":"Apply a bulk edit","tags":["Lines"]}},"/boms/{bom_id}/lines/reorder":{"post":{"description":"Orders the lines of one group (`group_id`, null for top level). `ordered_ids` must list every live line of the group exactly once; otherwise `validation_failed` names the missing, unknown, and duplicate ids.","operationId":"reorderLines","parameters":[{"description":"Record id.","in":"path","name":"bom_id","required":true,"schema":{"type":"integer"}},{"$ref":"#/components/parameters/idempotencyKey"}],"requestBody":{"content":{"application/json":{"example":{"group_id":10,"ordered_ids":[101,100]},"schema":{"$ref":"#/components/schemas/ReorderLinesInput"}}},"required":true},"responses":{"200":{"content":{"application/json":{"example":{"data":{"ordered_ids":[12,10,11]}},"schema":{"properties":{"data":{"type":"object"}},"required":["data"],"type":"object"}}},"description":"The record.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"content":{"application/json":{"example":{"error":{"code":"bom_archived","details":[],"message":"Refused: bom_archived."}},"schema":{"properties":{"error":{"allOf":[{"$ref":"#/components/schemas/ErrorBody"}],"properties":{"code":{"enum":["bom_archived","bom_trashed","idempotency_in_progress","idempotency_response_not_stored"],"type":"string"}},"type":"object"}},"required":["error"],"type":"object"}}},"description":"Refused by a domain rule: bom_archived, bom_trashed."},"415":{"$ref":"#/components/responses/UnsupportedMediaType"},"422":{"content":{"application/json":{"example":{"error":{"code":"validation_failed","details":[{"allowed":["purchase","on_hand","salvaged","fabricated","supplied","kit"],"code":"invalid","field":"supply","message":"is invalid"}],"message":"The request has invalid fields."}},"schema":{"properties":{"error":{"allOf":[{"$ref":"#/components/schemas/ErrorBody"}],"properties":{"code":{"enum":["validation_failed","idempotency_key_reused"],"type":"string"}},"type":"object"}},"required":["error"],"type":"object"}}},"description":"Invalid fields, or a declared query parameter with a bad value. `details` has one entry per problem with a dotted `field` path; enum errors list `allowed` values. A cursor (`after`) of this list written for another `sort` has detail code `cursor_mismatch`; any other unusable cursor has detail code `invalid`. Also: idempotency_key_reused."},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Busy"}},"summary":"Reorder lines","tags":["Lines"]}},"/suppliers/categories":{"get":{"description":"The fixed category and kind lists of the directory, with labels. Not paginated.","operationId":"listSupplierCategories","parameters":[],"responses":{"200":{"content":{"application/json":{"example":{"data":{"object":"supplier_categories"}},"schema":{"properties":{"data":{"$ref":"#/components/schemas/SupplierCategories"}},"required":["data"],"type":"object"}}},"description":"The record.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"429":{"$ref":"#/components/responses/RateLimited"}},"summary":"Supplier categories and kinds","tags":["Suppliers"]}},"/boms/{id}/restore":{"post":{"description":"Restores a trashed BOM. A stated version is checked when given.","operationId":"restoreBom","parameters":[{"description":"Record id.","in":"path","name":"id","required":true,"schema":{"type":"integer"}},{"$ref":"#/components/parameters/ifMatch"},{"$ref":"#/components/parameters/idempotencyKey"}],"responses":{"200":{"content":{"application/json":{"example":{"data":{"archived_at":null,"build_count":2,"build_label":"rev A","id":7,"inserted_at":"2026-11-01T09:00:00Z","links":{"analysis":"/api/v1/boms/7/analysis","lines":"/api/v1/boms/7/lines","self":"/api/v1/boms/7"},"lock_version":4,"name":"Desk weather station","object":"bom","purpose":"Indoor climate logger","state":"active","trashed_at":null,"updated_at":"2026-11-21T08:00:00Z"}},"schema":{"properties":{"data":{"$ref":"#/components/schemas/Bom"}},"required":["data"],"type":"object"}}},"description":"The record.","headers":{"ETag":{"$ref":"#/components/headers/ETag"},"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"content":{"application/json":{"example":{"error":{"code":"conflict","details":[{"code":"stale","field":"lock_version","message":"current version is 4"}],"message":"The record changed since the version you sent."}},"schema":{"properties":{"error":{"allOf":[{"$ref":"#/components/schemas/ErrorBody"}],"properties":{"code":{"enum":["conflict","idempotency_in_progress","idempotency_response_not_stored"],"type":"string"}},"type":"object"}},"required":["error"],"type":"object"}}},"description":"The record changed since the version you sent. `error.current` holds the stored record; reapply your change to it and retry with its lock_version. Also: idempotency_response_not_stored."},"412":{"$ref":"#/components/responses/PreconditionFailed"},"422":{"$ref":"#/components/responses/IdempotencyKeyReused"},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Busy"}},"summary":"Restore a BOM from the trash","tags":["BOMs"]}},"/order-items/{id}":{"delete":{"description":"Deletes an item with no receipts, with its allocations.","operationId":"deleteOrderItem","parameters":[{"description":"Record id.","in":"path","name":"id","required":true,"schema":{"type":"integer"}},{"$ref":"#/components/parameters/ifMatch"}],"responses":{"204":{"description":"Done; no body."},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"content":{"application/json":{"example":{"error":{"code":"conflict","details":[{"code":"stale","field":"lock_version","message":"current version is 4"}],"message":"The record changed since the version you sent."}},"schema":{"properties":{"error":{"allOf":[{"$ref":"#/components/schemas/ErrorBody"}],"properties":{"code":{"enum":["conflict","idempotency_in_progress","has_receipts"],"type":"string"}},"type":"object"}},"required":["error"],"type":"object"}}},"description":"The record changed since the version you sent. `error.current` holds the stored record; reapply your change to it and retry with its lock_version. Also: has_receipts."},"412":{"$ref":"#/components/responses/PreconditionFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Busy"}},"summary":"Delete an order item","tags":["Order items"],"x-example":{"request":"DELETE /api/v1/order-items/42","response":{"body":null,"status":204}}},"get":{"description":"One item with part, allocations, and receipts.","operationId":"getOrderItem","parameters":[{"description":"Record id.","in":"path","name":"id","required":true,"schema":{"type":"integer"}}],"responses":{"200":{"content":{"application/json":{"example":{"data":{"allocations":[{"id":300,"line_id":100,"links":{"line":"/api/v1/lines/100","self":"/api/v1/allocations/300"},"object":"allocation","order_id":20,"order_item_id":200,"quantity":"8","ready_quantity":"0","source":"order"}],"description":"10k resistor 0603 (Yageo RC0603FR-0710KL)","id":200,"links":{"self":"/api/v1/order-items/200"},"lock_version":1,"object":"order_item","order_id":20,"part_id":42,"quantity":"10","receipts":[{"exception":"none","id":400,"links":{"self":"/api/v1/receipts/400"},"object":"receipt","order_item_id":200,"quantity_accepted":"4","quantity_received":"4","received_on":"2026-11-21","replaces_id":null,"voided":false}],"status":"active","unit":"pcs","unit_price":"0.12"}},"schema":{"properties":{"data":{"$ref":"#/components/schemas/OrderItem"}},"required":["data"],"type":"object"}}},"description":"The record.","headers":{"ETag":{"$ref":"#/components/headers/ETag"},"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"}},"summary":"Get an order item","tags":["Order items"]},"patch":{"description":"Changes item fields. Requires the version. The quantity cannot drop below the allocated units.","operationId":"updateOrderItem","parameters":[{"description":"Record id.","in":"path","name":"id","required":true,"schema":{"type":"integer"}},{"$ref":"#/components/parameters/ifMatch"}],"requestBody":{"content":{"application/json":{"example":{"lock_version":1,"quantity":"12"},"schema":{"$ref":"#/components/schemas/OrderItemUpdate"}}},"required":true},"responses":{"200":{"content":{"application/json":{"example":{"data":{"allocations":[{"id":300,"line_id":100,"links":{"line":"/api/v1/lines/100","self":"/api/v1/allocations/300"},"object":"allocation","order_id":20,"order_item_id":200,"quantity":"8","ready_quantity":"0","source":"order"}],"description":"10k resistor 0603 (Yageo RC0603FR-0710KL)","id":200,"links":{"self":"/api/v1/order-items/200"},"lock_version":1,"object":"order_item","order_id":20,"part_id":42,"quantity":"10","receipts":[{"exception":"none","id":400,"links":{"self":"/api/v1/receipts/400"},"object":"receipt","order_item_id":200,"quantity_accepted":"4","quantity_received":"4","received_on":"2026-11-21","replaces_id":null,"voided":false}],"status":"active","unit":"pcs","unit_price":"0.12"}},"schema":{"properties":{"data":{"$ref":"#/components/schemas/OrderItem"}},"required":["data"],"type":"object"}}},"description":"The record.","headers":{"ETag":{"$ref":"#/components/headers/ETag"},"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"412":{"$ref":"#/components/responses/PreconditionFailed"},"415":{"$ref":"#/components/responses/UnsupportedMediaType"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Busy"}},"summary":"Update an order item","tags":["Order items"]}},"/boms/{bom_id}/revisions/{id}/restore":{"post":{"description":"Makes the draft match the revision. Restored lines take back order-item capacity only as far as it is free; `allocation_adjustments` lists every allocation reduced or removed. Read the restore impact first.","operationId":"restoreRevision","parameters":[{"description":"Record id.","in":"path","name":"bom_id","required":true,"schema":{"type":"integer"}},{"description":"Record id.","in":"path","name":"id","required":true,"schema":{"type":"integer"}},{"$ref":"#/components/parameters/idempotencyKey"}],"responses":{"200":{"content":{"application/json":{"example":{"data":{"object":"revision_restore"}},"schema":{"properties":{"data":{"$ref":"#/components/schemas/RevisionRestore"}},"required":["data"],"type":"object"}}},"description":"The record.","headers":{"ETag":{"$ref":"#/components/headers/ETag"},"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"content":{"application/json":{"example":{"error":{"code":"bom_archived","details":[],"message":"Refused: bom_archived."}},"schema":{"properties":{"error":{"allOf":[{"$ref":"#/components/schemas/ErrorBody"}],"properties":{"code":{"enum":["bom_archived","bom_trashed","idempotency_in_progress","idempotency_response_not_stored"],"type":"string"}},"type":"object"}},"required":["error"],"type":"object"}}},"description":"Refused by a domain rule: bom_archived, bom_trashed."},"422":{"$ref":"#/components/responses/IdempotencyKeyReused"},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Busy"}},"summary":"Restore a revision","tags":["Revisions"]}},"/boms/{id}/unarchive":{"post":{"description":"Brings an archived BOM back. A stated version is checked when given.","operationId":"unarchiveBom","parameters":[{"description":"Record id.","in":"path","name":"id","required":true,"schema":{"type":"integer"}},{"$ref":"#/components/parameters/ifMatch"},{"$ref":"#/components/parameters/idempotencyKey"}],"responses":{"200":{"content":{"application/json":{"example":{"data":{"archived_at":null,"build_count":2,"build_label":"rev A","id":7,"inserted_at":"2026-11-01T09:00:00Z","links":{"analysis":"/api/v1/boms/7/analysis","lines":"/api/v1/boms/7/lines","self":"/api/v1/boms/7"},"lock_version":4,"name":"Desk weather station","object":"bom","purpose":"Indoor climate logger","state":"active","trashed_at":null,"updated_at":"2026-11-21T08:00:00Z"}},"schema":{"properties":{"data":{"$ref":"#/components/schemas/Bom"}},"required":["data"],"type":"object"}}},"description":"The record.","headers":{"ETag":{"$ref":"#/components/headers/ETag"},"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"content":{"application/json":{"example":{"error":{"code":"conflict","details":[{"code":"stale","field":"lock_version","message":"current version is 4"}],"message":"The record changed since the version you sent."}},"schema":{"properties":{"error":{"allOf":[{"$ref":"#/components/schemas/ErrorBody"}],"properties":{"code":{"enum":["conflict","idempotency_in_progress","idempotency_response_not_stored"],"type":"string"}},"type":"object"}},"required":["error"],"type":"object"}}},"description":"The record changed since the version you sent. `error.current` holds the stored record; reapply your change to it and retry with its lock_version. Also: idempotency_response_not_stored."},"412":{"$ref":"#/components/responses/PreconditionFailed"},"422":{"$ref":"#/components/responses/IdempotencyKeyReused"},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Busy"}},"summary":"Unarchive a BOM","tags":["BOMs"]}},"/groups/{id}/move":{"post":{"description":"Moves the group under `parent_id` (null for top level) at `position` (0-based; omitted appends). Rejects cycles.","operationId":"moveGroup","parameters":[{"description":"Record id.","in":"path","name":"id","required":true,"schema":{"type":"integer"}},{"$ref":"#/components/parameters/idempotencyKey"}],"requestBody":{"content":{"application/json":{"example":{"lock_version":2,"parent_id":10,"position":0},"schema":{"$ref":"#/components/schemas/MoveGroupInput"}}},"required":true},"responses":{"200":{"content":{"application/json":{"example":{"data":{"bom_id":7,"id":10,"links":{"self":"/api/v1/groups/10"},"lock_version":1,"name":"Electronics","object":"group","parent_id":null,"position":0,"quantity":1}},"schema":{"properties":{"data":{"$ref":"#/components/schemas/Group"}},"required":["data"],"type":"object"}}},"description":"The record.","headers":{"ETag":{"$ref":"#/components/headers/ETag"},"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"content":{"application/json":{"example":{"error":{"code":"conflict","details":[{"code":"stale","field":"lock_version","message":"current version is 4"}],"message":"The record changed since the version you sent."}},"schema":{"properties":{"error":{"allOf":[{"$ref":"#/components/schemas/ErrorBody"}],"properties":{"code":{"enum":["conflict","idempotency_in_progress","bom_archived","bom_trashed","idempotency_response_not_stored"],"type":"string"}},"type":"object"}},"required":["error"],"type":"object"}}},"description":"The record changed since the version you sent. `error.current` holds the stored record; reapply your change to it and retry with its lock_version. Also: bom_archived, bom_trashed."},"415":{"$ref":"#/components/responses/UnsupportedMediaType"},"422":{"content":{"application/json":{"example":{"error":{"code":"validation_failed","details":[{"allowed":["purchase","on_hand","salvaged","fabricated","supplied","kit"],"code":"invalid","field":"supply","message":"is invalid"}],"message":"The request has invalid fields."}},"schema":{"properties":{"error":{"allOf":[{"$ref":"#/components/schemas/ErrorBody"}],"properties":{"code":{"enum":["validation_failed","idempotency_key_reused"],"type":"string"}},"type":"object"}},"required":["error"],"type":"object"}}},"description":"Invalid fields, or a declared query parameter with a bad value. `details` has one entry per problem with a dotted `field` path; enum errors list `allowed` values. A cursor (`after`) of this list written for another `sort` has detail code `cursor_mismatch`; any other unusable cursor has detail code `invalid`. Also: idempotency_key_reused."},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Busy"}},"summary":"Move a group","tags":["Groups"]}},"/comments/{id}":{"delete":{"description":"Deletes the comment and, for a thread root, its replies.","operationId":"deleteComment","parameters":[{"description":"Record id.","in":"path","name":"id","required":true,"schema":{"type":"integer"}}],"responses":{"204":{"description":"Done; no body."},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"content":{"application/json":{"example":{"error":{"code":"bom_archived","details":[],"message":"Refused: bom_archived."}},"schema":{"properties":{"error":{"allOf":[{"$ref":"#/components/schemas/ErrorBody"}],"properties":{"code":{"enum":["bom_archived","bom_trashed"],"type":"string"}},"type":"object"}},"required":["error"],"type":"object"}}},"description":"Refused by a domain rule: bom_archived, bom_trashed."},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Busy"}},"summary":"Delete a comment","tags":["Comments"],"x-example":{"request":"DELETE /api/v1/comments/42","response":{"body":null,"status":204}}},"get":{"description":"One comment with its replies.","operationId":"getComment","parameters":[{"description":"Record id.","in":"path","name":"id","required":true,"schema":{"type":"integer"}}],"responses":{"200":{"content":{"application/json":{"example":{"data":{"author":{"kind":"agent","name":"Claude (sourcing agent)"},"body":"Is 5% tolerance acceptable here?","bom_id":7,"id":500,"kind":"question","line_id":100,"links":{"self":"/api/v1/comments/500"},"object":"comment","replies":[],"resolved":false,"target":"line"}},"schema":{"properties":{"data":{"$ref":"#/components/schemas/Comment"}},"required":["data"],"type":"object"}}},"description":"The record.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"}},"summary":"Get a comment","tags":["Comments"]},"patch":{"description":"Edits the body (or kind) and stamps `edited_at`.","operationId":"updateComment","parameters":[{"description":"Record id.","in":"path","name":"id","required":true,"schema":{"type":"integer"}}],"requestBody":{"content":{"application/json":{"example":{"body":"Is 5% tolerance acceptable for R3?"},"schema":{"$ref":"#/components/schemas/CommentUpdate"}}},"required":true},"responses":{"200":{"content":{"application/json":{"example":{"data":{"author":{"kind":"agent","name":"Claude (sourcing agent)"},"body":"Is 5% tolerance acceptable here?","bom_id":7,"id":500,"kind":"question","line_id":100,"links":{"self":"/api/v1/comments/500"},"object":"comment","replies":[],"resolved":false,"target":"line"}},"schema":{"properties":{"data":{"$ref":"#/components/schemas/Comment"}},"required":["data"],"type":"object"}}},"description":"The record.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"content":{"application/json":{"example":{"error":{"code":"bom_archived","details":[],"message":"Refused: bom_archived."}},"schema":{"properties":{"error":{"allOf":[{"$ref":"#/components/schemas/ErrorBody"}],"properties":{"code":{"enum":["bom_archived","bom_trashed"],"type":"string"}},"type":"object"}},"required":["error"],"type":"object"}}},"description":"Refused by a domain rule: bom_archived, bom_trashed."},"415":{"$ref":"#/components/responses/UnsupportedMediaType"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Busy"}},"summary":"Edit a comment","tags":["Comments"]}},"/alternates/{id}/impact":{"get":{"description":"The allocations, orders, and receipts tied to the line, and whether accepting needs an `allocations` decision.","operationId":"getAlternateImpact","parameters":[{"description":"Record id.","in":"path","name":"id","required":true,"schema":{"type":"integer"}}],"responses":{"200":{"content":{"application/json":{"example":{"data":{"allocations":[],"alternate":{"author":{"kind":"agent","name":"Claude (sourcing agent)"},"id":600,"line_id":100,"links":{"accept":"/api/v1/alternates/600/accept","self":"/api/v1/alternates/600"},"object":"alternate","part_id":43,"rationale":"Same footprint, in stock","replaced_part_id":null,"status":"proposed","trade_offs":"5% tolerance"},"orders":[],"receipts":[],"requires_allocation_decision":false}},"schema":{"properties":{"data":{"$ref":"#/components/schemas/AlternateImpact"}},"required":["data"],"type":"object"}}},"description":"The record.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"}},"summary":"Impact of accepting","tags":["Alternates"]}},"/boms/{id}/activity":{"get":{"description":"Display history of the BOM, newest first. Page with `before` set to the previous `next_cursor`.","operationId":"listBomActivity","parameters":[{"description":"Record id.","in":"path","name":"id","required":true,"schema":{"type":"integer"}},{"description":"Only events older than this event id.","in":"query","name":"before","required":false,"schema":{"type":"integer"}},{"description":"Only events about this line.","in":"query","name":"line_id","required":false,"schema":{"type":"integer"}},{"$ref":"#/components/parameters/limit"}],"responses":{"200":{"content":{"application/json":{"example":{"data":[{"action":"line.updated","actor":{"api_token_id":3,"kind":"agent","name":"Claude (sourcing agent)"},"bom_id":7,"bom_ids":[7],"changes":{"quantity":["2","3"]},"cursor":"9001","id":9001,"metadata":{},"object":"event","occurred_at":"2026-11-21T08:00:00Z","subject":{"id":100,"type":"line"},"summary":"Updated requirement 10k pull-up"}],"next_cursor":null},"schema":{"properties":{"data":{"items":{"$ref":"#/components/schemas/Event"},"type":"array"},"next_cursor":{"description":"Pass as `after` for the next page; null on the last page.","type":["string","null"]}},"required":["data","next_cursor"],"type":"object"}}},"description":"A page of records.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"}},"summary":"BOM history","tags":["Activity"]}},"/receipts/{id}/void":{"post":{"description":"Voids the receipt (it stays in history) and, with `replacement`, records the corrected receipt.","operationId":"voidReceipt","parameters":[{"description":"Record id.","in":"path","name":"id","required":true,"schema":{"type":"integer"}},{"$ref":"#/components/parameters/idempotencyKey"}],"requestBody":{"content":{"application/json":{"example":{"replacement":{"exception":"damaged","quantity_accepted":"3","quantity_received":"4"}},"schema":{"$ref":"#/components/schemas/VoidReceiptInput"}}},"required":true},"responses":{"200":{"content":{"application/json":{"example":{"data":{"replacement":{"exception":"none","id":401,"links":{"self":"/api/v1/receipts/400"},"object":"receipt","order_item_id":200,"quantity_accepted":"4","quantity_received":"4","received_on":"2026-11-21","replaces_id":400,"voided":false},"voided":{"exception":"none","id":400,"links":{"self":"/api/v1/receipts/400"},"object":"receipt","order_item_id":200,"quantity_accepted":"4","quantity_received":"4","received_on":"2026-11-21","replaces_id":null,"voided":true}}},"schema":{"properties":{"data":{"$ref":"#/components/schemas/ReceiptVoid"}},"required":["data"],"type":"object"}}},"description":"The record.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"content":{"application/json":{"example":{"error":{"code":"already_voided","details":[],"message":"Refused: already_voided."}},"schema":{"properties":{"error":{"allOf":[{"$ref":"#/components/schemas/ErrorBody"}],"properties":{"code":{"enum":["already_voided","idempotency_in_progress","idempotency_response_not_stored"],"type":"string"}},"type":"object"}},"required":["error"],"type":"object"}}},"description":"Refused by a domain rule: already_voided."},"415":{"$ref":"#/components/responses/UnsupportedMediaType"},"422":{"content":{"application/json":{"example":{"error":{"code":"validation_failed","details":[{"allowed":["purchase","on_hand","salvaged","fabricated","supplied","kit"],"code":"invalid","field":"supply","message":"is invalid"}],"message":"The request has invalid fields."}},"schema":{"properties":{"error":{"allOf":[{"$ref":"#/components/schemas/ErrorBody"}],"properties":{"code":{"enum":["validation_failed","idempotency_key_reused"],"type":"string"}},"type":"object"}},"required":["error"],"type":"object"}}},"description":"Invalid fields, or a declared query parameter with a bad value. `details` has one entry per problem with a dotted `field` path; enum errors list `allowed` values. A cursor (`after`) of this list written for another `sort` has detail code `cursor_mismatch`; any other unusable cursor has detail code `invalid`. Also: idempotency_key_reused."},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Busy"}},"summary":"Void a receipt","tags":["Receipts"]}},"/order-items/{order_item_id}/receipts":{"get":{"description":"Receipts of the item, voided ones included unless `include_voided=false`.","operationId":"listReceipts","parameters":[{"description":"Record id.","in":"path","name":"order_item_id","required":true,"schema":{"type":"integer"}},{"description":"Include voided receipts (default true).","in":"query","name":"include_voided","required":false,"schema":{"type":"boolean"}},{"$ref":"#/components/parameters/limit"},{"$ref":"#/components/parameters/after"}],"responses":{"200":{"content":{"application/json":{"example":{"data":[{"exception":"none","id":400,"links":{"self":"/api/v1/receipts/400"},"object":"receipt","order_item_id":200,"quantity_accepted":"4","quantity_received":"4","received_on":"2026-11-21","replaces_id":null,"voided":false}],"next_cursor":null},"schema":{"properties":{"data":{"items":{"$ref":"#/components/schemas/Receipt"},"type":"array"},"next_cursor":{"description":"Pass as `after` for the next page; null on the last page.","type":["string","null"]}},"required":["data","next_cursor"],"type":"object"}}},"description":"A page of records.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"}},"summary":"List receipts","tags":["Receipts"]},"post":{"description":"Records what arrived. `quantity_accepted` defaults to `quantity_received`; accepted units make allocations ready, first in first out.","operationId":"recordReceipt","parameters":[{"description":"Record id.","in":"path","name":"order_item_id","required":true,"schema":{"type":"integer"}},{"$ref":"#/components/parameters/idempotencyKey"}],"requestBody":{"content":{"application/json":{"example":{"quantity_accepted":"4","quantity_received":"4","received_on":"2026-11-21"},"schema":{"$ref":"#/components/schemas/ReceiptInput"}}},"required":true},"responses":{"201":{"content":{"application/json":{"example":{"data":{"exception":"none","id":400,"links":{"self":"/api/v1/receipts/400"},"object":"receipt","order_item_id":200,"quantity_accepted":"4","quantity_received":"4","received_on":"2026-11-21","replaces_id":null,"voided":false}},"schema":{"properties":{"data":{"$ref":"#/components/schemas/Receipt"}},"required":["data"],"type":"object"}}},"description":"Created.","headers":{"Location":{"$ref":"#/components/headers/Location"},"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"content":{"application/json":{"example":{"error":{"code":"idempotency_in_progress","details":[],"message":"Refused: idempotency_in_progress."}},"schema":{"properties":{"error":{"allOf":[{"$ref":"#/components/schemas/ErrorBody"}],"properties":{"code":{"enum":["idempotency_in_progress","idempotency_response_not_stored"],"type":"string"}},"type":"object"}},"required":["error"],"type":"object"}}},"description":"Refused by a domain rule: idempotency_in_progress, idempotency_response_not_stored."},"415":{"$ref":"#/components/responses/UnsupportedMediaType"},"422":{"content":{"application/json":{"example":{"error":{"code":"validation_failed","details":[{"allowed":["purchase","on_hand","salvaged","fabricated","supplied","kit"],"code":"invalid","field":"supply","message":"is invalid"}],"message":"The request has invalid fields."}},"schema":{"properties":{"error":{"allOf":[{"$ref":"#/components/schemas/ErrorBody"}],"properties":{"code":{"enum":["validation_failed","idempotency_key_reused"],"type":"string"}},"type":"object"}},"required":["error"],"type":"object"}}},"description":"Invalid fields, or a declared query parameter with a bad value. `details` has one entry per problem with a dotted `field` path; enum errors list `allowed` values. A cursor (`after`) of this list written for another `sort` has detail code `cursor_mismatch`; any other unusable cursor has detail code `invalid`. Also: idempotency_key_reused."},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Busy"}},"summary":"Record a receipt","tags":["Receipts"]}},"/me":{"get":{"description":"The token's name, its owner's email, what the token may do, the rate limit, server time, and the API version. Call it first to verify a token.","operationId":"getMe","parameters":[],"responses":{"200":{"content":{"application/json":{"example":{"data":{"api_version":"v1","owner":{"email":"maker@example.com","id":1},"permissions":["boms:read","boms:write","groups:write","lines:write","alternates:write","revisions:write","parts:read","parts:write","orders:read","orders:write","comments:read","comments:write","events:read","imports:write","exports:read"],"rate_limit":{"enabled":true,"limit":600,"window_seconds":60},"server_time":"2026-11-21T08:00:00Z","token":{"default":false,"id":3,"name":"Claude (sourcing agent)","prefix":"bbom_Ab12"}}},"schema":{"properties":{"data":{"$ref":"#/components/schemas/Me"}},"required":["data"],"type":"object"}}},"description":"The record.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"429":{"$ref":"#/components/responses/RateLimited"}},"summary":"Current token","tags":["Account"]}},"/lines/{id}/duplicate":{"post":{"description":"Copies the line after the original (or to another group with `group_id`). Body fields override the copy. Allocations, alternates, and the source ref are not copied.","operationId":"duplicateLine","parameters":[{"description":"Record id.","in":"path","name":"id","required":true,"schema":{"type":"integer"}},{"$ref":"#/components/parameters/idempotencyKey"}],"requestBody":{"content":{"application/json":{"example":{"group_id":11},"schema":{"$ref":"#/components/schemas/LineInput"}}},"required":true},"responses":{"201":{"content":{"application/json":{"example":{"data":{"attributes":{"footprint":"R_0603","value":"10k"},"bom_id":7,"deleted":false,"external_links":[],"group_id":10,"id":100,"inclusion":"required","links":{"alternates":"/api/v1/lines/100/alternates","bom":"/api/v1/boms/7","self":"/api/v1/lines/100"},"lock_version":3,"name":"10k pull-up","object":"line","part_id":42,"position":0,"quantity":"3","references":["R1","R2","R3"],"spares":"2","supply":"purchase","tags":["passive"],"unit":"pcs"}},"schema":{"properties":{"data":{"$ref":"#/components/schemas/Line"}},"required":["data"],"type":"object"}}},"description":"Created.","headers":{"ETag":{"$ref":"#/components/headers/ETag"},"Location":{"$ref":"#/components/headers/Location"},"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"content":{"application/json":{"example":{"error":{"code":"bom_archived","details":[],"message":"Refused: bom_archived."}},"schema":{"properties":{"error":{"allOf":[{"$ref":"#/components/schemas/ErrorBody"}],"properties":{"code":{"enum":["bom_archived","bom_trashed","idempotency_in_progress","idempotency_response_not_stored"],"type":"string"}},"type":"object"}},"required":["error"],"type":"object"}}},"description":"Refused by a domain rule: bom_archived, bom_trashed."},"415":{"$ref":"#/components/responses/UnsupportedMediaType"},"422":{"content":{"application/json":{"example":{"error":{"code":"validation_failed","details":[{"allowed":["purchase","on_hand","salvaged","fabricated","supplied","kit"],"code":"invalid","field":"supply","message":"is invalid"}],"message":"The request has invalid fields."}},"schema":{"properties":{"error":{"allOf":[{"$ref":"#/components/schemas/ErrorBody"}],"properties":{"code":{"enum":["validation_failed","idempotency_key_reused"],"type":"string"}},"type":"object"}},"required":["error"],"type":"object"}}},"description":"Invalid fields, or a declared query parameter with a bad value. `details` has one entry per problem with a dotted `field` path; enum errors list `allowed` values. A cursor (`after`) of this list written for another `sort` has detail code `cursor_mismatch`; any other unusable cursor has detail code `invalid`. Also: idempotency_key_reused."},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Busy"}},"summary":"Duplicate a line","tags":["Lines"]}},"/order-items/{id}/cancel-impact":{"get":{"description":"Per line, the units that stop being covered and the units that stay ready. Read it before `POST /order-items/{id}/cancel`. Writes nothing.","operationId":"getOrderItemCancelImpact","parameters":[{"description":"Record id.","in":"path","name":"id","required":true,"schema":{"type":"integer"}}],"responses":{"200":{"content":{"application/json":{"example":{"data":{"lines":[{"bom_id":7,"bom_name":"Desk weather station","line_id":100,"line_name":"10k pull-up","stays_ready":"4","stops":"6","unit":"pcs"}],"stays_ready":"4","stops":"6"}},"schema":{"properties":{"data":{"$ref":"#/components/schemas/CancelImpact"}},"required":["data"],"type":"object"}}},"description":"The record.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"}},"summary":"What canceling an order item changes","tags":["Order items"]}},"/boms/{id}/share/code":{"post":{"description":"Generates a new access code for a link with a code. The old code stops working at once and every visitor must enter the new one. A stated version is checked when given.","operationId":"regenerateShareCode","parameters":[{"description":"Record id.","in":"path","name":"id","required":true,"schema":{"type":"integer"}},{"$ref":"#/components/parameters/ifMatch"},{"$ref":"#/components/parameters/idempotencyKey"}],"responses":{"200":{"content":{"application/json":{"example":{"data":{"access":"code","access_code":"K7QM-4XRT-9WPA-ZH3C","author_name":"Sam","bom_id":7,"changed_since_shared":false,"description":"Indoor climate logger","id":3,"include_notes":true,"include_prices":false,"license":null,"links":{"bom":"/api/v1/boms/7","csv":"https://example.com/b/k3m9xq2v7tw4hp6rz5ya2bnc/builderbom.csv","document":"https://example.com/b/k3m9xq2v7tw4hp6rz5ya2bnc/builderbom.json","page":"https://example.com/b/k3m9xq2v7tw4hp6rz5ya2bnc","self":"/api/v1/boms/7/share"},"lock_version":1,"object":"shared_build","requirement_count":18,"revision_id":70,"revision_label":"Revision 4: Shared copy","shared_at":"2026-11-21T10:00:00Z","slug":"k3m9xq2v7tw4hp6rz5ya2bnc","stop_reason":null,"stopped_at":null,"takedown_reason":null,"title":"Desk weather station","url":"https://example.com/b/k3m9xq2v7tw4hp6rz5ya2bnc"}},"schema":{"properties":{"data":{"$ref":"#/components/schemas/SharedBuild"}},"required":["data"],"type":"object"}}},"description":"The record.","headers":{"ETag":{"$ref":"#/components/headers/ETag"},"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"content":{"application/json":{"example":{"error":{"code":"conflict","details":[{"code":"stale","field":"lock_version","message":"current version is 4"}],"message":"The record changed since the version you sent."}},"schema":{"properties":{"error":{"allOf":[{"$ref":"#/components/schemas/ErrorBody"}],"properties":{"code":{"enum":["conflict","idempotency_in_progress","not_shared","no_code","idempotency_response_not_stored"],"type":"string"}},"type":"object"}},"required":["error"],"type":"object"}}},"description":"The record changed since the version you sent. `error.current` holds the stored record; reapply your change to it and retry with its lock_version. Also: not_shared, no_code."},"412":{"$ref":"#/components/responses/PreconditionFailed"},"422":{"$ref":"#/components/responses/IdempotencyKeyReused"},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Busy"}},"summary":"Replace the access code","tags":["Sharing"]}},"/boms/{bom_id}/groups":{"get":{"description":"The BOM's groups as a tree (each node has `children`), or flat with `flat=true`. Not paginated.","operationId":"listGroups","parameters":[{"description":"Record id.","in":"path","name":"bom_id","required":true,"schema":{"type":"integer"}},{"description":"Return a flat list.","in":"query","name":"flat","required":false,"schema":{"type":"boolean"}}],"responses":{"200":{"content":{"application/json":{"example":{"data":[{"bom_id":7,"children":[],"id":10,"links":{"self":"/api/v1/groups/10"},"lock_version":1,"name":"Electronics","object":"group","parent_id":null,"position":0,"quantity":1}],"next_cursor":null},"schema":{"properties":{"data":{"items":{"$ref":"#/components/schemas/GroupNode"},"type":"array"},"next_cursor":{"description":"Pass as `after` for the next page; null on the last page.","type":["string","null"]}},"required":["data","next_cursor"],"type":"object"}}},"description":"A page of records.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"}},"summary":"List groups","tags":["Groups"]},"post":{"description":"Adds a group at the end of its parent (`parent_id`, null for top level).","operationId":"createGroup","parameters":[{"description":"Record id.","in":"path","name":"bom_id","required":true,"schema":{"type":"integer"}},{"$ref":"#/components/parameters/idempotencyKey"}],"requestBody":{"content":{"application/json":{"example":{"name":"Power","parent_id":null,"quantity":1},"schema":{"$ref":"#/components/schemas/GroupInput"}}},"required":true},"responses":{"201":{"content":{"application/json":{"example":{"data":{"bom_id":7,"id":10,"links":{"self":"/api/v1/groups/10"},"lock_version":1,"name":"Electronics","object":"group","parent_id":null,"position":0,"quantity":1}},"schema":{"properties":{"data":{"$ref":"#/components/schemas/Group"}},"required":["data"],"type":"object"}}},"description":"Created.","headers":{"ETag":{"$ref":"#/components/headers/ETag"},"Location":{"$ref":"#/components/headers/Location"},"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"content":{"application/json":{"example":{"error":{"code":"bom_archived","details":[],"message":"Refused: bom_archived."}},"schema":{"properties":{"error":{"allOf":[{"$ref":"#/components/schemas/ErrorBody"}],"properties":{"code":{"enum":["bom_archived","bom_trashed","idempotency_in_progress","idempotency_response_not_stored"],"type":"string"}},"type":"object"}},"required":["error"],"type":"object"}}},"description":"Refused by a domain rule: bom_archived, bom_trashed."},"415":{"$ref":"#/components/responses/UnsupportedMediaType"},"422":{"content":{"application/json":{"example":{"error":{"code":"validation_failed","details":[{"allowed":["purchase","on_hand","salvaged","fabricated","supplied","kit"],"code":"invalid","field":"supply","message":"is invalid"}],"message":"The request has invalid fields."}},"schema":{"properties":{"error":{"allOf":[{"$ref":"#/components/schemas/ErrorBody"}],"properties":{"code":{"enum":["validation_failed","idempotency_key_reused"],"type":"string"}},"type":"object"}},"required":["error"],"type":"object"}}},"description":"Invalid fields, or a declared query parameter with a bad value. `details` has one entry per problem with a dotted `field` path; enum errors list `allowed` values. A cursor (`after`) of this list written for another `sort` has detail code `cursor_mismatch`; any other unusable cursor has detail code `invalid`. Also: idempotency_key_reused."},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Busy"}},"summary":"Create a group","tags":["Groups"]}},"/lines/{line_id}/allocations":{"get":{"description":"Allocations covering the line, oldest first.","operationId":"listLineAllocations","parameters":[{"description":"Record id.","in":"path","name":"line_id","required":true,"schema":{"type":"integer"}},{"$ref":"#/components/parameters/limit"},{"$ref":"#/components/parameters/after"}],"responses":{"200":{"content":{"application/json":{"example":{"data":[{"id":300,"line_id":100,"links":{"line":"/api/v1/lines/100","self":"/api/v1/allocations/300"},"object":"allocation","order_id":20,"order_item_id":200,"quantity":"8","ready_quantity":"0","source":"order"}],"next_cursor":null},"schema":{"properties":{"data":{"items":{"$ref":"#/components/schemas/Allocation"},"type":"array"},"next_cursor":{"description":"Pass as `after` for the next page; null on the last page.","type":["string","null"]}},"required":["data","next_cursor"],"type":"object"}}},"description":"A page of records.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"}},"summary":"Allocations of a line","tags":["Allocations"]},"post":{"description":"Assigns units to the line. `source: order` needs `order_item_id` and cannot exceed the item's unallocated units (`over_allocation`). Other sources (`stock`, `salvaged`, `fabricated`, `supplied`, `kit`) track readiness with `ready_quantity`.","operationId":"createAllocation","parameters":[{"description":"Record id.","in":"path","name":"line_id","required":true,"schema":{"type":"integer"}},{"$ref":"#/components/parameters/idempotencyKey"}],"requestBody":{"content":{"application/json":{"example":{"quantity":"5","ready_quantity":"5","source":"stock"},"schema":{"$ref":"#/components/schemas/AllocationInput"}}},"required":true},"responses":{"201":{"content":{"application/json":{"example":{"data":{"id":300,"line_id":100,"links":{"line":"/api/v1/lines/100","self":"/api/v1/allocations/300"},"object":"allocation","order_id":20,"order_item_id":200,"quantity":"8","ready_quantity":"0","source":"order"}},"schema":{"properties":{"data":{"$ref":"#/components/schemas/Allocation"}},"required":["data"],"type":"object"}}},"description":"Created.","headers":{"Location":{"$ref":"#/components/headers/Location"},"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"content":{"application/json":{"example":{"error":{"code":"bom_trashed","details":[],"message":"Refused: bom_trashed."}},"schema":{"properties":{"error":{"allOf":[{"$ref":"#/components/schemas/ErrorBody"}],"properties":{"code":{"enum":["bom_trashed","idempotency_in_progress","idempotency_response_not_stored"],"type":"string"}},"type":"object"}},"required":["error"],"type":"object"}}},"description":"Refused by a domain rule: bom_trashed."},"415":{"$ref":"#/components/responses/UnsupportedMediaType"},"422":{"content":{"application/json":{"example":{"error":{"code":"validation_failed","details":[{"allowed":["purchase","on_hand","salvaged","fabricated","supplied","kit"],"code":"invalid","field":"supply","message":"is invalid"}],"message":"The request has invalid fields."}},"schema":{"properties":{"error":{"allOf":[{"$ref":"#/components/schemas/ErrorBody"}],"properties":{"code":{"enum":["validation_failed","idempotency_key_reused"],"type":"string"}},"type":"object"}},"required":["error"],"type":"object"}}},"description":"Invalid fields, or a declared query parameter with a bad value. `details` has one entry per problem with a dotted `field` path; enum errors list `allowed` values. A cursor (`after`) of this list written for another `sort` has detail code `cursor_mismatch`; any other unusable cursor has detail code `invalid`. Also: idempotency_key_reused."},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Busy"}},"summary":"Allocate units","tags":["Allocations"]}},"/parts/{id}/merge":{"post":{"description":"Re-points lines, listings, order items, and alternates of `merged_part_id` to this part and deletes the merged part. Lines of archived and trashed BOMs are re-pointed too. The version of this part (`lock_version` or `If-Match`) and of the merged part (`merged_lock_version`) are checked when sent.","operationId":"mergePart","parameters":[{"description":"Record id.","in":"path","name":"id","required":true,"schema":{"type":"integer"}},{"$ref":"#/components/parameters/ifMatch"},{"$ref":"#/components/parameters/idempotencyKey"}],"requestBody":{"content":{"application/json":{"example":{"lock_version":2,"merged_lock_version":1,"merged_part_id":43},"schema":{"$ref":"#/components/schemas/MergePartInput"}}},"required":true},"responses":{"200":{"content":{"application/json":{"example":{"data":{"attributes":{"tolerance":"1%"},"external_links":[],"id":42,"links":{"listings":"/api/v1/parts/42/listings","self":"/api/v1/parts/42"},"listings":[{"confidence":"verified","currency":"USD","id":50,"links":{"self":"/api/v1/listings/50"},"object":"listing","pack_size":"100","part_id":42,"preferred":true,"price":"1.2","sku":"311-10.0KHRCT-ND","stale":false,"supplier":"DigiKey"}],"lock_version":1,"manufacturer":"Yageo","mpn":"RC0603FR-0710KL","name":"10k resistor 0603","object":"part","retired":false}},"schema":{"properties":{"data":{"$ref":"#/components/schemas/Part"}},"required":["data"],"type":"object"}}},"description":"The record.","headers":{"ETag":{"$ref":"#/components/headers/ETag"},"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"content":{"application/json":{"example":{"error":{"code":"conflict","details":[{"code":"stale","field":"lock_version","message":"current version is 4"}],"message":"The record changed since the version you sent."}},"schema":{"properties":{"error":{"allOf":[{"$ref":"#/components/schemas/ErrorBody"}],"properties":{"code":{"enum":["conflict","idempotency_in_progress","idempotency_response_not_stored"],"type":"string"}},"type":"object"}},"required":["error"],"type":"object"}}},"description":"The record changed since the version you sent. `error.current` holds the stored record; reapply your change to it and retry with its lock_version. Also: idempotency_response_not_stored."},"412":{"$ref":"#/components/responses/PreconditionFailed"},"415":{"$ref":"#/components/responses/UnsupportedMediaType"},"422":{"content":{"application/json":{"example":{"error":{"code":"validation_failed","details":[{"allowed":["purchase","on_hand","salvaged","fabricated","supplied","kit"],"code":"invalid","field":"supply","message":"is invalid"}],"message":"The request has invalid fields."}},"schema":{"properties":{"error":{"allOf":[{"$ref":"#/components/schemas/ErrorBody"}],"properties":{"code":{"enum":["validation_failed","same_part","idempotency_key_reused"],"type":"string"}},"type":"object"}},"required":["error"],"type":"object"}}},"description":"Invalid fields, or a declared query parameter with a bad value. `details` has one entry per problem with a dotted `field` path; enum errors list `allowed` values. A cursor (`after`) of this list written for another `sort` has detail code `cursor_mismatch`; any other unusable cursor has detail code `invalid`. Also: same_part."},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Busy"}},"summary":"Merge a part into this one","tags":["Parts"]}},"/events/undo-check":{"post":{"description":"Checks up to 100 events at once without writing: `event_ids` in, `results` keyed by event id out, each `{undoable, reason}`. Unknown ids and ids of other accounts report `not_found`.","operationId":"checkEventsUndo","parameters":[{"$ref":"#/components/parameters/idempotencyKey"}],"requestBody":{"content":{"application/json":{"example":{"event_ids":[9001,9002]},"schema":{"$ref":"#/components/schemas/UndoCheckManyInput"}}},"required":true},"responses":{"200":{"content":{"application/json":{"example":{"data":{"results":{"9001":{"reason":null,"undoable":true},"9002":{"reason":"changed_since","undoable":false}}}},"schema":{"properties":{"data":{"$ref":"#/components/schemas/UndoCheckMany"}},"required":["data"],"type":"object"}}},"description":"The record.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"409":{"content":{"application/json":{"example":{"error":{"code":"idempotency_in_progress","details":[],"message":"Refused: idempotency_in_progress."}},"schema":{"properties":{"error":{"allOf":[{"$ref":"#/components/schemas/ErrorBody"}],"properties":{"code":{"enum":["idempotency_in_progress","idempotency_response_not_stored"],"type":"string"}},"type":"object"}},"required":["error"],"type":"object"}}},"description":"Refused by a domain rule: idempotency_in_progress, idempotency_response_not_stored."},"415":{"$ref":"#/components/responses/UnsupportedMediaType"},"422":{"content":{"application/json":{"example":{"error":{"code":"validation_failed","details":[{"allowed":["purchase","on_hand","salvaged","fabricated","supplied","kit"],"code":"invalid","field":"supply","message":"is invalid"}],"message":"The request has invalid fields."}},"schema":{"properties":{"error":{"allOf":[{"$ref":"#/components/schemas/ErrorBody"}],"properties":{"code":{"enum":["validation_failed","idempotency_key_reused"],"type":"string"}},"type":"object"}},"required":["error"],"type":"object"}}},"description":"Invalid fields, or a declared query parameter with a bad value. `details` has one entry per problem with a dotted `field` path; enum errors list `allowed` values. A cursor (`after`) of this list written for another `sort` has detail code `cursor_mismatch`; any other unusable cursor has detail code `invalid`. Also: idempotency_key_reused."},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Busy"}},"summary":"Can these changes be undone","tags":["Activity"]}},"/boms/{id}/trash":{"post":{"description":"Moves the BOM to the trash (reversible). Writes to its contents then return `bom_trashed`. A stated version is checked when given.","operationId":"trashBom","parameters":[{"description":"Record id.","in":"path","name":"id","required":true,"schema":{"type":"integer"}},{"$ref":"#/components/parameters/ifMatch"},{"$ref":"#/components/parameters/idempotencyKey"}],"responses":{"200":{"content":{"application/json":{"example":{"data":{"archived_at":null,"build_count":2,"build_label":"rev A","id":7,"inserted_at":"2026-11-01T09:00:00Z","links":{"analysis":"/api/v1/boms/7/analysis","lines":"/api/v1/boms/7/lines","self":"/api/v1/boms/7"},"lock_version":4,"name":"Desk weather station","object":"bom","purpose":"Indoor climate logger","state":"active","trashed_at":null,"updated_at":"2026-11-21T08:00:00Z"}},"schema":{"properties":{"data":{"$ref":"#/components/schemas/Bom"}},"required":["data"],"type":"object"}}},"description":"The record.","headers":{"ETag":{"$ref":"#/components/headers/ETag"},"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"content":{"application/json":{"example":{"error":{"code":"conflict","details":[{"code":"stale","field":"lock_version","message":"current version is 4"}],"message":"The record changed since the version you sent."}},"schema":{"properties":{"error":{"allOf":[{"$ref":"#/components/schemas/ErrorBody"}],"properties":{"code":{"enum":["conflict","idempotency_in_progress","idempotency_response_not_stored"],"type":"string"}},"type":"object"}},"required":["error"],"type":"object"}}},"description":"The record changed since the version you sent. `error.current` holds the stored record; reapply your change to it and retry with its lock_version. Also: idempotency_response_not_stored."},"412":{"$ref":"#/components/responses/PreconditionFailed"},"422":{"$ref":"#/components/responses/IdempotencyKeyReused"},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Busy"}},"summary":"Move a BOM to the trash","tags":["BOMs"]}},"/boms/{bom_id}/revisions/compare":{"get":{"description":"Added, removed, and modified lines with field-level changes between `from` and `to` (revision ids or `draft`), plus open orders of removed or modified lines.","operationId":"compareRevisions","parameters":[{"description":"Record id.","in":"path","name":"bom_id","required":true,"schema":{"type":"integer"}},{"description":"A revision id or `draft`.","in":"query","name":"from","required":true,"schema":{"type":"string"}},{"description":"A revision id or `draft`.","in":"query","name":"to","required":true,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"example":{"data":{"added":[],"modified":[{"changes":{"quantity":["2","3"]},"line_id":100,"name":"10k pull-up"}],"open_orders":{},"removed":[],"unchanged_count":14}},"schema":{"properties":{"data":{"$ref":"#/components/schemas/Comparison"}},"required":["data"],"type":"object"}}},"description":"The record.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"}},"summary":"Compare versions","tags":["Revisions"]}},"/boms/{id}/archive":{"post":{"description":"Archives the BOM (reversible). Writes to its contents then return `bom_archived`. A stated version is checked when given.","operationId":"archiveBom","parameters":[{"description":"Record id.","in":"path","name":"id","required":true,"schema":{"type":"integer"}},{"$ref":"#/components/parameters/ifMatch"},{"$ref":"#/components/parameters/idempotencyKey"}],"responses":{"200":{"content":{"application/json":{"example":{"data":{"archived_at":null,"build_count":2,"build_label":"rev A","id":7,"inserted_at":"2026-11-01T09:00:00Z","links":{"analysis":"/api/v1/boms/7/analysis","lines":"/api/v1/boms/7/lines","self":"/api/v1/boms/7"},"lock_version":4,"name":"Desk weather station","object":"bom","purpose":"Indoor climate logger","state":"active","trashed_at":null,"updated_at":"2026-11-21T08:00:00Z"}},"schema":{"properties":{"data":{"$ref":"#/components/schemas/Bom"}},"required":["data"],"type":"object"}}},"description":"The record.","headers":{"ETag":{"$ref":"#/components/headers/ETag"},"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"content":{"application/json":{"example":{"error":{"code":"conflict","details":[{"code":"stale","field":"lock_version","message":"current version is 4"}],"message":"The record changed since the version you sent."}},"schema":{"properties":{"error":{"allOf":[{"$ref":"#/components/schemas/ErrorBody"}],"properties":{"code":{"enum":["conflict","idempotency_in_progress","idempotency_response_not_stored"],"type":"string"}},"type":"object"}},"required":["error"],"type":"object"}}},"description":"The record changed since the version you sent. `error.current` holds the stored record; reapply your change to it and retry with its lock_version. Also: idempotency_response_not_stored."},"412":{"$ref":"#/components/responses/PreconditionFailed"},"422":{"$ref":"#/components/responses/IdempotencyKeyReused"},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Busy"}},"summary":"Archive a BOM","tags":["BOMs"]}},"/boms/{id}/share":{"delete":{"description":"Removes the stored document and the access code; the link answers `410 Gone` from now on (a shared cache may serve the old page for up to 60 seconds). A stated version is checked when given.","operationId":"stopSharingBom","parameters":[{"description":"Record id.","in":"path","name":"id","required":true,"schema":{"type":"integer"}},{"$ref":"#/components/parameters/ifMatch"}],"responses":{"204":{"description":"Done; no body."},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"content":{"application/json":{"example":{"error":{"code":"conflict","details":[{"code":"stale","field":"lock_version","message":"current version is 4"}],"message":"The record changed since the version you sent."}},"schema":{"properties":{"error":{"allOf":[{"$ref":"#/components/schemas/ErrorBody"}],"properties":{"code":{"enum":["conflict","idempotency_in_progress","not_shared"],"type":"string"}},"type":"object"}},"required":["error"],"type":"object"}}},"description":"The record changed since the version you sent. `error.current` holds the stored record; reapply your change to it and retry with its lock_version. Also: not_shared."},"412":{"$ref":"#/components/responses/PreconditionFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Busy"}},"summary":"Stop sharing","tags":["Sharing"],"x-example":{"request":"DELETE /api/v1/boms/42/share","response":{"body":null,"status":204}}},"get":{"description":"The build's shared build: its public link, who can open it, the access code (for a link with a code), the revision it shows, and `changed_since_shared` (the build changed after the snapshot, so `PUT` would update it). A taken-down shared build answers with `stop_reason: taken_down` and `takedown_reason`. `404` when the build is not shared.","operationId":"getBomShare","parameters":[{"description":"Record id.","in":"path","name":"id","required":true,"schema":{"type":"integer"}}],"responses":{"200":{"content":{"application/json":{"example":{"data":{"access":"code","access_code":"K7QM-4XRT-9WPA-ZH3C","author_name":"Sam","bom_id":7,"changed_since_shared":false,"description":"Indoor climate logger","id":3,"include_notes":true,"include_prices":false,"license":null,"links":{"bom":"/api/v1/boms/7","csv":"https://example.com/b/k3m9xq2v7tw4hp6rz5ya2bnc/builderbom.csv","document":"https://example.com/b/k3m9xq2v7tw4hp6rz5ya2bnc/builderbom.json","page":"https://example.com/b/k3m9xq2v7tw4hp6rz5ya2bnc","self":"/api/v1/boms/7/share"},"lock_version":1,"object":"shared_build","requirement_count":18,"revision_id":70,"revision_label":"Revision 4: Shared copy","shared_at":"2026-11-21T10:00:00Z","slug":"k3m9xq2v7tw4hp6rz5ya2bnc","stop_reason":null,"stopped_at":null,"takedown_reason":null,"title":"Desk weather station","url":"https://example.com/b/k3m9xq2v7tw4hp6rz5ya2bnc"}},"schema":{"properties":{"data":{"$ref":"#/components/schemas/SharedBuild"}},"required":["data"],"type":"object"}}},"description":"The record.","headers":{"ETag":{"$ref":"#/components/headers/ETag"},"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"}},"summary":"Read the shared build","tags":["Sharing"]},"post":{"description":"Saves a revision (or uses `revision_id`), builds the Maker BOM document from it once, and publishes it at a new unlisted link. Anyone who can open the link can download and copy the build. With `access: code` the app generates an access code; it is in the response. Notes are included by default and prices are not. An archived build can be shared only from an existing revision.","operationId":"shareBom","parameters":[{"description":"Record id.","in":"path","name":"id","required":true,"schema":{"type":"integer"}},{"$ref":"#/components/parameters/idempotencyKey"}],"requestBody":{"content":{"application/json":{"example":{"access":"link","author_name":"Sam","include_notes":true,"include_prices":false,"title":"Desk weather station"},"schema":{"$ref":"#/components/schemas/ShareInput"}}},"required":true},"responses":{"201":{"content":{"application/json":{"example":{"data":{"access":"code","access_code":"K7QM-4XRT-9WPA-ZH3C","author_name":"Sam","bom_id":7,"changed_since_shared":false,"description":"Indoor climate logger","id":3,"include_notes":true,"include_prices":false,"license":null,"links":{"bom":"/api/v1/boms/7","csv":"https://example.com/b/k3m9xq2v7tw4hp6rz5ya2bnc/builderbom.csv","document":"https://example.com/b/k3m9xq2v7tw4hp6rz5ya2bnc/builderbom.json","page":"https://example.com/b/k3m9xq2v7tw4hp6rz5ya2bnc","self":"/api/v1/boms/7/share"},"lock_version":1,"object":"shared_build","requirement_count":18,"revision_id":70,"revision_label":"Revision 4: Shared copy","shared_at":"2026-11-21T10:00:00Z","slug":"k3m9xq2v7tw4hp6rz5ya2bnc","stop_reason":null,"stopped_at":null,"takedown_reason":null,"title":"Desk weather station","url":"https://example.com/b/k3m9xq2v7tw4hp6rz5ya2bnc"}},"schema":{"properties":{"data":{"$ref":"#/components/schemas/SharedBuild"}},"required":["data"],"type":"object"}}},"description":"Created.","headers":{"ETag":{"$ref":"#/components/headers/ETag"},"Location":{"$ref":"#/components/headers/Location"},"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"content":{"application/json":{"example":{"error":{"code":"already_shared","details":[],"message":"Refused: already_shared."}},"schema":{"properties":{"error":{"allOf":[{"$ref":"#/components/schemas/ErrorBody"}],"properties":{"code":{"enum":["already_shared","taken_down","account_held","bom_archived","bom_trashed","idempotency_in_progress","idempotency_response_not_stored"],"type":"string"}},"type":"object"}},"required":["error"],"type":"object"}}},"description":"Refused by a domain rule: already_shared, taken_down, account_held, bom_archived, bom_trashed."},"415":{"$ref":"#/components/responses/UnsupportedMediaType"},"422":{"content":{"application/json":{"example":{"error":{"code":"validation_failed","details":[{"allowed":["purchase","on_hand","salvaged","fabricated","supplied","kit"],"code":"invalid","field":"supply","message":"is invalid"}],"message":"The request has invalid fields."}},"schema":{"properties":{"error":{"allOf":[{"$ref":"#/components/schemas/ErrorBody"}],"properties":{"code":{"enum":["validation_failed","revision_not_found","idempotency_key_reused"],"type":"string"}},"type":"object"}},"required":["error"],"type":"object"}}},"description":"Invalid fields, or a declared query parameter with a bad value. `details` has one entry per problem with a dotted `field` path; enum errors list `allowed` values. A cursor (`after`) of this list written for another `sort` has detail code `cursor_mismatch`; any other unusable cursor has detail code `invalid`. Also: revision_not_found."},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Busy"}},"summary":"Share a build","tags":["Sharing"]},"put":{"description":"Takes a new snapshot of the build (a new revision, or `revision_id`) at the same link, and applies any settings sent. With `snapshot: false` only the settings change. Switching `access` between `link` and `code` takes effect at once and ends every visitor's access; switching to `code` generates a code. Requires `lock_version` or `If-Match`.","operationId":"updateBomShare","parameters":[{"description":"Record id.","in":"path","name":"id","required":true,"schema":{"type":"integer"}},{"$ref":"#/components/parameters/ifMatch"}],"requestBody":{"content":{"application/json":{"example":{"include_prices":true,"lock_version":1},"schema":{"$ref":"#/components/schemas/ShareUpdate"}}},"required":true},"responses":{"200":{"content":{"application/json":{"example":{"data":{"access":"code","access_code":"K7QM-4XRT-9WPA-ZH3C","author_name":"Sam","bom_id":7,"changed_since_shared":false,"description":"Indoor climate logger","id":3,"include_notes":true,"include_prices":false,"license":null,"links":{"bom":"/api/v1/boms/7","csv":"https://example.com/b/k3m9xq2v7tw4hp6rz5ya2bnc/builderbom.csv","document":"https://example.com/b/k3m9xq2v7tw4hp6rz5ya2bnc/builderbom.json","page":"https://example.com/b/k3m9xq2v7tw4hp6rz5ya2bnc","self":"/api/v1/boms/7/share"},"lock_version":1,"object":"shared_build","requirement_count":18,"revision_id":70,"revision_label":"Revision 4: Shared copy","shared_at":"2026-11-21T10:00:00Z","slug":"k3m9xq2v7tw4hp6rz5ya2bnc","stop_reason":null,"stopped_at":null,"takedown_reason":null,"title":"Desk weather station","url":"https://example.com/b/k3m9xq2v7tw4hp6rz5ya2bnc"}},"schema":{"properties":{"data":{"$ref":"#/components/schemas/SharedBuild"}},"required":["data"],"type":"object"}}},"description":"The record.","headers":{"ETag":{"$ref":"#/components/headers/ETag"},"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"content":{"application/json":{"example":{"error":{"code":"conflict","details":[{"code":"stale","field":"lock_version","message":"current version is 4"}],"message":"The record changed since the version you sent."}},"schema":{"properties":{"error":{"allOf":[{"$ref":"#/components/schemas/ErrorBody"}],"properties":{"code":{"enum":["conflict","idempotency_in_progress","not_shared","bom_archived","bom_trashed"],"type":"string"}},"type":"object"}},"required":["error"],"type":"object"}}},"description":"The record changed since the version you sent. `error.current` holds the stored record; reapply your change to it and retry with its lock_version. Also: not_shared, bom_archived, bom_trashed."},"412":{"$ref":"#/components/responses/PreconditionFailed"},"415":{"$ref":"#/components/responses/UnsupportedMediaType"},"422":{"content":{"application/json":{"example":{"error":{"code":"validation_failed","details":[{"allowed":["purchase","on_hand","salvaged","fabricated","supplied","kit"],"code":"invalid","field":"supply","message":"is invalid"}],"message":"The request has invalid fields."}},"schema":{"properties":{"error":{"allOf":[{"$ref":"#/components/schemas/ErrorBody"}],"properties":{"code":{"enum":["validation_failed","revision_not_found"],"type":"string"}},"type":"object"}},"required":["error"],"type":"object"}}},"description":"Invalid fields, or a declared query parameter with a bad value. `details` has one entry per problem with a dotted `field` path; enum errors list `allowed` values. A cursor (`after`) of this list written for another `sort` has detail code `cursor_mismatch`; any other unusable cursor has detail code `invalid`. Also: revision_not_found."},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Busy"}},"summary":"Update the shared copy","tags":["Sharing"]}},"/alternates/{id}":{"get":{"description":"One alternate.","operationId":"getAlternate","parameters":[{"description":"Record id.","in":"path","name":"id","required":true,"schema":{"type":"integer"}}],"responses":{"200":{"content":{"application/json":{"example":{"data":{"author":{"kind":"agent","name":"Claude (sourcing agent)"},"id":600,"line_id":100,"links":{"accept":"/api/v1/alternates/600/accept","self":"/api/v1/alternates/600"},"object":"alternate","part_id":43,"rationale":"Same footprint, in stock","replaced_part_id":null,"status":"proposed","trade_offs":"5% tolerance"}},"schema":{"properties":{"data":{"$ref":"#/components/schemas/Alternate"}},"required":["data"],"type":"object"}}},"description":"The record.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"}},"summary":"Get an alternate","tags":["Alternates"]}},"/me/export":{"get":{"description":"Everything the owner's account holds as one JSON document (`format: builder_bom_account`, `version: 1`), sent in chunks: the account, API token metadata, every build with its assemblies, requirements (deleted ones too), substitutes, and revisions, parts and listings, orders, items, allocations, receipts, comments, the change history, build views, each build's re-importable `builder_bom` export, and the account's supplier suggestions. Each table is a list of its rows with every column, in id order. It never holds the password hash, session tokens, a token's secret or hash, events' session references, or another account's records. **The last member is always `complete: true`.** The 200 status is sent before the body, so an export that stops part way (the account or the connection went away, or the server failed) still ends as a 200: a document that does not parse, or that lacks `complete: true`, is cut short and must be fetched again. Each account may start 3 exports per rate-limit window, from the browser and all its tokens together, counted on each server machine on its own and reset when the server restarts; past that the answer is 429 `export_limited` with `Retry-After`. No operation of the API deletes an account; the owner does that in the browser.","operationId":"exportAccount","parameters":[],"responses":{"200":{"content":{"application/json":{"example":{"account":{"admin":false,"confirmed_at":"2026-11-01T09:00:00Z","email":"maker@example.com","id":1,"inserted_at":"2026-11-01T09:00:00Z","updated_at":"2026-11-01T09:00:00Z"},"allocations":[],"alternates":[],"api_tokens":[{"default":true,"id":3,"inserted_at":"2026-11-01T09:00:00Z","last_used_at":"2026-11-21T07:59:00Z","name":"Claude (sourcing agent)","revoked_at":null,"token_prefix":"bbom_Ab12","updated_at":"2026-11-01T09:00:00Z"}],"bom_exports":[{"assemblies":[],"build":{"title":"Desk weather station"},"format":"builderbom","parts":[],"requirements":[],"version":1}],"bom_views":[],"boms":[{"id":7,"name":"Desk weather station","user_id":1}],"comments":[],"complete":true,"events":[],"exported_at":"2026-11-21T08:00:00Z","format":"builder_bom_account","groups":[],"lines":[],"listings":[],"marketing_consent_events":[],"order_items":[],"orders":[],"parts":[],"receipts":[],"reviewed_suppliers":[],"revisions":[],"shared_builds":[],"supplier_suggestions":[],"version":1},"schema":{"$ref":"#/components/schemas/AccountExport"}}},"description":"JSON document (no data envelope)."},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"429":{"content":{"application/json":{"example":{"error":{"code":"rate_limited","details":[],"message":"Too many requests for this token. Retry after 12 seconds."}},"schema":{"properties":{"error":{"allOf":[{"$ref":"#/components/schemas/ErrorBody"}],"properties":{"code":{"enum":["rate_limited","export_limited"],"type":"string"}},"type":"object"}},"required":["error"],"type":"object"}}},"description":"Too many requests for this token. Also: export_limited."}},"summary":"Export the account","tags":["Account"]}},"/boms/{id}/deletion-impact":{"get":{"description":"Counts of lines, groups, revisions, comments, and allocations that permanent deletion removes, and the orders that lose allocations.","operationId":"getBomDeletionImpact","parameters":[{"description":"Record id.","in":"path","name":"id","required":true,"schema":{"type":"integer"}}],"responses":{"200":{"content":{"application/json":{"example":{"data":{"allocation_count":4,"comment_count":2,"group_count":3,"line_count":12,"order_allocation_count":2,"order_ids":[20],"revision_count":1}},"schema":{"properties":{"data":{"$ref":"#/components/schemas/DeletionImpact"}},"required":["data"],"type":"object"}}},"description":"The record.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"}},"summary":"What permanent deletion removes","tags":["BOMs"]}},"/boms/{bom_id}/lines":{"get":{"description":"Without `limit`, `after`, or `sort`: every matching line in outline order (assemblies depth-first by position, then top-level lines), unpaginated, at most 2000 (`truncated: true` when more exist). With any of them: one page at a time in the `sort` order (default `id`, the order for a full sync, in which lines edited or moved between pages are never skipped or repeated). `include=breakdown` adds each line's quantity breakdown. Filters combine with AND.","operationId":"listLines","parameters":[{"description":"Record id.","in":"path","name":"bom_id","required":true,"schema":{"type":"integer"}},{"description":"Add each line's `breakdown`.","in":"query","name":"include","required":false,"schema":{"enum":["breakdown"],"type":"string"}},{"description":"A group id, or `top` for top-level lines.","in":"query","name":"group_id","required":false,"schema":{"type":"string"}},{"description":"With group_id, include nested groups.","in":"query","name":"include_subgroups","required":false,"schema":{"type":"boolean"}},{"description":"Line status; comma-separate several.","in":"query","name":"status","required":false,"schema":{"enum":["excluded","unresolved","to_source","in_progress","ready"],"type":"string"}},{"description":"Purchase lines with no selected part.","in":"query","name":"needs_part","required":false,"schema":{"type":"boolean"}},{"description":"Supply method; comma-separate several.","in":"query","name":"supply","required":false,"schema":{"enum":["purchase","on_hand","salvaged","fabricated","supplied","kit"],"type":"string"}},{"description":"Inclusion; comma-separate several.","in":"query","name":"inclusion","required":false,"schema":{"enum":["required","optional","dnp"],"type":"string"}},{"description":"Lines with any of these comma-separated tags.","in":"query","name":"tags","required":false,"schema":{"type":"string"}},{"description":"Exact category.","in":"query","name":"category","required":false,"schema":{"type":"string"}},{"description":"Selected part id(s), comma-separated.","in":"query","name":"part_id","required":false,"schema":{"type":"string"}},{"description":"Matches names, notes, references, tags, attributes, and the selected part.","in":"query","name":"search","required":false,"schema":{"type":"string"}},{"description":"Soft-deleted lines (default exclude).","in":"query","name":"deleted","required":false,"schema":{"enum":["exclude","only","include"],"type":"string"}},{"description":"One field, named as the records show it: `name` ascending, `-name` descending. Ties break by `id` in the same direction. Null values sort after every value ascending and before every value descending. Text sorts by the database collation (linguistic order, mostly ignoring case and accents), not by code point. The default `id` is the only order that never moves a record; in another order a record whose value changes between pages can move, so it can be missed or repeated. A cursor only works with the `sort` that wrote it. Without `limit`, `after`, or `sort` (empty values count as absent) the lines come unpaginated in outline order; with any of them and no `sort`, in id order. `name`, `category`, `quantity`, `inserted_at`, `updated_at`, and `id` sort in the database. The others are computed over the whole build: `position` (outline order) from the assembly tree, so adding, moving, or reordering an assembly between pages shifts every later line; `status` (excluded, unresolved, to_source, in_progress, ready), `required`, and `uncovered` from the quantity analysis, which runs once per page.","in":"query","name":"sort","required":false,"schema":{"enum":["id","-id","name","-name","category","-category","quantity","-quantity","inserted_at","-inserted_at","updated_at","-updated_at","position","-position","status","-status","required","-required","uncovered","-uncovered"],"type":"string"}},{"$ref":"#/components/parameters/limit"},{"$ref":"#/components/parameters/after"}],"responses":{"200":{"content":{"application/json":{"example":{"data":[{"attributes":{"footprint":"R_0603","value":"10k"},"bom_id":7,"breakdown":{"covered":"8","excess":"0","in_progress":"0","line_id":100,"needs_part":false,"on_order":"4","planned":"0","purchase":"fully_ordered","ready":"4","required":"8","status":"in_progress","uncovered":"0"},"deleted":false,"external_links":[],"group_id":10,"id":100,"inclusion":"required","links":{"alternates":"/api/v1/lines/100/alternates","bom":"/api/v1/boms/7","self":"/api/v1/lines/100"},"lock_version":3,"name":"10k pull-up","object":"line","part_id":42,"position":0,"quantity":"3","references":["R1","R2","R3"],"spares":"2","supply":"purchase","tags":["passive"],"unit":"pcs"}],"next_cursor":null},"schema":{"properties":{"data":{"items":{"$ref":"#/components/schemas/LineWithBreakdown"},"type":"array"},"next_cursor":{"description":"Pass as `after` for the next page; null on the last page.","type":["string","null"]}},"required":["data","next_cursor"],"type":"object"}}},"description":"A page of records.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"}},"summary":"List lines","tags":["Lines"]},"post":{"description":"Adds a line at the end of its group. With `dry_run=true` nothing is written; the response holds the would-be line and its quantity impact under `impact`.","operationId":"createLine","parameters":[{"description":"Record id.","in":"path","name":"bom_id","required":true,"schema":{"type":"integer"}},{"$ref":"#/components/parameters/dryRun"},{"$ref":"#/components/parameters/idempotencyKey"}],"requestBody":{"content":{"application/json":{"example":{"group_id":10,"name":"M3x8 socket head screw","quantity":"4","references":["H1","H2","H3","H4"],"spares":"2","supply":"purchase","unit":"pcs"},"schema":{"$ref":"#/components/schemas/LineInput"}}},"required":true},"responses":{"201":{"content":{"application/json":{"example":{"data":{"attributes":{"footprint":"R_0603","value":"10k"},"bom_id":7,"deleted":false,"external_links":[],"group_id":10,"id":100,"inclusion":"required","links":{"alternates":"/api/v1/lines/100/alternates","bom":"/api/v1/boms/7","self":"/api/v1/lines/100"},"lock_version":3,"name":"10k pull-up","object":"line","part_id":42,"position":0,"quantity":"3","references":["R1","R2","R3"],"spares":"2","supply":"purchase","tags":["passive"],"unit":"pcs"}},"schema":{"properties":{"data":{"$ref":"#/components/schemas/Line"}},"required":["data"],"type":"object"}}},"description":"Created.","headers":{"ETag":{"$ref":"#/components/headers/ETag"},"Location":{"$ref":"#/components/headers/Location"},"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"content":{"application/json":{"example":{"error":{"code":"bom_archived","details":[],"message":"Refused: bom_archived."}},"schema":{"properties":{"error":{"allOf":[{"$ref":"#/components/schemas/ErrorBody"}],"properties":{"code":{"enum":["bom_archived","bom_trashed","idempotency_in_progress","idempotency_response_not_stored"],"type":"string"}},"type":"object"}},"required":["error"],"type":"object"}}},"description":"Refused by a domain rule: bom_archived, bom_trashed."},"415":{"$ref":"#/components/responses/UnsupportedMediaType"},"422":{"content":{"application/json":{"example":{"error":{"code":"validation_failed","details":[{"allowed":["purchase","on_hand","salvaged","fabricated","supplied","kit"],"code":"invalid","field":"supply","message":"is invalid"}],"message":"The request has invalid fields."}},"schema":{"properties":{"error":{"allOf":[{"$ref":"#/components/schemas/ErrorBody"}],"properties":{"code":{"enum":["validation_failed","idempotency_key_reused"],"type":"string"}},"type":"object"}},"required":["error"],"type":"object"}}},"description":"Invalid fields, or a declared query parameter with a bad value. `details` has one entry per problem with a dotted `field` path; enum errors list `allowed` values. A cursor (`after`) of this list written for another `sort` has detail code `cursor_mismatch`; any other unusable cursor has detail code `invalid`. Also: idempotency_key_reused."},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Busy"}},"summary":"Create a line","tags":["Lines"]}},"/suppliers/{id}":{"get":{"description":"One published supplier. A supplier that is waiting for review, rejected, or retired answers 404.","operationId":"getSupplier","parameters":[{"description":"Record id.","in":"path","name":"id","required":true,"schema":{"type":"integer"}}],"responses":{"200":{"content":{"application/json":{"example":{"data":{"object":"supplier"}},"schema":{"properties":{"data":{"$ref":"#/components/schemas/Supplier"}},"required":["data"],"type":"object"}}},"description":"The record.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"}},"summary":"Get a supplier","tags":["Suppliers"]}},"/order-items/{id}/cancel":{"post":{"description":"Cancels the item. Units not yet received go back to uncovered; accepted units stay ready.","operationId":"cancelOrderItem","parameters":[{"description":"Record id.","in":"path","name":"id","required":true,"schema":{"type":"integer"}},{"$ref":"#/components/parameters/ifMatch"},{"$ref":"#/components/parameters/idempotencyKey"}],"responses":{"200":{"content":{"application/json":{"example":{"data":{"allocations":[{"id":300,"line_id":100,"links":{"line":"/api/v1/lines/100","self":"/api/v1/allocations/300"},"object":"allocation","order_id":20,"order_item_id":200,"quantity":"8","ready_quantity":"0","source":"order"}],"description":"10k resistor 0603 (Yageo RC0603FR-0710KL)","id":200,"links":{"self":"/api/v1/order-items/200"},"lock_version":1,"object":"order_item","order_id":20,"part_id":42,"quantity":"10","receipts":[{"exception":"none","id":400,"links":{"self":"/api/v1/receipts/400"},"object":"receipt","order_item_id":200,"quantity_accepted":"4","quantity_received":"4","received_on":"2026-11-21","replaces_id":null,"voided":false}],"status":"active","unit":"pcs","unit_price":"0.12"}},"schema":{"properties":{"data":{"$ref":"#/components/schemas/OrderItem"}},"required":["data"],"type":"object"}}},"description":"The record.","headers":{"ETag":{"$ref":"#/components/headers/ETag"},"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"content":{"application/json":{"example":{"error":{"code":"conflict","details":[{"code":"stale","field":"lock_version","message":"current version is 4"}],"message":"The record changed since the version you sent."}},"schema":{"properties":{"error":{"allOf":[{"$ref":"#/components/schemas/ErrorBody"}],"properties":{"code":{"enum":["conflict","idempotency_in_progress","idempotency_response_not_stored"],"type":"string"}},"type":"object"}},"required":["error"],"type":"object"}}},"description":"The record changed since the version you sent. `error.current` holds the stored record; reapply your change to it and retry with its lock_version. Also: idempotency_response_not_stored."},"412":{"$ref":"#/components/responses/PreconditionFailed"},"422":{"$ref":"#/components/responses/IdempotencyKeyReused"},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Busy"}},"summary":"Cancel an order item","tags":["Order items"]}},"/boms/{id}/import/preview":{"post":{"description":"Parses, maps, validates, and matches the rows without writing. Use the result to fix the mapping before committing. `expected_versions` maps every matched line to its lock_version; send it back with the commit.","operationId":"previewImport","parameters":[{"description":"Record id.","in":"path","name":"id","required":true,"schema":{"type":"integer"}},{"$ref":"#/components/parameters/idempotencyKey"}],"requestBody":{"content":{"application/json":{"example":{"format":"csv","text":"Reference,Value,Footprint,Qty\nR1 R2 R3,10k,R_0603,3\nC1,100n,C_0603,1\n"},"schema":{"$ref":"#/components/schemas/ImportInput"}}},"required":true},"responses":{"200":{"content":{"application/json":{"example":{"data":{"format":"csv","headers":["Reference","Value","Footprint","Qty"],"rows":[],"summary":{"additions":2,"errors":0,"total":2,"unchanged":0,"unmatched":0,"updates":0}}},"schema":{"properties":{"data":{"$ref":"#/components/schemas/ImportPreview"}},"required":["data"],"type":"object"}}},"description":"The record.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"content":{"application/json":{"example":{"error":{"code":"bom_archived","details":[],"message":"Refused: bom_archived."}},"schema":{"properties":{"error":{"allOf":[{"$ref":"#/components/schemas/ErrorBody"}],"properties":{"code":{"enum":["bom_archived","bom_trashed","idempotency_in_progress","idempotency_response_not_stored"],"type":"string"}},"type":"object"}},"required":["error"],"type":"object"}}},"description":"Refused by a domain rule: bom_archived, bom_trashed."},"413":{"content":{"application/json":{"example":{"error":{"code":"import_too_large","details":[],"message":"Refused: import_too_large."}},"schema":{"properties":{"error":{"allOf":[{"$ref":"#/components/schemas/ErrorBody"}],"properties":{"code":{"enum":["import_too_large"],"type":"string"}},"type":"object"}},"required":["error"],"type":"object"}}},"description":"Cannot be applied: import_too_large."},"415":{"$ref":"#/components/responses/UnsupportedMediaType"},"422":{"content":{"application/json":{"example":{"error":{"code":"validation_failed","details":[{"allowed":["purchase","on_hand","salvaged","fabricated","supplied","kit"],"code":"invalid","field":"supply","message":"is invalid"}],"message":"The request has invalid fields."}},"schema":{"properties":{"error":{"allOf":[{"$ref":"#/components/schemas/ErrorBody"}],"properties":{"code":{"enum":["validation_failed","import_empty","import_parse_error","import_unsupported_version","import_mapping_error","idempotency_key_reused"],"type":"string"}},"type":"object"}},"required":["error"],"type":"object"}}},"description":"Invalid fields, or a declared query parameter with a bad value. `details` has one entry per problem with a dotted `field` path; enum errors list `allowed` values. A cursor (`after`) of this list written for another `sort` has detail code `cursor_mismatch`; any other unusable cursor has detail code `invalid`. Also: import_empty, import_parse_error, import_unsupported_version, import_mapping_error."},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Busy"}},"summary":"Preview an import","tags":["Import and export"]}},"/revisions/{id}/export.json":{"get":{"description":"The revision's snapshot in the Maker BOM format (version 1) with the private `records` and `revision` sections. It carries no computed quantities or orders. `POST /imports` accepts it, so a revision can seed a new BOM.","operationId":"exportRevisionJson","parameters":[{"description":"Record id.","in":"path","name":"id","required":true,"schema":{"type":"integer"}}],"responses":{"200":{"content":{"application/json":{"example":{"assemblies":[],"build":{"title":"Desk weather station"},"format":"builderbom","parts":[],"requirements":[],"version":1},"schema":{"$ref":"#/components/schemas/BomExport"}}},"description":"JSON document (no data envelope)."},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"}},"summary":"Export a revision as JSON","tags":["Revisions"]}},"/lines/{id}/deletion-impact":{"get":{"description":"The active allocations with their order items and orders, and the open questions on the line. Writes nothing.","operationId":"getLineDeletionImpact","parameters":[{"description":"Record id.","in":"path","name":"id","required":true,"schema":{"type":"integer"}}],"responses":{"200":{"content":{"application/json":{"example":{"data":{"object":"line_deletion_impact"}},"schema":{"properties":{"data":{"$ref":"#/components/schemas/LineDeletionImpact"}},"required":["data"],"type":"object"}}},"description":"The record.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"}},"summary":"What deleting a line affects","tags":["Lines"]}},"/guide":{"get":{"description":"A concise Markdown guide for LLM agents: authentication, model, quantity rules, workflows, concurrency, idempotency, errors. No token needed.","operationId":"getGuide","parameters":[],"responses":{"200":{"content":{"text/markdown":{"example":"# Maker BOM agent guide\n...","schema":{"type":"string"}}},"description":"text/markdown document."},"400":{"$ref":"#/components/responses/BadRequest"}},"security":[],"summary":"Agent guide","tags":["Discovery"]}},"/parts":{"get":{"description":"Parts with their listings, one page at a time in the `sort` order (default `id`).","operationId":"listParts","parameters":[{"description":"Matches name, manufacturer, MPN, internal ref, description, category, and SKUs.","in":"query","name":"search","required":false,"schema":{"type":"string"}},{"description":"Exact category.","in":"query","name":"category","required":false,"schema":{"type":"string"}},{"description":"Retired parts (default exclude).","in":"query","name":"retired","required":false,"schema":{"enum":["exclude","include","only"],"type":"string"}},{"description":"One field, named as the records show it: `name` ascending, `-name` descending. Ties break by `id` in the same direction. Null values sort after every value ascending and before every value descending. Text sorts by the database collation (linguistic order, mostly ignoring case and accents), not by code point. The default `id` is the only order that never moves a record; in another order a record whose value changes between pages can move, so it can be missed or repeated. A cursor only works with the `sort` that wrote it.","in":"query","name":"sort","required":false,"schema":{"default":"id","enum":["id","-id","name","-name","category","-category","inserted_at","-inserted_at","updated_at","-updated_at"],"type":"string"}},{"$ref":"#/components/parameters/limit"},{"$ref":"#/components/parameters/after"}],"responses":{"200":{"content":{"application/json":{"example":{"data":[{"attributes":{"tolerance":"1%"},"external_links":[],"id":42,"links":{"listings":"/api/v1/parts/42/listings","self":"/api/v1/parts/42"},"listings":[{"confidence":"verified","currency":"USD","id":50,"links":{"self":"/api/v1/listings/50"},"object":"listing","pack_size":"100","part_id":42,"preferred":true,"price":"1.2","sku":"311-10.0KHRCT-ND","stale":false,"supplier":"DigiKey"}],"lock_version":1,"manufacturer":"Yageo","mpn":"RC0603FR-0710KL","name":"10k resistor 0603","object":"part","retired":false}],"next_cursor":null},"schema":{"properties":{"data":{"items":{"$ref":"#/components/schemas/Part"},"type":"array"},"next_cursor":{"description":"Pass as `after` for the next page; null on the last page.","type":["string","null"]}},"required":["data","next_cursor"],"type":"object"}}},"description":"A page of records.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"}},"summary":"List parts","tags":["Parts"]},"post":{"description":"Adds a part to the catalog.","operationId":"createPart","parameters":[{"$ref":"#/components/parameters/idempotencyKey"}],"requestBody":{"content":{"application/json":{"example":{"attributes":{"package":"0603","tolerance":"1%"},"manufacturer":"Yageo","mpn":"RC0603FR-0710KL","name":"10k resistor 0603"},"schema":{"$ref":"#/components/schemas/PartInput"}}},"required":true},"responses":{"201":{"content":{"application/json":{"example":{"data":{"attributes":{"tolerance":"1%"},"external_links":[],"id":42,"links":{"listings":"/api/v1/parts/42/listings","self":"/api/v1/parts/42"},"listings":[{"confidence":"verified","currency":"USD","id":50,"links":{"self":"/api/v1/listings/50"},"object":"listing","pack_size":"100","part_id":42,"preferred":true,"price":"1.2","sku":"311-10.0KHRCT-ND","stale":false,"supplier":"DigiKey"}],"lock_version":1,"manufacturer":"Yageo","mpn":"RC0603FR-0710KL","name":"10k resistor 0603","object":"part","retired":false}},"schema":{"properties":{"data":{"$ref":"#/components/schemas/Part"}},"required":["data"],"type":"object"}}},"description":"Created.","headers":{"ETag":{"$ref":"#/components/headers/ETag"},"Location":{"$ref":"#/components/headers/Location"},"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"409":{"content":{"application/json":{"example":{"error":{"code":"idempotency_in_progress","details":[],"message":"Refused: idempotency_in_progress."}},"schema":{"properties":{"error":{"allOf":[{"$ref":"#/components/schemas/ErrorBody"}],"properties":{"code":{"enum":["idempotency_in_progress","idempotency_response_not_stored"],"type":"string"}},"type":"object"}},"required":["error"],"type":"object"}}},"description":"Refused by a domain rule: idempotency_in_progress, idempotency_response_not_stored."},"415":{"$ref":"#/components/responses/UnsupportedMediaType"},"422":{"content":{"application/json":{"example":{"error":{"code":"validation_failed","details":[{"allowed":["purchase","on_hand","salvaged","fabricated","supplied","kit"],"code":"invalid","field":"supply","message":"is invalid"}],"message":"The request has invalid fields."}},"schema":{"properties":{"error":{"allOf":[{"$ref":"#/components/schemas/ErrorBody"}],"properties":{"code":{"enum":["validation_failed","idempotency_key_reused"],"type":"string"}},"type":"object"}},"required":["error"],"type":"object"}}},"description":"Invalid fields, or a declared query parameter with a bad value. `details` has one entry per problem with a dotted `field` path; enum errors list `allowed` values. A cursor (`after`) of this list written for another `sort` has detail code `cursor_mismatch`; any other unusable cursor has detail code `invalid`. Also: idempotency_key_reused."},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Busy"}},"summary":"Create a part","tags":["Parts"]}},"/comments":{"get":{"description":"Thread roots oldest first, with replies. Filter by target and state.","operationId":"listComments","parameters":[{"description":"Comments anywhere in this BOM.","in":"query","name":"bom_id","required":false,"schema":{"type":"integer"}},{"description":"Comments on this group.","in":"query","name":"group_id","required":false,"schema":{"type":"integer"}},{"description":"Comments on this line.","in":"query","name":"line_id","required":false,"schema":{"type":"integer"}},{"description":"Comments on this order.","in":"query","name":"order_id","required":false,"schema":{"type":"integer"}},{"description":"With bom_id, only comments on the BOM itself.","in":"query","name":"target","required":false,"schema":{"enum":["bom"],"type":"string"}},{"description":"Kind.","in":"query","name":"kind","required":false,"schema":{"enum":["note","question"],"type":"string"}},{"description":"Thread state.","in":"query","name":"resolved","required":false,"schema":{"type":"boolean"}},{"$ref":"#/components/parameters/limit"},{"$ref":"#/components/parameters/after"}],"responses":{"200":{"content":{"application/json":{"example":{"data":[{"author":{"kind":"agent","name":"Claude (sourcing agent)"},"body":"Is 5% tolerance acceptable here?","bom_id":7,"id":500,"kind":"question","line_id":100,"links":{"self":"/api/v1/comments/500"},"object":"comment","replies":[],"resolved":false,"target":"line"}],"next_cursor":null},"schema":{"properties":{"data":{"items":{"$ref":"#/components/schemas/Comment"},"type":"array"},"next_cursor":{"description":"Pass as `after` for the next page; null on the last page.","type":["string","null"]}},"required":["data","next_cursor"],"type":"object"}}},"description":"A page of records.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"}},"summary":"List comments","tags":["Comments"]},"post":{"description":"Starts a thread on a BOM, group, line, or order (`bom_id`, `group_id`, `line_id`, or `order_id`). `kind: question` makes it an open question until resolved.","operationId":"createComment","parameters":[{"$ref":"#/components/parameters/idempotencyKey"}],"requestBody":{"content":{"application/json":{"example":{"body":"Is 5% tolerance acceptable here?","kind":"question","line_id":100},"schema":{"$ref":"#/components/schemas/CommentInput"}}},"required":true},"responses":{"201":{"content":{"application/json":{"example":{"data":{"author":{"kind":"agent","name":"Claude (sourcing agent)"},"body":"Is 5% tolerance acceptable here?","bom_id":7,"id":500,"kind":"question","line_id":100,"links":{"self":"/api/v1/comments/500"},"object":"comment","replies":[],"resolved":false,"target":"line"}},"schema":{"properties":{"data":{"$ref":"#/components/schemas/Comment"}},"required":["data"],"type":"object"}}},"description":"Created.","headers":{"Location":{"$ref":"#/components/headers/Location"},"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"content":{"application/json":{"example":{"error":{"code":"bom_archived","details":[],"message":"Refused: bom_archived."}},"schema":{"properties":{"error":{"allOf":[{"$ref":"#/components/schemas/ErrorBody"}],"properties":{"code":{"enum":["bom_archived","bom_trashed","idempotency_in_progress","idempotency_response_not_stored"],"type":"string"}},"type":"object"}},"required":["error"],"type":"object"}}},"description":"Refused by a domain rule: bom_archived, bom_trashed."},"415":{"$ref":"#/components/responses/UnsupportedMediaType"},"422":{"content":{"application/json":{"example":{"error":{"code":"validation_failed","details":[{"allowed":["purchase","on_hand","salvaged","fabricated","supplied","kit"],"code":"invalid","field":"supply","message":"is invalid"}],"message":"The request has invalid fields."}},"schema":{"properties":{"error":{"allOf":[{"$ref":"#/components/schemas/ErrorBody"}],"properties":{"code":{"enum":["validation_failed","no_target","idempotency_key_reused"],"type":"string"}},"type":"object"}},"required":["error"],"type":"object"}}},"description":"Invalid fields, or a declared query parameter with a bad value. `details` has one entry per problem with a dotted `field` path; enum errors list `allowed` values. A cursor (`after`) of this list written for another `sort` has detail code `cursor_mismatch`; any other unusable cursor has detail code `invalid`. Also: no_target."},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Busy"}},"summary":"Comment or ask a question","tags":["Comments"]}},"/lines/{id}/restore":{"post":{"description":"Restores a soft-deleted line to the end of its group. Its order allocations become active only as far as their items have spare units; reduced or removed allocations are listed in the `line.restored` event's `metadata.allocation_adjustments`. A stated version is checked.","operationId":"restoreLine","parameters":[{"description":"Record id.","in":"path","name":"id","required":true,"schema":{"type":"integer"}},{"$ref":"#/components/parameters/ifMatch"},{"$ref":"#/components/parameters/idempotencyKey"}],"responses":{"200":{"content":{"application/json":{"example":{"data":{"attributes":{"footprint":"R_0603","value":"10k"},"bom_id":7,"deleted":false,"external_links":[],"group_id":10,"id":100,"inclusion":"required","links":{"alternates":"/api/v1/lines/100/alternates","bom":"/api/v1/boms/7","self":"/api/v1/lines/100"},"lock_version":3,"name":"10k pull-up","object":"line","part_id":42,"position":0,"quantity":"3","references":["R1","R2","R3"],"spares":"2","supply":"purchase","tags":["passive"],"unit":"pcs"}},"schema":{"properties":{"data":{"$ref":"#/components/schemas/Line"}},"required":["data"],"type":"object"}}},"description":"The record.","headers":{"ETag":{"$ref":"#/components/headers/ETag"},"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"content":{"application/json":{"example":{"error":{"code":"conflict","details":[{"code":"stale","field":"lock_version","message":"current version is 4"}],"message":"The record changed since the version you sent."}},"schema":{"properties":{"error":{"allOf":[{"$ref":"#/components/schemas/ErrorBody"}],"properties":{"code":{"enum":["conflict","idempotency_in_progress","bom_archived","bom_trashed","idempotency_response_not_stored"],"type":"string"}},"type":"object"}},"required":["error"],"type":"object"}}},"description":"The record changed since the version you sent. `error.current` holds the stored record; reapply your change to it and retry with its lock_version. Also: bom_archived, bom_trashed."},"412":{"$ref":"#/components/responses/PreconditionFailed"},"422":{"$ref":"#/components/responses/IdempotencyKeyReused"},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Busy"}},"summary":"Restore a line","tags":["Lines"]}},"/alternates/{id}/accept":{"post":{"description":"Selects the candidate part on the line and records the replaced part. When the line has active order allocations, send `allocations`: `keep` leaves them, `release` removes them so the units become unallocated on their orders.","operationId":"acceptAlternate","parameters":[{"description":"Record id.","in":"path","name":"id","required":true,"schema":{"type":"integer"}},{"$ref":"#/components/parameters/idempotencyKey"}],"requestBody":{"content":{"application/json":{"example":{"allocations":"keep","decision_reason":"Footprint and tolerance reviewed"},"schema":{"$ref":"#/components/schemas/AcceptAlternateInput"}}},"required":true},"responses":{"200":{"content":{"application/json":{"example":{"data":{"author":{"kind":"agent","name":"Claude (sourcing agent)"},"id":600,"line_id":100,"links":{"accept":"/api/v1/alternates/600/accept","self":"/api/v1/alternates/600"},"object":"alternate","part_id":43,"rationale":"Same footprint, in stock","replaced_part_id":null,"status":"proposed","trade_offs":"5% tolerance"}},"schema":{"properties":{"data":{"$ref":"#/components/schemas/Alternate"}},"required":["data"],"type":"object"}}},"description":"The record.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"content":{"application/json":{"example":{"error":{"code":"conflict","details":[{"code":"stale","field":"lock_version","message":"current version is 4"}],"message":"The record changed since the version you sent."}},"schema":{"properties":{"error":{"allOf":[{"$ref":"#/components/schemas/ErrorBody"}],"properties":{"code":{"enum":["conflict","idempotency_in_progress","allocation_decision_required","already_decided","bom_archived","bom_trashed","idempotency_response_not_stored"],"type":"string"}},"type":"object"}},"required":["error"],"type":"object"}}},"description":"The record changed since the version you sent. `error.current` holds the stored record; reapply your change to it and retry with its lock_version. Also: allocation_decision_required, already_decided."},"415":{"$ref":"#/components/responses/UnsupportedMediaType"},"422":{"content":{"application/json":{"example":{"error":{"code":"validation_failed","details":[{"allowed":["purchase","on_hand","salvaged","fabricated","supplied","kit"],"code":"invalid","field":"supply","message":"is invalid"}],"message":"The request has invalid fields."}},"schema":{"properties":{"error":{"allOf":[{"$ref":"#/components/schemas/ErrorBody"}],"properties":{"code":{"enum":["validation_failed","idempotency_key_reused"],"type":"string"}},"type":"object"}},"required":["error"],"type":"object"}}},"description":"Invalid fields, or a declared query parameter with a bad value. `details` has one entry per problem with a dotted `field` path; enum errors list `allowed` values. A cursor (`after`) of this list written for another `sort` has detail code `cursor_mismatch`; any other unusable cursor has detail code `invalid`. Also: idempotency_key_reused."},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Busy"}},"summary":"Accept an alternate","tags":["Alternates"]}},"/events/{id}":{"get":{"description":"One event of the account.","operationId":"getEvent","parameters":[{"description":"Record id.","in":"path","name":"id","required":true,"schema":{"type":"integer"}}],"responses":{"200":{"content":{"application/json":{"example":{"data":{"action":"line.updated","actor":{"api_token_id":3,"kind":"agent","name":"Claude (sourcing agent)"},"bom_id":7,"bom_ids":[7],"changes":{"quantity":["2","3"]},"cursor":"9001","id":9001,"metadata":{},"object":"event","occurred_at":"2026-11-21T08:00:00Z","subject":{"id":100,"type":"line"},"summary":"Updated requirement 10k pull-up"}},"schema":{"properties":{"data":{"$ref":"#/components/schemas/Event"}},"required":["data"],"type":"object"}}},"description":"The record.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"}},"summary":"Get an event","tags":["Activity"]}},"/orders/{id}":{"delete":{"description":"Deletes an order with no receipts; otherwise `has_receipts` (cancel instead).","operationId":"deleteOrder","parameters":[{"description":"Record id.","in":"path","name":"id","required":true,"schema":{"type":"integer"}},{"$ref":"#/components/parameters/ifMatch"}],"responses":{"204":{"description":"Done; no body."},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"content":{"application/json":{"example":{"error":{"code":"conflict","details":[{"code":"stale","field":"lock_version","message":"current version is 4"}],"message":"The record changed since the version you sent."}},"schema":{"properties":{"error":{"allOf":[{"$ref":"#/components/schemas/ErrorBody"}],"properties":{"code":{"enum":["conflict","idempotency_in_progress","has_receipts"],"type":"string"}},"type":"object"}},"required":["error"],"type":"object"}}},"description":"The record changed since the version you sent. `error.current` holds the stored record; reapply your change to it and retry with its lock_version. Also: has_receipts."},"412":{"$ref":"#/components/responses/PreconditionFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Busy"}},"summary":"Delete an order","tags":["Orders"],"x-example":{"request":"DELETE /api/v1/orders/42","response":{"body":null,"status":204}}},"get":{"description":"One order with items, allocations, receipts, and the computed summary.","operationId":"getOrder","parameters":[{"description":"Record id.","in":"path","name":"id","required":true,"schema":{"type":"integer"}}],"responses":{"200":{"content":{"application/json":{"example":{"data":{"currency":"USD","id":20,"items":[{"allocations":[{"id":300,"line_id":100,"links":{"line":"/api/v1/lines/100","self":"/api/v1/allocations/300"},"object":"allocation","order_id":20,"order_item_id":200,"quantity":"8","ready_quantity":"0","source":"order"}],"description":"10k resistor 0603 (Yageo RC0603FR-0710KL)","id":200,"links":{"self":"/api/v1/order-items/200"},"lock_version":1,"object":"order_item","order_id":20,"part_id":42,"quantity":"10","receipts":[{"exception":"none","id":400,"links":{"self":"/api/v1/receipts/400"},"object":"receipt","order_item_id":200,"quantity_accepted":"4","quantity_received":"4","received_on":"2026-11-21","replaces_id":null,"voided":false}],"status":"active","unit":"pcs","unit_price":"0.12"}],"links":{"self":"/api/v1/orders/20"},"lock_version":2,"object":"order","reference":"DK-12345","status":"ordered","summary":{"total":{"USD":"1.2"}},"supplier":"DigiKey"}},"schema":{"properties":{"data":{"$ref":"#/components/schemas/OrderDetail"}},"required":["data"],"type":"object"}}},"description":"The record.","headers":{"ETag":{"$ref":"#/components/headers/ETag"},"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"}},"summary":"Get an order","tags":["Orders"]},"patch":{"description":"Changes order fields. Requires the version. Status `canceled` or `received` closes the order: units not yet received go back to uncovered and accepted units stay ready. Reopening it (status `ordered` or `shipped`) puts the rest on order again.","operationId":"updateOrder","parameters":[{"description":"Record id.","in":"path","name":"id","required":true,"schema":{"type":"integer"}},{"$ref":"#/components/parameters/ifMatch"}],"requestBody":{"content":{"application/json":{"example":{"lock_version":2,"status":"shipped"},"schema":{"$ref":"#/components/schemas/OrderUpdate"}}},"required":true},"responses":{"200":{"content":{"application/json":{"example":{"data":{"currency":"USD","id":20,"items":[{"allocations":[{"id":300,"line_id":100,"links":{"line":"/api/v1/lines/100","self":"/api/v1/allocations/300"},"object":"allocation","order_id":20,"order_item_id":200,"quantity":"8","ready_quantity":"0","source":"order"}],"description":"10k resistor 0603 (Yageo RC0603FR-0710KL)","id":200,"links":{"self":"/api/v1/order-items/200"},"lock_version":1,"object":"order_item","order_id":20,"part_id":42,"quantity":"10","receipts":[{"exception":"none","id":400,"links":{"self":"/api/v1/receipts/400"},"object":"receipt","order_item_id":200,"quantity_accepted":"4","quantity_received":"4","received_on":"2026-11-21","replaces_id":null,"voided":false}],"status":"active","unit":"pcs","unit_price":"0.12"}],"links":{"self":"/api/v1/orders/20"},"lock_version":2,"object":"order","reference":"DK-12345","status":"ordered","summary":{"total":{"USD":"1.2"}},"supplier":"DigiKey"}},"schema":{"properties":{"data":{"$ref":"#/components/schemas/OrderDetail"}},"required":["data"],"type":"object"}}},"description":"The record.","headers":{"ETag":{"$ref":"#/components/headers/ETag"},"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"412":{"$ref":"#/components/responses/PreconditionFailed"},"415":{"$ref":"#/components/responses/UnsupportedMediaType"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Busy"}},"summary":"Update an order","tags":["Orders"]}},"/events/{id}/undo":{"get":{"description":"Says without writing whether `POST /events/{id}/undo` would succeed now. `reason` is `not_undoable` for a kind of change without an undo and `changed_since` when the record no longer holds what the event left.","operationId":"checkEventUndo","parameters":[{"description":"Record id.","in":"path","name":"id","required":true,"schema":{"type":"integer"}}],"responses":{"200":{"content":{"application/json":{"example":{"data":{"event_id":9001,"reason":null,"undoable":true}},"schema":{"properties":{"data":{"$ref":"#/components/schemas/UndoCheck"}},"required":["data"],"type":"object"}}},"description":"The record.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"}},"summary":"Can this change be undone","tags":["Activity"]},"post":{"description":"Reverses one recorded change, such as your own mistake: updates get their old values back (lockable records at their current version), a created line is removed, a deleted line restored, a created allocation removed, a recorded receipt voided. Allowed only while the record still holds what the event left; otherwise `changed_since`. The undo is recorded as a new event by your token and the original stays in history.","operationId":"undoEvent","parameters":[{"description":"Record id.","in":"path","name":"id","required":true,"schema":{"type":"integer"}},{"$ref":"#/components/parameters/idempotencyKey"}],"responses":{"200":{"content":{"application/json":{"example":{"data":{"event_id":9001,"record":{"id":100,"object":"line","quantity":"2"}}},"schema":{"properties":{"data":{"$ref":"#/components/schemas/UndoResult"}},"required":["data"],"type":"object"}}},"description":"The record.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"content":{"application/json":{"example":{"error":{"code":"conflict","details":[{"code":"stale","field":"lock_version","message":"current version is 4"}],"message":"The record changed since the version you sent."}},"schema":{"properties":{"error":{"allOf":[{"$ref":"#/components/schemas/ErrorBody"}],"properties":{"code":{"enum":["conflict","idempotency_in_progress","not_undoable","changed_since","bom_archived","bom_trashed","already_voided","idempotency_response_not_stored"],"type":"string"}},"type":"object"}},"required":["error"],"type":"object"}}},"description":"The record changed since the version you sent. `error.current` holds the stored record; reapply your change to it and retry with its lock_version. Also: not_undoable, changed_since, bom_archived, bom_trashed, already_voided."},"422":{"$ref":"#/components/responses/IdempotencyKeyReused"},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Busy"}},"summary":"Undo a change","tags":["Activity"]}},"/lines/{id}":{"delete":{"description":"Soft-deletes the line; restore it with `POST /lines/{id}/restore`. Its allocations are kept but become inactive: they cover nothing, take no received units, and free their order item's capacity. Read `GET /lines/{id}/deletion-impact` first. A stated version is checked. Returns the deleted line.","operationId":"deleteLine","parameters":[{"description":"Record id.","in":"path","name":"id","required":true,"schema":{"type":"integer"}},{"$ref":"#/components/parameters/ifMatch"}],"responses":{"200":{"content":{"application/json":{"example":{"data":{"attributes":{"footprint":"R_0603","value":"10k"},"bom_id":7,"deleted":false,"external_links":[],"group_id":10,"id":100,"inclusion":"required","links":{"alternates":"/api/v1/lines/100/alternates","bom":"/api/v1/boms/7","self":"/api/v1/lines/100"},"lock_version":3,"name":"10k pull-up","object":"line","part_id":42,"position":0,"quantity":"3","references":["R1","R2","R3"],"spares":"2","supply":"purchase","tags":["passive"],"unit":"pcs"}},"schema":{"properties":{"data":{"$ref":"#/components/schemas/Line"}},"required":["data"],"type":"object"}}},"description":"The record.","headers":{"ETag":{"$ref":"#/components/headers/ETag"},"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"content":{"application/json":{"example":{"error":{"code":"conflict","details":[{"code":"stale","field":"lock_version","message":"current version is 4"}],"message":"The record changed since the version you sent."}},"schema":{"properties":{"error":{"allOf":[{"$ref":"#/components/schemas/ErrorBody"}],"properties":{"code":{"enum":["conflict","idempotency_in_progress","bom_archived","bom_trashed"],"type":"string"}},"type":"object"}},"required":["error"],"type":"object"}}},"description":"The record changed since the version you sent. `error.current` holds the stored record; reapply your change to it and retry with its lock_version. Also: bom_archived, bom_trashed."},"412":{"$ref":"#/components/responses/PreconditionFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Busy"}},"summary":"Delete a line (soft)","tags":["Lines"]},"get":{"description":"One line with its breakdown, selected part and listings, alternates, allocations, and open questions. Soft-deleted lines are returned with `deleted: true`.","operationId":"getLine","parameters":[{"description":"Record id.","in":"path","name":"id","required":true,"schema":{"type":"integer"}}],"responses":{"200":{"content":{"application/json":{"example":{"data":{"allocations":[{"id":300,"line_id":100,"links":{"line":"/api/v1/lines/100","self":"/api/v1/allocations/300"},"object":"allocation","order_id":20,"order_item_id":200,"quantity":"8","ready_quantity":"0","source":"order"}],"alternates":[{"author":{"kind":"agent","name":"Claude (sourcing agent)"},"id":600,"line_id":100,"links":{"accept":"/api/v1/alternates/600/accept","self":"/api/v1/alternates/600"},"object":"alternate","part_id":43,"rationale":"Same footprint, in stock","replaced_part_id":null,"status":"proposed","trade_offs":"5% tolerance"}],"attributes":{"footprint":"R_0603","value":"10k"},"bom_id":7,"breakdown":{"covered":"8","excess":"0","in_progress":"0","line_id":100,"needs_part":false,"on_order":"4","planned":"0","purchase":"fully_ordered","ready":"4","required":"8","status":"in_progress","uncovered":"0"},"deleted":false,"external_links":[],"group_id":10,"id":100,"inclusion":"required","links":{"alternates":"/api/v1/lines/100/alternates","bom":"/api/v1/boms/7","self":"/api/v1/lines/100"},"lock_version":3,"name":"10k pull-up","object":"line","open_questions":[{"author":{"kind":"agent","name":"Claude (sourcing agent)"},"body":"Is 5% tolerance acceptable here?","bom_id":7,"id":500,"kind":"question","line_id":100,"links":{"self":"/api/v1/comments/500"},"object":"comment","replies":[],"resolved":false,"target":"line"}],"part_id":42,"position":0,"quantity":"3","references":["R1","R2","R3"],"spares":"2","supply":"purchase","tags":["passive"],"unit":"pcs"}},"schema":{"properties":{"data":{"$ref":"#/components/schemas/LineDetail"}},"required":["data"],"type":"object"}}},"description":"The record.","headers":{"ETag":{"$ref":"#/components/headers/ETag"},"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"}},"summary":"Get a line","tags":["Lines"]},"patch":{"description":"Changes any editable field. Requires the version. A new `group_id` moves the line to the end of that group. With `dry_run=true` nothing is written and `impact` shows the quantity change.","operationId":"updateLine","parameters":[{"description":"Record id.","in":"path","name":"id","required":true,"schema":{"type":"integer"}},{"$ref":"#/components/parameters/dryRun"},{"$ref":"#/components/parameters/ifMatch"}],"requestBody":{"content":{"application/json":{"example":{"lock_version":3,"quantity":"6"},"schema":{"$ref":"#/components/schemas/LineUpdate"}}},"required":true},"responses":{"200":{"content":{"application/json":{"example":{"data":{"attributes":{"footprint":"R_0603","value":"10k"},"bom_id":7,"deleted":false,"external_links":[],"group_id":10,"id":100,"inclusion":"required","links":{"alternates":"/api/v1/lines/100/alternates","bom":"/api/v1/boms/7","self":"/api/v1/lines/100"},"lock_version":3,"name":"10k pull-up","object":"line","part_id":42,"position":0,"quantity":"3","references":["R1","R2","R3"],"spares":"2","supply":"purchase","tags":["passive"],"unit":"pcs"}},"schema":{"properties":{"data":{"$ref":"#/components/schemas/Line"}},"required":["data"],"type":"object"}}},"description":"The record.","headers":{"ETag":{"$ref":"#/components/headers/ETag"},"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"content":{"application/json":{"example":{"error":{"code":"conflict","details":[{"code":"stale","field":"lock_version","message":"current version is 4"}],"message":"The record changed since the version you sent."}},"schema":{"properties":{"error":{"allOf":[{"$ref":"#/components/schemas/ErrorBody"}],"properties":{"code":{"enum":["conflict","idempotency_in_progress","bom_archived","bom_trashed"],"type":"string"}},"type":"object"}},"required":["error"],"type":"object"}}},"description":"The record changed since the version you sent. `error.current` holds the stored record; reapply your change to it and retry with its lock_version. Also: bom_archived, bom_trashed."},"412":{"$ref":"#/components/responses/PreconditionFailed"},"415":{"$ref":"#/components/responses/UnsupportedMediaType"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Busy"}},"summary":"Update a line","tags":["Lines"]}},"/groups/{id}/merge":{"post":{"description":"Moves the lines and subgroups of this group to the end of `target_id` and removes this group. The version of this group (`lock_version` or `If-Match`) and of the target (`target_lock_version`) are checked when sent.","operationId":"mergeGroup","parameters":[{"description":"Record id.","in":"path","name":"id","required":true,"schema":{"type":"integer"}},{"$ref":"#/components/parameters/ifMatch"},{"$ref":"#/components/parameters/idempotencyKey"}],"requestBody":{"content":{"application/json":{"example":{"lock_version":2,"target_id":11,"target_lock_version":5},"schema":{"$ref":"#/components/schemas/MergeGroupInput"}}},"required":true},"responses":{"200":{"content":{"application/json":{"example":{"data":{"bom_id":7,"id":10,"links":{"self":"/api/v1/groups/10"},"lock_version":1,"name":"Electronics","object":"group","parent_id":null,"position":0,"quantity":1}},"schema":{"properties":{"data":{"$ref":"#/components/schemas/Group"}},"required":["data"],"type":"object"}}},"description":"The record.","headers":{"ETag":{"$ref":"#/components/headers/ETag"},"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"content":{"application/json":{"example":{"error":{"code":"conflict","details":[{"code":"stale","field":"lock_version","message":"current version is 4"}],"message":"The record changed since the version you sent."}},"schema":{"properties":{"error":{"allOf":[{"$ref":"#/components/schemas/ErrorBody"}],"properties":{"code":{"enum":["conflict","idempotency_in_progress","bom_archived","bom_trashed","idempotency_response_not_stored"],"type":"string"}},"type":"object"}},"required":["error"],"type":"object"}}},"description":"The record changed since the version you sent. `error.current` holds the stored record; reapply your change to it and retry with its lock_version. Also: bom_archived, bom_trashed."},"412":{"$ref":"#/components/responses/PreconditionFailed"},"415":{"$ref":"#/components/responses/UnsupportedMediaType"},"422":{"content":{"application/json":{"example":{"error":{"code":"validation_failed","details":[{"allowed":["purchase","on_hand","salvaged","fabricated","supplied","kit"],"code":"invalid","field":"supply","message":"is invalid"}],"message":"The request has invalid fields."}},"schema":{"properties":{"error":{"allOf":[{"$ref":"#/components/schemas/ErrorBody"}],"properties":{"code":{"enum":["validation_failed","same_group","cycle","idempotency_key_reused"],"type":"string"}},"type":"object"}},"required":["error"],"type":"object"}}},"description":"Invalid fields, or a declared query parameter with a bad value. `details` has one entry per problem with a dotted `field` path; enum errors list `allowed` values. A cursor (`after`) of this list written for another `sort` has detail code `cursor_mismatch`; any other unusable cursor has detail code `invalid`. Also: same_group, cycle."},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Busy"}},"summary":"Merge a group into another","tags":["Groups"]}},"/comments/{id}/resolve":{"post":{"description":"Resolves the thread and records who resolved it.","operationId":"resolveComment","parameters":[{"description":"Record id.","in":"path","name":"id","required":true,"schema":{"type":"integer"}},{"$ref":"#/components/parameters/idempotencyKey"}],"responses":{"200":{"content":{"application/json":{"example":{"data":{"author":{"kind":"agent","name":"Claude (sourcing agent)"},"body":"Is 5% tolerance acceptable here?","bom_id":7,"id":500,"kind":"question","line_id":100,"links":{"self":"/api/v1/comments/500"},"object":"comment","replies":[],"resolved":false,"target":"line"}},"schema":{"properties":{"data":{"$ref":"#/components/schemas/Comment"}},"required":["data"],"type":"object"}}},"description":"The record.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"content":{"application/json":{"example":{"error":{"code":"bom_archived","details":[],"message":"Refused: bom_archived."}},"schema":{"properties":{"error":{"allOf":[{"$ref":"#/components/schemas/ErrorBody"}],"properties":{"code":{"enum":["bom_archived","bom_trashed","idempotency_in_progress","idempotency_response_not_stored"],"type":"string"}},"type":"object"}},"required":["error"],"type":"object"}}},"description":"Refused by a domain rule: bom_archived, bom_trashed."},"422":{"$ref":"#/components/responses/IdempotencyKeyReused"},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Busy"}},"summary":"Resolve a thread","tags":["Comments"]}},"/boms/{id}/checklist":{"get":{"description":"The same answer as the web What to do next view, in the steps decide, order, place, receive, make, set_aside. `decide` waits on a judgement (unknown quantity, no part, a proposed substitute, an open question); `order` lists uncovered purchase units with the preferred listing; `place` lists each allocation on a planned order (not placed yet, so nothing to receive); `receive` lists each allocation on a placed, open order with units not yet accepted (an order closed as `received` or canceled waits on nothing); `extra` on place and receive items counts units the requirement does not need, such as units still on order for an excluded requirement; `make` and `set_aside` list units still to fabricate or to take from stock, salvage, a supplier, or a kit. A line can appear under several steps with its own units. Filters narrow the steps; `suppliers` and the counts help pick them.","operationId":"getBomChecklist","parameters":[{"description":"Record id.","in":"path","name":"id","required":true,"schema":{"type":"integer"}},{"description":"Only this step.","in":"query","name":"step","required":false,"schema":{"enum":["decide","order","place","receive","make","set_aside"],"type":"string"}},{"description":"Only items from this supplier (order, place, and receive).","in":"query","name":"supplier","required":false,"schema":{"type":"string"}},{"description":"Only lines in this group and the groups nested in it.","in":"query","name":"group_id","required":false,"schema":{"type":"integer"}},{"description":"Items per step (default 200, at most 1000); `truncated` says a step had more.","in":"query","name":"limit","required":false,"schema":{"default":200,"maximum":1000,"minimum":1,"type":"integer"}}],"responses":{"200":{"content":{"application/json":{"example":{"data":{"bom_id":7,"counts":{"decide":0,"make":0,"order":0,"receive":1,"set_aside":0},"item_count":1,"line_count":1,"steps":[{"items":[{"allocation_id":300,"line":{"id":100,"name":"10k pull-up","unit":"pcs"},"note":null,"order":{"id":20,"status":"ordered","supplier":"DigiKey"},"order_item_id":200,"quantity":"4","step":"receive","supplier":"DigiKey"}],"step":"receive"}],"suppliers":["DigiKey"]}},"schema":{"properties":{"data":{"$ref":"#/components/schemas/Checklist"}},"required":["data"],"type":"object"}}},"description":"The record.","headers":{"ETag":{"$ref":"#/components/headers/ETag"},"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"}},"summary":"What to do next","tags":["BOMs"]}},"/orders":{"get":{"description":"Orders with their items, one page at a time in the `sort` order (default `id`). `sort=-inserted_at` lists the newest first.","operationId":"listOrders","parameters":[{"description":"Status; comma-separate several.","in":"query","name":"status","required":false,"schema":{"enum":["planned","ordered","shipped","received","canceled"],"type":"string"}},{"description":"Case-insensitive supplier match.","in":"query","name":"supplier","required":false,"schema":{"type":"string"}},{"description":"Orders with allocations to lines of this BOM.","in":"query","name":"bom_id","required":false,"schema":{"type":"integer"}},{"description":"Matches supplier, reference, notes, and item descriptions.","in":"query","name":"search","required":false,"schema":{"type":"string"}},{"description":"One field, named as the records show it: `name` ascending, `-name` descending. Ties break by `id` in the same direction. Null values sort after every value ascending and before every value descending. Text sorts by the database collation (linguistic order, mostly ignoring case and accents), not by code point. The default `id` is the only order that never moves a record; in another order a record whose value changes between pages can move, so it can be missed or repeated. A cursor only works with the `sort` that wrote it.","in":"query","name":"sort","required":false,"schema":{"default":"id","enum":["id","-id","supplier","-supplier","inserted_at","-inserted_at","updated_at","-updated_at"],"type":"string"}},{"$ref":"#/components/parameters/limit"},{"$ref":"#/components/parameters/after"}],"responses":{"200":{"content":{"application/json":{"example":{"data":[{"currency":"USD","id":20,"items":[{"allocations":[{"id":300,"line_id":100,"links":{"line":"/api/v1/lines/100","self":"/api/v1/allocations/300"},"object":"allocation","order_id":20,"order_item_id":200,"quantity":"8","ready_quantity":"0","source":"order"}],"description":"10k resistor 0603 (Yageo RC0603FR-0710KL)","id":200,"links":{"self":"/api/v1/order-items/200"},"lock_version":1,"object":"order_item","order_id":20,"part_id":42,"quantity":"10","receipts":[{"exception":"none","id":400,"links":{"self":"/api/v1/receipts/400"},"object":"receipt","order_item_id":200,"quantity_accepted":"4","quantity_received":"4","received_on":"2026-11-21","replaces_id":null,"voided":false}],"status":"active","unit":"pcs","unit_price":"0.12"}],"links":{"self":"/api/v1/orders/20"},"lock_version":2,"object":"order","reference":"DK-12345","status":"ordered","supplier":"DigiKey"}],"next_cursor":null},"schema":{"properties":{"data":{"items":{"$ref":"#/components/schemas/Order"},"type":"array"},"next_cursor":{"description":"Pass as `after` for the next page; null on the last page.","type":["string","null"]}},"required":["data","next_cursor"],"type":"object"}}},"description":"A page of records.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"}},"summary":"List orders","tags":["Orders"]},"post":{"description":"Creates an order, optionally with `items`, each with `allocations` to BOM lines, all in one transaction. Use an Idempotency-Key so a retry cannot create a second order.","operationId":"createOrder","parameters":[{"$ref":"#/components/parameters/idempotencyKey"}],"requestBody":{"content":{"application/json":{"example":{"items":[{"allocations":[{"line_id":100,"quantity":"9"}],"part_id":42,"quantity":"10","unit_price":"0.12"}],"reference":"DK-12345","status":"ordered","supplier":"DigiKey"},"schema":{"$ref":"#/components/schemas/OrderCreate"}}},"required":true},"responses":{"201":{"content":{"application/json":{"example":{"data":{"currency":"USD","id":20,"items":[{"allocations":[{"id":300,"line_id":100,"links":{"line":"/api/v1/lines/100","self":"/api/v1/allocations/300"},"object":"allocation","order_id":20,"order_item_id":200,"quantity":"8","ready_quantity":"0","source":"order"}],"description":"10k resistor 0603 (Yageo RC0603FR-0710KL)","id":200,"links":{"self":"/api/v1/order-items/200"},"lock_version":1,"object":"order_item","order_id":20,"part_id":42,"quantity":"10","receipts":[{"exception":"none","id":400,"links":{"self":"/api/v1/receipts/400"},"object":"receipt","order_item_id":200,"quantity_accepted":"4","quantity_received":"4","received_on":"2026-11-21","replaces_id":null,"voided":false}],"status":"active","unit":"pcs","unit_price":"0.12"}],"links":{"self":"/api/v1/orders/20"},"lock_version":2,"object":"order","reference":"DK-12345","status":"ordered","summary":{"total":{"USD":"1.2"}},"supplier":"DigiKey"}},"schema":{"properties":{"data":{"$ref":"#/components/schemas/OrderDetail"}},"required":["data"],"type":"object"}}},"description":"Created.","headers":{"ETag":{"$ref":"#/components/headers/ETag"},"Location":{"$ref":"#/components/headers/Location"},"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"409":{"content":{"application/json":{"example":{"error":{"code":"bom_trashed","details":[],"message":"Refused: bom_trashed."}},"schema":{"properties":{"error":{"allOf":[{"$ref":"#/components/schemas/ErrorBody"}],"properties":{"code":{"enum":["bom_trashed","idempotency_in_progress","idempotency_response_not_stored"],"type":"string"}},"type":"object"}},"required":["error"],"type":"object"}}},"description":"Refused by a domain rule: bom_trashed."},"415":{"$ref":"#/components/responses/UnsupportedMediaType"},"422":{"content":{"application/json":{"example":{"error":{"code":"validation_failed","details":[{"allowed":["purchase","on_hand","salvaged","fabricated","supplied","kit"],"code":"invalid","field":"supply","message":"is invalid"}],"message":"The request has invalid fields."}},"schema":{"properties":{"error":{"allOf":[{"$ref":"#/components/schemas/ErrorBody"}],"properties":{"code":{"enum":["validation_failed","idempotency_key_reused"],"type":"string"}},"type":"object"}},"required":["error"],"type":"object"}}},"description":"Invalid fields, or a declared query parameter with a bad value. `details` has one entry per problem with a dotted `field` path; enum errors list `allowed` values. A cursor (`after`) of this list written for another `sort` has detail code `cursor_mismatch`; any other unusable cursor has detail code `invalid`. Also: idempotency_key_reused."},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Busy"}},"summary":"Create an order","tags":["Orders"]}},"/order-items/{order_item_id}/allocations":{"get":{"description":"Allocations drawing on the item.","operationId":"listOrderItemAllocations","parameters":[{"description":"Record id.","in":"path","name":"order_item_id","required":true,"schema":{"type":"integer"}},{"$ref":"#/components/parameters/limit"},{"$ref":"#/components/parameters/after"}],"responses":{"200":{"content":{"application/json":{"example":{"data":[{"id":300,"line_id":100,"links":{"line":"/api/v1/lines/100","self":"/api/v1/allocations/300"},"object":"allocation","order_id":20,"order_item_id":200,"quantity":"8","ready_quantity":"0","source":"order"}],"next_cursor":null},"schema":{"properties":{"data":{"items":{"$ref":"#/components/schemas/Allocation"},"type":"array"},"next_cursor":{"description":"Pass as `after` for the next page; null on the last page.","type":["string","null"]}},"required":["data","next_cursor"],"type":"object"}}},"description":"A page of records.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"}},"summary":"Allocations of an order item","tags":["Allocations"]}},"/orders/order-lines":{"post":{"description":"Records an order for lines in one step: `order_id` (existing) or `order` (new), and `entries` of `{line_id, quantity}`. Lines selecting the same part in the same unit share one item with one allocation per line. A canceled order refuses new lines (`order_canceled`); a deleted line is refused (`line_deleted`). An entry without `unit_price` is priced per unit from the line's preferred listing when it has one; the event lists those items under `priced_from_listing`.","operationId":"orderLines","parameters":[{"$ref":"#/components/parameters/idempotencyKey"}],"requestBody":{"content":{"application/json":{"example":{"entries":[{"line_id":100,"quantity":"10","unit_price":"0.12"}],"order":{"status":"ordered","supplier":"DigiKey"}},"schema":{"$ref":"#/components/schemas/OrderLinesInput"}}},"required":true},"responses":{"200":{"content":{"application/json":{"example":{"data":{"id":20,"object":"order"}},"schema":{"properties":{"data":{"$ref":"#/components/schemas/OrderDetail"}},"required":["data"],"type":"object"}}},"description":"The lines were added to the existing order named by `order_id`."},"201":{"content":{"application/json":{"example":{"data":{"currency":"USD","id":20,"items":[{"allocations":[{"id":300,"line_id":100,"links":{"line":"/api/v1/lines/100","self":"/api/v1/allocations/300"},"object":"allocation","order_id":20,"order_item_id":200,"quantity":"8","ready_quantity":"0","source":"order"}],"description":"10k resistor 0603 (Yageo RC0603FR-0710KL)","id":200,"links":{"self":"/api/v1/order-items/200"},"lock_version":1,"object":"order_item","order_id":20,"part_id":42,"quantity":"10","receipts":[{"exception":"none","id":400,"links":{"self":"/api/v1/receipts/400"},"object":"receipt","order_item_id":200,"quantity_accepted":"4","quantity_received":"4","received_on":"2026-11-21","replaces_id":null,"voided":false}],"status":"active","unit":"pcs","unit_price":"0.12"}],"links":{"self":"/api/v1/orders/20"},"lock_version":2,"object":"order","reference":"DK-12345","status":"ordered","summary":{"total":{"USD":"1.2"}},"supplier":"DigiKey"}},"schema":{"properties":{"data":{"$ref":"#/components/schemas/OrderDetail"}},"required":["data"],"type":"object"}}},"description":"Created.","headers":{"ETag":{"$ref":"#/components/headers/ETag"},"Location":{"$ref":"#/components/headers/Location"},"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"content":{"application/json":{"example":{"error":{"code":"order_canceled","details":[],"message":"Refused: order_canceled."}},"schema":{"properties":{"error":{"allOf":[{"$ref":"#/components/schemas/ErrorBody"}],"properties":{"code":{"enum":["order_canceled","bom_trashed","idempotency_in_progress","idempotency_response_not_stored"],"type":"string"}},"type":"object"}},"required":["error"],"type":"object"}}},"description":"Refused by a domain rule: order_canceled, bom_trashed."},"415":{"$ref":"#/components/responses/UnsupportedMediaType"},"422":{"content":{"application/json":{"example":{"error":{"code":"validation_failed","details":[{"allowed":["purchase","on_hand","salvaged","fabricated","supplied","kit"],"code":"invalid","field":"supply","message":"is invalid"}],"message":"The request has invalid fields."}},"schema":{"properties":{"error":{"allOf":[{"$ref":"#/components/schemas/ErrorBody"}],"properties":{"code":{"enum":["validation_failed","no_lines","line_deleted","idempotency_key_reused"],"type":"string"}},"type":"object"}},"required":["error"],"type":"object"}}},"description":"Invalid fields, or a declared query parameter with a bad value. `details` has one entry per problem with a dotted `field` path; enum errors list `allowed` values. A cursor (`after`) of this list written for another `sort` has detail code `cursor_mismatch`; any other unusable cursor has detail code `invalid`. Also: no_lines, line_deleted."},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Busy"}},"summary":"Order BOM lines","tags":["Orders"]}},"/orders/{id}/cancel-impact":{"get":{"description":"Per line, the units that stop being covered (`stops`, not yet received) and the units that stay ready (`stays_ready`, already accepted), with totals. Read it before `POST /orders/{id}/cancel`. Writes nothing.","operationId":"getOrderCancelImpact","parameters":[{"description":"Record id.","in":"path","name":"id","required":true,"schema":{"type":"integer"}}],"responses":{"200":{"content":{"application/json":{"example":{"data":{"lines":[{"bom_id":7,"bom_name":"Desk weather station","line_id":100,"line_name":"10k pull-up","stays_ready":"4","stops":"6","unit":"pcs"}],"stays_ready":"4","stops":"6"}},"schema":{"properties":{"data":{"$ref":"#/components/schemas/CancelImpact"}},"required":["data"],"type":"object"}}},"description":"The record.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"}},"summary":"What canceling an order changes","tags":["Orders"]}},"/boms/{bom_id}/groups/reorder":{"post":{"description":"Orders the children of `parent_id` (null for top level). `ordered_ids` must list every child exactly once; otherwise `validation_failed` names the missing, unknown, and duplicate ids.","operationId":"reorderGroups","parameters":[{"description":"Record id.","in":"path","name":"bom_id","required":true,"schema":{"type":"integer"}},{"$ref":"#/components/parameters/idempotencyKey"}],"requestBody":{"content":{"application/json":{"example":{"ordered_ids":[12,10,11],"parent_id":null},"schema":{"$ref":"#/components/schemas/ReorderGroupsInput"}}},"required":true},"responses":{"200":{"content":{"application/json":{"example":{"data":{"ordered_ids":[12,10,11]}},"schema":{"properties":{"data":{"type":"object"}},"required":["data"],"type":"object"}}},"description":"The record.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"content":{"application/json":{"example":{"error":{"code":"bom_archived","details":[],"message":"Refused: bom_archived."}},"schema":{"properties":{"error":{"allOf":[{"$ref":"#/components/schemas/ErrorBody"}],"properties":{"code":{"enum":["bom_archived","bom_trashed","idempotency_in_progress","idempotency_response_not_stored"],"type":"string"}},"type":"object"}},"required":["error"],"type":"object"}}},"description":"Refused by a domain rule: bom_archived, bom_trashed."},"415":{"$ref":"#/components/responses/UnsupportedMediaType"},"422":{"content":{"application/json":{"example":{"error":{"code":"validation_failed","details":[{"allowed":["purchase","on_hand","salvaged","fabricated","supplied","kit"],"code":"invalid","field":"supply","message":"is invalid"}],"message":"The request has invalid fields."}},"schema":{"properties":{"error":{"allOf":[{"$ref":"#/components/schemas/ErrorBody"}],"properties":{"code":{"enum":["validation_failed","idempotency_key_reused"],"type":"string"}},"type":"object"}},"required":["error"],"type":"object"}}},"description":"Invalid fields, or a declared query parameter with a bad value. `details` has one entry per problem with a dotted `field` path; enum errors list `allowed` values. A cursor (`after`) of this list written for another `sort` has detail code `cursor_mismatch`; any other unusable cursor has detail code `invalid`. Also: idempotency_key_reused."},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Busy"}},"summary":"Reorder groups","tags":["Groups"]}},"/parts/{part_id}/listings":{"get":{"description":"Listings of a part, preferred first.","operationId":"listListings","parameters":[{"description":"Record id.","in":"path","name":"part_id","required":true,"schema":{"type":"integer"}},{"$ref":"#/components/parameters/limit"},{"$ref":"#/components/parameters/after"}],"responses":{"200":{"content":{"application/json":{"example":{"data":[{"confidence":"verified","currency":"USD","id":50,"links":{"self":"/api/v1/listings/50"},"object":"listing","pack_size":"100","part_id":42,"preferred":true,"price":"1.2","sku":"311-10.0KHRCT-ND","stale":false,"supplier":"DigiKey"}],"next_cursor":null},"schema":{"properties":{"data":{"items":{"$ref":"#/components/schemas/Listing"},"type":"array"},"next_cursor":{"description":"Pass as `after` for the next page; null on the last page.","type":["string","null"]}},"required":["data","next_cursor"],"type":"object"}}},"description":"A page of records.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"}},"summary":"List listings","tags":["Listings"]},"post":{"description":"Adds a supplier listing. The first listing of a part becomes preferred; `preferred: true` makes a new one preferred.","operationId":"createListing","parameters":[{"description":"Record id.","in":"path","name":"part_id","required":true,"schema":{"type":"integer"}},{"$ref":"#/components/parameters/idempotencyKey"}],"requestBody":{"content":{"application/json":{"example":{"confidence":"verified","currency":"USD","observed_at":"2026-11-20T10:00:00Z","pack_size":"100","price":"1.20","sku":"311-10.0KHRCT-ND","supplier":"DigiKey"},"schema":{"$ref":"#/components/schemas/ListingInput"}}},"required":true},"responses":{"201":{"content":{"application/json":{"example":{"data":{"confidence":"verified","currency":"USD","id":50,"links":{"self":"/api/v1/listings/50"},"object":"listing","pack_size":"100","part_id":42,"preferred":true,"price":"1.2","sku":"311-10.0KHRCT-ND","stale":false,"supplier":"DigiKey"}},"schema":{"properties":{"data":{"$ref":"#/components/schemas/Listing"}},"required":["data"],"type":"object"}}},"description":"Created.","headers":{"Location":{"$ref":"#/components/headers/Location"},"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"content":{"application/json":{"example":{"error":{"code":"idempotency_in_progress","details":[],"message":"Refused: idempotency_in_progress."}},"schema":{"properties":{"error":{"allOf":[{"$ref":"#/components/schemas/ErrorBody"}],"properties":{"code":{"enum":["idempotency_in_progress","idempotency_response_not_stored"],"type":"string"}},"type":"object"}},"required":["error"],"type":"object"}}},"description":"Refused by a domain rule: idempotency_in_progress, idempotency_response_not_stored."},"415":{"$ref":"#/components/responses/UnsupportedMediaType"},"422":{"content":{"application/json":{"example":{"error":{"code":"validation_failed","details":[{"allowed":["purchase","on_hand","salvaged","fabricated","supplied","kit"],"code":"invalid","field":"supply","message":"is invalid"}],"message":"The request has invalid fields."}},"schema":{"properties":{"error":{"allOf":[{"$ref":"#/components/schemas/ErrorBody"}],"properties":{"code":{"enum":["validation_failed","idempotency_key_reused"],"type":"string"}},"type":"object"}},"required":["error"],"type":"object"}}},"description":"Invalid fields, or a declared query parameter with a bad value. `details` has one entry per problem with a dotted `field` path; enum errors list `allowed` values. A cursor (`after`) of this list written for another `sort` has detail code `cursor_mismatch`; any other unusable cursor has detail code `invalid`. Also: idempotency_key_reused."},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Busy"}},"summary":"Add a listing","tags":["Listings"]}},"/parts/{id}/where-used":{"get":{"description":"Lines (with their BOM), alternates, and order items that reference the part.","operationId":"getPartWhereUsed","parameters":[{"description":"Record id.","in":"path","name":"id","required":true,"schema":{"type":"integer"}}],"responses":{"200":{"content":{"application/json":{"example":{"data":{"alternates":[],"bom_count":1,"lines":[{"attributes":{"footprint":"R_0603","value":"10k"},"bom_id":7,"deleted":false,"external_links":[],"group_id":10,"id":100,"inclusion":"required","links":{"alternates":"/api/v1/lines/100/alternates","bom":"/api/v1/boms/7","self":"/api/v1/lines/100"},"lock_version":3,"name":"10k pull-up","object":"line","part_id":42,"position":0,"quantity":"3","references":["R1","R2","R3"],"spares":"2","supply":"purchase","tags":["passive"],"unit":"pcs"}],"order_items":[{"allocations":[{"id":300,"line_id":100,"links":{"line":"/api/v1/lines/100","self":"/api/v1/allocations/300"},"object":"allocation","order_id":20,"order_item_id":200,"quantity":"8","ready_quantity":"0","source":"order"}],"description":"10k resistor 0603 (Yageo RC0603FR-0710KL)","id":200,"links":{"self":"/api/v1/order-items/200"},"lock_version":1,"object":"order_item","order_id":20,"part_id":42,"quantity":"10","receipts":[{"exception":"none","id":400,"links":{"self":"/api/v1/receipts/400"},"object":"receipt","order_item_id":200,"quantity_accepted":"4","quantity_received":"4","received_on":"2026-11-21","replaces_id":null,"voided":false}],"status":"active","unit":"pcs","unit_price":"0.12"}],"part_id":42}},"schema":{"properties":{"data":{"$ref":"#/components/schemas/WhereUsed"}},"required":["data"],"type":"object"}}},"description":"The record.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"}},"summary":"Where a part is used","tags":["Parts"]}},"/":{"get":{"description":"Version, links to every top-level collection, the OpenAPI document, and the guide. No token needed.","operationId":"getIndex","parameters":[],"responses":{"200":{"content":{"application/json":{"example":{"api_version":"v1","links":{"boms":"/api/v1/boms","guide":"/api/v1/guide","openapi":"/api/v1/openapi.json"}},"schema":{"$ref":"#/components/schemas/Index"}}},"description":"JSON document (no data envelope)."},"400":{"$ref":"#/components/responses/BadRequest"}},"security":[],"summary":"API index","tags":["Discovery"]}},"/suppliers":{"get":{"description":"The supplier directory: suppliers an admin reviewed and published, one page at a time in the `sort` order (default `id`). Maker BOM never fetches a supplier's site and does not look up prices or stock; search the supplier yourself with `search_url_template` and follow `agent_notes`. Ratings are 1 to 5 or null, and 5 is best for the buyer on every criterion, so `price_rating` 5 means low prices. No average is returned. `review_stale` is true when the entry was last reviewed more than 365 days ago.","operationId":"listSuppliers","parameters":[{"description":"A category slug from `GET /suppliers/categories`.","in":"query","name":"category","required":false,"schema":{"enum":["electronic_components","boards_and_modules","connectors_and_cable","batteries_and_power","motors_and_motion","hardware_and_fasteners","raw_materials","printing_supplies","tools_and_equipment","pcb_fabrication","custom_fabrication","kits","surplus_and_salvage"],"type":"string"}},{"description":"One kind, several separated by commas, or the parameter repeated: distributor, manufacturer, retailer, marketplace, surplus, service.","in":"query","name":"kind","required":false,"schema":{"type":"string"}},{"description":"Case-insensitive substring of name, host, summary, description, best for, ships from, ships to, or currencies.","in":"query","name":"search","required":false,"schema":{"type":"string"}},{"description":"One field, named as the records show it: `name` ascending, `-name` descending. Ties break by `id` in the same direction. Null values sort after every value ascending and before every value descending. Text sorts by the database collation (linguistic order, mostly ignoring case and accents), not by code point. The default `id` is the only order that never moves a record; in another order a record whose value changes between pages can move, so it can be missed or repeated. A cursor only works with the `sort` that wrote it. Exception: the four ratings and `reviewed_at` put a supplier without a value last in both directions, so `sort=-price_rating` lists the lowest prices first and the unrated suppliers after them.","in":"query","name":"sort","required":false,"schema":{"default":"id","enum":["id","-id","name","-name","price_rating","-price_rating","ease_rating","-ease_rating","availability_rating","-availability_rating","variety_rating","-variety_rating","reviewed_at","-reviewed_at","published_at","-published_at"],"type":"string"}},{"$ref":"#/components/parameters/limit"},{"$ref":"#/components/parameters/after"}],"responses":{"200":{"content":{"application/json":{"example":{"data":[{"object":"supplier"}],"next_cursor":null},"schema":{"properties":{"data":{"items":{"$ref":"#/components/schemas/Supplier"},"type":"array"},"next_cursor":{"description":"Pass as `after` for the next page; null on the last page.","type":["string","null"]}},"required":["data","next_cursor"],"type":"object"}}},"description":"A page of records.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"}},"summary":"List published suppliers","tags":["Suppliers"]}},"/boms/{bom_id}/lines/bulk/preview":{"post":{"description":"Shows per line the changes, validation errors, and required quantity and status before and after, plus the BOM summary before and after. `versions` maps each line to its lock_version; pass it as `expected_versions` to the apply. Writes nothing.","operationId":"previewBulk","parameters":[{"description":"Record id.","in":"path","name":"bom_id","required":true,"schema":{"type":"integer"}},{"$ref":"#/components/parameters/idempotencyKey"}],"requestBody":{"content":{"application/json":{"example":{"attrs":{"supply":"on_hand"},"line_ids":[100,101],"operation":"update"},"schema":{"$ref":"#/components/schemas/BulkInput"}}},"required":true},"responses":{"200":{"content":{"application/json":{"example":{"data":{"affected_count":1,"lines":[{"changes":{"supply":["purchase","on_hand"]},"errors":{},"line_id":100}],"operation":{"update":{"supply":"on_hand"}},"valid":true}},"schema":{"properties":{"data":{"$ref":"#/components/schemas/BulkPreview"}},"required":["data"],"type":"object"}}},"description":"The record.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"content":{"application/json":{"example":{"error":{"code":"bom_archived","details":[],"message":"Refused: bom_archived."}},"schema":{"properties":{"error":{"allOf":[{"$ref":"#/components/schemas/ErrorBody"}],"properties":{"code":{"enum":["bom_archived","bom_trashed","idempotency_in_progress","idempotency_response_not_stored"],"type":"string"}},"type":"object"}},"required":["error"],"type":"object"}}},"description":"Refused by a domain rule: bom_archived, bom_trashed."},"415":{"$ref":"#/components/responses/UnsupportedMediaType"},"422":{"content":{"application/json":{"example":{"error":{"code":"validation_failed","details":[{"allowed":["purchase","on_hand","salvaged","fabricated","supplied","kit"],"code":"invalid","field":"supply","message":"is invalid"}],"message":"The request has invalid fields."}},"schema":{"properties":{"error":{"allOf":[{"$ref":"#/components/schemas/ErrorBody"}],"properties":{"code":{"enum":["validation_failed","invalid_operation","idempotency_key_reused"],"type":"string"}},"type":"object"}},"required":["error"],"type":"object"}}},"description":"Invalid fields, or a declared query parameter with a bad value. `details` has one entry per problem with a dotted `field` path; enum errors list `allowed` values. A cursor (`after`) of this list written for another `sort` has detail code `cursor_mismatch`; any other unusable cursor has detail code `invalid`. Also: invalid_operation."},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Busy"}},"summary":"Preview a bulk edit","tags":["Lines"]}},"/comments/{id}/replies":{"post":{"description":"Replies to the thread (a reply to a reply attaches to the root).","operationId":"replyToComment","parameters":[{"description":"Record id.","in":"path","name":"id","required":true,"schema":{"type":"integer"}},{"$ref":"#/components/parameters/idempotencyKey"}],"requestBody":{"content":{"application/json":{"example":{"body":"Yes, it is a pull-up."},"schema":{"$ref":"#/components/schemas/ReplyInput"}}},"required":true},"responses":{"201":{"content":{"application/json":{"example":{"data":{"author":{"kind":"agent","name":"Claude (sourcing agent)"},"body":"Is 5% tolerance acceptable here?","bom_id":7,"id":500,"kind":"question","line_id":100,"links":{"self":"/api/v1/comments/500"},"object":"comment","replies":[],"resolved":false,"target":"line"}},"schema":{"properties":{"data":{"$ref":"#/components/schemas/Comment"}},"required":["data"],"type":"object"}}},"description":"Created.","headers":{"Location":{"$ref":"#/components/headers/Location"},"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"content":{"application/json":{"example":{"error":{"code":"bom_archived","details":[],"message":"Refused: bom_archived."}},"schema":{"properties":{"error":{"allOf":[{"$ref":"#/components/schemas/ErrorBody"}],"properties":{"code":{"enum":["bom_archived","bom_trashed","idempotency_in_progress","idempotency_response_not_stored"],"type":"string"}},"type":"object"}},"required":["error"],"type":"object"}}},"description":"Refused by a domain rule: bom_archived, bom_trashed."},"415":{"$ref":"#/components/responses/UnsupportedMediaType"},"422":{"content":{"application/json":{"example":{"error":{"code":"validation_failed","details":[{"allowed":["purchase","on_hand","salvaged","fabricated","supplied","kit"],"code":"invalid","field":"supply","message":"is invalid"}],"message":"The request has invalid fields."}},"schema":{"properties":{"error":{"allOf":[{"$ref":"#/components/schemas/ErrorBody"}],"properties":{"code":{"enum":["validation_failed","idempotency_key_reused"],"type":"string"}},"type":"object"}},"required":["error"],"type":"object"}}},"description":"Invalid fields, or a declared query parameter with a bad value. `details` has one entry per problem with a dotted `field` path; enum errors list `allowed` values. A cursor (`after`) of this list written for another `sort` has detail code `cursor_mismatch`; any other unusable cursor has detail code `invalid`. Also: idempotency_key_reused."},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Busy"}},"summary":"Reply","tags":["Comments"]}},"/imports":{"post":{"description":"Creates a BOM and imports into it in one transaction. A Maker BOM document brings its own title and description; otherwise `bom.name` is required. The new BOM records where it came from only when the document's `shared.url` is a live shared build of this server (taken from that shared build, not from the document). A part of this account is reused by manufacturer part number and gains the document's sources as listings, but its preferred listing never changes. A document over the size limits (2,000 requirements, 500 assemblies, 4,000 parts, 8,000 sources and 10 per part, 2,000 substitutes and 5 per requirement, 20,000 characters per text, multipliers up to 100,000) is refused with `413 import_too_large` before anything is written. A document of a newer major version is refused with `422 import_unsupported_version`.","operationId":"importNewBom","parameters":[{"$ref":"#/components/parameters/idempotencyKey"}],"requestBody":{"content":{"application/json":{"example":{"bom":{"name":"Sensor board rev B"},"format":"csv","text":"Reference,Value,Footprint,Qty\nR1 R2 R3,10k,R_0603,3\nC1,100n,C_0603,1\n"},"schema":{"$ref":"#/components/schemas/ImportNewBomInput"}}},"required":true},"responses":{"201":{"content":{"application/json":{"example":{"data":{"bom":{"archived_at":null,"build_count":2,"build_label":"rev A","id":7,"inserted_at":"2026-11-01T09:00:00Z","links":{"analysis":"/api/v1/boms/7/analysis","lines":"/api/v1/boms/7/lines","self":"/api/v1/boms/7"},"lock_version":4,"name":"Desk weather station","object":"bom","purpose":"Indoor climate logger","state":"active","trashed_at":null,"updated_at":"2026-11-21T08:00:00Z"},"import":{"created":[{"attributes":{"footprint":"R_0603","value":"10k"},"bom_id":7,"deleted":false,"external_links":[],"group_id":10,"id":100,"inclusion":"required","links":{"alternates":"/api/v1/lines/100/alternates","bom":"/api/v1/boms/7","self":"/api/v1/lines/100"},"lock_version":3,"name":"10k pull-up","object":"line","part_id":42,"position":0,"quantity":"3","references":["R1","R2","R3"],"spares":"2","supply":"purchase","tags":["passive"],"unit":"pcs"}],"removed":[],"skipped_rows":[],"unchanged":0,"updated":[]}}},"schema":{"properties":{"data":{"$ref":"#/components/schemas/ImportNewBomResult"}},"required":["data"],"type":"object"}}},"description":"Created.","headers":{"Location":{"$ref":"#/components/headers/Location"},"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"409":{"content":{"application/json":{"example":{"error":{"code":"idempotency_in_progress","details":[],"message":"Refused: idempotency_in_progress."}},"schema":{"properties":{"error":{"allOf":[{"$ref":"#/components/schemas/ErrorBody"}],"properties":{"code":{"enum":["idempotency_in_progress","idempotency_response_not_stored"],"type":"string"}},"type":"object"}},"required":["error"],"type":"object"}}},"description":"Refused by a domain rule: idempotency_in_progress, idempotency_response_not_stored."},"413":{"content":{"application/json":{"example":{"error":{"code":"import_too_large","details":[],"message":"Refused: import_too_large."}},"schema":{"properties":{"error":{"allOf":[{"$ref":"#/components/schemas/ErrorBody"}],"properties":{"code":{"enum":["import_too_large"],"type":"string"}},"type":"object"}},"required":["error"],"type":"object"}}},"description":"Cannot be applied: import_too_large."},"415":{"$ref":"#/components/responses/UnsupportedMediaType"},"422":{"content":{"application/json":{"example":{"error":{"code":"validation_failed","details":[{"allowed":["purchase","on_hand","salvaged","fabricated","supplied","kit"],"code":"invalid","field":"supply","message":"is invalid"}],"message":"The request has invalid fields."}},"schema":{"properties":{"error":{"allOf":[{"$ref":"#/components/schemas/ErrorBody"}],"properties":{"code":{"enum":["validation_failed","import_invalid_rows","import_empty","import_parse_error","import_unsupported_version","idempotency_key_reused"],"type":"string"}},"type":"object"}},"required":["error"],"type":"object"}}},"description":"Invalid fields, or a declared query parameter with a bad value. `details` has one entry per problem with a dotted `field` path; enum errors list `allowed` values. A cursor (`after`) of this list written for another `sort` has detail code `cursor_mismatch`; any other unusable cursor has detail code `invalid`. Also: import_invalid_rows, import_empty, import_parse_error, import_unsupported_version."},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Busy"}},"summary":"Create a BOM from an import","tags":["Import and export"]}},"/alternates/{id}/reject":{"post":{"description":"Rejects the proposal with an optional reason.","operationId":"rejectAlternate","parameters":[{"description":"Record id.","in":"path","name":"id","required":true,"schema":{"type":"integer"}},{"$ref":"#/components/parameters/idempotencyKey"}],"requestBody":{"content":{"application/json":{"example":{"decision_reason":"Needs 1% tolerance"},"schema":{"$ref":"#/components/schemas/RejectAlternateInput"}}},"required":true},"responses":{"200":{"content":{"application/json":{"example":{"data":{"author":{"kind":"agent","name":"Claude (sourcing agent)"},"id":600,"line_id":100,"links":{"accept":"/api/v1/alternates/600/accept","self":"/api/v1/alternates/600"},"object":"alternate","part_id":43,"rationale":"Same footprint, in stock","replaced_part_id":null,"status":"proposed","trade_offs":"5% tolerance"}},"schema":{"properties":{"data":{"$ref":"#/components/schemas/Alternate"}},"required":["data"],"type":"object"}}},"description":"The record.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"content":{"application/json":{"example":{"error":{"code":"already_decided","details":[],"message":"Refused: already_decided."}},"schema":{"properties":{"error":{"allOf":[{"$ref":"#/components/schemas/ErrorBody"}],"properties":{"code":{"enum":["already_decided","bom_archived","bom_trashed","idempotency_in_progress","idempotency_response_not_stored"],"type":"string"}},"type":"object"}},"required":["error"],"type":"object"}}},"description":"Refused by a domain rule: already_decided."},"415":{"$ref":"#/components/responses/UnsupportedMediaType"},"422":{"$ref":"#/components/responses/IdempotencyKeyReused"},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Busy"}},"summary":"Reject an alternate","tags":["Alternates"]}},"/boms/{id}/export.json":{"get":{"description":"The build in the Maker BOM format (`format: builderbom`, `version: 1`, schema at `/schemas/builderbom/v1.json`, documented at `/docs/format`): the shared sections plus the private `records` and `status` sections, and `orders` and `comments` when asked. It re-imports through `POST /imports`; re-importing into the same build matches its lines.","operationId":"exportBomJson","parameters":[{"description":"Record id.","in":"path","name":"id","required":true,"schema":{"type":"integer"}},{"description":"Add each line's allocations.","in":"query","name":"include_orders","required":false,"schema":{"type":"boolean"}},{"description":"Add the BOM's comments.","in":"query","name":"include_comments","required":false,"schema":{"type":"boolean"}}],"responses":{"200":{"content":{"application/json":{"example":{"assemblies":[],"build":{"title":"Desk weather station"},"format":"builderbom","parts":[],"requirements":[],"version":1},"schema":{"$ref":"#/components/schemas/BomExport"}}},"description":"JSON document (no data envelope)."},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"}},"summary":"Export as JSON","tags":["Import and export"]}},"/events":{"get":{"description":"Events after the cursor `after`, oldest first. Store `next_cursor` and poll with it; it equals the sent cursor when nothing is new. `has_more` says another page is ready.","operationId":"listEvents","parameters":[{"description":"Cursor: an event id (default 0, the beginning).","in":"query","name":"after","required":false,"schema":{"type":"string"}},{"description":"Only events about this BOM, including order events covering its lines.","in":"query","name":"bom_id","required":false,"schema":{"type":"integer"}},{"$ref":"#/components/parameters/limit"}],"responses":{"200":{"content":{"application/json":{"example":{"data":[{"action":"line.updated","actor":{"api_token_id":3,"kind":"agent","name":"Claude (sourcing agent)"},"bom_id":7,"bom_ids":[7],"changes":{"quantity":["2","3"]},"cursor":"9001","id":9001,"metadata":{},"object":"event","occurred_at":"2026-11-21T08:00:00Z","subject":{"id":100,"type":"line"},"summary":"Updated requirement 10k pull-up"}],"next_cursor":null},"schema":{"properties":{"data":{"items":{"$ref":"#/components/schemas/Event"},"type":"array"},"next_cursor":{"description":"Pass as `after` for the next page; null on the last page.","type":["string","null"]}},"required":["data","next_cursor"],"type":"object"}}},"description":"A page of records.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"}},"summary":"Change feed","tags":["Activity"]}},"/lines/{line_id}/alternates":{"get":{"description":"Alternates of a line with candidate and replaced parts.","operationId":"listAlternates","parameters":[{"description":"Record id.","in":"path","name":"line_id","required":true,"schema":{"type":"integer"}},{"description":"Decision filter.","in":"query","name":"status","required":false,"schema":{"enum":["proposed","accepted","rejected"],"type":"string"}},{"$ref":"#/components/parameters/limit"},{"$ref":"#/components/parameters/after"}],"responses":{"200":{"content":{"application/json":{"example":{"data":[{"author":{"kind":"agent","name":"Claude (sourcing agent)"},"id":600,"line_id":100,"links":{"accept":"/api/v1/alternates/600/accept","self":"/api/v1/alternates/600"},"object":"alternate","part_id":43,"rationale":"Same footprint, in stock","replaced_part_id":null,"status":"proposed","trade_offs":"5% tolerance"}],"next_cursor":null},"schema":{"properties":{"data":{"items":{"$ref":"#/components/schemas/Alternate"},"type":"array"},"next_cursor":{"description":"Pass as `after` for the next page; null on the last page.","type":["string","null"]}},"required":["data","next_cursor"],"type":"object"}}},"description":"A page of records.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"}},"summary":"List alternates","tags":["Alternates"]},"post":{"description":"Proposes a candidate part (not the current selection) with rationale and trade-offs. The author is the token.","operationId":"proposeAlternate","parameters":[{"description":"Record id.","in":"path","name":"line_id","required":true,"schema":{"type":"integer"}},{"$ref":"#/components/parameters/idempotencyKey"}],"requestBody":{"content":{"application/json":{"example":{"part_id":42,"rationale":"Same footprint, in stock at two suppliers","trade_offs":"Tolerance 5% instead of 1%"},"schema":{"$ref":"#/components/schemas/AlternateInput"}}},"required":true},"responses":{"201":{"content":{"application/json":{"example":{"data":{"author":{"kind":"agent","name":"Claude (sourcing agent)"},"id":600,"line_id":100,"links":{"accept":"/api/v1/alternates/600/accept","self":"/api/v1/alternates/600"},"object":"alternate","part_id":43,"rationale":"Same footprint, in stock","replaced_part_id":null,"status":"proposed","trade_offs":"5% tolerance"}},"schema":{"properties":{"data":{"$ref":"#/components/schemas/Alternate"}},"required":["data"],"type":"object"}}},"description":"Created.","headers":{"Location":{"$ref":"#/components/headers/Location"},"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"content":{"application/json":{"example":{"error":{"code":"bom_archived","details":[],"message":"Refused: bom_archived."}},"schema":{"properties":{"error":{"allOf":[{"$ref":"#/components/schemas/ErrorBody"}],"properties":{"code":{"enum":["bom_archived","bom_trashed","idempotency_in_progress","idempotency_response_not_stored"],"type":"string"}},"type":"object"}},"required":["error"],"type":"object"}}},"description":"Refused by a domain rule: bom_archived, bom_trashed."},"415":{"$ref":"#/components/responses/UnsupportedMediaType"},"422":{"content":{"application/json":{"example":{"error":{"code":"validation_failed","details":[{"allowed":["purchase","on_hand","salvaged","fabricated","supplied","kit"],"code":"invalid","field":"supply","message":"is invalid"}],"message":"The request has invalid fields."}},"schema":{"properties":{"error":{"allOf":[{"$ref":"#/components/schemas/ErrorBody"}],"properties":{"code":{"enum":["validation_failed","idempotency_key_reused"],"type":"string"}},"type":"object"}},"required":["error"],"type":"object"}}},"description":"Invalid fields, or a declared query parameter with a bad value. `details` has one entry per problem with a dotted `field` path; enum errors list `allowed` values. A cursor (`after`) of this list written for another `sort` has detail code `cursor_mismatch`; any other unusable cursor has detail code `invalid`. Also: idempotency_key_reused."},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Busy"}},"summary":"Propose a substitute","tags":["Alternates"]}},"/boms":{"get":{"description":"BOMs of the owner, one page at a time in the `sort` order (default `id`). `sort=-updated_at` lists the most recently changed first.","operationId":"listBoms","parameters":[{"description":"Lifecycle filter (default `active`).","in":"query","name":"state","required":false,"schema":{"enum":["active","archived","trashed","not_trashed","all"],"type":"string"}},{"description":"Matches name, build label, and purpose.","in":"query","name":"search","required":false,"schema":{"type":"string"}},{"description":"One field, named as the records show it: `name` ascending, `-name` descending. Ties break by `id` in the same direction. Null values sort after every value ascending and before every value descending. Text sorts by the database collation (linguistic order, mostly ignoring case and accents), not by code point. The default `id` is the only order that never moves a record; in another order a record whose value changes between pages can move, so it can be missed or repeated. A cursor only works with the `sort` that wrote it.","in":"query","name":"sort","required":false,"schema":{"default":"id","enum":["id","-id","name","-name","inserted_at","-inserted_at","updated_at","-updated_at"],"type":"string"}},{"$ref":"#/components/parameters/limit"},{"$ref":"#/components/parameters/after"}],"responses":{"200":{"content":{"application/json":{"example":{"data":[{"archived_at":null,"build_count":2,"build_label":"rev A","id":7,"inserted_at":"2026-11-01T09:00:00Z","links":{"analysis":"/api/v1/boms/7/analysis","lines":"/api/v1/boms/7/lines","self":"/api/v1/boms/7"},"lock_version":4,"name":"Desk weather station","object":"bom","purpose":"Indoor climate logger","state":"active","trashed_at":null,"updated_at":"2026-11-21T08:00:00Z"}],"next_cursor":null},"schema":{"properties":{"data":{"items":{"$ref":"#/components/schemas/Bom"},"type":"array"},"next_cursor":{"description":"Pass as `after` for the next page; null on the last page.","type":["string","null"]}},"required":["data","next_cursor"],"type":"object"}}},"description":"A page of records.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"}},"summary":"List BOMs","tags":["BOMs"]},"post":{"description":"Creates an empty BOM.","operationId":"createBom","parameters":[{"$ref":"#/components/parameters/idempotencyKey"}],"requestBody":{"content":{"application/json":{"example":{"build_count":2,"name":"Desk weather station"},"schema":{"$ref":"#/components/schemas/BomInput"}}},"required":true},"responses":{"201":{"content":{"application/json":{"example":{"data":{"archived_at":null,"build_count":2,"build_label":"rev A","id":7,"inserted_at":"2026-11-01T09:00:00Z","links":{"analysis":"/api/v1/boms/7/analysis","lines":"/api/v1/boms/7/lines","self":"/api/v1/boms/7"},"lock_version":4,"name":"Desk weather station","object":"bom","purpose":"Indoor climate logger","state":"active","trashed_at":null,"updated_at":"2026-11-21T08:00:00Z"}},"schema":{"properties":{"data":{"$ref":"#/components/schemas/Bom"}},"required":["data"],"type":"object"}}},"description":"Created.","headers":{"ETag":{"$ref":"#/components/headers/ETag"},"Location":{"$ref":"#/components/headers/Location"},"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"409":{"content":{"application/json":{"example":{"error":{"code":"idempotency_in_progress","details":[],"message":"Refused: idempotency_in_progress."}},"schema":{"properties":{"error":{"allOf":[{"$ref":"#/components/schemas/ErrorBody"}],"properties":{"code":{"enum":["idempotency_in_progress","idempotency_response_not_stored"],"type":"string"}},"type":"object"}},"required":["error"],"type":"object"}}},"description":"Refused by a domain rule: idempotency_in_progress, idempotency_response_not_stored."},"415":{"$ref":"#/components/responses/UnsupportedMediaType"},"422":{"content":{"application/json":{"example":{"error":{"code":"validation_failed","details":[{"allowed":["purchase","on_hand","salvaged","fabricated","supplied","kit"],"code":"invalid","field":"supply","message":"is invalid"}],"message":"The request has invalid fields."}},"schema":{"properties":{"error":{"allOf":[{"$ref":"#/components/schemas/ErrorBody"}],"properties":{"code":{"enum":["validation_failed","idempotency_key_reused"],"type":"string"}},"type":"object"}},"required":["error"],"type":"object"}}},"description":"Invalid fields, or a declared query parameter with a bad value. `details` has one entry per problem with a dotted `field` path; enum errors list `allowed` values. A cursor (`after`) of this list written for another `sort` has detail code `cursor_mismatch`; any other unusable cursor has detail code `invalid`. Also: idempotency_key_reused."},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Busy"}},"summary":"Create a BOM","tags":["BOMs"]}},"/orders/{order_id}/items":{"post":{"description":"Adds an item. `quantity` counts usable units; `unit_price` is per unit. Without a description the part's label is recorded.","operationId":"createOrderItem","parameters":[{"description":"Record id.","in":"path","name":"order_id","required":true,"schema":{"type":"integer"}},{"$ref":"#/components/parameters/idempotencyKey"}],"requestBody":{"content":{"application/json":{"example":{"part_id":42,"quantity":"10","unit":"pcs","unit_price":"0.12"},"schema":{"$ref":"#/components/schemas/OrderItemInput"}}},"required":true},"responses":{"201":{"content":{"application/json":{"example":{"data":{"allocations":[{"id":300,"line_id":100,"links":{"line":"/api/v1/lines/100","self":"/api/v1/allocations/300"},"object":"allocation","order_id":20,"order_item_id":200,"quantity":"8","ready_quantity":"0","source":"order"}],"description":"10k resistor 0603 (Yageo RC0603FR-0710KL)","id":200,"links":{"self":"/api/v1/order-items/200"},"lock_version":1,"object":"order_item","order_id":20,"part_id":42,"quantity":"10","receipts":[{"exception":"none","id":400,"links":{"self":"/api/v1/receipts/400"},"object":"receipt","order_item_id":200,"quantity_accepted":"4","quantity_received":"4","received_on":"2026-11-21","replaces_id":null,"voided":false}],"status":"active","unit":"pcs","unit_price":"0.12"}},"schema":{"properties":{"data":{"$ref":"#/components/schemas/OrderItem"}},"required":["data"],"type":"object"}}},"description":"Created.","headers":{"ETag":{"$ref":"#/components/headers/ETag"},"Location":{"$ref":"#/components/headers/Location"},"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"content":{"application/json":{"example":{"error":{"code":"idempotency_in_progress","details":[],"message":"Refused: idempotency_in_progress."}},"schema":{"properties":{"error":{"allOf":[{"$ref":"#/components/schemas/ErrorBody"}],"properties":{"code":{"enum":["idempotency_in_progress","idempotency_response_not_stored"],"type":"string"}},"type":"object"}},"required":["error"],"type":"object"}}},"description":"Refused by a domain rule: idempotency_in_progress, idempotency_response_not_stored."},"415":{"$ref":"#/components/responses/UnsupportedMediaType"},"422":{"content":{"application/json":{"example":{"error":{"code":"validation_failed","details":[{"allowed":["purchase","on_hand","salvaged","fabricated","supplied","kit"],"code":"invalid","field":"supply","message":"is invalid"}],"message":"The request has invalid fields."}},"schema":{"properties":{"error":{"allOf":[{"$ref":"#/components/schemas/ErrorBody"}],"properties":{"code":{"enum":["validation_failed","idempotency_key_reused"],"type":"string"}},"type":"object"}},"required":["error"],"type":"object"}}},"description":"Invalid fields, or a declared query parameter with a bad value. `details` has one entry per problem with a dotted `field` path; enum errors list `allowed` values. A cursor (`after`) of this list written for another `sort` has detail code `cursor_mismatch`; any other unusable cursor has detail code `invalid`. Also: idempotency_key_reused."},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Busy"}},"summary":"Add an order item","tags":["Order items"]}},"/boms/{id}/analysis":{"get":{"description":"The full analysis: per-line breakdown and status in tree order, group rollups, the BOM summary, cost totals per currency, the identical-part rollup, completeness checks, and order item summaries.","operationId":"getBomAnalysis","parameters":[{"description":"Record id.","in":"path","name":"id","required":true,"schema":{"type":"integer"}}],"responses":{"200":{"content":{"application/json":{"example":{"data":{"bom":{"archived_at":null,"build_count":2,"build_label":"rev A","id":7,"inserted_at":"2026-11-01T09:00:00Z","links":{"analysis":"/api/v1/boms/7/analysis","lines":"/api/v1/boms/7/lines","self":"/api/v1/boms/7"},"lock_version":4,"name":"Desk weather station","object":"bom","purpose":"Indoor climate logger","state":"active","trashed_at":null,"updated_at":"2026-11-21T08:00:00Z"},"checks":[],"groups":[],"lines":[{"covered":"8","excess":"0","id":100,"in_progress":"0","line_id":100,"name":"10k pull-up","needs_part":false,"on_order":"4","planned":"0","purchase":"fully_ordered","ready":"4","required":"8","status":"in_progress","uncovered":"0"}],"parts":[],"summary":{"line_count":1,"status":"in_progress"}}},"schema":{"properties":{"data":{"$ref":"#/components/schemas/Analysis"}},"required":["data"],"type":"object"}}},"description":"The record.","headers":{"ETag":{"$ref":"#/components/headers/ETag"},"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"}},"summary":"Quantity analysis","tags":["BOMs"]}},"/boms/{id}/import":{"post":{"description":"Applies an import in one transaction. Rows with a source ref (a mapped column or a derived key) update their line on re-import and never replace a selected part. `mode: valid_rows` imports the valid rows and reports skipped ones; the default `all_or_nothing` fails with `import_invalid_rows`. Send the preview's `expected_versions` to refuse the commit with `409 import_stale_rows` when a matched line changed since.","operationId":"commitImport","parameters":[{"description":"Record id.","in":"path","name":"id","required":true,"schema":{"type":"integer"}},{"$ref":"#/components/parameters/idempotencyKey"}],"requestBody":{"content":{"application/json":{"example":{"format":"csv","mode":"all_or_nothing","text":"Reference,Value,Footprint,Qty\nR1 R2 R3,10k,R_0603,3\nC1,100n,C_0603,1\n"},"schema":{"$ref":"#/components/schemas/ImportCommitInput"}}},"required":true},"responses":{"200":{"content":{"application/json":{"example":{"data":{"created":[{"attributes":{"footprint":"R_0603","value":"10k"},"bom_id":7,"deleted":false,"external_links":[],"group_id":10,"id":100,"inclusion":"required","links":{"alternates":"/api/v1/lines/100/alternates","bom":"/api/v1/boms/7","self":"/api/v1/lines/100"},"lock_version":3,"name":"10k pull-up","object":"line","part_id":42,"position":0,"quantity":"3","references":["R1","R2","R3"],"spares":"2","supply":"purchase","tags":["passive"],"unit":"pcs"}],"removed":[],"skipped_rows":[],"unchanged":0,"updated":[]}},"schema":{"properties":{"data":{"$ref":"#/components/schemas/ImportResult"}},"required":["data"],"type":"object"}}},"description":"The record.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"content":{"application/json":{"example":{"error":{"code":"import_stale_rows","details":[],"message":"Refused: import_stale_rows."}},"schema":{"properties":{"error":{"allOf":[{"$ref":"#/components/schemas/ErrorBody"}],"properties":{"code":{"enum":["import_stale_rows","bom_archived","bom_trashed","idempotency_in_progress","idempotency_response_not_stored"],"type":"string"}},"type":"object"}},"required":["error"],"type":"object"}}},"description":"Refused by a domain rule: import_stale_rows, bom_archived, bom_trashed."},"413":{"content":{"application/json":{"example":{"error":{"code":"import_too_large","details":[],"message":"Refused: import_too_large."}},"schema":{"properties":{"error":{"allOf":[{"$ref":"#/components/schemas/ErrorBody"}],"properties":{"code":{"enum":["import_too_large"],"type":"string"}},"type":"object"}},"required":["error"],"type":"object"}}},"description":"Cannot be applied: import_too_large."},"415":{"$ref":"#/components/responses/UnsupportedMediaType"},"422":{"content":{"application/json":{"example":{"error":{"code":"validation_failed","details":[{"allowed":["purchase","on_hand","salvaged","fabricated","supplied","kit"],"code":"invalid","field":"supply","message":"is invalid"}],"message":"The request has invalid fields."}},"schema":{"properties":{"error":{"allOf":[{"$ref":"#/components/schemas/ErrorBody"}],"properties":{"code":{"enum":["validation_failed","import_invalid_rows","import_empty","import_parse_error","import_unsupported_version","import_mapping_error","idempotency_key_reused"],"type":"string"}},"type":"object"}},"required":["error"],"type":"object"}}},"description":"Invalid fields, or a declared query parameter with a bad value. `details` has one entry per problem with a dotted `field` path; enum errors list `allowed` values. A cursor (`after`) of this list written for another `sort` has detail code `cursor_mismatch`; any other unusable cursor has detail code `invalid`. Also: import_invalid_rows, import_empty, import_parse_error, import_unsupported_version, import_mapping_error."},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Busy"}},"summary":"Import into a BOM","tags":["Import and export"]}},"/orders/{id}/cancel":{"post":{"description":"Cancels the order. Units not yet received go back to uncovered; units already accepted on a receipt stay ready. A stated version is checked.","operationId":"cancelOrder","parameters":[{"description":"Record id.","in":"path","name":"id","required":true,"schema":{"type":"integer"}},{"$ref":"#/components/parameters/ifMatch"},{"$ref":"#/components/parameters/idempotencyKey"}],"responses":{"200":{"content":{"application/json":{"example":{"data":{"currency":"USD","id":20,"items":[{"allocations":[{"id":300,"line_id":100,"links":{"line":"/api/v1/lines/100","self":"/api/v1/allocations/300"},"object":"allocation","order_id":20,"order_item_id":200,"quantity":"8","ready_quantity":"0","source":"order"}],"description":"10k resistor 0603 (Yageo RC0603FR-0710KL)","id":200,"links":{"self":"/api/v1/order-items/200"},"lock_version":1,"object":"order_item","order_id":20,"part_id":42,"quantity":"10","receipts":[{"exception":"none","id":400,"links":{"self":"/api/v1/receipts/400"},"object":"receipt","order_item_id":200,"quantity_accepted":"4","quantity_received":"4","received_on":"2026-11-21","replaces_id":null,"voided":false}],"status":"active","unit":"pcs","unit_price":"0.12"}],"links":{"self":"/api/v1/orders/20"},"lock_version":2,"object":"order","reference":"DK-12345","status":"ordered","summary":{"total":{"USD":"1.2"}},"supplier":"DigiKey"}},"schema":{"properties":{"data":{"$ref":"#/components/schemas/OrderDetail"}},"required":["data"],"type":"object"}}},"description":"The record.","headers":{"ETag":{"$ref":"#/components/headers/ETag"},"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"content":{"application/json":{"example":{"error":{"code":"conflict","details":[{"code":"stale","field":"lock_version","message":"current version is 4"}],"message":"The record changed since the version you sent."}},"schema":{"properties":{"error":{"allOf":[{"$ref":"#/components/schemas/ErrorBody"}],"properties":{"code":{"enum":["conflict","idempotency_in_progress","idempotency_response_not_stored"],"type":"string"}},"type":"object"}},"required":["error"],"type":"object"}}},"description":"The record changed since the version you sent. `error.current` holds the stored record; reapply your change to it and retry with its lock_version. Also: idempotency_response_not_stored."},"412":{"$ref":"#/components/responses/PreconditionFailed"},"422":{"$ref":"#/components/responses/IdempotencyKeyReused"},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Busy"}},"summary":"Cancel an order","tags":["Orders"]}},"/listings/{id}/preferred":{"post":{"description":"Makes the listing the single preferred listing of its part. Estimates use the preferred listing.","operationId":"preferListing","parameters":[{"description":"Record id.","in":"path","name":"id","required":true,"schema":{"type":"integer"}},{"$ref":"#/components/parameters/idempotencyKey"}],"responses":{"200":{"content":{"application/json":{"example":{"data":{"confidence":"verified","currency":"USD","id":50,"links":{"self":"/api/v1/listings/50"},"object":"listing","pack_size":"100","part_id":42,"preferred":true,"price":"1.2","sku":"311-10.0KHRCT-ND","stale":false,"supplier":"DigiKey"}},"schema":{"properties":{"data":{"$ref":"#/components/schemas/Listing"}},"required":["data"],"type":"object"}}},"description":"The record.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"content":{"application/json":{"example":{"error":{"code":"idempotency_in_progress","details":[],"message":"Refused: idempotency_in_progress."}},"schema":{"properties":{"error":{"allOf":[{"$ref":"#/components/schemas/ErrorBody"}],"properties":{"code":{"enum":["idempotency_in_progress","idempotency_response_not_stored"],"type":"string"}},"type":"object"}},"required":["error"],"type":"object"}}},"description":"Refused by a domain rule: idempotency_in_progress, idempotency_response_not_stored."},"422":{"$ref":"#/components/responses/IdempotencyKeyReused"},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Busy"}},"summary":"Make a listing preferred","tags":["Listings"]}},"/receipts/{id}":{"get":{"description":"One receipt.","operationId":"getReceipt","parameters":[{"description":"Record id.","in":"path","name":"id","required":true,"schema":{"type":"integer"}}],"responses":{"200":{"content":{"application/json":{"example":{"data":{"exception":"none","id":400,"links":{"self":"/api/v1/receipts/400"},"object":"receipt","order_item_id":200,"quantity_accepted":"4","quantity_received":"4","received_on":"2026-11-21","replaces_id":null,"voided":false}},"schema":{"properties":{"data":{"$ref":"#/components/schemas/Receipt"}},"required":["data"],"type":"object"}}},"description":"The record.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"}},"summary":"Get a receipt","tags":["Receipts"]}},"/allocations/{id}":{"delete":{"description":"Removes the allocation; the units become uncovered on the line and unallocated on the item.","operationId":"deleteAllocation","parameters":[{"description":"Record id.","in":"path","name":"id","required":true,"schema":{"type":"integer"}}],"responses":{"204":{"description":"Done; no body."},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"content":{"application/json":{"example":{"error":{"code":"bom_trashed","details":[],"message":"Refused: bom_trashed."}},"schema":{"properties":{"error":{"allOf":[{"$ref":"#/components/schemas/ErrorBody"}],"properties":{"code":{"enum":["bom_trashed"],"type":"string"}},"type":"object"}},"required":["error"],"type":"object"}}},"description":"Refused by a domain rule: bom_trashed."},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Busy"}},"summary":"Remove an allocation","tags":["Allocations"],"x-example":{"request":"DELETE /api/v1/allocations/42","response":{"body":null,"status":204}}},"get":{"description":"One allocation.","operationId":"getAllocation","parameters":[{"description":"Record id.","in":"path","name":"id","required":true,"schema":{"type":"integer"}}],"responses":{"200":{"content":{"application/json":{"example":{"data":{"id":300,"line_id":100,"links":{"line":"/api/v1/lines/100","self":"/api/v1/allocations/300"},"object":"allocation","order_id":20,"order_item_id":200,"quantity":"8","ready_quantity":"0","source":"order"}},"schema":{"properties":{"data":{"$ref":"#/components/schemas/Allocation"}},"required":["data"],"type":"object"}}},"description":"The record.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"}},"summary":"Get an allocation","tags":["Allocations"]},"patch":{"description":"Changes quantity, ready quantity, or note. Recording progress on a non-order allocation is an update of `ready_quantity`. Not versioned.","operationId":"updateAllocation","parameters":[{"description":"Record id.","in":"path","name":"id","required":true,"schema":{"type":"integer"}}],"requestBody":{"content":{"application/json":{"example":{"ready_quantity":"3"},"schema":{"$ref":"#/components/schemas/AllocationUpdate"}}},"required":true},"responses":{"200":{"content":{"application/json":{"example":{"data":{"id":300,"line_id":100,"links":{"line":"/api/v1/lines/100","self":"/api/v1/allocations/300"},"object":"allocation","order_id":20,"order_item_id":200,"quantity":"8","ready_quantity":"0","source":"order"}},"schema":{"properties":{"data":{"$ref":"#/components/schemas/Allocation"}},"required":["data"],"type":"object"}}},"description":"The record.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"content":{"application/json":{"example":{"error":{"code":"bom_trashed","details":[],"message":"Refused: bom_trashed."}},"schema":{"properties":{"error":{"allOf":[{"$ref":"#/components/schemas/ErrorBody"}],"properties":{"code":{"enum":["bom_trashed"],"type":"string"}},"type":"object"}},"required":["error"],"type":"object"}}},"description":"Refused by a domain rule: bom_trashed."},"415":{"$ref":"#/components/responses/UnsupportedMediaType"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Busy"}},"summary":"Update an allocation","tags":["Allocations"]}},"/revisions/{id}/export.csv":{"get":{"description":"One row per line of the revision: line id, group path, name, quantity, unit, spares, inclusion, supply, references, category, tags, part, notes, source ref.","operationId":"exportRevisionCsv","parameters":[{"description":"Record id.","in":"path","name":"id","required":true,"schema":{"type":"integer"}}],"responses":{"200":{"content":{"text/csv":{"example":"group,name,quantity,unit,required,status\nPower,M3x8 screw,4,pcs,14,to_source\n","schema":{"type":"string"}}},"description":"text/csv document."},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"}},"summary":"Export a revision as CSV","tags":["Revisions"]}},"/revisions/{id}":{"get":{"description":"One revision with its snapshot.","operationId":"getRevision","parameters":[{"description":"Record id.","in":"path","name":"id","required":true,"schema":{"type":"integer"}}],"responses":{"200":{"content":{"application/json":{"example":{"data":{"author":{"kind":"user","name":"maker@example.com"},"bom_id":7,"id":70,"links":{"self":"/api/v1/revisions/70"},"name":"Sent to fab","number":3,"object":"revision","snapshot":{"bom":{"name":"Desk weather station"},"format":1,"groups":[],"lines":[]}}},"schema":{"properties":{"data":{"$ref":"#/components/schemas/RevisionDetail"}},"required":["data"],"type":"object"}}},"description":"The record.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"}},"summary":"Get a revision","tags":["Revisions"]}},"/boms/{id}/duplicate":{"post":{"description":"Copies groups and lines into a new BOM without orders, allocations, receipts, comments, or revisions. With `revision_id` the copy starts from that revision's snapshot instead of the draft.","operationId":"duplicateBom","parameters":[{"description":"Record id.","in":"path","name":"id","required":true,"schema":{"type":"integer"}},{"$ref":"#/components/parameters/idempotencyKey"}],"requestBody":{"content":{"application/json":{"example":{"attrs":{"name":"Weather station v2"},"keep_parts":true},"schema":{"$ref":"#/components/schemas/DuplicateBomInput"}}},"required":true},"responses":{"201":{"content":{"application/json":{"example":{"data":{"archived_at":null,"build_count":2,"build_label":"rev A","id":7,"inserted_at":"2026-11-01T09:00:00Z","links":{"analysis":"/api/v1/boms/7/analysis","lines":"/api/v1/boms/7/lines","self":"/api/v1/boms/7"},"lock_version":4,"name":"Desk weather station","object":"bom","purpose":"Indoor climate logger","state":"active","trashed_at":null,"updated_at":"2026-11-21T08:00:00Z"}},"schema":{"properties":{"data":{"$ref":"#/components/schemas/Bom"}},"required":["data"],"type":"object"}}},"description":"Created.","headers":{"ETag":{"$ref":"#/components/headers/ETag"},"Location":{"$ref":"#/components/headers/Location"},"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"content":{"application/json":{"example":{"error":{"code":"idempotency_in_progress","details":[],"message":"Refused: idempotency_in_progress."}},"schema":{"properties":{"error":{"allOf":[{"$ref":"#/components/schemas/ErrorBody"}],"properties":{"code":{"enum":["idempotency_in_progress","idempotency_response_not_stored"],"type":"string"}},"type":"object"}},"required":["error"],"type":"object"}}},"description":"Refused by a domain rule: idempotency_in_progress, idempotency_response_not_stored."},"415":{"$ref":"#/components/responses/UnsupportedMediaType"},"422":{"content":{"application/json":{"example":{"error":{"code":"validation_failed","details":[{"allowed":["purchase","on_hand","salvaged","fabricated","supplied","kit"],"code":"invalid","field":"supply","message":"is invalid"}],"message":"The request has invalid fields."}},"schema":{"properties":{"error":{"allOf":[{"$ref":"#/components/schemas/ErrorBody"}],"properties":{"code":{"enum":["validation_failed","idempotency_key_reused"],"type":"string"}},"type":"object"}},"required":["error"],"type":"object"}}},"description":"Invalid fields, or a declared query parameter with a bad value. `details` has one entry per problem with a dotted `field` path; enum errors list `allowed` values. A cursor (`after`) of this list written for another `sort` has detail code `cursor_mismatch`; any other unusable cursor has detail code `invalid`. Also: idempotency_key_reused."},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Busy"}},"summary":"Duplicate a BOM","tags":["BOMs"]}},"/boms/{id}":{"delete":{"description":"Deletes a BOM that is in the trash, with its groups, lines, revisions, comments, and allocations. Orders stay. Check `GET /boms/{id}/deletion-impact` first. A stated version is checked when given.","operationId":"deleteBom","parameters":[{"description":"Record id.","in":"path","name":"id","required":true,"schema":{"type":"integer"}},{"$ref":"#/components/parameters/ifMatch"}],"responses":{"204":{"description":"Done; no body."},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"content":{"application/json":{"example":{"error":{"code":"conflict","details":[{"code":"stale","field":"lock_version","message":"current version is 4"}],"message":"The record changed since the version you sent."}},"schema":{"properties":{"error":{"allOf":[{"$ref":"#/components/schemas/ErrorBody"}],"properties":{"code":{"enum":["conflict","idempotency_in_progress","not_trashed"],"type":"string"}},"type":"object"}},"required":["error"],"type":"object"}}},"description":"The record changed since the version you sent. `error.current` holds the stored record; reapply your change to it and retry with its lock_version. Also: not_trashed."},"412":{"$ref":"#/components/responses/PreconditionFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Busy"}},"summary":"Delete a BOM permanently","tags":["BOMs"],"x-example":{"request":"DELETE /api/v1/boms/42","response":{"body":null,"status":204}}},"get":{"description":"One BOM with its `cost` summary (runs the analysis): `estimate` and `to_buy` are priced per part from preferred listings, with packs rounded once per part across every line that selects it; `estimated` and `to_source` are per-line sums, as in the group rollups. Lists leave `cost` out.","operationId":"getBom","parameters":[{"description":"Record id.","in":"path","name":"id","required":true,"schema":{"type":"integer"}}],"responses":{"200":{"content":{"application/json":{"example":{"data":{"archived_at":null,"build_count":2,"build_label":"rev A","cost":{"committed":{"USD":"28.7"},"committed_missing":false,"committed_missing_count":0,"estimate":{"USD":"41.2"},"estimate_missing_line_ids":[104],"estimated":{"USD":"43.9"},"to_buy":{"USD":"12.5"},"to_source":{"USD":"13.1"}},"id":7,"inserted_at":"2026-11-01T09:00:00Z","links":{"analysis":"/api/v1/boms/7/analysis","lines":"/api/v1/boms/7/lines","self":"/api/v1/boms/7"},"lock_version":4,"name":"Desk weather station","object":"bom","purpose":"Indoor climate logger","state":"active","trashed_at":null,"updated_at":"2026-11-21T08:00:00Z"}},"schema":{"properties":{"data":{"$ref":"#/components/schemas/BomWithCost"}},"required":["data"],"type":"object"}}},"description":"The record.","headers":{"ETag":{"$ref":"#/components/headers/ETag"},"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"}},"summary":"Get a BOM","tags":["BOMs"]},"patch":{"description":"Changes name, build label, purpose, or build count. Requires the version (`lock_version` or `If-Match`).","operationId":"updateBom","parameters":[{"description":"Record id.","in":"path","name":"id","required":true,"schema":{"type":"integer"}},{"$ref":"#/components/parameters/ifMatch"}],"requestBody":{"content":{"application/json":{"example":{"build_count":3,"lock_version":4},"schema":{"$ref":"#/components/schemas/BomUpdate"}}},"required":true},"responses":{"200":{"content":{"application/json":{"example":{"data":{"archived_at":null,"build_count":2,"build_label":"rev A","id":7,"inserted_at":"2026-11-01T09:00:00Z","links":{"analysis":"/api/v1/boms/7/analysis","lines":"/api/v1/boms/7/lines","self":"/api/v1/boms/7"},"lock_version":4,"name":"Desk weather station","object":"bom","purpose":"Indoor climate logger","state":"active","trashed_at":null,"updated_at":"2026-11-21T08:00:00Z"}},"schema":{"properties":{"data":{"$ref":"#/components/schemas/Bom"}},"required":["data"],"type":"object"}}},"description":"The record.","headers":{"ETag":{"$ref":"#/components/headers/ETag"},"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"content":{"application/json":{"example":{"error":{"code":"conflict","details":[{"code":"stale","field":"lock_version","message":"current version is 4"}],"message":"The record changed since the version you sent."}},"schema":{"properties":{"error":{"allOf":[{"$ref":"#/components/schemas/ErrorBody"}],"properties":{"code":{"enum":["conflict","idempotency_in_progress","bom_archived","bom_trashed"],"type":"string"}},"type":"object"}},"required":["error"],"type":"object"}}},"description":"The record changed since the version you sent. `error.current` holds the stored record; reapply your change to it and retry with its lock_version. Also: bom_archived, bom_trashed."},"412":{"$ref":"#/components/responses/PreconditionFailed"},"415":{"$ref":"#/components/responses/UnsupportedMediaType"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Busy"}},"summary":"Update a BOM","tags":["BOMs"]}},"/supplier-suggestions":{"get":{"description":"This account's own suggestions (from the maker and every agent token of the account) in id order, each with its supplier's status. `supplier.status_reason` is set while the supplier is rejected or retired. Other accounts' suggestions are never listed.","operationId":"listSupplierSuggestions","parameters":[{"$ref":"#/components/parameters/limit"},{"$ref":"#/components/parameters/after"}],"responses":{"200":{"content":{"application/json":{"example":{"data":[{"object":"supplier_suggestion"}],"next_cursor":null},"schema":{"properties":{"data":{"items":{"$ref":"#/components/schemas/SupplierSuggestion"},"type":"array"},"next_cursor":{"description":"Pass as `after` for the next page; null on the last page.","type":["string","null"]}},"required":["data","next_cursor"],"type":"object"}}},"description":"A page of records.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"}},"summary":"List your supplier suggestions","tags":["Suppliers"]},"post":{"description":"Proposes a supplier for the admin's review queue. The host of `url` (lowercased, without `www.`, port, or path) identifies the supplier, so the same site always lands on the same entry. `outcome` says what happened: `queued` (a new queue entry), `reason_added` (the host was waiting; this account's reason was added), `already_suggested` (this account suggested it before; its reason was replaced), `already_published` (it is in the directory; nothing was recorded, and `supplier` is the directory entry), or `not_listed` (reviewed before and rejected or retired; the reason is recorded for the admin and the status stays). An account may make a limited number of new suggestions in any 24 hours (20 by default); past that the answer is 429 `suggestion_limit` and nothing is recorded. That answer carries `Retry-After` and `error.retry_after` (seconds) and `error.retry_at`: the moment the oldest counted suggestion leaves the 24-hour window. It carries no `X-RateLimit-*` headers, because the request-rate window does not apply.","operationId":"suggestSupplier","parameters":[{"$ref":"#/components/parameters/idempotencyKey"}],"requestBody":{"content":{"application/json":{"example":{"categories":["electronic_components"],"name":"Tayda Electronics","reason":"Cheap passives and pots, ships single units worldwide.","url":"https://www.taydaelectronics.com/"},"schema":{"$ref":"#/components/schemas/SupplierSuggestionInput"}}},"required":true},"responses":{"200":{"content":{"application/json":{"example":{"data":{"object":"supplier_suggestion_result"}},"schema":{"properties":{"data":{"$ref":"#/components/schemas/SupplierSuggestionResult"}},"required":["data"],"type":"object"}}},"description":"The record.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"409":{"content":{"application/json":{"example":{"error":{"code":"idempotency_in_progress","details":[],"message":"Refused: idempotency_in_progress."}},"schema":{"properties":{"error":{"allOf":[{"$ref":"#/components/schemas/ErrorBody"}],"properties":{"code":{"enum":["idempotency_in_progress","idempotency_response_not_stored"],"type":"string"}},"type":"object"}},"required":["error"],"type":"object"}}},"description":"Refused by a domain rule: idempotency_in_progress, idempotency_response_not_stored."},"415":{"$ref":"#/components/responses/UnsupportedMediaType"},"422":{"content":{"application/json":{"example":{"error":{"code":"validation_failed","details":[{"allowed":["purchase","on_hand","salvaged","fabricated","supplied","kit"],"code":"invalid","field":"supply","message":"is invalid"}],"message":"The request has invalid fields."}},"schema":{"properties":{"error":{"allOf":[{"$ref":"#/components/schemas/ErrorBody"}],"properties":{"code":{"enum":["validation_failed","idempotency_key_reused"],"type":"string"}},"type":"object"}},"required":["error"],"type":"object"}}},"description":"Invalid fields, or a declared query parameter with a bad value. `details` has one entry per problem with a dotted `field` path; enum errors list `allowed` values. A cursor (`after`) of this list written for another `sort` has detail code `cursor_mismatch`; any other unusable cursor has detail code `invalid`. Also: idempotency_key_reused."},"429":{"content":{"application/json":{"example":{"error":{"code":"rate_limited","details":[],"message":"Too many requests for this token. Retry after 12 seconds."}},"schema":{"properties":{"error":{"allOf":[{"$ref":"#/components/schemas/ErrorBody"}],"properties":{"code":{"enum":["rate_limited","suggestion_limit"],"type":"string"}},"type":"object"}},"required":["error"],"type":"object"}}},"description":"Too many requests for this token. Also: suggestion_limit."},"503":{"$ref":"#/components/responses/Busy"}},"summary":"Suggest a supplier","tags":["Suppliers"]}},"/boms/{id}/export.csv":{"get":{"description":"One row per live line in tree order with quantities, breakdown, status, selected part, and preferred listing.","operationId":"exportBomCsv","parameters":[{"description":"Record id.","in":"path","name":"id","required":true,"schema":{"type":"integer"}}],"responses":{"200":{"content":{"text/csv":{"example":"group,name,quantity,unit,required,status\nPower,M3x8 screw,4,pcs,14,to_source\n","schema":{"type":"string"}}},"description":"text/csv document."},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"}},"summary":"Export as CSV","tags":["Import and export"]}},"/boms/{id}/order-list":{"get":{"description":"What still needs buying, grouped by supplier and planned against preferred listings. `format=csv` returns CSV; any other format is refused.","operationId":"getOrderList","parameters":[{"description":"Record id.","in":"path","name":"id","required":true,"schema":{"type":"integer"}},{"description":"Response format.","in":"query","name":"format","required":false,"schema":{"enum":["json","csv"],"type":"string"}}],"responses":{"200":{"content":{"application/json":{"example":{"data":{"bom_id":7,"kit_supplied":[],"needs_part":[],"suppliers":[{"items":[],"missing_price_count":0,"supplier":"DigiKey","totals":{"USD":"1.2"}}]}},"schema":{"properties":{"data":{"$ref":"#/components/schemas/OrderList"}},"required":["data"],"type":"object"}},"text/csv":{"example":"supplier,part,units,packs,cost\nDigiKey,10k resistor,14,1,1.20\n","schema":{"type":"string"}}},"description":"The record.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"}},"summary":"Order list","tags":["Import and export"]}},"/groups/{id}":{"delete":{"description":"Removes a group. `lines=move_to_parent` (default) moves its lines and subgroups up; `lines=delete` removes the subtree and soft-deletes its lines.","operationId":"deleteGroup","parameters":[{"description":"Record id.","in":"path","name":"id","required":true,"schema":{"type":"integer"}},{"description":"What happens to the lines.","in":"query","name":"lines","required":false,"schema":{"enum":["move_to_parent","delete"],"type":"string"}},{"$ref":"#/components/parameters/ifMatch"}],"responses":{"204":{"description":"Done; no body."},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"content":{"application/json":{"example":{"error":{"code":"conflict","details":[{"code":"stale","field":"lock_version","message":"current version is 4"}],"message":"The record changed since the version you sent."}},"schema":{"properties":{"error":{"allOf":[{"$ref":"#/components/schemas/ErrorBody"}],"properties":{"code":{"enum":["conflict","idempotency_in_progress","bom_archived","bom_trashed"],"type":"string"}},"type":"object"}},"required":["error"],"type":"object"}}},"description":"The record changed since the version you sent. `error.current` holds the stored record; reapply your change to it and retry with its lock_version. Also: bom_archived, bom_trashed."},"412":{"$ref":"#/components/responses/PreconditionFailed"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Busy"}},"summary":"Delete a group","tags":["Groups"],"x-example":{"request":"DELETE /api/v1/groups/42","response":{"body":null,"status":204}}},"get":{"description":"One group.","operationId":"getGroup","parameters":[{"description":"Record id.","in":"path","name":"id","required":true,"schema":{"type":"integer"}}],"responses":{"200":{"content":{"application/json":{"example":{"data":{"bom_id":7,"id":10,"links":{"self":"/api/v1/groups/10"},"lock_version":1,"name":"Electronics","object":"group","parent_id":null,"position":0,"quantity":1}},"schema":{"properties":{"data":{"$ref":"#/components/schemas/Group"}},"required":["data"],"type":"object"}}},"description":"The record.","headers":{"ETag":{"$ref":"#/components/headers/ETag"},"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"}},"summary":"Get a group","tags":["Groups"]},"patch":{"description":"Changes name, description, quantity, or parent. Requires the version. A parent inside the group's own subtree is rejected.","operationId":"updateGroup","parameters":[{"description":"Record id.","in":"path","name":"id","required":true,"schema":{"type":"integer"}},{"$ref":"#/components/parameters/ifMatch"}],"requestBody":{"content":{"application/json":{"example":{"lock_version":2,"quantity":4},"schema":{"$ref":"#/components/schemas/GroupUpdate"}}},"required":true},"responses":{"200":{"content":{"application/json":{"example":{"data":{"bom_id":7,"id":10,"links":{"self":"/api/v1/groups/10"},"lock_version":1,"name":"Electronics","object":"group","parent_id":null,"position":0,"quantity":1}},"schema":{"properties":{"data":{"$ref":"#/components/schemas/Group"}},"required":["data"],"type":"object"}}},"description":"The record.","headers":{"ETag":{"$ref":"#/components/headers/ETag"},"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"content":{"application/json":{"example":{"error":{"code":"conflict","details":[{"code":"stale","field":"lock_version","message":"current version is 4"}],"message":"The record changed since the version you sent."}},"schema":{"properties":{"error":{"allOf":[{"$ref":"#/components/schemas/ErrorBody"}],"properties":{"code":{"enum":["conflict","idempotency_in_progress","bom_archived","bom_trashed"],"type":"string"}},"type":"object"}},"required":["error"],"type":"object"}}},"description":"The record changed since the version you sent. `error.current` holds the stored record; reapply your change to it and retry with its lock_version. Also: bom_archived, bom_trashed."},"412":{"$ref":"#/components/responses/PreconditionFailed"},"415":{"$ref":"#/components/responses/UnsupportedMediaType"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Busy"}},"summary":"Update a group","tags":["Groups"]}},"/listings/{id}":{"delete":{"description":"Deletes the listing. When it was preferred, the oldest remaining listing becomes preferred.","operationId":"deleteListing","parameters":[{"description":"Record id.","in":"path","name":"id","required":true,"schema":{"type":"integer"}}],"responses":{"204":{"description":"Done; no body."},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Busy"}},"summary":"Delete a listing","tags":["Listings"],"x-example":{"request":"DELETE /api/v1/listings/42","response":{"body":null,"status":204}}},"get":{"description":"One listing.","operationId":"getListing","parameters":[{"description":"Record id.","in":"path","name":"id","required":true,"schema":{"type":"integer"}}],"responses":{"200":{"content":{"application/json":{"example":{"data":{"confidence":"verified","currency":"USD","id":50,"links":{"self":"/api/v1/listings/50"},"object":"listing","pack_size":"100","part_id":42,"preferred":true,"price":"1.2","sku":"311-10.0KHRCT-ND","stale":false,"supplier":"DigiKey"}},"schema":{"properties":{"data":{"$ref":"#/components/schemas/Listing"}},"required":["data"],"type":"object"}}},"description":"The record.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"}},"summary":"Get a listing","tags":["Listings"]},"patch":{"description":"Changes listing fields. Listings are not versioned; the last write wins.","operationId":"updateListing","parameters":[{"description":"Record id.","in":"path","name":"id","required":true,"schema":{"type":"integer"}}],"requestBody":{"content":{"application/json":{"example":{"observed_at":"2026-11-21T09:00:00Z","price":"1.05"},"schema":{"$ref":"#/components/schemas/ListingUpdate"}}},"required":true},"responses":{"200":{"content":{"application/json":{"example":{"data":{"confidence":"verified","currency":"USD","id":50,"links":{"self":"/api/v1/listings/50"},"object":"listing","pack_size":"100","part_id":42,"preferred":true,"price":"1.2","sku":"311-10.0KHRCT-ND","stale":false,"supplier":"DigiKey"}},"schema":{"properties":{"data":{"$ref":"#/components/schemas/Listing"}},"required":["data"],"type":"object"}}},"description":"The record.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"},"415":{"$ref":"#/components/responses/UnsupportedMediaType"},"422":{"$ref":"#/components/responses/ValidationFailed"},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Busy"}},"summary":"Update a listing","tags":["Listings"]}},"/comments/{id}/reopen":{"post":{"description":"Reopens a resolved thread.","operationId":"reopenComment","parameters":[{"description":"Record id.","in":"path","name":"id","required":true,"schema":{"type":"integer"}},{"$ref":"#/components/parameters/idempotencyKey"}],"responses":{"200":{"content":{"application/json":{"example":{"data":{"author":{"kind":"agent","name":"Claude (sourcing agent)"},"body":"Is 5% tolerance acceptable here?","bom_id":7,"id":500,"kind":"question","line_id":100,"links":{"self":"/api/v1/comments/500"},"object":"comment","replies":[],"resolved":false,"target":"line"}},"schema":{"properties":{"data":{"$ref":"#/components/schemas/Comment"}},"required":["data"],"type":"object"}}},"description":"The record.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"content":{"application/json":{"example":{"error":{"code":"bom_archived","details":[],"message":"Refused: bom_archived."}},"schema":{"properties":{"error":{"allOf":[{"$ref":"#/components/schemas/ErrorBody"}],"properties":{"code":{"enum":["bom_archived","bom_trashed","idempotency_in_progress","idempotency_response_not_stored"],"type":"string"}},"type":"object"}},"required":["error"],"type":"object"}}},"description":"Refused by a domain rule: bom_archived, bom_trashed."},"422":{"$ref":"#/components/responses/IdempotencyKeyReused"},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Busy"}},"summary":"Reopen a thread","tags":["Comments"]}},"/boms/{bom_id}/revisions/{id}/restore-impact":{"get":{"description":"The reconciliation a restore would apply to the draft: lines added, removed, and changed, and the order allocations that would be reduced or removed. Writes nothing.","operationId":"getRevisionRestoreImpact","parameters":[{"description":"Record id.","in":"path","name":"bom_id","required":true,"schema":{"type":"integer"}},{"description":"Record id.","in":"path","name":"id","required":true,"schema":{"type":"integer"}}],"responses":{"200":{"content":{"application/json":{"example":{"data":{"object":"revision_restore_impact"}},"schema":{"properties":{"data":{"$ref":"#/components/schemas/RevisionRestoreImpact"}},"required":["data"],"type":"object"}}},"description":"The record.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"}},"summary":"What restoring a revision changes","tags":["Revisions"]}},"/orders/{order_id}/receipts":{"post":{"description":"Records several receipts of one order in one transaction, all or nothing: `receipts` of `{order_item_id, quantity_received, quantity_accepted?, received_on?, exception?, note?}`. An entry for an item of another order is refused. Errors name the entry, such as `receipts[1].quantity_received`.","operationId":"recordOrderReceipts","parameters":[{"description":"Record id.","in":"path","name":"order_id","required":true,"schema":{"type":"integer"}},{"$ref":"#/components/parameters/idempotencyKey"}],"requestBody":{"content":{"application/json":{"example":{"receipts":[{"order_item_id":200,"quantity_received":"4"},{"exception":"damaged","order_item_id":201,"quantity_accepted":"1","quantity_received":"2"}]},"schema":{"$ref":"#/components/schemas/OrderReceiptsInput"}}},"required":true},"responses":{"201":{"content":{"application/json":{"example":{"data":[{"exception":"none","id":400,"links":{"self":"/api/v1/receipts/400"},"object":"receipt","order_item_id":200,"quantity_accepted":"4","quantity_received":"4","received_on":"2026-11-21","replaces_id":null,"voided":false}],"next_cursor":null},"schema":{"properties":{"data":{"items":{"$ref":"#/components/schemas/Receipt"},"type":"array"},"next_cursor":{"description":"Pass as `after` for the next page; null on the last page.","type":["string","null"]}},"required":["data","next_cursor"],"type":"object"}}},"description":"Created.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"content":{"application/json":{"example":{"error":{"code":"idempotency_in_progress","details":[],"message":"Refused: idempotency_in_progress."}},"schema":{"properties":{"error":{"allOf":[{"$ref":"#/components/schemas/ErrorBody"}],"properties":{"code":{"enum":["idempotency_in_progress","idempotency_response_not_stored"],"type":"string"}},"type":"object"}},"required":["error"],"type":"object"}}},"description":"Refused by a domain rule: idempotency_in_progress, idempotency_response_not_stored."},"415":{"$ref":"#/components/responses/UnsupportedMediaType"},"422":{"content":{"application/json":{"example":{"error":{"code":"validation_failed","details":[{"allowed":["purchase","on_hand","salvaged","fabricated","supplied","kit"],"code":"invalid","field":"supply","message":"is invalid"}],"message":"The request has invalid fields."}},"schema":{"properties":{"error":{"allOf":[{"$ref":"#/components/schemas/ErrorBody"}],"properties":{"code":{"enum":["validation_failed","idempotency_key_reused"],"type":"string"}},"type":"object"}},"required":["error"],"type":"object"}}},"description":"Invalid fields, or a declared query parameter with a bad value. `details` has one entry per problem with a dotted `field` path; enum errors list `allowed` values. A cursor (`after`) of this list written for another `sort` has detail code `cursor_mismatch`; any other unusable cursor has detail code `invalid`. Also: idempotency_key_reused."},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Busy"}},"summary":"Record receipts for an order","tags":["Receipts"]}},"/parts/duplicates":{"get":{"description":"Groups of parts that share a normalized MPN, or a name and manufacturer when they have no MPN. Nothing is merged; merge with `POST /parts/{id}/merge`. Not paginated.","operationId":"listLikelyDuplicateParts","parameters":[],"responses":{"200":{"content":{"application/json":{"example":{"data":[{"object":"duplicate_group"}],"next_cursor":null},"schema":{"properties":{"data":{"items":{"$ref":"#/components/schemas/DuplicateGroup"},"type":"array"},"next_cursor":{"description":"Pass as `after` for the next page; null on the last page.","type":["string","null"]}},"required":["data","next_cursor"],"type":"object"}}},"description":"A page of records.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"429":{"$ref":"#/components/responses/RateLimited"}},"summary":"Likely duplicate parts","tags":["Parts"]}}},"security":[{"bearerAuth":[]}],"servers":[{"description":"Version 1","url":"/api/v1"}],"tags":[{"description":"Public entry points: index, OpenAPI document, guide.","name":"Discovery"},{"description":"The calling token and its owner, and the export of everything the account holds.","name":"Account"},{"description":"Bills of materials: lifecycle, duplication, analysis, what to do next.","name":"BOMs"},{"description":"Functional parts or assemblies inside a BOM, nestable, with a quantity multiplier.","name":"Groups"},{"description":"Requirements of a BOM: quantities, supply method, selected part, bulk edits.","name":"Lines"},{"description":"Proposed substitutes for a line and their decisions.","name":"Alternates"},{"description":"Named snapshots of a BOM and comparisons.","name":"Revisions"},{"description":"A shared build: a read-only snapshot of a build in the Maker BOM format at an unlisted public link. To copy someone else's shared build, fetch its document (`/b/{slug}/builderbom.json`) and post it to `POST /imports`.","name":"Sharing"},{"description":"The reusable parts catalog.","name":"Parts"},{"description":"Supplier listings with pack size, price, and freshness.","name":"Listings"},{"description":"Purchase orders that can cover lines of several BOMs.","name":"Orders"},{"description":"Items of an order; quantity counts usable units.","name":"Order items"},{"description":"Units assigned to cover a line, from an order item or another source.","name":"Allocations"},{"description":"What arrived; corrections void a receipt and add a replacement.","name":"Receipts"},{"description":"Notes and questions on BOMs, groups, lines, and orders.","name":"Comments"},{"description":"The supplier directory: published suppliers to shop at, and suggestions for the review queue. Maker BOM never fetches a supplier's site or looks up prices; the agent does the shopping.","name":"Suppliers"},{"description":"Change feed and display history.","name":"Activity"},{"description":"CSV, TSV, and JSON import with preview; CSV and JSON export; order list.","name":"Import and export"}]}