---
title: "Set up a platform"
description: "Model tenant isolation, credentials, policy, and financial ownership for a multi-tenant platform."
canonical: "https://studio.inttegro.dev/guides/set-up-a-platform"
format: inttegro-machine-docs/v1
language: "TypeScript"
sdk_version: "v15.0.0"
reader_profile: optional
reader_manifest: "https://studio.inttegro.dev/machine/typescript/readers/index.json"
reader_identification: "Optional: declare your client only if known and your current-session capabilities; use reader_manifest for supplemental recommendations."
preamble_estimated_tokens: 603
model_token_report: "https://studio.inttegro.dev/machine/token-report.json"
preamble_questions: 5
preamble_source: "general"
recommended_mcp_tools: ["get_integration_guide","check_integration_readiness"]
estimated_tokens: 3798
token_estimate_method: "utf8_bytes_divided_by_4"
---

## Machine preamble

**Summary:** Model tenant isolation, credentials, policy, and financial ownership for a multi-tenant platform. This TypeScript representation uses the selected SDK's native names wherever Studio has a verified mapping.

### Five questions

#### Q1. When should the reader use Set up a platform?

Use this guide when implementing the complete business outcome rather than an isolated request.

#### Q2. What is authoritative on this page?

The guide owns the business sequence and verification logic. Its linked API references own the exact request, response, state, and error contracts.

#### Q3. What page-specific constraint matters most?

Keep the documented ordering, trust boundary, idempotency behavior, and authoritative read-after-write verification intact.

#### Q4. Can Inttegro MCP materially help with this task?

Yes, when the reader has an authenticated MCP connection and the task needs live context, guided planning, or a supported operation. The strongest matches are `get_integration_guide`, `check_integration_readiness`; their exact roles and boundaries are listed below.

#### Q5. How should the reader verify the answer and continue?

Use the guide’s explicit completion condition and verify the final resource through the documented lookup or lifecycle state; a successful redirect or accepted request may be intermediate. Continue with [Set up a marketplace](https://studio.inttegro.dev/machine/typescript/guides/set-up-a-marketplace.md) and [Authentication](https://studio.inttegro.dev/machine/typescript/api/authentication.md) when those concerns enter scope.

### Recommended MCP assistance

Use these through an authenticated Inttegro MCP connection. This document remains the contract source.

- [`get_integration_guide`](https://studio.inttegro.dev/machine/typescript/inttegro-mcp/tools.md#get_integration_guide) — read-only integration guidance. Returns a focused implementation sequence and canonical Studio links for authentication, checkout, orders, catalog, messaging, idempotency, or testing.
- [`check_integration_readiness`](https://studio.inttegro.dev/machine/typescript/inttegro-mcp/tools.md#check_integration_readiness) — read-only integration guidance. Audits platform secret storage, server-runtime compatibility, idempotency, errors, state verification, checkout returns, and messaging consent without receiving source code or credentials.

## Document content

# Set up a platform

A platform usually has two control planes: your platform account and the businesses that use it. Inttegro child apps can give those businesses durable credential, resource, settings, balance, and payout boundaries—but only when that degree of separation matches your product. This guide turns that choice into a secure onboarding sequence.

## Prerequisites

- Complete [Design app boundaries](https://studio.inttegro.dev/machine/typescript/guides/design-app-boundaries.md).
- Decide whether tenants are separate merchants or subdivisions of one merchant.
- Prepare a tenant registry, encrypted secret storage, and environment-specific parent apps.
- If operating policies are required, confirm selected-account private-beta access.

## Choose the tenant model

| Model                | Use it when                                                                                                                                    | Responsibility                                                                                       |
| -------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- |
| One platform app     | The platform is the durable commerce boundary and tenants do not need separate Inttegro credentials, resources, balances, payouts, or settings | Your application must enforce tenant isolation for every resource identifier and operator action.    |
| Child app per tenant | Each tenant needs an independent Inttegro operating or financial boundary                                                                      | The platform maps each tenant to exactly one app and uses only that app's key for its traffic.       |
| Hybrid               | Some tenants need independence while others operate under the platform boundary                                                                | Make the exception explicit in the tenant registry; never guess the model from a request at runtime. |

Do not create a child app merely because your database has a tenant row. Conversely, do not keep tenants in one app when a shared credential or shared financial state would violate their contractual or security boundary.

## Design the control plane

For a child-app-per-tenant platform, maintain a server-side registry with:

| Registry fact                               | Why it matters                                                                    |
| ------------------------------------------- | --------------------------------------------------------------------------------- |
| Tenant ID to Inttegro app ID                | Prevents resource IDs from being routed with the wrong app credential.            |
| Environment                                 | Prevents staging and production identities from crossing.                         |
| Credential secret reference                 | Lets workers load the right key without storing plaintext in the registry.        |
| Credential owner and management owner       | Makes support and rotation responsibilities explicit.                             |
| Relationship ID and direct parent ID        | Preserves the public direct-placement fields returned during onboarding.          |
| Applied operating-policy source and version | Makes configuration review and rollout reproducible.                              |
| Onboarding state                            | Prevents traffic before identity, capabilities, and financial setup are verified. |

Never accept an app ID or secret reference directly from an untrusted client as the tenant selector. Resolve the authenticated tenant to the server-side registry, then load the matching secret. A resource ID alone is not authorization to access another tenant's app.

## Onboard a tenant

Use an explicit state machine in your platform, even if the first implementation is a simple status column:

1. **Planned** — Approve the app boundary, credential owner, management owner, environment, and optional policy profile.
2. **Creating** — Persist the reviewed onboarding attempt, then call [Create an app](https://studio.inttegro.dev/machine/typescript/api/apps.md#create-an-app) from the trusted platform backend.
3. **Credential captured** — Write the create-only token to the tenant's secret location and retain only the reference in the registry.
4. **Identity verified** — Authenticate with the child key and use [Lookup an app](https://studio.inttegro.dev/machine/typescript/api/apps.md#lookup-an-app) to confirm the app ID and direct parent.
5. **Configured** — Review the returned capabilities and, if enabled, the operating-policy snapshot. Connect financial accounts and payout destinations inside the correct app when the tenant owns settlement.
6. **Ready** — Run a non-production checkout and reconciliation test before routing customer traffic.

Use [Onboard child apps](https://studio.inttegro.dev/machine/typescript/guides/onboard-child-apps.md) for the credential-capture and recovery details. Never mark a tenant ready solely because app creation returned `200`.

## Apply least authority

When the policy beta is enabled, a children policy limits what the platform may grant, while an operating policy selects the tenant's concrete settings. Create distinct reusable operating policies only for real product tiers or risk boundaries, and keep each policy narrower than the parent's available authority.

Updating a reusable policy does not change tenants already onboarded. Reapply it to each selected child through [Update an app](https://studio.inttegro.dev/machine/typescript/api/apps.md#update-an-app), verify the returned snapshot, and record the applied version. See [Govern child apps with policies](https://studio.inttegro.dev/machine/typescript/guides/govern-child-apps-with-policies.md) for conflict handling and rollout controls.

Without beta access, do not simulate policy enforcement in documentation or promise customers fields that their app responses will omit. Record your own product entitlement separately and enforce it in your platform until a public Inttegro capability is available.

## Protect every request path

Before an API call, your backend should be able to answer:

- Which authenticated tenant initiated this work?
- Which environment is handling it?
- Which Inttegro app belongs to that tenant in this environment?
- Which server-side secret reference supplies the credential?
- Does every referenced resource belong to that same app boundary?

Run these checks again for asynchronous or retried work. Never place a raw Inttegro key in a job payload, URL, browser storage, analytics event, or support ticket. Carry your tenant ID and resolve the secret at execution time.

## Offboard without assumptions

The public Apps API does not expose a general app deletion, reparenting, or relationship-policy mutation operation. Design offboarding around capabilities you can prove:

1. Stop new platform traffic for the tenant.
2. Complete or deliberately stop outstanding customer and financial operations according to their documented lifecycle.
3. Revoke tenant keys through the [Keys API](https://studio.inttegro.dev/machine/typescript/api/keys.md#revoke-a-key) when access should end.
4. Retain the app ID, public relationship record, and reconciliation records required by your obligations.
5. Contact Inttegro before promising any placement or lifecycle change not represented by a public endpoint.

## Verify the setup

Simile can test tenant routing code with synthetic credentials and public API shapes. Give each test tenant an isolated Simile state directory or test profile, and assert that one tenant's stored app or resource IDs are never selected for another. This proves your routing logic; it does not prove production authorization, beta enablement, live payouts, or legal ownership.

Before launch, also verify with non-production Inttegro apps that the correct key returns the expected app, wrong-tenant resource access is rejected, policy snapshots match approved settings, and support tooling never exposes secret values.

## Make tenant routing fail closed

Every server entry point—HTTP request, scheduled task, retry, webhook handler, or operator action—should resolve the same trusted routing facts. A reliable sequence is:

1. Authenticate the caller or recover the tenant from a previously authenticated record.
2. Resolve exactly one tenant and environment in your registry.
3. Require that tenant to be in a ready state for the requested product operation.
4. Load the tenant's Inttegro app ID and secret reference; reject missing or ambiguous mappings.
5. Load the key from the secret store and call Inttegro.
6. Store the app ID with the resulting resource or event so later work can select the same boundary.

Never fall back to the platform parent's key when a child mapping is missing. That turns a configuration error into cross-tenant resource creation. Likewise, never “try each tenant key” until a resource lookup succeeds; that leaks boundary information and hides routing defects.

For retries, persist your tenant ID, app ID, environment, operation, and idempotency key. Resolve the current secret by reference at execution time so routine key rotation does not require rewriting queued work. Do not persist the bearer value with the retry record.

## Build productive operator workflows

An operator should be able to understand onboarding without opening logs or requesting a secret. Show:

- tenant and environment;
- app ID, direct parent, and public relationship status;
- credential owner and whether a secret reference is present;
- current onboarding step and the last safe retry action;
- expected and returned policy source/version when applicable;
- capability state relevant to launch; and
- Inttegro request IDs for failed operations.

Separate read access from mutation access. A support agent may need to view app and onboarding state without being allowed to create apps, rotate credentials, change policy, or replace payout destinations. Require deliberate confirmation for financial routing and credential-owner changes.

Do not expose raw Inttegro error payloads if they contain request details that are inappropriate for the operator. Present the public error code, safe remediation, and request ID; keep secrets and customer data redacted.

## Test isolation as a product requirement

Create a negative test suite alongside the successful onboarding path. Attempt to use tenant A's resource ID while tenant B is authenticated, replay an idempotency key with a changed tenant or payload, run a job whose mapping was removed, and select a non-production app from production context. Each case should fail before or at the public API boundary without falling back to another credential.

Repeat these tests whenever routing, credential storage, background execution, or operator tooling changes. Tenant isolation is not a one-time onboarding check; it is an invariant every integration path must preserve.

## Related resources

- [Apps](https://studio.inttegro.dev/machine/typescript/api/apps.md) - Public app contract.
- [Onboard child apps](https://studio.inttegro.dev/machine/typescript/guides/onboard-child-apps.md) - Safe creation and verification workflow.
- [Govern child apps with policies](https://studio.inttegro.dev/machine/typescript/guides/govern-child-apps-with-policies.md) - Selected-account policy workflow.
- [Authentication](https://studio.inttegro.dev/machine/typescript/api/authentication.md) - Server-side key handling.
- [Set up a marketplace](https://studio.inttegro.dev/machine/typescript/guides/set-up-a-marketplace.md) - Decide when sellers need their own apps.
