{"openapi":"3.0.3","info":{"description":"REST API for Drop RFID. Public endpoints under /public use org-level API keys. Authenticated app endpoints, including routines, use Cognito JWTs and organization membership.\n\nPublic API rate limit: 60 requests/minute and 1000 requests/hour per API key. Standard X-RateLimit-* response headers are returned on public API responses.","title":"Drop RFID API","version":"1.2.0"},"servers":[{"description":"production","url":"https://www.droprfid.com/api/v1"}],"paths":{"/ai/generate-routine":{"post":{"tags":["AI"],"summary":"Generate a routine draft from a natural-language description","description":"Uses AI to produce a validated CreateRoutineRequest and explanation. The routine is not persisted until the caller submits it to create or import.","operationId":"generateRoutine","security":[{"cognitoAuth":[]}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/GenerateRoutineRequest"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/GenerateRoutineResponse"}}},"description":"Generated routine draft."},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"}}}},"/public/ai/generate-session":{"post":{"tags":["Public AI"],"summary":"Generate a simulated scan session from a natural-language description","description":"Uses AI to produce a session metadata object and a list of RFID entries based on the provided description. Useful for testing and demo data generation.","operationId":"generateSession","security":[{"apiKeyAuth":[]}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/GenerateSessionRequest"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/GenerateSessionResponse"}}},"description":"Generated session data."},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/public/containers":{"get":{"tags":["Public Containers"],"summary":"List containers for the authenticated organization","description":"A container is a named collection with recorded contents and optional RFID/barcode identifiers. Containers never appear under /public/orders, and transaction orders never appear here.","operationId":"listContainers","security":[{"apiKeyAuth":[]}],"parameters":[{"in":"query","name":"tag","required":false,"schema":{"description":"Return containers carrying this organization tag. Repeat the parameter to require multiple tags.","type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"items":{"$ref":"#/components/schemas/Container"},"type":"array"}}},"description":"Array of containers."},"401":{"$ref":"#/components/responses/Unauthorized"},"429":{"$ref":"#/components/responses/RateLimited"}}},"post":{"tags":["Public Containers"],"summary":"Create a container with recorded contents","description":"display_name is required. items reference owned SKUs; identifiers bind an RFID EPC or barcode to this container and must be free within the organization.","operationId":"createContainer","security":[{"apiKeyAuth":[]}],"requestBody":{"content":{"application/json":{"schema":{"properties":{"display_name":{"description":"Friendly label, 1..200 characters.","type":"string"},"identifiers":{"items":{"$ref":"#/components/schemas/ContainerIdentifier"},"type":"array"},"items":{"items":{"$ref":"#/components/schemas/OrderItemInput"},"type":"array"}},"required":["display_name"],"type":"object"}}},"required":true},"responses":{"201":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Container"}}},"description":"Container created."},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"409":{"$ref":"#/components/responses/Conflict"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/public/containers/{container_id}":{"get":{"tags":["Public Containers"],"summary":"Fetch a container with its recorded contents and identifiers","description":"Returns 404 for a transaction order id.","operationId":"getContainer","security":[{"apiKeyAuth":[]}],"parameters":[{"in":"path","name":"container_id","required":true,"schema":{"format":"uuid","type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Container"}}},"description":"Container detail."},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"}}},"patch":{"tags":["Public Containers"],"summary":"Replace a container's name, contents, or identifiers","description":"revision is required and must match the stored value; a stale revision returns 409 rather than overwriting a concurrent edit. Supplying items or identifiers replaces that collection wholesale. Container status, order_number and tags are not editable here.","operationId":"updateContainer","security":[{"apiKeyAuth":[]}],"parameters":[{"in":"path","name":"container_id","required":true,"schema":{"format":"uuid","type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"properties":{"display_name":{"type":"string"},"identifiers":{"items":{"$ref":"#/components/schemas/ContainerIdentifier"},"type":"array"},"items":{"items":{"$ref":"#/components/schemas/OrderItemInput"},"type":"array"},"revision":{"type":"integer"}},"required":["revision"],"type":"object"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Container"}}},"description":"Updated container."},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/public/graphql":{"post":{"tags":["Public GraphQL"],"summary":"Execute a GraphQL query or mutation against the public schema","description":"Single GraphQL endpoint over sessions, RFID entries, SKUs, and orders, resolved for the organization tied to the API key. Useful for fetching a session's scanned tags already joined to their SKUs in one round-trip — e.g. `query($id: ID!) { session(id: $id) { rfids { epc sku { id skuCode productTitle } } } }` — for fulfillment reconciliation. Reads and the createSku/updateSku/createOrder mutations are supported.","operationId":"publicGraphQL","security":[{"apiKeyAuth":[]}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/GraphQLRequest"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/GraphQLResponse"}}},"description":"GraphQL execution result. Field-level errors are returned in the errors array with a 200 status."},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/public/orders":{"get":{"tags":["Public Orders"],"summary":"List orders for the authenticated organization","operationId":"listOrders","security":[{"apiKeyAuth":[]}],"parameters":[{"in":"query","name":"status","required":false,"schema":{"type":"string"}},{"in":"query","name":"tag","required":false,"schema":{"description":"Return orders carrying this organization tag. Repeat the parameter to require multiple tags.","type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"items":{"$ref":"#/components/schemas/Order"},"type":"array"}}},"description":"Array of orders."},"401":{"$ref":"#/components/responses/Unauthorized"},"429":{"$ref":"#/components/responses/RateLimited"}}},"post":{"tags":["Public Orders"],"summary":"Create an order from SKU items","operationId":"createOrder","security":[{"apiKeyAuth":[]}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateOrderRequest"}}},"required":true},"responses":{"201":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Order"}}},"description":"Order created."},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/public/orders/{order_id}":{"get":{"tags":["Public Orders"],"summary":"Fetch an order with its items or RFIDs","operationId":"getOrder","security":[{"apiKeyAuth":[]}],"parameters":[{"in":"path","name":"order_id","required":true,"schema":{"format":"uuid","type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Order"}}},"description":"Order detail."},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"}}},"patch":{"tags":["Public Orders"],"summary":"Update an order's status","operationId":"updateOrder","security":[{"apiKeyAuth":[]}],"parameters":[{"in":"path","name":"order_id","required":true,"schema":{"format":"uuid","type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"properties":{"status":{"description":"pending | in_progress | review_required | blocked | completed | cancelled","type":"string"}},"required":["status"],"type":"object"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Order"}}},"description":"Updated order."},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/public/routines":{"get":{"tags":["Public Routines"],"summary":"List routines for the authenticated organization","description":"The organization is resolved from the API key.","operationId":"listPublicRoutines","security":[{"apiKeyAuth":[]}],"parameters":[{"in":"query","name":"include_disabled","required":false,"schema":{"type":"boolean"}}],"responses":{"200":{"content":{"application/json":{"schema":{"items":{"$ref":"#/components/schemas/Routine"},"type":"array"}}},"description":"Array of routines."},"401":{"$ref":"#/components/responses/Unauthorized"},"429":{"$ref":"#/components/responses/RateLimited"}}},"post":{"tags":["Public Routines"],"summary":"Create a routine","description":"Creates a routine in the organization resolved from the API key.","operationId":"createPublicRoutine","security":[{"apiKeyAuth":[]}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateRoutineRequest"}}},"required":true},"responses":{"201":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Routine"}}},"description":"Routine created."},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/public/routines/import":{"post":{"tags":["Public Routines"],"summary":"Import a routine manifest","description":"Parses and validates YAML or JSON routine manifest content, then upserts routines by code in the organization resolved from the API key. Idempotent — safe to re-run for bulk seeding.","operationId":"importPublicRoutines","security":[{"apiKeyAuth":[]}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RoutineManifestRequest"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RoutineImportResponse"}}},"description":"Import result."},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/public/sessions":{"get":{"tags":["Public Sessions"],"summary":"List scan sessions for the authenticated organization","operationId":"listSessions","security":[{"apiKeyAuth":[]}],"responses":{"200":{"content":{"application/json":{"schema":{"items":{"$ref":"#/components/schemas/Session"},"type":"array"}}},"description":"Array of sessions with embedded device metadata."},"401":{"$ref":"#/components/responses/Unauthorized"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/public/sessions/{session_id}":{"get":{"tags":["Public Sessions"],"summary":"Fetch a single session with scanned RFID tags and device metadata","operationId":"getSession","security":[{"apiKeyAuth":[]}],"parameters":[{"in":"path","name":"session_id","required":true,"schema":{"format":"uuid","type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SessionDetail"}}},"description":"Session with embedded device and RFID entries."},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/public/skus":{"get":{"tags":["Public SKUs"],"summary":"List SKUs for the authenticated organization","description":"Always returns one page, newest first; there is no unbounded mode. Pass limit (1-1000; default 100) to control the page size. When more SKUs follow, the response carries an X-Next-Cursor header; pass its value as cursor to fetch the next page. The last page has no X-Next-Cursor. The body is a JSON array.","operationId":"listSkus","security":[{"apiKeyAuth":[]}],"parameters":[{"in":"query","name":"limit","required":false,"schema":{"type":"integer"}},{"in":"query","name":"cursor","required":false,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"items":{"$ref":"#/components/schemas/SKU"},"type":"array"}}},"description":"Array of SKUs, newest first."},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"429":{"$ref":"#/components/responses/RateLimited"}}},"post":{"tags":["Public SKUs"],"summary":"Create a SKU","operationId":"createSku","security":[{"apiKeyAuth":[]}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateSkuRequest"}}},"required":true},"responses":{"201":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SKU"}}},"description":"SKU created."},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/public/skus/{sku_id}":{"delete":{"tags":["Public SKUs"],"summary":"Delete a SKU and its RFID bindings","operationId":"deleteSku","security":[{"apiKeyAuth":[]}],"parameters":[{"in":"path","name":"sku_id","required":true,"schema":{"format":"uuid","type":"string"}}],"responses":{"204":{"description":"Deleted."},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"}}},"get":{"tags":["Public SKUs"],"summary":"Fetch a SKU with its bound RFIDs","description":"Returns the full rfids[] array by default for backward compatibility. Provide rfids_limit and optional rfids_offset to return one RFID page with rfids_page metadata while rfid_count remains the total linked RFID count.","operationId":"getSku","security":[{"apiKeyAuth":[]}],"parameters":[{"in":"path","name":"sku_id","required":true,"schema":{"format":"uuid","type":"string"}},{"in":"query","name":"rfids_limit","required":false,"schema":{"type":"integer"}},{"in":"query","name":"rfids_offset","required":false,"schema":{"type":"integer"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SkuDetail"}}},"description":"SKU detail with rfids[]."},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"}}},"patch":{"tags":["Public SKUs"],"summary":"Update a SKU (partial update)","operationId":"updateSku","security":[{"apiKeyAuth":[]}],"parameters":[{"in":"path","name":"sku_id","required":true,"schema":{"format":"uuid","type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateSkuRequest"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SKU"}}},"description":"Updated SKU."},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/routines":{"get":{"tags":["Routines"],"summary":"List routines for the authenticated organization","description":"Requires Cognito authentication and organization membership.","operationId":"listRoutines","security":[{"cognitoAuth":[]}],"parameters":[{"in":"query","name":"include_disabled","required":false,"schema":{"type":"boolean"}}],"responses":{"200":{"content":{"application/json":{"schema":{"items":{"$ref":"#/components/schemas/Routine"},"type":"array"}}},"description":"Array of routines."},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"}}},"post":{"tags":["Routines"],"summary":"Create a routine","description":"Requires Cognito authentication, organization membership, and admin access.","operationId":"createRoutine","security":[{"cognitoAuth":[]}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateRoutineRequest"}}},"required":true},"responses":{"201":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Routine"}}},"description":"Routine created."},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"}}}},"/routines/import":{"post":{"tags":["Routines"],"summary":"Import a routine manifest","description":"Parses and validates YAML or JSON routine manifest content, then upserts routines by code in the authenticated organization. Requires admin access.","operationId":"importRoutines","security":[{"cognitoAuth":[]}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RoutineManifestRequest"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RoutineImportResponse"}}},"description":"Import result."},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"}}}},"/routines/import/preview":{"post":{"tags":["Routines"],"summary":"Preview a routine manifest import","description":"Parses and validates YAML or JSON routine manifest content for the authenticated organization without writing changes. Requires admin access.","operationId":"previewRoutineImport","security":[{"cognitoAuth":[]}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RoutineManifestRequest"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RoutineImportResponse"}}},"description":"Import preview."},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"}}}},"/routines/templates/track-containers/install":{"post":{"tags":["Routines"],"summary":"Install the curated container routine idempotently","description":"Requires organization administrator. Preserves an existing installation.","operationId":"installContainerRoutine","security":[{"cognitoAuth":[]}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Routine"}}},"description":"Installed routine"},"400":{"$ref":"#/components/responses/BadRequest"},"403":{"$ref":"#/components/responses/Forbidden"}}}},"/routines/{routine_id}":{"delete":{"tags":["Routines"],"summary":"Disable a routine","description":"Requires Cognito authentication, organization membership, and admin access.","operationId":"deleteRoutine","security":[{"cognitoAuth":[]}],"parameters":[{"in":"path","name":"routine_id","required":true,"schema":{"format":"uuid","type":"string"}}],"responses":{"204":{"description":"Routine disabled."},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"}}},"get":{"tags":["Routines"],"summary":"Fetch a routine","description":"Requires Cognito authentication and organization membership.","operationId":"getRoutine","security":[{"cognitoAuth":[]}],"parameters":[{"in":"path","name":"routine_id","required":true,"schema":{"format":"uuid","type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Routine"}}},"description":"Routine detail."},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"}}},"put":{"tags":["Routines"],"summary":"Update a routine","description":"Requires Cognito authentication, organization membership, and admin access.","operationId":"updateRoutine","security":[{"cognitoAuth":[]}],"parameters":[{"in":"path","name":"routine_id","required":true,"schema":{"format":"uuid","type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateRoutineRequest"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Routine"}}},"description":"Updated routine."},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"}}}},"/routines/{routine_id}/fields/{field_key}/resolve":{"post":{"tags":["Routines"],"summary":"Resolve a configured routine field value","description":"Requires Cognito authentication and organization membership.","operationId":"resolveRoutineField","security":[{"cognitoAuth":[]}],"parameters":[{"in":"path","name":"routine_id","required":true,"schema":{"format":"uuid","type":"string"}},{"in":"path","name":"field_key","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ResolveRoutineFieldRequest"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ResolveRoutineFieldResponse"}}},"description":"Resolved field value or validation result."},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"}}}},"/routines/{routine_id}/lookup":{"post":{"tags":["Routines"],"summary":"Resolve typed identifiers to named containers","description":"Requires X-Routine-Capabilities: container_lookup_v1 and an enabled container routine. Bounded to 100 identifiers. Does not save observations.","operationId":"lookupContainers","security":[{"cognitoAuth":[]}],"parameters":[{"in":"path","name":"routine_id","required":true,"schema":{"format":"uuid","type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"properties":{"identifiers":{"items":{"properties":{"observed_at":{"format":"date-time","type":"string"},"type":{"enum":["rfid","barcode"],"type":"string"},"value":{"type":"string"}},"required":["type","value"],"type":"object"},"type":"array"}},"required":["identifiers"],"type":"object"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{"properties":{"results":{"items":{"properties":{"display_name":{"type":"string"},"observed_at":{"format":"date-time","type":"string"},"order_id":{"format":"uuid","type":"string"},"status":{"enum":["matched","unknown","conflict"],"type":"string"},"type":{"enum":["rfid","barcode"],"type":"string"},"value":{"type":"string"}},"required":["type","value","status"],"type":"object"},"type":"array"}},"required":["results"],"type":"object"}}},"description":"One result per identifier"},"400":{"$ref":"#/components/responses/BadRequest"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"}}}}},"components":{"responses":{"BadRequest":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Invalid request body or parameters."},"Forbidden":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Organization membership or admin access is required."},"NotFound":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Resource not found."},"RateLimited":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Rate limit exceeded."},"Unauthorized":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Missing or invalid credentials."}},"schemas":{"Container":{"properties":{"created_at":{"format":"date-time","type":"string"},"customer_id":{"type":"string"},"display_name":{"description":"Friendly label, 1..200 characters.","type":"string"},"id":{"format":"uuid","type":"string"},"identifiers":{"items":{"$ref":"#/components/schemas/ContainerIdentifier"},"type":"array"},"items":{"description":"Recorded contents. These are not evidence that each item was individually scanned.","items":{"$ref":"#/components/schemas/OrderItem"},"type":"array"},"order_number":{"description":"Server-generated stable reference. Renaming a container does not change it.","type":"string"},"purpose":{"description":"Always \"container\" on this path.","type":"string"},"revision":{"description":"Increments on every edit. Send the value you read back in PATCH; a stale value returns 409.","type":"integer"},"updated_at":{"format":"date-time","type":"string"}},"type":"object"},"ContainerIdentifier":{"properties":{"id":{"format":"uuid","type":"string"},"type":{"enum":["rfid","barcode"],"type":"string"},"value":{"description":"RFID EPCs are compared as uppercase hex with spaces removed. Barcodes are compared verbatim, preserving leading zeroes.","type":"string"}},"required":["type","value"],"type":"object"},"CreateOrderRequest":{"properties":{"items":{"items":{"$ref":"#/components/schemas/OrderItemInput"},"type":"array"},"order_number":{"type":"string"},"tags":{"items":{"type":"string"},"type":"array"}},"required":["order_number"],"type":"object"},"CreateRoutineRequest":{"properties":{"code":{"type":"string"},"config":{"$ref":"#/components/schemas/RoutineConfig"},"description":{"type":"string"},"enabled":{"type":"boolean"},"name":{"type":"string"}},"required":["code","name","config"],"type":"object"},"CreateSkuRequest":{"properties":{"attributes":{"additionalProperties":{"type":"string"},"type":"object"},"barcode":{"type":"string"},"brand":{"type":"string"},"color":{"type":"string"},"description":{"type":"string"},"external_reference":{"type":"string"},"image_url":{"type":"string"},"product_title":{"type":"string"},"rfids":{"items":{"type":"string"},"type":"array"},"size":{"type":"string"},"sku_code":{"type":"string"},"variant_label":{"type":"string"}},"required":["sku_code"],"type":"object"},"Device":{"properties":{"created_at":{"format":"date-time","type":"string"},"device_type":{"type":"string"},"id":{"format":"uuid","type":"string"},"last_seen_at":{"format":"date-time","nullable":true,"type":"string"},"name":{"type":"string"},"org_id":{"format":"uuid","type":"string"},"serial_number":{"type":"string"},"status":{"enum":["active","inactive","decommissioned"],"type":"string"},"updated_at":{"format":"date-time","type":"string"}},"type":"object"},"Error":{"properties":{"error":{"type":"string"}},"type":"object"},"GenerateRoutineRequest":{"properties":{"description":{"description":"Natural-language description of the routine to draft.","type":"string"}},"required":["description"],"type":"object"},"GenerateRoutineResponse":{"properties":{"explanation":{"type":"string"},"routine":{"$ref":"#/components/schemas/CreateRoutineRequest"}},"required":["routine","explanation"],"type":"object"},"GenerateSessionRequest":{"properties":{"description":{"description":"Natural-language description of the session to generate.","type":"string"}},"required":["description"],"type":"object"},"GenerateSessionResponse":{"properties":{"metadata":{"additionalProperties":true,"type":"object"},"rfid_entries":{"items":{"$ref":"#/components/schemas/GeneratedRfidEntry"},"type":"array"}},"type":"object"},"GeneratedRfidEntry":{"properties":{"epc":{"type":"string"},"sku_code":{"type":"string"}},"type":"object"},"GraphQLRequest":{"properties":{"operationName":{"type":"string"},"query":{"description":"GraphQL query or mutation document.","type":"string"},"variables":{"additionalProperties":true,"type":"object"}},"required":["query"],"type":"object"},"GraphQLResponse":{"properties":{"data":{"additionalProperties":true,"type":"object"},"errors":{"items":{"additionalProperties":true,"type":"object"},"type":"array"}},"type":"object"},"Order":{"properties":{"created_at":{"format":"date-time","type":"string"},"customer_id":{"type":"string"},"id":{"format":"uuid","type":"string"},"items":{"items":{"$ref":"#/components/schemas/OrderItem"},"type":"array"},"order_number":{"type":"string"},"purpose":{"description":"Always \"transaction\" on this path. Containers are served from /public/containers.","type":"string"},"status":{"description":"pending | in_progress | review_required | blocked | completed | cancelled","type":"string"},"tags":{"items":{"$ref":"#/components/schemas/OrderTag"},"type":"array"},"updated_at":{"format":"date-time","type":"string"}},"type":"object"},"OrderItem":{"properties":{"attributes":{"additionalProperties":{"type":"string"},"type":"object"},"created_at":{"format":"date-time","type":"string"},"expected_quantity":{"type":"integer"},"id":{"format":"uuid","type":"string"},"image_url":{"type":"string"},"order_id":{"format":"uuid","type":"string"},"product_title":{"type":"string"},"sku_code":{"type":"string"},"sku_id":{"format":"uuid","type":"string"}},"type":"object"},"OrderItemInput":{"properties":{"expected_quantity":{"minimum":1,"type":"integer"},"sku_id":{"format":"uuid","type":"string"}},"required":["sku_id","expected_quantity"],"type":"object"},"OrderTag":{"properties":{"created_at":{"format":"date-time","type":"string"},"id":{"format":"uuid","type":"string"},"name":{"type":"string"},"org_id":{"format":"uuid","type":"string"},"updated_at":{"format":"date-time","type":"string"}},"type":"object"},"ResolveRoutineFieldRequest":{"properties":{"input_method":{"type":"string"},"value":{"type":"string"}},"required":["input_method","value"],"type":"object"},"ResolveRoutineFieldResponse":{"properties":{"code":{"type":"string"},"error":{"type":"string"},"field_key":{"type":"string"},"ok":{"type":"boolean"},"session_metadata_patch":{"additionalProperties":true,"type":"object"},"value":{"$ref":"#/components/schemas/ResolvedRoutineValue"}},"required":["ok","field_key"],"type":"object"},"ResolvedRoutineValue":{"properties":{"entity_id":{"type":"string"},"entity_type":{"type":"string"},"label":{"type":"string"},"metadata":{"additionalProperties":true,"type":"object"}},"required":["entity_type","entity_id","label"],"type":"object"},"RfidEntry":{"properties":{"antenna":{"type":"integer"},"id":{"format":"uuid","type":"string"},"read_count":{"type":"integer"},"rfid_code":{"type":"string"},"rssi":{"type":"integer"},"scanned_at":{"format":"date-time","type":"string"},"session_id":{"format":"uuid","type":"string"},"tid":{"type":"string"}},"type":"object"},"RfidPageInfo":{"properties":{"count":{"type":"integer"},"has_more":{"type":"boolean"},"limit":{"type":"integer"},"offset":{"type":"integer"}},"type":"object"},"Routine":{"properties":{"code":{"type":"string"},"config":{"$ref":"#/components/schemas/RoutineConfig"},"created_at":{"format":"date-time","type":"string"},"description":{"type":"string"},"enabled":{"type":"boolean"},"id":{"format":"uuid","type":"string"},"name":{"type":"string"},"org_id":{"format":"uuid","type":"string"},"updated_at":{"format":"date-time","type":"string"}},"type":"object"},"RoutineAction":{"properties":{"config":{"additionalProperties":true,"type":"object"},"event_type":{"type":"string"},"label":{"type":"string"},"mode":{"enum":["automatic","review_only","approval_required","exception_gated"],"type":"string"},"target_id":{"type":"string"},"type":{"enum":["webhook_event","export_session_report","no_action"],"type":"string"}},"required":["type","label"],"type":"object"},"RoutineConfig":{"properties":{"completion_actions":{"items":{"$ref":"#/components/schemas/RoutineAction"},"type":"array"},"finish_fields":{"items":{"$ref":"#/components/schemas/RoutineField"},"type":"array"},"scan":{"properties":{"mode":{"enum":["container_lookup"],"type":"string"},"version":{"type":"integer"}},"required":["mode","version"],"type":"object"},"session_view":{"$ref":"#/components/schemas/RoutineSessionView"},"start_fields":{"items":{"$ref":"#/components/schemas/RoutineField"},"type":"array"},"template":{"properties":{"id":{"enum":["track-containers"],"type":"string"},"version":{"type":"integer"}},"required":["id","version"],"type":"object"}},"type":"object"},"RoutineDefaultSort":{"properties":{"direction":{"enum":["asc","desc"],"type":"string"},"key":{"type":"string"}},"required":["key","direction"],"type":"object"},"RoutineField":{"properties":{"capture_methods":{"items":{"enum":["barcode","manual","rfid","qr","qr_code"],"type":"string"},"type":"array"},"display_in_sessions":{"type":"boolean"},"entity":{"type":"string"},"key":{"type":"string"},"label":{"type":"string"},"options":{"items":{"type":"string"},"type":"array"},"required":{"type":"boolean"},"resolver":{"additionalProperties":true,"type":"object"},"searchable":{"type":"boolean"},"type":{"enum":["text","select","reference","number","boolean","date","datetime","time"],"type":"string"}},"required":["key","label","type"],"type":"object"},"RoutineImportItem":{"properties":{"action":{"enum":["create","update","skip"],"type":"string"},"code":{"type":"string"},"routine":{"$ref":"#/components/schemas/CreateRoutineRequest"}},"required":["code","action","routine"],"type":"object"},"RoutineImportResponse":{"properties":{"created":{"type":"integer"},"errors":{"items":{"type":"string"},"type":"array"},"items":{"items":{"$ref":"#/components/schemas/RoutineImportItem"},"type":"array"},"routines":{"items":{"$ref":"#/components/schemas/CreateRoutineRequest"},"type":"array"},"skipped":{"type":"integer"},"updated":{"type":"integer"}},"required":["created","updated","skipped","routines","items"],"type":"object"},"RoutineManifestRequest":{"properties":{"content":{"description":"YAML or JSON manifest content. May contain a routine_bundle with routines[] or a single CreateRoutineRequest.","type":"string"},"format":{"description":"Optional parser hint: yaml, yml, or json.","type":"string"}},"required":["content"],"type":"object"},"RoutineSessionView":{"properties":{"default_columns":{"items":{"$ref":"#/components/schemas/RoutineViewColumn"},"type":"array"},"default_sort":{"$ref":"#/components/schemas/RoutineDefaultSort"}},"type":"object"},"RoutineViewColumn":{"properties":{"key":{"type":"string"},"label":{"type":"string"},"type":{"type":"string"}},"required":["type","key","label"],"type":"object"},"SKU":{"properties":{"attributes":{"additionalProperties":{"type":"string"},"type":"object"},"barcode":{"type":"string"},"brand":{"type":"string"},"color":{"type":"string"},"created_at":{"format":"date-time","type":"string"},"customer_id":{"type":"string"},"description":{"type":"string"},"external_reference":{"type":"string"},"id":{"format":"uuid","type":"string"},"image_url":{"type":"string"},"product_title":{"type":"string"},"rfid_count":{"type":"integer"},"size":{"type":"string"},"sku_code":{"type":"string"},"updated_at":{"format":"date-time","type":"string"},"variant_label":{"type":"string"}},"type":"object"},"Session":{"properties":{"completed_at":{"format":"date-time","nullable":true,"type":"string"},"created_at":{"format":"date-time","type":"string"},"customer_id":{"type":"string"},"device":{"$ref":"#/components/schemas/Device"},"device_id":{"format":"uuid","type":"string"},"id":{"format":"uuid","type":"string"},"metadata":{"additionalProperties":true,"type":"object"},"org_id":{"format":"uuid","type":"string"},"status":{"enum":["active","completed","cancelled"],"type":"string"}},"type":"object"},"SessionDetail":{"allOf":[{"$ref":"#/components/schemas/Session"},{"properties":{"rfids":{"items":{"$ref":"#/components/schemas/RfidEntry"},"type":"array"}},"type":"object"}]},"SkuDetail":{"allOf":[{"$ref":"#/components/schemas/SKU"},{"properties":{"rfids":{"items":{"type":"string"},"type":"array"},"rfids_page":{"$ref":"#/components/schemas/RfidPageInfo"}},"type":"object"}]},"UpdateRoutineRequest":{"description":"All fields are optional. Only provided fields are updated.","properties":{"code":{"type":"string"},"config":{"$ref":"#/components/schemas/RoutineConfig"},"description":{"type":"string"},"enabled":{"type":"boolean"},"name":{"type":"string"}},"type":"object"},"UpdateSkuRequest":{"description":"All fields are optional. Only provided fields are updated.","properties":{"attributes":{"additionalProperties":{"type":"string"},"type":"object"},"barcode":{"type":"string"},"brand":{"type":"string"},"color":{"type":"string"},"description":{"type":"string"},"image_url":{"type":"string"},"product_title":{"type":"string"},"size":{"type":"string"},"variant_label":{"type":"string"}},"type":"object"}},"securitySchemes":{"apiKeyAuth":{"description":"Authorization: Bearer drfid_sk_live_...","scheme":"bearer","type":"http"},"cognitoAuth":{"bearerFormat":"JWT","description":"Cognito JWT for authenticated organization users.","scheme":"bearer","type":"http"}}}}
