Skip to Content
ReferenceUCP API ReferenceREST API

REST API

All UCP REST endpoints live under https://{shop-domain}/api/ucp. Mutating endpoints accept Content-Type: application/json, except /oauth/*, which uses application/x-www-form-urlencoded. CORS is supported for browser-based integrations.

Service root: GET /api/ucp returns {"protocol":"ucp","version":"2026-08-25","status":"ok"} to confirm reachability. It is exempt from UCP-Agent, but subject to agent authentication unless anonymous access is enabled on the channel.

Standard headers

HeaderRequiredPurpose
X-API-KeyToken / User tierChannel (fq_secret_...) or platform (fq_platform_...) API key. Authorization: Bearer fq_... is accepted as a legacy fallback only and cannot be combined with a buyer token.
Signature, Signature-InputSigned tierRFC 9421 HTTP Message Signatures (with Signature-Agent and Content-Digest as required) instead of X-API-Key
AuthorizationUser tier (paired with agent credential)Bearer ucp_at_... buyer identity token. Always send together with X-API-Key or RFC 9421 signature headers; sending Bearer ucp_at_... alone returns 401.
UCP-AgentRequired on capability routesRFC 8941 dictionary profile="https://..." for capability negotiation. Omitting it on /api/ucp/* returns 400 invalid_profile_url (exempt: GET /api/ucp, OPTIONS, and /oauth/*).
Idempotency-KeyRecommended on create, complete, cancelPrevents duplicate side effects on cart create/cancel and checkout create/complete/cancel
Content-TypeOn POST/PUTapplication/json (application/x-www-form-urlencoded on /oauth/*)

See Authentication for tier details.

Catalog

MethodPathDescription
POST/catalog/searchSearch products (query, filters, pagination: { limit, cursor }, context)
POST/catalog/lookupBatch look up products by ids array (max 50), optional filters and context
POST/catalog/productGet a single product by product or variant id

Pagination on /catalog/search: Pass pagination: { "limit": 20, "cursor": "..." } (default 20, max 50). Top-level limit and cursor are accepted as a legacy fallback.

Lookup identifiers on /catalog/lookup: The ids array accepts product IDs, variant IDs, handles, SKUs, and GTINs/EANs, resolved in precedence order: direct product or variant ID, then handle, then SKU and GTIN/EAN (so a direct ID or handle takes precedence over a numeric SKU).

  • Batch limit: Duplicates are removed, and at most 50 unique identifiers are accepted per call. Sending more than 50 returns HTTP 400 with code request_too_large.
  • Multi-match: One SKU or GTIN can match up to 5 products or variants, returning all matched products and variants.
  • Response shape: Each matched product includes only the matching variants, and each variant carries inputs: [{ "id": "...", "match": "exact" | "featured" }] (exact for variant ID, SKU, or GTIN; featured for parent product ID or handle). Unmatched identifiers appear in messages as type: "info", code: "not_found".
  • Lookup filters: Optional filters (price, available, on_sale) narrow the returned variants; other filter keys return an unsupported_filter warning.

Single product on /catalog/product: Accepts one product ID or variant ID only (not handles, SKUs, or GTINs) and returns { "ucp": { ... }, "product": { ... } }.

Context object (optional on catalog calls): Pass language (BCP 47), currency (ISO 4217), address_country, address_region, and postal_code. See Money and localization for language fallback and currency rules.

Search responses include products and pagination (with has_next_page, cursor, and total_count). Lookup and product responses return full product objects including variants, pricing, and customization metadata, with lookup narrowing variants to the matched variants.

Carts

MethodPathDescription
POST/cartsCreate a cart from line_items
GET/carts/{id}Retrieve a cart
PUT/carts/{id}Replace all line items (full update)
POST/carts/{id}/cancelCancel a cart (clear all items)

Line items reference a variant by its canonical numeric variant ID (variants[].id from catalog search, lookup, or product) in item.id, plus quantity. Do not pass SKUs, handles, GTINs, or parent product IDs in item.id. Products with customizations require a customizations array; see Product customizations.

Cart responses include:

FieldDescription
id, currency, line_items, totalsCart state and totals (subtotal, optional negative discount entries, and total in minor currency units; prices are tax-inclusive so no separate tax entry is emitted)
continue_urlBuyer-facing URL to continue to checkout in the storefront
discountsIncluded when the discount capability is negotiated
messagesWarnings or recoverable errors (for example rejected coupon codes)
ucpProtocol metadata block

Idempotency: POST /carts and POST /carts/{id}/cancel honor the Idempotency-Key header. Keys are cached for 24 hours with a request fingerprint and scoped per channel and authenticated caller identity (per downstream profile origin for broker platform keys). Replaying the same request returns the original response; reusing a key with a different request payload or target returns HTTP 409 (idempotency_conflict).

Checkout sessions

MethodPathDescription
POST/checkout-sessionsCreate a session. Pass cart_id to check out an existing cart
GET/checkout-sessions/{id}Retrieve a session
PUT/checkout-sessions/{id}Update buyer, fulfillment, and discounts (restate line_items)
POST/checkout-sessions/{id}/completeComplete the session. Credentialed app payment instruments settle directly (or redirect to the provider); any remaining balance hands payment to com.finqu.hosted_checkout via continue_url
POST/checkout-sessions/{id}/cancelCancel the session and leave the cart in place

POST /checkout-sessions returns 201. POST /checkout-sessions, POST .../complete, and POST .../cancel honor Idempotency-Key with the same 24-hour TTL, caller scoping, and 409 idempotency_conflict behavior as carts.

Copy fulfillment method, group, and option IDs from the session instead of inventing them. When identity linking is negotiated and the request has no buyer token, the session includes an identity_optional message and checkout still proceeds as a guest.

See Getting started: Checkout for a runnable sequence.

Orders

MethodPathDescription
GET/orders/{id}Read one order

Token and Signed callers can read an order by the opaque public order ID returned on checkout without buyer linking.

To read orders as a linked buyer (User tier, scoped to that customer’s own orders), send Authorization: Bearer ucp_at_... with scope dev.ucp.shopping.order:read together with the agent’s own credential (X-API-Key: fq_secret_... or fq_platform_..., or RFC 9421 signature headers). Sending Authorization: Bearer ucp_at_... alone returns 401. A buyer token without dev.ucp.shopping.order:read returns 403 and an insufficient_scope WWW-Authenticate challenge. See Identity linking.

Locations

MethodPathDescription
POST/locations/searchSearch pickup locations (serves, context, distance, pagination)
POST/locations/lookupLook up pickup locations by ids (ids, serves, context, distance)

Both /locations/search and /locations/lookup require a postal_code in serves.address (preferred when serves.address is present) or in context. Omitting a postal code returns HTTP 200 with a validation_error message.

MethodPathDescription
GEThttps://{shop-domain}/buyBrowser purchase-link resolver (fields passed via query string)
GEThttps://{shop-domain}/buy/{items}Browser purchase-link resolver with compact {variant-id}:{qty} items

Permalink routes live on the storefront root outside /api/ucp, require no agent authentication, and return a 303 redirect (Cache-Control: no-store) to the initialized hosted checkout session. Read the advertised endpoint from dev.ucp.shopping.permalink in /.well-known/ucp.

Loyalty, buyer consent, and invoice payment terms extend the cart, checkout, catalog, and order payloads listed in the capability reference. Order webhook delivery and verification are covered in Responses and errors.

OAuth

MethodPathDescription
POST/oauth/tokenExchange an authorization code or refresh a token
POST/oauth/revokeRevoke an access or refresh token

Both endpoints take application/x-www-form-urlencoded and do not use the channel API key or UCP-Agent. See Identity linking.

Money and localization

  • All monetary amounts are integers in minor currency units (cents, öre, etc.).
  • Currency codes are ISO 4217 three-letter strings.
  • Country codes are ISO 3166-1 alpha-2 strings.
  • context.language (BCP 47) localizes product content on catalog and cart calls, falling back to the channel’s default language with a language_unavailable info message when unsupported.
  • context.currency does not convert prices. Prices always return in the store’s currency; on catalog calls, context.currency only determines whether filters.price applies (a mismatch emits a price_filter_ignored warning).

Product customizations

Many Finqu products support buyer customizations such as text fields, option groups, and required selections. The catalog returns customization definitions in variant metadata. When adding customized items to a cart:

  1. Search for or look up the product first.
  2. Read metadata.customizations on the chosen variant.
  3. Include a customizations array on each line item with { "id": "...", "value": "..." }, where id is the option ID (options[].id).
  4. Provide at least one selection for every required customization group.

Missing or invalid customizations return validation errors with field-level messages.