Create a product detail
const url = 'https://example.com/product-details';const options = { method: 'POST', headers: { cookie: '__Host-bottle.session_token=<__Host-bottle.session_token>', 'Content-Type': 'application/json' }, body: '{"name":"example","type":"choice","multiple":true,"unit":"example","kinds":["cylinder"],"options":["Clip-on","Screw-fit"]}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://example.com/product-details \ --header 'Content-Type: application/json' \ --cookie __Host-bottle.session_token=<__Host-bottle.session_token> \ --data '{ "name": "example", "type": "choice", "multiple": true, "unit": "example", "kinds": [ "cylinder" ], "options": [ "Clip-on", "Screw-fit" ] }'Goes last in the order. Its key is made from the name, with a number added when another detail has it. A choice needs its options. Up to 50 per business, archived ones included.
Authorizations
Section titled “Authorizations”Request Bodyrequired
Section titled “Request Bodyrequired”object
Choice: one of a list of options, or several when multiple is true. number: a number, in the fixed unit set on the detail, such as kg. yesno: yes or no. text: a short line of text, shown on the product and not a filter.
On a choice: let a product have several options. Ignored on other types.
On a number: the unit, such as kg or litres.
The kinds of product it applies to. Null or left out: every product.
On a choice: the options, in order. Needed on a choice, ignored otherwise.
Example
[ "Clip-on", "Screw-fit"]Responses
Section titled “Responses”Created
object
UUID v7
In the shop’s filter addresses: /products?d-regulator-fitting=clip-on. Made from the name when the detail is created and kept when it is renamed, so shared links keep working. Unique within the business.
Choice: one of a list of options, or several when multiple is true. number: a number, in the fixed unit set on the detail, such as kg. yesno: yes or no. text: a short line of text, shown on the product and not a filter.
On a choice: whether a product can have several options. False otherwise.
On a number: the unit it is in, as shown after it. Null when there is none.
The kinds of product it applies to. Null: every product.
On a choice: its options in order, archived ones included. Empty otherwise.
object
UUID v7
Archived options are kept on the products that have them and are not offered for new ones.
Example
{ "id": "019205d1-6e7a-7c3b-9f6e-3a2b1c0d9e8f", "name": "Regulator fitting", "key": "regulator-fitting", "type": "choice", "unit": "kg", "kinds": [ "cylinder" ], "options": [ { "id": "019205d1-6e7a-7c3b-9f6e-3a2b1c0d9e8f", "label": "Clip-on" } ]}Not signed in
object
Example
{ "error": "not_found", "message": "Customer not found"}Not a member, or without the permission this needs
object
Example
{ "error": "not_found", "message": "Customer not found"}The business already has 50 product details
object
Example
{ "error": "not_found", "message": "Customer not found"}Validation failed
object
object
Example
{ "error": "validation", "issues": [ { "path": "email", "message": "Invalid email" } ]}