Search Documentation

Search for a documentation page...

Settings API

REST API endpoints for store settings and checkout consents.

Read and update general store settings, and manage the checkout consent checkboxes shown to customers. Sensitive configuration – API key hashes, Stripe credentials, and deploy config – is never exposed by these endpoints. Appearance, socials, brand kit, and loyalty have their own endpoints.

Get Settings

GET /api/v1/settings

Returns general store settings. The subdomain, domain, environment, and email-domain fields are read-only – they cannot be changed through this endpoint.

curl -H "Authorization: Bearer your_api_key" \
https://your-store.yns.store/api/v1/settings

Response

{
"name": "Acme Goods",
"description": "Handmade home essentials",
"currency": "USD",
"subdomain": "acme",
"domain": "shop.acme.com",
"environment": "live",
"emailDomain": "acme.com",
"emailDomainVerified": true,
"published": true,
"defaultLanguage": "en-US",
"enabledLanguages": { "en-US": true },
"enabledCurrencies": ["USD"],
"notificationEmail": "team@acme.com",
"contactRoutingEmails": { "sales": "sales@acme.com", "support": "help@acme.com" },
"outboundEmail": "hello@acme.com",
"aiInstructions": null,
"omnibus": false,
"taxBehavior": "exclusive",
"logo": null,
"welcomeOffer": null,
"newsletterPopup": null,
"newsletter": null,
"stockHold": null,
"invoiceSettings": null,
"emailTracking": null,
"blogSettings": null,
"bookings": null,
"cartRecommendations": null,
"checkoutAppearance": null,
"storeChat": null
}

Update Settings

PATCH /api/v1/settings

Partially updates general store settings. Only the fields you send are changed; read-only fields are ignored if included. Returns the full, updated settings object.

Grouped settings merge rule

Every grouped setting (the object fields below) follows one rule: send only the fields you are changing; null on a field clears that field; null on the entire group removes the whole group. A write never requires a read first.

Request Body – Top-level Fields

FieldTypeRequiredDescription
namestringNoPublic store name (min 1 char)
descriptionstring | nullNoShort store description
publishedbooleanNoWhether the storefront is live
currencystringNoBase currency (ISO code). Changing it re-denominates existing prices – a product at 29.99 becomes 29.99 of the new currency. Re-price the catalog afterwards.
defaultLanguagestringNoDefault storefront locale (e.g. en-US) – must be enabled in enabledLanguages
enabledLanguagesobjectNoPer-locale toggle map, e.g. { "en-US": true }
enabledCurrenciesstring[]NoISO currency codes customers can shop in besides the base currency
notificationEmailstring | nullNoWhere store notifications are sent
contactRoutingEmailsobject | nullNoMaps form routing keys to recipients, e.g. { "sales": "sales@acme.com" }. Max 20 entries. Pass null to remove.
outboundEmailstring | nullNoFrom-address for customer emails (empty string allowed)
aiInstructionsstring | nullNoCustom instructions for AI features (max 20,000 chars)
omnibusboolean | nullNoEU Omnibus price-history compliance
taxBehaviorstringNoHow prices are presented to shoppers: "inclusive" (shoppers see gross prices, tax included) or "exclusive" (shoppers see net prices, tax added at checkout). Prices are always stored net — see Prices and tax.
logoobject | nullNoStorefront logo. Pass null to remove.
logo.imageUrlstringYes (within logo)Logo image URL. External URLs are re-hosted on your store CDN.
logo.widthnumber | nullNoLogo width in pixels
logo.heightnumber | nullNoLogo height in pixels

Request Body – welcomeOffer

Newsletter welcome discount: automatically email a discount code to every new subscriber. Pass null to remove the group.

FieldTypeDescription
enabledbooleanWhether the welcome offer is active
modestring"shared" uses an existing coupon; "unique" (paid plans) generates a single-use code per subscriber
sharedCouponIdstring | nullUUID of an existing coupon. Required when mode is "shared" and enabled is true.
uniquePrefixstring | nullPrefix for generated codes (A–Z, 0–9, hyphen; max 20 chars)
discountTypestring"percentage" or "fixed"
discountValuenumber | nullDiscount amount. Required when mode is "unique".
expiryDaysnumberDays until the code expires (1–365)
reminderDaysBeforenumber | nullSend an expiry reminder this many days before (1–30); null sends none

Request Body – newsletterPopup

Newsletter popup copy, image, and timing. Only renders when the newsletterPopup module is enabled via PATCH /api/v1/modules. Pass null to remove the group.

FieldTypeDescription
delaySecondsnumberSeconds on the page before the popup opens (0–300)
headingstring | nullPopup headline (max 100 chars)
subheadingstring | nullSupporting line below the headline (max 200 chars)
ctaTextstring | nullSubscribe button label (max 50 chars)
teaserTextstring | nullLabel on the tab that reopens the popup after dismissal (max 50 chars)
imageUrlstring | nullImage shown beside the form. External URLs are re-hosted on your store CDN.

Request Body – newsletter

Newsletter signup mechanics.

FieldTypeDescription
doubleOptInbooleanRequire email confirmation before counting as subscribed. While on, the welcome offer is held back until they confirm.

Request Body – stockHold

Cart stock reservations at checkout, so two shoppers cannot buy the last unit.

FieldTypeDescription
enabledbooleanReserve stock once the shopper reaches checkout
holdMinutesnumberHow long the reservation lasts (5–60 minutes)

Request Body – invoiceSettings

Invoicing for orders. Pass null to remove the group.

FieldTypeDescription
enabledboolean | nullIssue invoices for orders
templatestringInvoice template identifier (max 100 chars)
cadencestringInvoice numbering cycle: "monthly" or "yearly"
notesstring | nullFooter note printed on every invoice (max 2,000 chars)

Request Body – emailTracking

Open and click tracking on outgoing store emails.

FieldTypeDescription
trackOpensbooleanEmbed a tracking pixel in outgoing store emails
trackClicksbooleanRewrite links in outgoing store emails to count clicks

Request Body – blogSettings

House style and model strength for AI blog generation. Requires the blog module.

FieldTypeDescription
systemPromptstring | nullRules prepended to every AI blog generation (max 20,000 chars)
modelTierstringModel strength: "regular", "extra", or "max"

Request Body – bookings

Defaults and rules for the Bookings module. Individual slots are managed at /api/v1/booking-slots. Requires the bookings module.

FieldTypeDescription
defaultSlotDurationnumberDefault slot length in minutes
bufferTimenumberMinutes held between consecutive slots
advanceBookingDaysnumberHow far ahead shoppers may book
cancellationHoursnumberCancellation cut-off before a slot starts
autoConfirmbooleanConfirm bookings without merchant review
requireApprovalbooleanHold every booking for merchant approval
sendRemindersbooleanEmail attendees before their slot
reminderHoursnumberHow long before the slot the reminder goes out

Request Body – cartRecommendations

Cart recommendation display. Requires the cartRecommendations module.

FieldTypeDescription
layoutstringWhere recommendations render: "inline" or "sidebar"

Request Body – checkoutAppearance

Branding of the YNS-hosted checkout page. This is checkout only – the rest of the storefront's look is the storefront's own code.

FieldTypeDescription
summaryPositionstring | nullDesktop side for the order summary: "left" or "right"
summaryBackgroundstring | nullSummary panel fill: "tint", "plain", or "custom"
summaryBackgroundColorstring | nullUsed when summaryBackground is "custom" (max 32 chars)
cornerRadiusstring | nullCorner rounding: "none", "small", "medium", "large"
payButtonLabelstring | nullPay button wording: "pay", "completeOrder", "placeOrder"
showHeaderboolean | nullShow the store header on the checkout page
showPolicyLinksboolean | nullShow the Terms / Privacy / Refund / Contact footer bar

Request Body – storeChat

Shopper-facing AI assistant: its persona, its knowledge, and its spend caps. Requires the storeChat module on a plan that grants it.

FieldTypeDescription
assistantNamestring | nullDisplay name of the assistant (max 60 chars)
greetingstring | nullFirst message the assistant opens with (max 300 chars)
suggestedQuestionsstring[] | nullUp to 4 starter prompts (120 chars each)
knowledgestring | nullMerchant-authored Markdown facts injected into the prompt. Never storefront-visible. (max 10,000 chars)
monthlyAllowancenumberMonthly credit budget (0–1,000,000)
merchantReservenumberCredits held back for the merchant (0–1,000,000)
visitorDailyTurnsnumberPer-visitor daily message cap (1–500)

Example

curl -X PATCH \
-H "Authorization: Bearer your_api_key" \
-H "Content-Type: application/json" \
-d '{
"description": "Now shipping worldwide",
"published": true,
"stockHold": { "enabled": true, "holdMinutes": 15 },
"checkoutAppearance": { "cornerRadius": "medium" }
}' \
https://your-store.yns.store/api/v1/settings

Response (200)

Returns the full settings object with the updated values.

Errors

StatusCondition
400sharedCouponId does not reference an existing coupon in this store (shared mode)
400discountValue is missing when using unique mode
400Unique welcome codes require a paid plan
400Logo or newsletter popup image URL is unreachable
400defaultLanguage is not enabled in enabledLanguages
422taxBehavior set to inclusive while the Stripe Tax module is enabled — Stripe Tax only works on tax-exclusive prices

List Checkout Consents

GET /api/v1/settings/checkout-consents

Returns the consent checkboxes shown at checkout, ordered by their position. Each consent includes both the stored TipTap content document and a rendered contentHtml string.

curl -H "Authorization: Bearer your_api_key" \
https://your-store.yns.store/api/v1/settings/checkout-consents

Response

{
"data": [
{
"id": "0191abc0-1234-7def-8000-000000000001",
"required": true,
"type": "general",
"content": {
"type": "doc",
"content": [
{
"type": "paragraph",
"content": [{ "type": "text", "text": "I accept the terms of service." }]
}
]
},
"contentHtml": "<p>I accept the terms of service.</p>"
}
],
"meta": {
"count": 1
}
}

POST /api/v1/settings/checkout-consents

Adds a consent checkbox to checkout. Pass content as a plain string (auto-wrapped into a single paragraph) or a TipTap JSON document (type: "doc") for rich text such as links. Invalid TipTap documents are rejected with a 400.

Request Body

FieldTypeRequiredDescription
contentstring | objectYesConsent text: plain string or a TipTap JSON document (type: "doc")
requiredbooleanNoWhether the consent must be accepted to complete checkout (default: false)
type"general" | "newsletter"Nonewsletter consents auto-subscribe the customer when accepted (default: general)
curl -X POST \
-H "Authorization: Bearer your_api_key" \
-H "Content-Type: application/json" \
-d '{"content": "Subscribe me to the newsletter", "type": "newsletter"}' \
https://your-store.yns.store/api/v1/settings/checkout-consents

Response (201)

{
"id": "0191abc0-1234-7def-8000-000000000002",
"required": false,
"type": "newsletter",
"content": {
"type": "doc",
"content": [
{
"type": "paragraph",
"content": [{ "type": "text", "text": "Subscribe me to the newsletter" }]
}
]
},
"contentHtml": "<p>Subscribe me to the newsletter</p>"
}

GET /api/v1/settings/checkout-consents/:id

Returns a single consent by ID. Returns 404 if the consent does not exist in this store.

curl -H "Authorization: Bearer your_api_key" \
https://your-store.yns.store/api/v1/settings/checkout-consents/0191abc0-1234-7def-8000-000000000001

PATCH /api/v1/settings/checkout-consents/:id

Updates an existing consent. Send only the fields you want to change. Use position to reorder a consent relative to its neighbors.

Request Body

FieldTypeRequiredDescription
contentstring | objectNoPlain string or TipTap JSON document (type: "doc")
requiredbooleanNoWhether the consent must be accepted to complete checkout
type"general" | "newsletter"NoConsent type
positionstringNoLexoRank ordering key – set between two neighbors' positions (from the list endpoint) to reorder
curl -X PATCH \
-H "Authorization: Bearer your_api_key" \
-H "Content-Type: application/json" \
-d '{"required": true}' \
https://your-store.yns.store/api/v1/settings/checkout-consents/0191abc0-1234-7def-8000-000000000001

Response (200)

Returns the updated consent with content and contentHtml.


DELETE /api/v1/settings/checkout-consents/:id

Removes a consent from checkout. Returns 404 if it does not exist.

curl -X DELETE \
-H "Authorization: Bearer your_api_key" \
https://your-store.yns.store/api/v1/settings/checkout-consents/0191abc0-1234-7def-8000-000000000001

Response (200)

{
"ok": true,
"deleted": 1
}