{"openapi":"3.1.0","info":{"title":"Placivity sample-piece API: room sizes and fit checks (fictional)","version":"1.0.0","description":"Read Placivity's sample pieces with real sizes in inches (W x D x H), check whether one piece fits a room with POST /api/v1/fit (the room editor's own check), and price a basket at sample (list) prices. Placivity sells nothing and agents never place orders: no endpoint creates one. 60 requests a minute; every call is logged. The public paths answer CORS preflight (OPTIONS) and send Access-Control-Allow-Origin: *, without credentials, so a browser-based tool can call them. To hand a person a room, link them to https://placivity.com/home/room?w=12&d=14&add=OV-SOF-HARLOW&v=oat (w and d in feet (whole numbers from 6 to 40); add is a sample SKU and v its variant, both optional). Piece sizes stay in inches. The link will not replace a room that already has pieces in that browser, or a room saved to an account."},"servers":[{"url":"https://placivity.com"}],"components":{"schemas":{"Error":{"type":"object","required":["error"],"properties":{"error":{"type":"string"}}},"Dimensions":{"type":"object","properties":{"unit":{"const":"in"},"width":{"type":"number"},"depth":{"type":"number"},"height":{"type":"number"}}},"Product":{"type":"object","required":["sku","name","dimensions","variants"],"properties":{"sku":{"type":"string"},"name":{"type":"string"},"collection":{"type":"string"},"category":{"type":"string"},"room":{"type":"string"},"styles":{"type":"array","items":{"type":"string"}},"description":{"type":"string"},"materials":{"type":"string"},"dimensions":{"$ref":"#/components/schemas/Dimensions"},"variants":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"label":{"type":"string"},"color":{"type":"string"},"material":{"type":"string"},"finish":{"type":"string"},"dimensions":{"$ref":"#/components/schemas/Dimensions"},"price":{"type":"object","description":"Decimal US dollars.","properties":{"currency":{"const":"USD"},"amount":{"type":"number"},"list":{"type":"number"},"source":{"type":"string"}}}}}},"availability":{"type":"object","properties":{"inStock":{"type":"boolean"},"quantity":{"type":"integer"},"leadTimeDays":{"type":"integer"}}},"url":{"type":"string","description":"The piece's page. Absolute on this site's origin in /api/v1/products, /api/v1/products/{sku} and /products.json."}}},"Catalog":{"type":"object","properties":{"pricedFor":{"type":"string"},"currency":{"const":"USD"},"count":{"type":"integer"},"products":{"type":"array","items":{"$ref":"#/components/schemas/Product"}}}},"FitRequest":{"type":"object","required":["room","piece"],"description":"The piece goes in an empty room of that size: one 32 in door on the south wall opening in, one 48 in window centred on the north wall (sill at 30 in), an 8 ft ceiling unless ceilingFt is given.","example":{"room":{"widthFt":12,"depthFt":14,"ceilingFt":8},"piece":{"sku":"OV-SOF-HARLOW","variant":"oat"}},"properties":{"room":{"type":"object","required":["widthFt","depthFt"],"properties":{"widthFt":{"type":"number","minimum":6,"maximum":40,"description":"feet"},"depthFt":{"type":"number","minimum":6,"maximum":40,"description":"feet"},"ceilingFt":{"type":"number","minimum":7,"maximum":20,"default":8,"description":"feet"}}},"piece":{"description":"A sample piece by SKU, or a piece the catalog does not have, in inches.","oneOf":[{"type":"object","required":["sku"],"properties":{"sku":{"type":"string"},"variant":{"type":"string"}}},{"type":"object","required":["widthIn","depthIn","heightIn"],"properties":{"widthIn":{"type":"number","exclusiveMinimum":0},"depthIn":{"type":"number","exclusiveMinimum":0},"heightIn":{"type":"number","exclusiveMinimum":0}}}]}}},"FitResult":{"type":"object","description":"The room editor's fit check for one piece. Doorways, hallways and stairs on the way in are not checked: measure them before the piece is bought.","required":["result","fits","verdict","problems","warnings","wayIn"],"properties":{"result":{"enum":["fits","tight","wont-fit"],"description":"fits: nothing flagged; tight: fits with warnings; wont-fit: a problem."},"fits":{"type":"boolean"},"verdict":{"type":"string","description":"One plain-English sentence."},"room":{"type":"object"},"piece":{"type":"object"},"placement":{"type":["object","null"],"description":"Centre from the north-west corner in inches, and a clockwise turn."},"problems":{"type":"array","description":"The check's errors.","items":{"type":"object","properties":{"kind":{"type":"string"},"message":{"type":"string"},"distanceIn":{"type":"number"}}}},"warnings":{"type":"array","description":"The check's warnings.","items":{"type":"object"}},"wayIn":{"type":"object","description":"Always checked: false. Doorways, hallways and stairs are not checked.","properties":{"checked":{"const":false},"note":{"type":"string"}}},"roomLink":{"type":"string","description":"The room editor at this size (whole feet), with the sample piece."}}},"QuoteRequest":{"type":"object","required":["items"],"properties":{"items":{"type":"array","minItems":1,"maxItems":200,"items":{"type":"object","required":["sku","qty"],"properties":{"sku":{"type":"string"},"variant":{"type":"string"},"qty":{"type":"integer","minimum":1,"maximum":10000}}}}}},"Quote":{"type":"object","description":"A priced basket. A quote is not an order.","properties":{"quoteId":{"type":"string"},"pricedFor":{"type":"string"},"currency":{"const":"USD"},"lines":{"type":"array","items":{"type":"object"}},"errors":{"type":"array","description":"Lines that could not be priced, by their index in the request.","items":{"type":"object","properties":{"index":{"type":"integer"},"sku":{"type":["string","null"]},"error":{"type":"string"}}}},"total":{"type":"number"},"validUntil":{"type":"string","format":"date"},"sources":{"type":"array","items":{"type":"string"}},"next":{"type":"string"}}}}},"paths":{"/api/v1/products":{"get":{"summary":"List products with dimensions and the caller's prices","parameters":[{"name":"category","in":"query","schema":{"type":"string"}},{"name":"room","in":"query","schema":{"type":"string"}},{"name":"maxWidth","in":"query","schema":{"type":"number"},"description":"inches"}],"responses":{"200":{"description":"Catalog","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Catalog"}}}},"401":{"description":"Invalid token","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited: 60 requests a minute. See the retry-after header.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/products/{sku}":{"get":{"summary":"One product","parameters":[{"name":"sku","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Product","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Product"}}}},"401":{"description":"Invalid token","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Unknown SKU","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited: 60 requests a minute. See the retry-after header.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/fit":{"post":{"summary":"Check whether one piece fits a room (read only, no price, no order)","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/FitRequest"}}}},"responses":{"200":{"description":"Fit result","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FitResult"}}}},"400":{"description":"Unsized or invalid input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Unknown SKU","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited: 60 requests a minute. See the retry-after header.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/quote":{"post":{"summary":"Price a basket (no order is created)","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/QuoteRequest"}}}},"responses":{"200":{"description":"Quote","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Quote"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Invalid token","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited: 60 requests a minute. See the retry-after header.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/orders":{"post":{"summary":"Not available: agents never place orders","responses":{"403":{"description":"Always, for every caller. Placivity sells nothing.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}}}}