Related services: ReviewsService: lynkow.reviews.getBySlug(), lynkow.reviews.list(), lynkow.reviews.settings(), lynkow.reviews.submit()

Review

Interface

An approved customer review, as reviews.list() and reviews.getBySlug() return it. Free-text fields are HTML-sanitized. With a request locale, it also carries requestedLocale and isFallback from LocaleResolution.

Extends: LocaleResolution

Property

Type

Optional

Description

authorCity

string | null

Yes

Author's city. The key is absent unless the site shows author cities.

authorCompany

string | null

Yes

Author's company. The key is absent unless the site shows author companies.

authorName

string

No

Author's display name, 2 to 100 characters, e.g. 'Jane D.'.

authorPhotoUrl

string | null

Yes

Absolute URL of the author's photo. The key is absent unless the site shows author photos.

authorPosition

string | null

Yes

Author's job title. The key is absent unless the site shows author companies.

content

string | null

No

Review text, at most 5000 characters, without markup. null on an<br>imported review stored without text.

createdAt

string

No

ISO 8601 datetime the review was created, e.g. '2024-03-15T10:30:00.000+00:00'.

customFields

Record<string, unknown>

Yes

Answers to the site's extra questions, keyed by ReviewCustomField.id.<br>The key is absent when the review has none.

id

string

No

Review ID (UUID), e.g. '4a4358cb-defb-4738-9f8d-9f227fb2c663'.

isFallback

boolean

Yes

true when the record is served in another locale because requestedLocale has no translation.<br>Absent when the request carried no locale. Never true with fallback: false.

isFeatured

boolean

No

Whether an admin featured this review, e.g. for a testimonials block.

locale

string

No

Locale the review is written in, e.g. 'fr', also when it is served as a<br>fallback. Use it as the lang of the rendered review.

productId

string | null

No

Public ID (prod_...) of the linked product. null when the review links no<br>product, or the product is not published on the storefront.

productName

string | null

No

Free-text name of the product or service reviewed. null when not given.

rating

number

No

Rating from 1 (lowest) to 5 (highest), a whole number.

requestedLocale

string

Yes

BCP 47 locale code the request asked for (e.g. 'de'), as sent in the<br>locale request option or the client's configured locale.<br>Absent when the request carried no locale.

reviewDate

string

Yes

ISO 8601 date the review refers to, which an import can set in the past.<br>undefined when the review has none.

slug

string | null

No

Slug built from the author name and title, accepted by reviews.getBySlug().<br>null when none could be built.

title

string | null

No

Headline, at most 200 characters. null when the author gave none.


ReviewCustomField

Interface

One admin-defined extra question on the public review form.

Returned inside ReviewSettings.customFieldsSchema. Render one input per entry, keyed by id, and send the collected answers back as ReviewSubmitData.customFields.

Property

Type

Optional

Description

id

string

No

Stable key for this field. Use it as the input name and as the key in<br>the customFields object you submit.

label

string

No

Human-readable label to render next to the input.

options

{ label: string; value: string }[]

Yes

Choices for a 'select' field. undefined for every other type.

required

boolean

Yes

Whether the site marks the question as required. The API does not enforce<br>it, so validate it in your form. undefined means optional.

type

"number" | "text" | "select" | "url" | "date"

No

Input type to render:<br>- 'text': single-line text input<br>- 'number': numeric input<br>- 'select': dropdown, choices in options<br>- 'date': date picker<br>- 'url': URL input


ReviewSettings

Interface

The review form settings reviews.settings() returns. Moderation settings are not part of it.

Extends: LocaleResolution

Property

Type

Optional

Description

customFieldsSchema

ReviewCustomField[]

No

The extra questions the site owner added to the review form.<br>Empty array when none are configured. Render one input per entry and send<br>the answers back as ReviewSubmitData.customFields.

isFallback

boolean

Yes

true when the record is served in another locale because requestedLocale has no translation.<br>Absent when the request carried no locale. Never true with fallback: false.

locale

string

Yes

BCP 47 locale code of the record actually served (e.g. 'en', 'fr').<br>Equals requestedLocale unless isFallback is true.

publicSubmissionEnabled

boolean

No

Whether visitors may submit reviews. When false, reviews.submit() throws<br>FORBIDDEN with apiCode AUTHZ_PERMISSION_DENIED: hide the form.

requestedLocale

string

Yes

BCP 47 locale code the request asked for (e.g. 'de'), as sent in the<br>locale request option or the client's configured locale.<br>Absent when the request carried no locale.

requireEmail

boolean

No

Whether authorEmail is required. Without it, reviews.submit() throws<br>BAD_REQUEST with apiCode VALIDATION_FIELD_REQUIRED.


ReviewSubmitData

Interface

The review reviews.submit() sends. authorName, rating and content are required. The API drops any key not declared here.

Property

Type

Optional

Description

authorCity

string

Yes

Reviewer's city. Max 100 characters.

authorCompany

string

Yes

Reviewer's company. Max 100 characters.

authorEmail

string

Yes

Author's email address, never shown publicly. Required when<br>ReviewSettings.requireEmail is true.

authorName

string

No

Author's display name, shown publicly. 2 to 100 characters.

authorPhotoUrl

string

Yes

Absolute URL to a photo of the reviewer. Must be a valid URL.

authorPosition

string

Yes

Reviewer's job title. Max 100 characters.

content

string

No

Review text, 10 to 5000 characters. HTML tags are removed.

customFields

Record<string, unknown>

Yes

Answers to the site's extra questions, keyed by ReviewCustomField.id.

locale

string

Yes

Locale the review is written in, e.g. 'fr'. Defaults to the client locale,<br>then the site default. A multi-language site refuses a locale it does not enable with a 400.

productId

string | null

Yes

Product to link: its public ID (prod_...) or slug, published on the storefront.<br>Otherwise a 422 VALIDATION_ERROR on productId. null links none.

productName

string

Yes

The product or service being reviewed. Max 200 characters.

productSku

string

Yes

Merchant SKU of the reviewed product. Max 100 characters.

rating

number

No

Rating, a whole number from 1 to 5.

title

string

Yes

Headline, at most 200 characters.