Appbricx
Docs
FeaturesPricingStart free

Get started

OverviewWhat Appbricx isQuickstart with a coding agentQuickstart with the builderCore concepts

Guides

Data and tablesAccess and rolesBusiness rulesSign-inCustom screensRealtime and topicsWorkflows, schedules and webhooksServer functionsAI in your appPaymentsFilesMessagesIntegrationsVerifyPublishing, domains and rollbackOperating your appExport and self-hostSelf-host install

Tutorials

Build a booking app with Claude CodeMulti-user todo listClient portalSlack on new sign-upTemplates

Reference

Reference homeFrontend SDKHTTP APIMCP toolsCLIIntegrations catalogContract formatAI key resolutionRun Appbricx locally

Payments API

Offline and Stripe card payments against the app's order rows. The server computes every amount.

4 endpointsHTTP API referenceGuide: Payments

On this page
  1. Authentication
  2. Endpoints
  3. POST /pay/confirm
  4. GET /pay/methods
  5. GET /pay/for/:table/:id
  6. POST /pay/checkout

Base URL: your app's origin ($APP_ORIGIN): the published host, a custom domain, or the platform origin for the builder preview. Errors answer { ok: false, error: { code, message } } unless noted. Add x-appbricx-env: dev or prod to pick the database explicitly; otherwise the host decides (preview means dev, a published host means prod).

Authentication

App key + data marker
A project API key (dpk_c_… in browsers, bound to the app's origins; dpk_s_… on servers) or the builder preview token, plus the data-API marker header. With an app session (the header, or the appbricx_app_session cookie) the call acts as that user under row-level security; without one it acts as a guest. A server key may assert x-appbricx-app-user, x-appbricx-app-role and x-appbricx-app-org. Authorization: Bearer $APP_KEYx-appbricx-data-api: 1x-appbricx-app-session: $APP_SESSION (optional: acts as that user)

Endpoints

Confirm a card payment

POST/__appbricx/pay/confirm

After Stripe: ask Stripe about the order's open card payment and record paid, failed or processing.

Auth
App key + data marker: Authorization: Bearer $APP_KEYx-appbricx-data-api: 1x-appbricx-app-session: $APP_SESSION (optional: acts as that user)

Body

NameTypeDescription
tablerequiredstringThe order entity.
idrequiredstringThe order id.

Response

Response
{
  "ok": true,
  "status": "paid"
}

Errors

StatusCodeWhen
401UNAUTHORIZEDMissing or invalid Authorization bearer ("Missing Authorization: Bearer <token>", "Invalid API key").
400PARAMS_INVALIDThe x-appbricx-data-api: 1 header is missing.
403ORIGIN_NOT_ALLOWEDA browser key used from an origin it isn't bound to (ORIGIN_REQUIRED when there is no Origin at all).
429RATE_LIMITEDThe project's per-minute request budget is spent (600 for preview tokens and browser keys, 1200 for server keys by default).
404ORDER_NOT_FOUNDCan't read the order.
404NO_CARD_PAYMENTNo card payment started.
503STRIPE_NOT_CONNECTEDNo Stripe key.
502STRIPE_ERRORStripe failed.
409PAYMENT_MISMATCHThe session belongs to another order or project.
curl
curl -X POST "$APP_ORIGIN/__appbricx/pay/confirm" \
  -H "Authorization: Bearer $APP_KEY" \
  -H "x-appbricx-data-api: 1" \
  -H "x-appbricx-app-session: $APP_SESSION" \
  -H "content-type: application/json" \
  -d '{"table":"orders","id":"8c1d…"}'
fetch
const res = await fetch(`${APP_ORIGIN}/__appbricx/pay/confirm`, {
  method: "POST",
  headers: {
    Authorization: `Bearer ${APP_KEY}`,
    "x-appbricx-data-api": "1",
    "x-appbricx-app-session": APP_SESSION,
    "content-type": "application/json",
  },
  body: JSON.stringify({
    "table": "orders",
    "id": "8c1d…"
  }),
});
const data = await res.json();
if (!res.ok) throw new Error(data.error?.message ?? data.error ?? res.statusText);

Relatedapp.pay.confirm

Source: services/api/src/app-runtime/http/payments-routes.ts:126

Payment methods

GET/__appbricx/pay/methods

What the app accepts: offline always, card once Stripe is connected.

Auth
App key + data marker: Authorization: Bearer $APP_KEYx-appbricx-data-api: 1x-appbricx-app-session: $APP_SESSION (optional: acts as that user)

Response

Response
{
  "ok": true,
  "currency": "usd",
  "methods": [
    "offline",
    "card"
  ]
}

Errors

StatusCodeWhen
401UNAUTHORIZEDMissing or invalid Authorization bearer ("Missing Authorization: Bearer <token>", "Invalid API key").
400PARAMS_INVALIDThe x-appbricx-data-api: 1 header is missing.
403ORIGIN_NOT_ALLOWEDA browser key used from an origin it isn't bound to (ORIGIN_REQUIRED when there is no Origin at all).
429RATE_LIMITEDThe project's per-minute request budget is spent (600 for preview tokens and browser keys, 1200 for server keys by default).
curl
curl "$APP_ORIGIN/__appbricx/pay/methods" \
  -H "Authorization: Bearer $APP_KEY" \
  -H "x-appbricx-data-api: 1" \
  -H "x-appbricx-app-session: $APP_SESSION"
fetch
const res = await fetch(`${APP_ORIGIN}/__appbricx/pay/methods`, {
  headers: {
    Authorization: `Bearer ${APP_KEY}`,
    "x-appbricx-data-api": "1",
    "x-appbricx-app-session": APP_SESSION,
  },
});
const data = await res.json();
if (!res.ok) throw new Error(data.error?.message ?? data.error ?? res.statusText);

Relatedapp.pay.methods

Source: services/api/src/app-runtime/http/payments-routes.ts:169

Latest payment of an order

GET/__appbricx/pay/for/:table/:id

The order's latest ledger entry, or null.

Auth
App key + data marker: Authorization: Bearer $APP_KEYx-appbricx-data-api: 1x-appbricx-app-session: $APP_SESSION (optional: acts as that user)

Path parameters

NameTypeDescription
:tablerequiredstringThe order entity.
:idrequiredstringThe order id.

Response

Response
{
  "ok": true,
  "payment": {
    "method": "card",
    "provider": "stripe",
    "status": "paid",
    "amount_cents": 4250,
    "currency": "usd",
    "created_at": "…"
  }
}

Errors

StatusCodeWhen
401UNAUTHORIZEDMissing or invalid Authorization bearer ("Missing Authorization: Bearer <token>", "Invalid API key").
400PARAMS_INVALIDThe x-appbricx-data-api: 1 header is missing.
403ORIGIN_NOT_ALLOWEDA browser key used from an origin it isn't bound to (ORIGIN_REQUIRED when there is no Origin at all).
429RATE_LIMITEDThe project's per-minute request budget is spent (600 for preview tokens and browser keys, 1200 for server keys by default).
400BAD_TABLEInvalid table name.
404ORDER_NOT_FOUNDCan't read the order.
curl
curl "$APP_ORIGIN/__appbricx/pay/for/orders/8c1d…" \
  -H "Authorization: Bearer $APP_KEY" \
  -H "x-appbricx-data-api: 1" \
  -H "x-appbricx-app-session: $APP_SESSION"
fetch
const res = await fetch(`${APP_ORIGIN}/__appbricx/pay/for/orders/8c1d…`, {
  headers: {
    Authorization: `Bearer ${APP_KEY}`,
    "x-appbricx-data-api": "1",
    "x-appbricx-app-session": APP_SESSION,
  },
});
const data = await res.json();
if (!res.ok) throw new Error(data.error?.message ?? data.error ?? res.statusText);

Relatedapp.pay.status

Source: services/api/src/app-runtime/http/payments-routes.ts:177

Check out an order

POST/__appbricx/pay/checkout

Record payment for an order the caller can read. The total is Σ qty × catalog price over the order's line rows, computed on the server. card creates a Stripe Checkout session and returns its url.

Auth
App key + data marker: Authorization: Bearer $APP_KEYx-appbricx-data-api: 1x-appbricx-app-session: $APP_SESSION (optional: acts as that user)

Body

NameTypeDescription
tablerequiredstringThe contract's order entity.
idrequiredstringThe order id.
methodoptional"offline" | "card"Default offline.
returnUrloptionalstringcard only: a URL on one of the app's hosts to come back to.

Response

offline: { ok, method: "offline", status: "due", amountCents }. Card that can't start (no return URL, under 50 cents, Stripe not connected or failing): recorded offline with fallback: true and a note.

Response
{
  "ok": true,
  "method": "card",
  "status": "processing",
  "amountCents": 4250,
  "url": "https://checkout.stripe.com/c/pay/cs_…"
}

Errors

StatusCodeWhen
401UNAUTHORIZEDMissing or invalid Authorization bearer ("Missing Authorization: Bearer <token>", "Invalid API key").
400PARAMS_INVALIDThe x-appbricx-data-api: 1 header is missing.
403ORIGIN_NOT_ALLOWEDA browser key used from an origin it isn't bound to (ORIGIN_REQUIRED when there is no Origin at all).
429RATE_LIMITEDThe project's per-minute request budget is spent (600 for preview tokens and browser keys, 1200 for server keys by default).
400BAD_REQUESTtable or id missing.
400NOT_AN_ORDERNot the basket's order entity.
404ORDER_NOT_FOUNDThe caller can't read the order.
400BAD_CONTRACTThe basket names an invalid column.
curl
curl -X POST "$APP_ORIGIN/__appbricx/pay/checkout" \
  -H "Authorization: Bearer $APP_KEY" \
  -H "x-appbricx-data-api: 1" \
  -H "x-appbricx-app-session: $APP_SESSION" \
  -H "content-type: application/json" \
  -d '{"table":"orders","id":"8c1d…","method":"card","returnUrl":"https://tablefor.apps.appbricx.com/orders/8c1d"}'
fetch
const res = await fetch(`${APP_ORIGIN}/__appbricx/pay/checkout`, {
  method: "POST",
  headers: {
    Authorization: `Bearer ${APP_KEY}`,
    "x-appbricx-data-api": "1",
    "x-appbricx-app-session": APP_SESSION,
    "content-type": "application/json",
  },
  body: JSON.stringify({
    "table": "orders",
    "id": "8c1d…",
    "method": "card",
    "returnUrl": "https://tablefor.apps.appbricx.com/orders/8c1d"
  }),
});
const data = await res.json();
if (!res.ok) throw new Error(data.error?.message ?? data.error ?? res.statusText);

Relatedapp.pay.checkout

Source: services/api/src/app-runtime/http/payments-routes.ts:210

On this page

  1. Authentication
  2. Endpoints
  3. POST /pay/confirm
  4. GET /pay/methods
  5. GET /pay/for/:table/:id
  6. POST /pay/checkout
Appbricx

The backend, runtime and hosting for apps your coding agent builds. On our cloud, in yours, or on your own servers.

Features

Coding agents and MCPVerify testingBuilder consolePostgres databaseData APIRealtimeRow-level securitySign-in and authPaymentsWorkflows and jobsAI in your appIntegrationsBackups and rollbackHosting and domainsSelf-host and exportAll features

Product

ShowcasePricingFor coding agentsTemplatesPrivate cloudBring your own AI keyFAQ

Compare

Appbricx vs SupabaseLovable alternativeBolt alternativeFor freelancersFor agencies

Resources

DocumentationReferenceBlogSupportContact

© 2026 Appbricx. All rights reserved.

TermsPrivacyCookiesAcceptable Use