Platform Businesses Guide

The Platform Business API lets you create and manage businesses on behalf of your platform's users. This is useful when onboarding new businesses programmatically — you create the business entity, attach members by email, and optionally auto-grant your platform access scopes.

Required scopes

business:create, business:read, business:update

How it works

Loading diagram…

When you create a business via the Platform API, the system:

  1. Creates the business entity with the provided name and address
  2. Looks up each member by email — if an Oncade account exists, they are attached immediately
  3. For members without an account, a placeholder is created so they can claim it later
  4. If grantScopes is provided, an automatic permission grant is created for your platform
!

Members must complete account setup. Creating a business via the API attaches members by email, but those users still need to:

  1. Create their Oncade account (or sign in if they already have one)
  2. Set up their payout wallet to receive funds

Until the business owner completes wallet setup, the business cannot receive payments through invoices or distributions. Direct your users to oncade.gg to complete their account setup.

Loading diagram…

Creating a business

curl -s -X POST \
  -H "Authorization: Bearer $PLATFORM_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Acme Games LLC",
    "address": {
      "line1": "123 Main Street",
      "line2": "Suite 400",
      "city": "Austin",
      "state": "TX",
      "postalCode": "78701",
      "country": "US"
    },
    "members": [
      {
        "email": "owner@acmegames.com",
        "roles": ["ADMIN"],
        "isOwner": true
      },
      {
        "email": "finance@acmegames.com",
        "roles": ["VIEWER"]
      }
    ],
    "grantScopes": [
      "invoice:create",
      "invoice:read",
      "invoice:send",
      "distribution:create",
      "distribution:read"
    ]
  }' \
  https://<host>/api/v1/platform/business

Required fields

FieldTypeDescription
namestringBusiness name. Must be unique across the platform.
membersarrayAt least one member. Each entry requires email and roles.

Member roles

RolePermissions
ADMINFull access to all business resources. Required for the business owner.
GAME_EDITORCan create and edit games, invoices, and other business content.
VIEWERRead-only access to business resources.

Set isOwner: true on exactly one member to designate them as the business owner. The owner's payout wallet is used as a fallback when the business does not have a dedicated payout wallet configured.

Address format

The address fields use US-style naming conventions but work for any country or region. Map your local address components to the following fields:

FieldRequiredUS exampleInternational usage
line1Yes123 Main StreetStreet address, building number, or equivalent
line2NoSuite 400Apartment, floor, unit, or additional address detail
cityYesAustinCity, town, municipality, or locality
stateYesTXState, province, prefecture, region, or equivalent subdivision
postalCodeYes78701ZIP code, postal code, or postcode in any local format
countryYesUSISO 3166-1 alpha-2 country code (e.g., US, GB, JP, DE)
i

International addresses. While the field names follow US conventions (state, postalCode), they accept values from any country. For example, a Japanese address would use "state": "Tokyo", "postalCode": "150-0002", "country": "JP". A UK address would use "state": "England", "postalCode": "SW1A 1AA", "country": "GB".

International address example

curl -s -X POST \
  -H "Authorization: Bearer $PLATFORM_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Tokyo Digital Co",
    "address": {
      "line1": "1-2-3 Shibuya",
      "city": "Tokyo",
      "state": "Tokyo",
      "postalCode": "150-0002",
      "country": "JP"
    },
    "members": [
      { "email": "admin@tokyodigital.co", "roles": ["ADMIN"], "isOwner": true }
    ]
  }' \
  https://<host>/api/v1/platform/business

Optional fields

FieldTypeDescription
logoUrlstringURL to the business logo image
addressobjectBusiness address (see fields above). When provided, all required address fields must be present.
payoutWalletstringWallet address for receiving payments. Can also be configured by the business owner later.
grantScopesarrayScopes to automatically grant your platform on this business. Skips the manual grant flow.

Auto-granting platform access

When you include grantScopes in the create request, a permission grant is automatically created for your platform on the new business. This eliminates the need for a separate link session or invite flow.

The scopes you request must be a subset of your platform's approved scopes. For example, if your platform has invoice:create and distribution:create approved, you can auto-grant either or both to a new business.

Managing businesses

Getting business details

Retrieve business information using the X-Target-Business-Id header.

curl -s \
  -H "Authorization: Bearer $PLATFORM_KEY" \
  -H "X-Target-Business-Id: $BIZ_ID" \
  https://<host>/api/v1/platform/business

Updating a business

Use PATCH to update business fields. At least one field must be provided.

curl -s -X PATCH \
  -H "Authorization: Bearer $PLATFORM_KEY" \
  -H "X-Target-Business-Id: $BIZ_ID" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Acme Games Inc",
    "address": {
      "line1": "456 Commerce Blvd",
      "city": "Austin",
      "state": "TX",
      "postalCode": "78702",
      "country": "US"
    }
  }' \
  https://<host>/api/v1/platform/business

Updatable fields: name, logoUrl, address, payoutWallet.

Payout wallet setup

The payout wallet determines where payments are routed for invoices and distributions. It can be configured in three ways:

  1. At creation time — pass payoutWallet in the create request
  2. Via API update — use PATCH /v1/platform/business to set it later
  3. By the business owner — the owner configures it through the Oncade dashboard
!

A payout wallet is required for payments. Platform invoice creation requires the business to have an explicit payoutWallet configured. If the wallet is not set, the API returns a 400 error. There is no automatic fallback to the owner's personal wallet for platform-created invoices.

Ensure your onboarding flow either sets payoutWallet at business creation time or prompts the business owner to configure it through the Oncade dashboard at oncade.gg before creating invoices.

API Quick Reference

All business endpoints are under /v1/platform/business.

MethodPathScopePurpose
POST/businessbusiness:createCreate a business with members
GET/businessbusiness:readGet business details
PATCH/businessbusiness:updateUpdate business details

References