grid_view
YLP.
menu
Public API Reference

Ship against the real runtime surface.

This page documents both public namespaces: CMS endpoints under /api/public/v1 and storefront commerce endpoints under /api/v1/shop, including catalog reads, customer auth, checkout flows, signup, preview, plugin runtime, and Stripe webhooks.

campaign
Implementation note

The reference below is based on the live route implementation. Signup is verification-first, even if older OpenAPI snippets still imply one-step provisioning.

7
Route groups
28+
Endpoints covered
4
Auth modes
JSON
Primary format
Quick Start CMS + Shop
curl -X GET "https://api.yourlocalpage.com/api/public/v1/pages/home?locale=en" \
    -H "x-api-key: YOUR_PUBLIC_API_KEY"

curl -X GET "https://api.yourlocalpage.com/api/v1/shop/products/slug/starter-plan" \
    -H "x-api-key: YOUR_PUBLIC_API_KEY"
Authentication

Know which credential each route expects.

Most of the surface is API-key protected, but preview and Stripe webhooks intentionally use separate trust models. Your client integration should branch on that distinction rather than forcing one header onto every request.

vpn_key

Public API key

Most CMS and storefront reads use x-api-key, including /api/public/v1 content routes and /api/v1/shop catalog and checkout routes.

badge

Customer JWT

Customer login returns a storefront JWT. Use it for authenticated customer endpoints and optionally for checkout flows tied to a signed-in customer.

visibility

Preview token

Preview reads are token based and do not use x-api-key. They return draft composition and force noIndex SEO behavior.

verified

Stripe signature

Stripe webhooks are unauthenticated but require a valid stripe-signature header and access to the raw request body for verification.

Base endpoints
CMS namespace
https://api.yourlocalpage.com/api/public/v1

Published pages, content entries, preview, signup, plugin runtime, and webhook routes.

Shop namespace
https://api.yourlocalpage.com/api/v1/shop

Storefront catalog, customer auth, checkout, and subscription plan routes.

Platform conventions
translate

Locale resolution

Locale-aware routes validate against the site locale config and often fall back to the default locale when a requested locale has no published match.

view_array

Pagination

Paged list routes accept page and pageSize. Pages default to 50 items, generic content defaults to 20, and both cap pageSize at 100.

policy

Origin checks

API-key authenticated public routes also validate the request origin against site CORS settings and globally allowed public origins.

speed

Rate limits

Public routes can return 429 when traffic is too aggressive, so storefront and integration clients should back off and retry sensibly.

CMS delivery

Pages, content models, and blog payloads

These routes expose published page compositions and published entries. They all use the public site API key and return locale-aware JSON.

GET /block-types

List registered block types

Returns the block catalog for the site, including the editor field schema for each block type.

200 OK x-api-key header required
Operational notes
subdirectory_arrow_right

No locale or pagination parameters are used here.

subdirectory_arrow_right

Useful when a custom frontend needs to understand which block definitions exist for a site.

Request Fetch block registry
curl -X GET "https://api.yourlocalpage.com/api/public/v1/block-types" \
  -H "x-api-key: YOUR_PUBLIC_API_KEY"
Response 200 OK
{
  "data": {
    "id": "item_123",
    "slug": "starter-plan",
    "title": "List registered block types"
  }
}
GET /pages

List published pages

Returns a paged list of published pages for the site with SEO metadata and publication timestamps.

200 OK x-api-key header required
Parameters
locale

Locale tag such as en or en-US. Defaults to the site default locale.

Optional
page

1-based page number. Defaults to 1.

Optional
pageSize

Page size. Defaults to 50 and is capped at 100.

Optional
Operational notes
subdirectory_arrow_right

The response envelope includes data, page, pageSize, and total.

subdirectory_arrow_right

Invalid or unsupported locales return 400 with supportedLocales details.

Request List English pages
curl -G "https://api.yourlocalpage.com/api/public/v1/pages" \
  -H "x-api-key: YOUR_PUBLIC_API_KEY" \
  --data-urlencode "locale=en" \
  --data-urlencode "page=1" \
  --data-urlencode "pageSize=20"
Response 200 OK
{
  "data": [
    {
      "id": "item_123",
      "slug": "starter-plan",
      "title": "Starter Plan"
    }
  ],
  "page": 1,
  "pageSize": 20,
  "total": 1
}
GET /pages/{slug}

Fetch one published page by slug

Returns the published page object, including the content composition your frontend should render.

200 OK x-api-key header required
Parameters
slug

Page slug, for example home or api-docs.

Required
locale

Locale tag. If a locale-specific page is missing, the API falls back to the default locale when a locale was requested.

Optional
Operational notes
subdirectory_arrow_right

404 is returned when the page does not exist in either the requested locale or the default fallback locale.

subdirectory_arrow_right

This is the route the yourlocalpage SSR site already uses to resolve page metadata and composition data.

Request Fetch the home page
curl -X GET "https://api.yourlocalpage.com/api/public/v1/pages/home?locale=en" \
  -H "x-api-key: YOUR_PUBLIC_API_KEY"
Response 200 OK
{
  "data": {
    "id": "item_123",
    "slug": "starter-plan",
    "title": "Fetch one published page by slug"
  }
}
GET /content/{contentTypeSlug}

List published entries for a content type

Returns paged content entries for a single content type such as blog-post, case-study, or any custom model you publish.

200 OK x-api-key header required
Parameters
contentTypeSlug

The content type slug configured in CMS.

Required
locale

Locale tag. Defaults to the site default locale.

Optional
page

1-based page number. Defaults to 1.

Optional
pageSize

Page size. Defaults to 20 and is capped at 100.

Optional
Operational notes
subdirectory_arrow_right

Only entries with PUBLISHED status are returned.

subdirectory_arrow_right

The payload exposes the published data object under data.

Request List blog posts
curl -G "https://api.yourlocalpage.com/api/public/v1/content/blog-post" \
  -H "x-api-key: YOUR_PUBLIC_API_KEY" \
  --data-urlencode "page=1" \
  --data-urlencode "pageSize=12"
Response 200 OK
{
  "data": [
    {
      "id": "item_123",
      "slug": "starter-plan",
      "title": "Starter Plan"
    }
  ],
  "page": 1,
  "pageSize": 20,
  "total": 1
}
GET /content/{contentTypeSlug}/{slug}

Fetch one published entry by slug

Resolves a single published content entry within a content type. Locale fallback mirrors the page-by-slug behavior.

200 OK x-api-key header required
Parameters
contentTypeSlug

The content type slug configured in CMS.

Required
slug

Entry slug within that content type.

Required
locale

Locale tag with default-locale fallback when a locale was requested.

Optional
Operational notes
subdirectory_arrow_right

Returns 404 when the content type is missing or the entry is not published.

subdirectory_arrow_right

The response uses the published data payload instead of draft data.

Request Fetch a case study entry
curl -X GET "https://api.yourlocalpage.com/api/public/v1/content/case-study/acme-launch" \
  -H "x-api-key: YOUR_PUBLIC_API_KEY"
Response 200 OK
{
  "data": {
    "id": "item_123",
    "slug": "starter-plan",
    "title": "Fetch one published entry by slug"
  }
}
GET /blog/{slug}

Convenience route for blog posts

Shortcut for the published blog-post content type. Use it when your frontend treats blog posts as a first-class public surface.

200 OK x-api-key header required
Parameters
slug

The blog post slug.

Required
locale

Locale tag with fallback to the site default locale when requested.

Optional
Operational notes
subdirectory_arrow_right

Use this route when your frontend treats blog posts as a dedicated content surface.

Request Fetch one blog post
curl -X GET "https://api.yourlocalpage.com/api/public/v1/blog/product-launch-checklist" \
  -H "x-api-key: YOUR_PUBLIC_API_KEY"
Response 200 OK
{
  "data": {
    "id": "item_123",
    "slug": "starter-plan",
    "title": "Convenience route for blog posts"
  }
}
Storefront catalog

Products, categories, and subscription plans

These shop routes power storefront catalog browsing and are the endpoints your product grids and PDP pages should call.

GET /products

List storefront products

Returns a paged product list with optional text, category, price, and sort filters.

200 OK x-api-key header required
Parameters
page

1-based page number.

Optional
pageSize

Page size up to 100.

Optional
q

Free-text search string.

Optional
status

Optional status filter.

Optional
categoryId

Filter by category id.

Optional
category

Filter by category slug.

Optional
minPrice

Minimum price in minor units.

Optional
maxPrice

Maximum price in minor units.

Optional
sort

Sort expression such as createdAt:desc.

Optional
Operational notes
subdirectory_arrow_right

Use this as the primary PLP feed for collection pages and category browsing.

Request List products in a category
curl -G "https://api.yourlocalpage.com/api/v1/shop/products" \
  -H "x-api-key: YOUR_PUBLIC_API_KEY" \
  --data-urlencode "category=apparel" \
  --data-urlencode "page=1" \
  --data-urlencode "pageSize=24"
Response 200 OK
{
  "data": [
    {
      "id": "item_123",
      "slug": "starter-plan",
      "title": "Starter Plan"
    }
  ],
  "page": 1,
  "pageSize": 20,
  "total": 1
}
GET /products/slug/{slug}

Fetch one product by slug

Loads a single storefront product using its slug, which is typically the route segment used by the storefront.

200 OK x-api-key header required
Parameters
slug

Product slug.

Required
Operational notes
subdirectory_arrow_right

This is usually the most convenient PDP lookup route for public storefronts.

Request Load one product page
curl -X GET "https://api.yourlocalpage.com/api/v1/shop/products/slug/starter-plan" \
  -H "x-api-key: YOUR_PUBLIC_API_KEY"
Response 200 OK
{
  "data": {
    "id": "item_123",
    "slug": "starter-plan",
    "title": "Fetch one product by slug"
  }
}
GET /products/{id}

Fetch one product by id

Loads a single product when your storefront already has the canonical product id.

200 OK x-api-key header required
Parameters
id

Product id.

Required
Request Load one product by id
curl -X GET "https://api.yourlocalpage.com/api/v1/shop/products/prod_123" \
  -H "x-api-key: YOUR_PUBLIC_API_KEY"
Response 200 OK
{
  "data": {
    "id": "item_123",
    "slug": "starter-plan",
    "title": "Fetch one product by id"
  }
}
GET /categories

List categories

Returns categories either as a flat list or as a nested tree suitable for storefront navigation.

200 OK x-api-key header required
Parameters
page

1-based page number.

Optional
pageSize

Page size up to 100.

Optional
q

Free-text search string.

Optional
status

Optional status filter.

Optional
sort

Sort expression such as title:asc.

Optional
tree

When true, returns nested children arrays.

Optional
Operational notes
subdirectory_arrow_right

Use tree=true when you want to hydrate nav menus in one roundtrip.

Request Load a category tree
curl -G "https://api.yourlocalpage.com/api/v1/shop/categories" \
  -H "x-api-key: YOUR_PUBLIC_API_KEY" \
  --data-urlencode "tree=true"
Response 200 OK
{
  "data": [
    {
      "id": "item_123",
      "slug": "starter-plan",
      "title": "Starter Plan"
    }
  ],
  "page": 1,
  "pageSize": 20,
  "total": 1
}
GET /categories/slug/{slug}

Fetch one category by slug

Loads a category using the storefront-facing slug value.

200 OK x-api-key header required
Parameters
slug

Category slug.

Required
Request Load one category page
curl -X GET "https://api.yourlocalpage.com/api/v1/shop/categories/slug/apparel" \
  -H "x-api-key: YOUR_PUBLIC_API_KEY"
Response 200 OK
{
  "data": {
    "id": "item_123",
    "slug": "starter-plan",
    "title": "Fetch one category by slug"
  }
}
GET /categories/{id}

Fetch one category by id

Loads a category by its identifier.

200 OK x-api-key header required
Parameters
id

Category id.

Required
Request Load one category by id
curl -X GET "https://api.yourlocalpage.com/api/v1/shop/categories/cat_123" \
  -H "x-api-key: YOUR_PUBLIC_API_KEY"
Response 200 OK
{
  "data": {
    "id": "item_123",
    "slug": "starter-plan",
    "title": "Fetch one category by id"
  }
}
GET /subscriptions/plans

List active subscription plans

Returns the active subscription plans that a storefront can offer to signed-in customers.

200 OK x-api-key header required
Operational notes
subdirectory_arrow_right

This endpoint is publicly callable from storefronts and is useful for pricing pages or self-serve plan selection.

Request Load public plans
curl -X GET "https://api.yourlocalpage.com/api/v1/shop/subscriptions/plans" \
  -H "x-api-key: YOUR_PUBLIC_API_KEY"
Response 200 OK
{
  "data": [
    {
      "id": "item_123",
      "slug": "starter-plan",
      "title": "Starter Plan"
    }
  ],
  "page": 1,
  "pageSize": 20,
  "total": 1
}
Storefront auth

Customer login, registration, and profile sessions

Use these endpoints when your storefront allows customers to create accounts, sign in, or load their own profile data.

POST /auth/register

Register a customer account

Creates a storefront customer account for the current site.

201 Created x-api-key header required
Request body
email

Customer email address.

Required
password

Customer password.

Required
firstName

Optional first name.

Optional
lastName

Optional last name.

Optional
phone

Optional phone number.

Optional
verifyUrlBase

Base URL used when constructing the email verification link.

Optional
Request Register a customer
curl -X POST "https://api.yourlocalpage.com/api/v1/shop/auth/register" \
  -H "x-api-key: YOUR_PUBLIC_API_KEY" \
  -H "Content-Type: application/json" \
  -d "{
    "email": "buyer@example.com",
    "password": "CorrectHorseBatteryStaple1",
    "firstName": "Ada",
    "verifyUrlBase": "https://store.example.com/account/verify"
  }"
Response 201 Created
{
  "data": {
    "id": "item_123",
    "slug": "starter-plan",
    "title": "Register a customer account"
  }
}
POST /auth/verify-email

Verify customer email

Consumes the email verification token sent during signup or re-verification.

200 OK x-api-key header required
Request body
token

Email verification token.

Required
Request Verify customer email
curl -X POST "https://api.yourlocalpage.com/api/v1/shop/auth/verify-email" \
  -H "x-api-key: YOUR_PUBLIC_API_KEY" \
  -H "Content-Type: application/json" \
  -d "{ "token": "verification_token_here" }"
Response 200 OK
{
  "data": {
    "id": "item_123",
    "slug": "starter-plan",
    "title": "Verify customer email"
  }
}
POST /auth/request-email-verification

Re-send customer verification email

Requests another email verification message for a customer account.

200 OK x-api-key header required or customer JWT
Request body
verifyUrlBase

Base URL used when constructing the verification link.

Required
Operational notes
subdirectory_arrow_right

Useful when the customer lost the original verification email.

Request Request a new verification email
curl -X POST "https://api.yourlocalpage.com/api/v1/shop/auth/request-email-verification" \
  -H "x-api-key: YOUR_PUBLIC_API_KEY" \
  -H "Authorization: Bearer CUSTOMER_JWT" \
  -H "Content-Type: application/json" \
  -d "{ "verifyUrlBase": "https://store.example.com/account/verify" }"
Response 200 OK
{
  "data": {
    "id": "item_123",
    "slug": "starter-plan",
    "title": "Re-send customer verification email"
  }
}
POST /auth/login

Log in a customer account

Authenticates the customer and returns a customer JWT for subsequent account-scoped calls.

200 OK x-api-key header required
Request body
email

Customer email address.

Required
password

Customer password.

Required
Operational notes
subdirectory_arrow_right

Store the returned customer JWT for /account and authenticated checkout experiences.

Request Log in a customer
curl -X POST "https://api.yourlocalpage.com/api/v1/shop/auth/login" \
  -H "x-api-key: YOUR_PUBLIC_API_KEY" \
  -H "Content-Type: application/json" \
  -d "{ "email": "buyer@example.com", "password": "CorrectHorseBatteryStaple1" }"
Response 200 OK
{
  "ok": true,
  "data": {
    "token": "eyJhbGciOi...",
    "customer": {
      "id": "cust_123",
      "email": "buyer@example.com"
    }
  }
}
POST /auth/request-password-reset

Send a password reset email

Requests a one-time password reset link for the customer account.

200 OK x-api-key header required
Request body
email

Customer email address.

Required
resetUrlBase

Base URL used when constructing the reset link.

Required
Operational notes
subdirectory_arrow_right

The endpoint always responds successfully to avoid leaking whether an account exists.

Request Request a password reset
curl -X POST "https://api.yourlocalpage.com/api/v1/shop/auth/request-password-reset" \
  -H "x-api-key: YOUR_PUBLIC_API_KEY" \
  -H "Content-Type: application/json" \
  -d "{
    "email": "buyer@example.com",
    "resetUrlBase": "https://store.example.com/account/reset-password"
  }"
Response 200 OK
{
  "data": {
    "id": "item_123",
    "slug": "starter-plan",
    "title": "Send a password reset email"
  }
}
POST /auth/reset-password

Reset a customer password

Consumes a valid one-time reset token and writes the new password.

200 OK x-api-key header required
Request body
token

Password reset token.

Required
password

New password.

Required
Request Complete a password reset
curl -X POST "https://api.yourlocalpage.com/api/v1/shop/auth/reset-password" \
  -H "x-api-key: YOUR_PUBLIC_API_KEY" \
  -H "Content-Type: application/json" \
  -d "{ "token": "reset_token_here", "password": "NewStrongPassword1" }"
Response 200 OK
{
  "data": {
    "id": "item_123",
    "slug": "starter-plan",
    "title": "Reset a customer password"
  }
}
Checkout

Checkout sessions, payment intents, and order status

These routes drive payment creation and order-status polling for storefront checkout experiences.

POST /checkout/session

Create a hosted checkout session

Creates a pending order and returns a Stripe-hosted checkout URL.

201 Created x-api-key header required. Customer JWT optional.
Request body
customerId

Optional customer id when the storefront already knows it.

Optional
customerEmail

Optional customer email for guest checkout or prefill.

Optional
items

Array of { variantId, quantity } line items.

Required
tax

Tax amount in minor units.

Optional
shipping

Shipping amount in minor units.

Optional
notes

Optional order note.

Optional
successUrl

Absolute redirect URL after successful payment.

Required
cancelUrl

Absolute redirect URL if the customer cancels checkout.

Required
Request Create a hosted checkout session
curl -X POST "https://api.yourlocalpage.com/api/v1/shop/checkout/session" \
  -H "x-api-key: YOUR_PUBLIC_API_KEY" \
  -H "Content-Type: application/json" \
  -d "{
    "customerEmail": "buyer@example.com",
    "items": [{ "variantId": "var_123", "quantity": 2 }],
    "successUrl": "https://store.example.com/checkout/success",
    "cancelUrl": "https://store.example.com/cart"
  }"
Response 201 Created
{
  "data": {
    "orderId": "ord_123",
    "checkoutUrl": "https://checkout.stripe.com/c/pay/cs_test_123"
  }
}
POST /checkout/payment-intent

Create an embedded card payment flow

Creates a pending order and returns a Stripe PaymentIntent client secret for embedded checkout.

201 Created x-api-key header required. Customer JWT optional.
Request body
customerId

Optional customer id when the storefront already knows it.

Optional
customerEmail

Optional customer email for guest checkout or prefill.

Optional
items

Array of { variantId, quantity } line items.

Required
tax

Tax amount in minor units.

Optional
shipping

Shipping amount in minor units.

Optional
notes

Optional order note.

Optional
Request Create a payment intent
curl -X POST "https://api.yourlocalpage.com/api/v1/shop/checkout/payment-intent" \
  -H "x-api-key: YOUR_PUBLIC_API_KEY" \
  -H "Content-Type: application/json" \
  -d "{
    "customerEmail": "buyer@example.com",
    "items": [{ "variantId": "var_123", "quantity": 1 }]
  }"
Response 201 Created
{
  "data": {
    "orderId": "ord_123",
    "clientSecret": "pi_123_secret_456"
  }
}
GET /checkout/order/{id}

Poll checkout order status

Returns the non-sensitive order and payment status needed to drive post-checkout polling UIs.

200 OK x-api-key header required or customer JWT
Parameters
id

Order id returned by checkout creation.

Required
Operational notes
subdirectory_arrow_right

Use this route to confirm completion after redirect-based checkout or background payment confirmation.

Request Poll order status
curl -X GET "https://api.yourlocalpage.com/api/v1/shop/checkout/order/ord_123" \
  -H "x-api-key: YOUR_PUBLIC_API_KEY"
Response 200 OK
{
  "data": {
    "id": "ord_123",
    "status": "PAID",
    "paymentStatus": "SUCCEEDED"
  }
}
Provisioning

Public site signup and verification

Public signup is verification-first. These routes create the verification flow, resend codes, and finalize provisioning only after verification succeeds.

POST /signup

Start public signup

Validates the site slug and email, stores a pending signup verification, and emails a 6-digit code to the user.

200 OK No API key required
Request body
siteName

Display name for the site. 2 to 80 chars.

Required
siteSlug

Lowercase slug using letters, numbers, and hyphens.

Required
email

Admin email. Must be unique.

Required
password

Admin password. 8 to 200 chars.

Required
Operational notes
subdirectory_arrow_right

Returns verificationId, maskedEmail, codeLength, codeHint, expiresAt, resendAvailableAt, and resendCooldownSeconds.

subdirectory_arrow_right

409 is returned when the site slug already exists or the email is already registered.

subdirectory_arrow_right

429 is returned when an active pending verification is still inside the resend cooldown window.

Request Create a signup challenge
curl -X POST "https://api.yourlocalpage.com/api/public/v1/signup" \
  -H "Content-Type: application/json" \
  -d "{
    "siteName": "Acme Co",
    "siteSlug": "acme-co",
    "email": "owner@acme.test",
    "password": "CorrectHorseBatteryStaple1"
  }"
Response 200 OK
{
  "ok": true,
  "data": {
    "verificationId": "3c8a1f9a-2f5d-4fb9-9fd9-94a0a3e53c4b",
    "maskedEmail": "o***r@acme.test",
    "siteSlug": "acme-co",
    "codeLength": 6,
    "resendCooldownSeconds": 60
  }
}
POST /signup/resend

Refresh the email verification code

Issues a new code for an existing pending signup verification after the resend cooldown has elapsed.

200 OK No API key required
Request body
verificationId

UUID returned from POST /signup.

Required
Operational notes
subdirectory_arrow_right

410 is returned when the verification challenge has expired.

subdirectory_arrow_right

429 is returned if the resend cooldown has not elapsed yet.

subdirectory_arrow_right

The success payload has the same verification metadata shape as POST /signup.

Request Resend a verification code
curl -X POST "https://api.yourlocalpage.com/api/public/v1/signup/resend" \
  -H "Content-Type: application/json" \
  -d "{ "verificationId": "3c8a1f9a-2f5d-4fb9-9fd9-94a0a3e53c4b" }"
Response 200 OK
{
  "ok": true,
  "data": {
    "verificationId": "3c8a1f9a-2f5d-4fb9-9fd9-94a0a3e53c4b",
    "resendCooldownSeconds": 60,
    "codeHint": "4412"
  }
}
POST /signup/verify

Verify the code and provision the site

Confirms the 6-digit code, marks the signup request verified, and provisions the site plus admin account inside a transaction.

200 OK No API key required
Request body
verificationId

UUID returned from POST /signup.

Required
code

Six-digit verification code from the email.

Required
Operational notes
subdirectory_arrow_right

400 is returned for invalid codes. After too many invalid attempts the challenge is cancelled and must be restarted.

subdirectory_arrow_right

410 is returned when the code has expired.

subdirectory_arrow_right

The response includes the provisioned site details plus a verification object containing verificationId, email, and siteSlug.

Request Complete signup
curl -X POST "https://api.yourlocalpage.com/api/public/v1/signup/verify" \
  -H "Content-Type: application/json" \
  -d "{
    "verificationId": "3c8a1f9a-2f5d-4fb9-9fd9-94a0a3e53c4b",
    "code": "384112"
  }"
Response 200 OK
{
  "ok": true,
  "data": {
    "siteSlug": "acme-co",
    "adminEmail": "owner@acme.test",
    "verification": {
      "verificationId": "3c8a1f9a-2f5d-4fb9-9fd9-94a0a3e53c4b",
      "siteSlug": "acme-co"
    }
  }
}
Draft preview

Preview tokens and draft page reads

Preview links are token based and intentionally separate from the API-key protected public content surface.

GET /preview/{token}

Fetch a draft preview payload

Uses a preview token to resolve a page draft by slug and locale, then applies bindings before returning the page payload.

200 OK No API key required. Preview token required in path.
Parameters
token

Opaque preview token created by CMS.

Required
locale

Optional locale with fallback to the site default locale when requested.

Optional
Operational notes
subdirectory_arrow_right

404 is returned for invalid, expired, or cancelled preview tokens.

subdirectory_arrow_right

The returned SEO object is forced to noIndex=true to keep preview URLs out of search indexes.

subdirectory_arrow_right

Clients should still handle 429 responses like any other public route.

Request Load a preview page
curl -X GET "https://api.yourlocalpage.com/api/public/v1/preview/preview_token_here?locale=en"
Response 200 OK
{
  "data": {
    "slug": "home",
    "title": "Homepage Draft",
    "seo": {
      "noIndex": true
    },
    "composition": [
      {
        "type": "hero"
      }
    ]
  }
}
Plugin runtime

Forms and Stripe runtime endpoints

Plugin routes live under dedicated namespaces below the public API root and power forms and payment flows.

GET /plugins/ylp.forms/forms/{slug}

Fetch a form schema

Returns the form definition required to render a headless form experience on a custom website.

200 OK x-api-key header required
Parameters
slug

Form slug configured in the Forms plugin.

Required
Operational notes
subdirectory_arrow_right

The response includes slug, name, and schema.

subdirectory_arrow_right

404 is returned when the form slug does not exist.

Request Get a newsletter form schema
curl -X GET "https://api.yourlocalpage.com/api/public/v1/plugins/ylp.forms/forms/newsletter" \
  -H "x-api-key: YOUR_PUBLIC_API_KEY"
Response 200 OK
{
  "data": {
    "id": "item_123",
    "slug": "starter-plan",
    "title": "Fetch a form schema"
  }
}
POST /plugins/ylp.forms/forms/{slug}/submit

Submit a form response

Stores a submission and can trigger a success notification email depending on site settings.

202 Accepted x-api-key header required
Parameters
slug

Form slug configured in the Forms plugin.

Required
Request body
data

Arbitrary object containing the submitted field values.

Required
Operational notes
subdirectory_arrow_right

The response shape is { ok, successMessage }.

subdirectory_arrow_right

400 is returned for validation failures against the stored form schema.

Request Submit a contact form
curl -X POST "https://api.yourlocalpage.com/api/public/v1/plugins/ylp.forms/forms/contact/submit" \
  -H "x-api-key: YOUR_PUBLIC_API_KEY" \
  -H "Content-Type: application/json" \
  -d "{
    "data": {
      "name": "Ada Lovelace",
      "email": "ada@example.com",
      "message": "I need a multi-site demo."
    }
  }"
Response 202 Accepted
{
  "ok": true,
  "successMessage": "Thanks, your submission was received."
}
POST /plugins/ylp.stripe/payment-intents

Create a Stripe PaymentIntent

Creates the PaymentIntent server-side, stores the CMS payment row, and returns the clientSecret plus publishable key for Stripe.js.

201 Created x-api-key header required
Request body
amount

Amount in the smallest currency unit.

Required
currency

Optional ISO currency code. Plugin defaults apply when omitted.

Optional
description

Optional payment description.

Optional
metadata

Optional arbitrary metadata object stored with the payment.

Optional
Operational notes
subdirectory_arrow_right

The success payload includes paymentId, clientSecret, publishableKey, and currency.

subdirectory_arrow_right

400 is returned when validation fails or the Stripe plugin is not fully configured for the site.

Request Create a payment intent
curl -X POST "https://api.yourlocalpage.com/api/public/v1/plugins/ylp.stripe/payment-intents" \
  -H "x-api-key: YOUR_PUBLIC_API_KEY" \
  -H "Content-Type: application/json" \
  -d "{
    "amount": 4900,
    "currency": "usd",
    "description": "Starter plan",
    "metadata": { "plan": "starter" }
  }"
Response 201 Created
{
  "data": {
    "paymentId": "pay_123",
    "clientSecret": "pi_123_secret_456",
    "publishableKey": "pk_live_123",
    "currency": "usd"
  }
}
POST /plugins/ylp.stripe/checkout-sessions

Create a hosted Stripe Checkout session

Creates a Checkout Session, stores the payment row, and returns a checkoutUrl your frontend can redirect to immediately.

201 Created x-api-key header required
Request body
amount

Amount in the smallest currency unit.

Required
successUrl

Absolute URL Stripe redirects to after successful payment.

Required
cancelUrl

Absolute URL Stripe redirects to when checkout is cancelled.

Required
currency

Optional ISO currency code.

Optional
productName

Optional product label displayed in checkout.

Optional
description

Optional description for the payment record.

Optional
metadata

Optional metadata object stored with the payment.

Optional
Operational notes
subdirectory_arrow_right

The success payload includes paymentId, checkoutUrl, and currency.

subdirectory_arrow_right

Use this route when you want Stripe-hosted checkout rather than an embedded card flow.

Request Create a hosted checkout session
curl -X POST "https://api.yourlocalpage.com/api/public/v1/plugins/ylp.stripe/checkout-sessions" \
  -H "x-api-key: YOUR_PUBLIC_API_KEY" \
  -H "Content-Type: application/json" \
  -d "{
    "amount": 14900,
    "currency": "usd",
    "productName": "Growth Plan",
    "successUrl": "https://www.example.com/billing/success",
    "cancelUrl": "https://www.example.com/billing/cancel"
  }"
Response 201 Created
{
  "data": {
    "paymentId": "pay_123",
    "checkoutUrl": "https://checkout.stripe.com/c/pay/cs_test_123",
    "currency": "usd"
  }
}
GET /plugins/ylp.stripe/payments/{id}

Read payment status by id

Fetches the CMS-side payment record so a frontend can poll or hydrate payment status after returning from Stripe.

200 OK x-api-key header required
Parameters
id

Payment identifier returned when the payment or checkout session was created.

Required
Operational notes
subdirectory_arrow_right

The response includes amount, currency, description, status, metadata, createdAt, and updatedAt.

subdirectory_arrow_right

404 is returned when the payment id is unknown for the site.

Request Poll payment status
curl -X GET "https://api.yourlocalpage.com/api/public/v1/plugins/ylp.stripe/payments/pay_123" \
  -H "x-api-key: YOUR_PUBLIC_API_KEY"
Response 200 OK
{
  "data": {
    "id": "pay_123",
    "amount": 14900,
    "currency": "usd",
    "status": "SUCCEEDED"
  }
}
Inbound events

Stripe webhook delivery

Webhook handling is part of the live runtime surface and depends on raw-body signature verification.

POST /webhooks/ylp.stripe/{siteSlug}

Receive Stripe webhook events

Accepts Stripe events for a site and returns whether the event was handled. This endpoint is intended for Stripe servers, not browsers.

200 OK No API key. Valid stripe-signature header required.
Parameters
siteSlug

The site slug whose Stripe plugin configuration should be used for signature validation.

Required
Operational notes
subdirectory_arrow_right

The raw request body must be preserved for signature verification.

subdirectory_arrow_right

400 is returned for missing or invalid signatures, or when Stripe config is incomplete.

subdirectory_arrow_right

404 is returned when the site is unknown or the Stripe plugin is not enabled for that site.

Request Configured in Stripe dashboard
POST https://api.yourlocalpage.com/api/public/v1/webhooks/ylp.stripe/{siteSlug}
stripe-signature: t=...,v1=...
content-type: application/json
Response 200 OK
{
  "data": {
    "id": "item_123",
    "slug": "starter-plan",
    "title": "Receive Stripe webhook events"
  }
}
Integration checklist

Start with the content routes, then layer flows on top.

A typical integration sequence is: fetch published pages, hydrate content entries, wire preview for editors, add public signup if you need site self-service, and finally connect forms or Stripe when the experience needs runtime submissions or payments.

Suggested first calls
GET https://api.yourlocalpage.com/api/public/v1/pages/home
GET https://api.yourlocalpage.com/api/v1/shop/products