Questions
These endpoints are called from a shopper's browser, so they take your publishable key rather than a secret one. Anything specific to one customer also takes a signed email and timestamp: see Identifying the customer for how to produce the signature.
GET /widgets/questions
List a product's published questions with their published answers, newest question first. Only what a moderator has approved appears here, and an asker's email never does.
Query Parameters
apiPublishableKeystringrequiredYour organization's publishable key, from Settings, API keys.
productSlugstringrequiredSlug of the product whose questions to list.
limitnumberHow many questions to return.
cursorstringThe nextCursor from the previous page.
POST /widgets/questions
Ask a question about a product. The question is recorded for the store to answer and published once a moderator approves it. The response also carries an instant answer generated from the product's published reviews, to read while the store writes a real one; it is null when the store has generated answers switched off or unavailable, which never stops the question being recorded.
Query Parameters
apiPublishableKeystringrequiredYour organization's publishable key, from Settings, API keys.
Body Parameters
productSlugstringrequiredSlug of the product the question is about.
questionstringrequiredThe shopper's question, up to 500 characters.
visitorTokenstringrequiredRandom id identifying the visitor's browser, used only for rate limiting. Only a hash of it is ever stored, and never with the question.
namestringThe name to show beside the question once it is published. Omit to ask anonymously.
emailstring (email)Where to send the answer. Never published, and used for nothing else. Omit to ask without leaving one.
POST /widgets/questions/{id}/answers
Answer another shopper's published question. The answer waits for the store to approve it before it appears. Only available when the store allows shoppers to answer, which GET /widgets/questions reports as allowShopperAnswers.
Path Parameters
idstring (uuid)requiredThe ID of the published question being answered.
Query Parameters
apiPublishableKeystringrequiredYour organization's publishable key, from Settings, API keys.
Body Parameters
answerstringrequiredWhat this shopper wants to tell the person who asked.
visitorTokenstringrequiredRandom id identifying the visitor's browser, used only for rate limiting.
namestringThe name to show above the answer. Omit to answer anonymously.