Platform API Reference

The Platform API enables partner platforms to integrate with Oncade and manage resources on behalf of businesses that have granted them access. Platforms can create campaigns, manage distributions, and handle account linking flows.

Business Linking & Permission Grants

Before a platform can perform operations on behalf of a business (like creating campaigns or distributions), the business must explicitly grant permission to the platform. This consent-based model ensures businesses maintain control over who can access their resources and what actions they can perform.

How Permission Grants Work

A grant represents an active permission relationship between a platform and a business. When a business grants access to a platform, they specify which scopes (permissions) the platform receives. Once established, the platform can use the X-Target-Business-Id header to perform operations on behalf of that business, limited to the granted scopes.

Two Methods for Establishing Grants

There are two ways for businesses to grant permissions to your platform:

Method 1: Link Sessions (Recommended for Onboarding)

Use link sessions when you want any business to be able to connect to your platform. This is ideal for self-service onboarding flows.

  1. Create a Link Session: Call POST /v1/platform/link-sessions with the scopes you need. You receive a unique URL and session key.
  2. Share the Link: Direct business admins to the link session URL. This can be embedded in your onboarding flow, sent via email, or displayed in your dashboard.
  3. Business Reviews & Approves: The business admin logs into Oncade, reviews the requested permissions, and either approves or declines.
  4. Receive Webhook: Your platform receives a Platform.Link.Completedwebhook with the businessId and grantId. If declined, you receivePlatform.Link.Declined.
  5. Start Operating: Use the businessId from the grant in yourX-Target-Business-Id header to perform operations on their behalf.

Tip: Include metadata when creating link sessions to track which of your users initiated the connection. This metadata is echoed back in webhooks.

Method 2: Direct Invites (For Known Businesses)

Use direct invites when you already know the business ID and want to request access directly. This is useful for partnership scenarios or when migrating existing relationships.

  1. Send an Invite: Call POST /v1/platform/invites with the targetbusinessId and requested scopes.
  2. Business Reviews: The business receives a notification and can review the invite in their Oncade dashboard.
  3. Business Responds: They approve or decline the invite. On approval, a grant is automatically created.
  4. Start Operating: Once approved, use the businessId in yourX-Target-Business-Id header to perform operations.

Managing Grants

Use GET /v1/platform/grants to list all active grants — businesses that have opted in to your platform. Each grant includes the businessId, the scopes they granted, and when the grant was created.

Either party can revoke a grant at any time. If your platform needs to update the permissions for a business (e.g., requesting additional scopes), you can revoke the existing grant viaPOST /v1/platform/grants/{grantId}/revoke and send a new invite or link session with the updated scope requirements.

Scope Intersection

The operations you can perform on behalf of a business depend on the intersection of:

  • Platform scopes: Scopes approved for your platform by Oncade
  • API key scopes: Scopes assigned to your specific API key
  • Grant scopes: Scopes the business granted to your platform

For example, if your platform has campaign:create approved, your API key includescampaign:create, but a business only granted campaign:read, you can only read their campaigns — not create new ones. Typically you will be requesting all scopes from a business. Scope granularity is provided for key level access rather than platform level access.


Common Headers

Every request must include the Authorization header with Bearer <platform_api_key> and X-Oncade-API-Version (defaults to v1). Business operations require X-Target-Business-Id from an active grant. Campaign operations (e.g. wallet balance, link details) require X-Campaign-Id. For POST, PUT, and PATCH requests, supply an Idempotency-Key to safely retry requests without creating duplicates.

Scopes

Platform API keys have scopes that determine what operations they can perform. Scopes are requested when creating keys and must be approved by Oncade (auto-approved in test environment).

Management Scopes (Auto-approved)

  • platform:read - View platform information
  • platform.key:manage - Manage API keys
  • platform.invite:manage - Manage business invites
  • platform.grant:manage - Manage business grants
  • platform.scope:request - Request new permission scopes

Business Operation Scopes (Require Approval)

  • Campaigns: campaign:create, campaign:read, campaign:update, campaign:delete, campaign:start, campaign:stop, campaign:payout-wallet:balance, campaign:users:link:read, campaign:users:link:create, campaign:users:link:remove, campaign:users:link:static campaign:users:wallet:read, campaign:events:create, campaign:funds:create, campaign:funds:read
  • Split Templates: splitTemplate:create, splitTemplate:read, splitTemplate:update, splitTemplate:delete
  • Distributions: distribution:create, distribution:read, distribution:funds:create, distribution:funds:read
  • Gifts: gift:create, gift:read
  • Invoices: invoice:create, invoice:read, invoice:update, invoice:send, invoice:cancel
  • Business Management: business:create, business:read, business:update, business:wallet:balance
  • Lookup: lookup:emails

Get Platform InfoGET

/v1/platform/me

Get the current platform's information including approved and pending scopes.

Required scope: platform:read

curl -X GET "https://oncade.gg/api/v1/platform/me" \
  -H "Authorization: Bearer PLATFORM_API_KEY" \
  -H "X-Oncade-API-Version: v1"

Example Response

{
  "platformId": "platform_abc123",
  "name": "My Platform",
  "description": "Platform description",
  "status": "active",
  "approvedScopes": [
    "platform:read",
    "campaign:create"
  ],
  "pendingScopes": [],
  "keyInfo": {
    "keyId": "key_xyz789",
    "environment": "test",
    "activeScopes": [
      "platform:read"
    ],
    "requestedScopes": [
      "platform:read",
      "campaign:create"
    ]
  }
}

Request Additional ScopesPOST

/v1/platform/me/scopes

Request new scopes for the platform. In test environment, scopes are auto-approved.

Required scope: platform.scope:request

Array of scope strings to request
curl -X POST "https://oncade.gg/api/v1/platform/me/scopes" \
  -H "Authorization: Bearer PLATFORM_API_KEY" \
  -H "X-Oncade-API-Version: v1" \
  -H "Idempotency-Key: a616a147-81b4-46c2-a476-87123c090607" \
  -H "Content-Type: application/json" \
  -d '{
  "scopes": [
    "campaign:create",
    "distribution:create"
  ]
}'

Example Response

{
  "requestId": "req_123",
  "requestedScopes": [
    "campaign:create",
    "distribution:create"
  ],
  "status": "approved"
}

List API KeysGET

/v1/platform/me/keys

List all API keys for this platform with computed statuses.

Required scope: platform.key:manage

curl -X GET "https://oncade.gg/api/v1/platform/me/keys" \
  -H "Authorization: Bearer PLATFORM_API_KEY" \
  -H "X-Oncade-API-Version: v1"

Example Response

{
  "keys": [
    {
      "keyId": "key_123",
      "status": "active",
      "requestedScopes": [
        "platform:read"
      ]
    }
  ],
  "total": 1
}

Create API KeyPOST

/v1/platform/me/keys

Create a new API key. The raw key value is only returned on creation - it cannot be retrieved later.

Required scope: platform.key:manage

Array of scope strings for the key
Optional label for the key
curl -X POST "https://oncade.gg/api/v1/platform/me/keys" \
  -H "Authorization: Bearer PLATFORM_API_KEY" \
  -H "X-Oncade-API-Version: v1" \
  -H "Idempotency-Key: 8bab687b-4c5c-4421-9cd3-9aa27e1e94fc" \
  -H "Content-Type: application/json" \
  -d '{
  "requestedScopes": [
    "platform:read",
    "campaign:create"
  ],
  "label": "Production Key"
}'

Example Response

{
  "key": {
    "keyId": "key_new123",
    "requestedScopes": [
      "platform:read",
      "campaign:create"
    ],
    "status": "active"
  },
  "rawKey": "pk_live_xxxxxxxxxxxx",
  "message": "Save this key securely - it cannot be retrieved again"
}

Get API Key DetailsGET

/v1/platform/me/keys/{keyId}

Get details for a specific key with computed status and scopes.

Required scope: platform.key:manage

Key identifier
curl -X GET "https://oncade.gg/api/v1/platform/me/keys/key_123" \
  -H "Authorization: Bearer PLATFORM_API_KEY" \
  -H "X-Oncade-API-Version: v1"

Example Response

{
  "key": {
    "keyId": "key_123",
    "status": "active"
  }
}

Revoke API KeyDELETE

/v1/platform/me/keys/{keyId}

Permanently revoke a key. This cannot be undone.

Required scope: platform.key:manage

Key identifier
curl -X DELETE "https://oncade.gg/api/v1/platform/me/keys/key_123" \
  -H "Authorization: Bearer PLATFORM_API_KEY" \
  -H "X-Oncade-API-Version: v1"

Example Response

{
  "message": "Key revoked successfully",
  "keyId": "key_123"
}

Rotate API KeyPOST

/v1/platform/me/keys/{keyId}/rotate

Start key rotation. Creates a new key with the same scopes and sets a grace period during which both keys are valid.

Required scope: platform.key:manage

Key identifier to rotate
Grace period in days (1-30, default 7)
curl -X POST "https://oncade.gg/api/v1/platform/me/keys/key_123/rotate" \
  -H "Authorization: Bearer PLATFORM_API_KEY" \
  -H "X-Oncade-API-Version: v1" \
  -H "Idempotency-Key: fa1289bd-949f-41fc-9350-270b9ce1b5c5" \
  -H "Content-Type: application/json" \
  -d '{
  "gracePeriodDays": 7
}'

Example Response

{
  "newKey": {
    "keyId": "key_new456"
  },
  "rawKey": "pk_live_yyyyyyyyyyyy",
  "oldKeyId": "key_123",
  "gracePeriodDays": 7
}

List GrantsGET

/v1/platform/grants

List all active grants - businesses that have opted in to your platform.

Required scope: platform.grant:manage

curl -X GET "https://oncade.gg/api/v1/platform/grants" \
  -H "Authorization: Bearer PLATFORM_API_KEY" \
  -H "X-Oncade-API-Version: v1"

Example Response

{
  "grants": [
    {
      "grantId": "grant_abc123",
      "businessId": "biz_xyz789",
      "businessName": "Awesome Games Inc",
      "grantedScopes": [
        "campaign:create"
      ],
      "createdAt": "2024-01-10T12:00:00.000Z"
    }
  ],
  "total": 1
}

Revoke GrantPOST

/v1/platform/grants/{grantId}/revoke

Revoke an active grant to allow sending a new invite with different permissions.

Required scope: platform.grant:manage

Grant identifier
curl -X POST "https://oncade.gg/api/v1/platform/grants/grant_abc123/revoke" \
  -H "Authorization: Bearer PLATFORM_API_KEY" \
  -H "X-Oncade-API-Version: v1" \
  -H "Idempotency-Key: e2d14535-e4a7-4b1b-b4c5-be35dc1b1200"

Example Response

{
  "success": true,
  "message": "Grant revoked. You can now send a new invite with updated permissions."
}

List InvitesGET

/v1/platform/invites

List all invites sent by this platform.

Required scope: platform.invite:manage

curl -X GET "https://oncade.gg/api/v1/platform/invites" \
  -H "Authorization: Bearer PLATFORM_API_KEY" \
  -H "X-Oncade-API-Version: v1"

Example Response

{
  "invites": [],
  "total": 0
}

Send Direct InvitePOST

/v1/platform/invites

Send an invite directly to a known business requesting access with specified scopes.

Required scope: platform.invite:manage

Target business ID
Array of scope strings to request
curl -X POST "https://oncade.gg/api/v1/platform/invites" \
  -H "Authorization: Bearer PLATFORM_API_KEY" \
  -H "X-Oncade-API-Version: v1" \
  -H "Idempotency-Key: 7e9e572c-174a-4a0d-81d8-f57cd94acdac" \
  -H "Content-Type: application/json" \
  -d '{
  "businessId": "65fa1234abcdef5678901234",
  "requestedScopes": [
    "campaign:create"
  ]
}'

Example Response

{
  "inviteId": "inv_123",
  "platformId": "platform_abc",
  "businessId": "65fa1234abcdef5678901234",
  "requestedScopes": [
    "campaign:create"
  ],
  "status": "pending"
}

Cancel InvitePOST

/v1/platform/invites/{inviteId}/cancel

Cancel a pending invite sent by the platform.

Required scope: platform.invite:manage

Invite identifier
curl -X POST "https://oncade.gg/api/v1/platform/invites/inv_123/cancel" \
  -H "Authorization: Bearer PLATFORM_API_KEY" \
  -H "X-Oncade-API-Version: v1" \
  -H "Idempotency-Key: db65e17b-1407-41a3-8e92-10ff779945f7"

Example Response

{
  "success": true,
  "message": "Invite cancelled successfully"
}

List CampaignsGET

/v1/platform/campaigns

Lists campaigns created by this platform for the target business.

Required scope: campaign:readRequires: X-Target-Business-Id header

curl -X GET "https://oncade.gg/api/v1/platform/campaigns" \
  -H "Authorization: Bearer PLATFORM_API_KEY" \
  -H "X-Oncade-API-Version: v1" \
  -H "X-Target-Business-Id: TARGET_BUSINESS_ID"

Example Response

{
  "campaigns": [
    {
      "campaignId": "cmp_abc123",
      "name": "Summer Promotion",
      "environment": "live",
      "status": "started"
    }
  ],
  "total": 1
}

Create CampaignPOST

/v1/platform/campaigns

Creates a new campaign for the target business. The contract is automatically deployed using the target business's payout wallet as the owner. If a webhook URL is provided, it will be validated and a webhook secret will be automatically generated.

Required scope: campaign:createRequires: X-Target-Business-Id header

Campaign name
Public-facing campaign name
Message included in payout emails
Array of { code, name, payoutAmount } objects
Optional webhook URL for campaign-specific webhooks. Must be HTTPS and will be validated. A webhook secret will be automatically generated.
curl -X POST "https://oncade.gg/api/v1/platform/campaigns" \
  -H "Authorization: Bearer PLATFORM_API_KEY" \
  -H "X-Oncade-API-Version: v1" \
  -H "X-Target-Business-Id: TARGET_BUSINESS_ID" \
  -H "Idempotency-Key: a73efc17-fca9-46d4-8756-5b696844a18e" \
  -H "Content-Type: application/json" \
  -d '{
  "name": "Summer Promotion",
  "publicName": "Summer Event",
  "events": [
    {
      "code": "signup",
      "name": "Account Created",
      "payoutAmount": 500
    }
  ],
  "webhookUrl": "https://example.com/webhooks/campaigns"
}'

Example Response

{
  "campaignId": "cmp_abc123",
  "name": "Summer Promotion",
  "environment": "live",
  "status": "created",
  "address": "0xabcdef...",
  "chain": "base"
}

Get CampaignGET

/v1/platform/campaigns/{campaignId}

Gets details of a campaign created by this platform.

Required scope: campaign:read

Campaign identifier
curl -X GET "https://oncade.gg/api/v1/platform/campaigns/cmp_abc123" \
  -H "Authorization: Bearer PLATFORM_API_KEY" \
  -H "X-Oncade-API-Version: v1"

Update CampaignPATCH

/v1/platform/campaigns/{campaignId}

Updates a campaign created by this platform. If a webhook URL is provided, it will be validated and a new webhook secret will be automatically generated. Set webhookUrl to null to clear the webhook configuration.

Required scope: campaign:update

Campaign identifier
Campaign name
Public-facing campaign name
Message included in payout emails
Array of { code, name, payoutAmount } objects
Optional webhook URL for campaign-specific webhooks. Must be HTTPS and will be validated. A new webhook secret will be automatically generated. Set to null to clear the webhook configuration.
curl -X PATCH "https://oncade.gg/api/v1/platform/campaigns/cmp_abc123" \
  -H "Authorization: Bearer PLATFORM_API_KEY" \
  -H "X-Oncade-API-Version: v1" \
  -H "Idempotency-Key: eb6bba04-6aed-421d-8920-cb303a10bebf" \
  -H "Content-Type: application/json" \
  -d '{
  "name": "Updated Campaign Name",
  "webhookUrl": "https://example.com/webhooks/campaigns"
}'

Delete CampaignDELETE

/v1/platform/campaigns/{campaignId}

Deletes a campaign created by this platform.

Required scope: campaign:delete

Campaign identifier
curl -X DELETE "https://oncade.gg/api/v1/platform/campaigns/cmp_abc123" \
  -H "Authorization: Bearer PLATFORM_API_KEY" \
  -H "X-Oncade-API-Version: v1"

Record Campaign EventPOST

/v1/platform/campaigns/{campaignId}/events

Records a campaign event and triggers the associated payout. The user identified by userRef must have an approved account link for this campaign. For one-time tips, provide payoutAmount with userRef (eventCode optional).

Required scope: campaign:events:create

Campaign identifier
The event code configured on the campaign; optional when payoutAmount provided (tip flow)
The transformed user ID from account linking
One-time tip amount in USD; when provided with userRef, skips event lookup
curl -X POST "https://oncade.gg/api/v1/platform/campaigns/cmp_abc123/events" \
  -H "Authorization: Bearer PLATFORM_API_KEY" \
  -H "X-Oncade-API-Version: v1" \
  -H "Idempotency-Key: afa14ef4-e885-4d11-bd37-855158eaceb6" \
  -H "Content-Type: application/json" \
  -d '{
  "eventCode": "signup",
  "userRef": "tuid_xyz789"
}'

Example Response

{
  "success": true,
  "message": "Event enqueued"
}

Start CampaignPUT

/v1/platform/campaigns/{campaignId}/start

Activates a campaign so it can begin accepting events and issuing payouts. The campaign must be in a created or stopped state.

Required scope: campaign:start

Campaign identifier
curl -X PUT "https://oncade.gg/api/v1/platform/campaigns/cmp_abc123/start" \
  -H "Authorization: Bearer PLATFORM_API_KEY" \
  -H "X-Oncade-API-Version: v1" \
  -H "Idempotency-Key: 5b3110c0-7f0d-4bcc-8bb5-1d58c45d317c"

Example Response

{
  "success": true,
  "message": "Start enqueued"
}

Stop CampaignPUT

/v1/platform/campaigns/{campaignId}/stop

Deactivates a campaign so it stops accepting events and issuing payouts. The campaign must be in a started state.

Required scope: campaign:stop

Campaign identifier
curl -X PUT "https://oncade.gg/api/v1/platform/campaigns/cmp_abc123/stop" \
  -H "Authorization: Bearer PLATFORM_API_KEY" \
  -H "X-Oncade-API-Version: v1" \
  -H "Idempotency-Key: 17875ca6-2e4c-4b51-adc4-b55bed42eb09"

Example Response

{
  "success": true,
  "message": "Stop enqueued"
}

Create Fund SessionPOST

/v1/platform/campaigns/{campaignId}/fund-sessions

Creates a new campaign funding session. The returned URL should be given to the campaign owner to complete funding in the hosted UI. Idempotent by Idempotency-Key header.

Required scope: campaign:funds:create

Campaign identifier
Optional metadata echoed back in responses
curl -X POST "https://oncade.gg/api/v1/platform/campaigns/cmp_abc123/fund-sessions" \
  -H "Authorization: Bearer PLATFORM_API_KEY" \
  -H "X-Oncade-API-Version: v1" \
  -H "Idempotency-Key: 71508cc6-bec4-420b-84eb-1e096788b240" \
  -H "Content-Type: application/json" \
  -d '{
  "metadata": {
    "referrer": "admin-dashboard"
  }
}'

Example Response

{
  "sessionKey": "cfs_abc123",
  "url": "https://oncade.gg/fund-campaign?session=cfs_abc123",
  "expiresAt": "2024-01-15T12:00:00.000Z"
}

List Campaign Linked UsersGET

/v1/platform/campaigns/{campaignId}/users

Returns a paginated list of users linked to a campaign. The campaign must be owned by the platform (createdByPlatformId).

Required scope: campaignLink:read

Campaign identifier
Page number (default 1)
Items per page (default 20, max 100)
curl -X GET "https://oncade.gg/api/v1/platform/campaigns/cmp_abc123/users?page=1&limit=20" \
  -H "Authorization: Bearer PLATFORM_API_KEY" \
  -H "X-Oncade-API-Version: v1"

Example Response

{
  "users": [
    {
      "linkId": "link_abc123",
      "userRef": "usr_xyz789",
      "email": "player@example.com",
      "name": "Player One",
      "linkedAt": "2025-01-15T12:00:00.000Z"
    }
  ],
  "pagination": {
    "page": 1,
    "limit": 20,
    "totalCount": 1,
    "totalPages": 1,
    "hasNextPage": false,
    "hasPrevPage": false
  }
}

Get Fund SessionGET

/v1/platform/campaigns/{campaignId}/fund-sessions/{handle}

Returns the current status of a funding session including whether it has been completed and the transaction details.

Required scope: campaign:funds:read

Campaign identifier
Fund session handle
curl -X GET "https://oncade.gg/api/v1/platform/campaigns/cmp_abc123/fund-sessions/cfs_abc123" \
  -H "Authorization: Bearer PLATFORM_API_KEY" \
  -H "X-Oncade-API-Version: v1"

Example Response

{
  "sessionKey": "cfs_abc123",
  "url": "https://oncade.gg/fund-campaign?session=cfs_abc123",
  "amountUsdc": 500,
  "status": "completed",
  "campaignId": "cmp_abc123",
  "expiresAt": "2024-01-15T12:00:00.000Z",
  "transactionHash": "0xabcdef...",
  "completedAt": "2024-01-12T08:30:00.000Z",
  "createdAt": "2024-01-10T12:00:00.000Z"
}

Get Campaign User Wallet BalanceGET

/v1/platform/campaigns/{campaignId}/users/{userRef}/wallet/balance

Gets the USDC wallet balance for a user linked to a campaign. Requires the platform to own the campaign (createdByPlatformId). Requires campaign:users:wallet:read scope.

Required scope: campaign:users:wallet:read

Campaign identifier
Transformed user ID within the campaign namespace
curl -X GET "https://oncade.gg/api/v1/platform/campaigns/cmp_abc123/users/trans-user-123/wallet/balance" \
  -H "Authorization: Bearer PLATFORM_API_KEY" \
  -H "X-Oncade-API-Version: v1"

Example Response

{
  "address": "0x1234...",
  "balance": "10.50"
}

Get Campaign Payout Wallet BalanceGET

/v1/platform/campaigns/{campaignId}/payout-wallet/balance

Returns the balance of the wallet used to pay out a campaign. Resolves the address from the business payout wallet, falling back to the business owner wallet.

Required scope: campaign:payout-wallet:balance

Campaign identifier
curl -X GET "https://oncade.gg/api/v1/platform/campaigns/cmp_abc123/payout-wallet/balance" \
  -H "Authorization: Bearer PLATFORM_API_KEY" \
  -H "X-Oncade-API-Version: v1"

Example Response

{
  "address": "0x1234567890abcdef1234567890abcdef12345678",
  "balance": "1500.00"
}

Get Business Wallet BalanceGET

/v1/platform/business/wallet-balance

Gets the USDC wallet balance for a business. Resolves the wallet by checking the business's payout wallet first, then falling back to the business owner's smart wallet address. Requires X-Target-Business-Id header.

Required scope: business:wallet:balanceRequires: X-Target-Business-Id header

curl -X GET "https://oncade.gg/api/v1/platform/business/wallet-balance" \
  -H "Authorization: Bearer PLATFORM_API_KEY" \
  -H "X-Oncade-API-Version: v1" \
  -H "X-Target-Business-Id: TARGET_BUSINESS_ID"

Example Response

{
  "address": "0x1234567890abcdef1234567890abcdef12345678",
  "balance": "1500.00"
}

List InvoicesGET

/v1/platform/invoices

Lists invoices for the target business. Supports pagination and status filtering.

Required scope: invoice:readRequires: X-Target-Business-Id header

Page number (default 1)
Items per page (default 50, max 100)
Filter by invoice status: draft, sent, processing, paid, cancelled
curl -X GET "https://oncade.gg/api/v1/platform/invoices?page=1&limit=20&status=sent" \
  -H "Authorization: Bearer PLATFORM_API_KEY" \
  -H "X-Oncade-API-Version: v1" \
  -H "X-Target-Business-Id: TARGET_BUSINESS_ID"

Example Response

{
  "invoices": [
    {
      "_id": "inv_abc123",
      "invoiceNumber": "INV-2026-1234567",
      "receiverName": "Acme Corp",
      "total": 5000,
      "status": "sent",
      "environment": "live"
    }
  ],
  "pagination": {
    "total": 1,
    "page": 1,
    "limit": 20,
    "totalPages": 1
  }
}

Create InvoicePOST

/v1/platform/invoices

Creates a new invoice for the target business. Requires an Idempotency-Key header. Defaults to draft status. Set status to "sent" to create and immediately send the invoice email. Returns 201 Created with a Location header. The payToTarget field should be "BUSINESS" — payment is routed to the business payout wallet. Environment is determined by your API key (test key = test invoice, live key = live invoice). Platform fees can be attached via the fees array.

Required scope: invoice:createRequires: X-Target-Business-Id header

Name of the invoice recipient
Recipient email address
Invoice date (ISO 8601)
Due date (ISO 8601, must be on or after date)
"BUSINESS" — routes payment to the business payout wallet
Line items: [{ description, quantity, rate (dollars), amount (dollars) }]
Custom invoice number (auto-generated if omitted)
Tax amount in dollars
Expected total for validation (rejected if differs by > $0.01)
Note displayed to recipient
"draft" (default) or "sent" to send immediately
Arbitrary key-value metadata
Platform fee line items: [{ label, percentage?, flat? (cents), recipientWallet }]
curl -X POST "https://oncade.gg/api/v1/platform/invoices" \
  -H "Authorization: Bearer PLATFORM_API_KEY" \
  -H "X-Oncade-API-Version: v1" \
  -H "X-Target-Business-Id: TARGET_BUSINESS_ID" \
  -H "Idempotency-Key: b82af16e-822a-40d7-ba99-7292c4fe8e77" \
  -H "Content-Type: application/json" \
  -d '{
  "receiverName": "Acme Corp",
  "receiverEmail": "billing@acme.com",
  "date": "2026-04-12",
  "dueDate": "2026-05-12",
  "payToTarget": "BUSINESS",
  "items": [
    {
      "description": "Consulting — April 2026",
      "quantity": 1,
      "rate": 5000,
      "amount": 5000
    }
  ]
}'

Example Response

{
  "_id": "inv_abc123",
  "invoiceNumber": "INV-2026-1234567",
  "receiverName": "Acme Corp",
  "receiverEmail": "billing@acme.com",
  "total": 5000,
  "status": "draft",
  "paymentSummary": {
    "invoiceAmount": 5000,
    "payerFee": 25,
    "totalCharged": 5025
  },
  "publicInvoiceId": "uuid-...",
  "environment": "live"
}

Get InvoiceGET

/v1/platform/invoices/{invoiceId}

Gets details of a single invoice. The invoice must belong to the target business and match the authenticated environment.

Required scope: invoice:readRequires: X-Target-Business-Id header

Invoice identifier
curl -X GET "https://oncade.gg/api/v1/platform/invoices/inv_abc123" \
  -H "Authorization: Bearer PLATFORM_API_KEY" \
  -H "X-Oncade-API-Version: v1" \
  -H "X-Target-Business-Id: TARGET_BUSINESS_ID"

Update InvoicePUT

/v1/platform/invoices/{invoiceId}

Updates a non-terminal invoice (draft or sent) with full body replacement. Totals and payouts are recalculated, but fee line items are determined at creation time and not recalculated on update. Cannot modify paid or cancelled invoices.

Required scope: invoice:updateRequires: X-Target-Business-Id header

Invoice identifier
Recipient name
Recipient email
Invoice date
"BUSINESS"
Line items
curl -X PUT "https://oncade.gg/api/v1/platform/invoices/inv_abc123" \
  -H "Authorization: Bearer PLATFORM_API_KEY" \
  -H "X-Oncade-API-Version: v1" \
  -H "X-Target-Business-Id: TARGET_BUSINESS_ID" \
  -H "Idempotency-Key: 9d77eadd-8725-43f4-b919-07017e0b8abd" \
  -H "Content-Type: application/json" \
  -d '{
  "receiverName": "Acme Corp",
  "receiverEmail": "billing@acme.com",
  "date": "2026-04-12",
  "payToTarget": "BUSINESS",
  "items": [
    {
      "description": "Consulting — April 2026",
      "quantity": 1,
      "rate": 7500,
      "amount": 7500
    }
  ]
}'

Send InvoicePOST

/v1/platform/invoices/{invoiceId}/send

Transitions a draft invoice to sent and triggers the delivery email to the recipient. Only valid from draft status.

Required scope: invoice:sendRequires: X-Target-Business-Id header

Invoice identifier
curl -X POST "https://oncade.gg/api/v1/platform/invoices/inv_abc123/send" \
  -H "Authorization: Bearer PLATFORM_API_KEY" \
  -H "X-Oncade-API-Version: v1" \
  -H "X-Target-Business-Id: TARGET_BUSINESS_ID" \
  -H "Idempotency-Key: 8f3b256a-a778-4993-806e-b07a3c255a94"

Example Response

{
  "_id": "inv_abc123",
  "status": "sent",
  "invoiceNumber": "INV-2026-1234567"
}

Cancel InvoicePOST

/v1/platform/invoices/{invoiceId}/cancel

Cancels a non-terminal invoice. Valid from draft or sent status. Cancelled is a terminal state.

Required scope: invoice:cancelRequires: X-Target-Business-Id header

Invoice identifier
curl -X POST "https://oncade.gg/api/v1/platform/invoices/inv_abc123/cancel" \
  -H "Authorization: Bearer PLATFORM_API_KEY" \
  -H "X-Oncade-API-Version: v1" \
  -H "X-Target-Business-Id: TARGET_BUSINESS_ID" \
  -H "Idempotency-Key: 595b0f43-bba6-4599-b1dd-7142b1e68565"

Example Response

{
  "_id": "inv_abc123",
  "status": "cancelled",
  "invoiceNumber": "INV-2026-1234567"
}

Export Invoices (CSV)GET

/v1/platform/invoices/export

Exports invoices for the target business as a CSV file. Supports date range and invoice ID filtering.

Required scope: invoice:readRequires: X-Target-Business-Id header

Start date filter (ISO 8601)
End date filter (ISO 8601)
Comma-separated invoice IDs to filter
curl -X GET "https://oncade.gg/api/v1/platform/invoices/export" \
  -H "Authorization: Bearer PLATFORM_API_KEY" \
  -H "X-Oncade-API-Version: v1" \
  -H "X-Target-Business-Id: TARGET_BUSINESS_ID"

Create BusinessPOST

/v1/platform/business

Creates a new business with members. Requires an Idempotency-Key header. Returns 201 Created with a Location header. Members are attached by email — if they have an Oncade account, they are linked immediately; otherwise a placeholder is created. Optionally include grantScopes to auto-grant your platform access. Address fields use US-style naming (line1, city, state, postalCode, country) but accept values from any country or region.

Required scope: business:create

Business name (must be unique)
Array of { email, roles: string[], isOwner?: boolean }
{ line1, line2?, city, state, postalCode, country }
URL to business logo
Wallet address for receiving payments
Scopes to auto-grant to your platform on this business
curl -X POST "https://oncade.gg/api/v1/platform/business" \
  -H "Authorization: Bearer PLATFORM_API_KEY" \
  -H "X-Oncade-API-Version: v1" \
  -H "Idempotency-Key: d2b8dbbb-6cbe-40fe-8e23-e2240dce4a36" \
  -H "Content-Type: application/json" \
  -d '{
  "name": "Acme Games LLC",
  "members": [
    {
      "email": "owner@acmegames.com",
      "roles": [
        "ADMIN"
      ],
      "isOwner": true
    },
    {
      "email": "dev@acmegames.com",
      "roles": [
        "GAME_EDITOR"
      ]
    }
  ],
  "address": {
    "line1": "123 Main Street",
    "city": "Austin",
    "state": "TX",
    "postalCode": "78701",
    "country": "US"
  },
  "grantScopes": [
    "invoice:create",
    "invoice:read",
    "invoice:send"
  ]
}'

Example Response

{
  "business": {
    "_id": "65fa1234abcdef5678901234",
    "name": "Acme Games LLC"
  },
  "members": [
    {
      "userId": "user_abc123",
      "email": "owner@acmegames.com",
      "roles": [
        "ADMIN"
      ],
      "isOwner": true
    },
    {
      "userId": "user_def456",
      "email": "dev@acmegames.com",
      "roles": [
        "GAME_EDITOR"
      ],
      "isOwner": false
    }
  ],
  "grant": {
    "_id": "grant_xyz789",
    "grantedScopes": [
      "invoice:create",
      "invoice:read",
      "invoice:send"
    ],
    "status": "active"
  }
}

Get BusinessGET

/v1/platform/business

Returns details for the targeted business. Requires X-Target-Business-Id header.

Required scope: business:readRequires: X-Target-Business-Id header

curl -X GET "https://oncade.gg/api/v1/platform/business" \
  -H "Authorization: Bearer PLATFORM_API_KEY" \
  -H "X-Oncade-API-Version: v1" \
  -H "X-Target-Business-Id: TARGET_BUSINESS_ID"

Example Response

{
  "_id": "biz_abc123",
  "name": "Acme Games LLC",
  "address": {
    "line1": "123 Main Street",
    "city": "Austin",
    "state": "TX",
    "postalCode": "78701",
    "country": "US"
  },
  "payoutWallet": "0x1234...abcd"
}

Update BusinessPATCH

/v1/platform/business

Updates the targeted business details. At least one field must be provided. Updatable fields: name, logoUrl, address, payoutWallet.

Required scope: business:updateRequires: X-Target-Business-Id header

Business name
Logo URL (null to clear)
{ line1, line2?, city, state, postalCode, country }
Wallet address
curl -X PATCH "https://oncade.gg/api/v1/platform/business" \
  -H "Authorization: Bearer PLATFORM_API_KEY" \
  -H "X-Oncade-API-Version: v1" \
  -H "X-Target-Business-Id: TARGET_BUSINESS_ID" \
  -H "Idempotency-Key: cb902976-b534-46ad-b39c-9031bd892207" \
  -H "Content-Type: application/json" \
  -d '{
  "name": "Acme Games Inc",
  "payoutWallet": "0xnew...wallet"
}'

Example Response

{
  "_id": "biz_abc123",
  "name": "Acme Games Inc",
  "payoutWallet": "0xnew...wallet"
}

List DistributionsGET

/v1/platform/distributions

Lists distributions created by this platform for the target business.

Required scope: distribution:readRequires: X-Target-Business-Id header

Page number (default 1)
Items per page (default 20, max 100)
Filter by distribution status
curl -X GET "https://oncade.gg/api/v1/platform/distributions?page=1&limit=20" \
  -H "Authorization: Bearer PLATFORM_API_KEY" \
  -H "X-Oncade-API-Version: v1" \
  -H "X-Target-Business-Id: TARGET_BUSINESS_ID"

Example Response

{
  "distributions": [],
  "pagination": {
    "total": 0,
    "page": 1,
    "limit": 20,
    "totalPages": 1
  }
}

Create DistributionPOST

/v1/platform/distributions

Creates a new distribution for the target business. Can use a saved template or provide one-time recipients.

Required scope: distribution:createRequires: X-Target-Business-Id header

Use a saved split template
One-time recipients array
Total amount in cents
Split mode: percentage or fixed
Optional memo
Optional fee line items. Each entry: { label: string, percentage?: number (0-100), flat?: number (cents), feeType?: string, recipientWallet: string }. percentage and flat default to 0. feeType defaults to flat_rate_plus_percentage; also accepts per_payout_plus_percentage. Fees are added on top of the distribution amount.
curl -X POST "https://oncade.gg/api/v1/platform/distributions" \
  -H "Authorization: Bearer PLATFORM_API_KEY" \
  -H "X-Oncade-API-Version: v1" \
  -H "X-Target-Business-Id: TARGET_BUSINESS_ID" \
  -H "Idempotency-Key: 2e201351-5bf7-4449-acf9-804995e6cb63" \
  -H "Content-Type: application/json" \
  -d '{
  "recipients": [
    {
      "email": "dev1@example.com",
      "name": "Developer 1",
      "percentage": 60
    },
    {
      "email": "dev2@example.com",
      "name": "Developer 2",
      "percentage": 40
    }
  ],
  "totalAmountCents": 100000,
  "mode": "percentage",
  "memo": "Q1 Revenue Share",
  "fees": [
    {
      "label": "Platform Fee",
      "percentage": 3,
      "flat": 0,
      "recipientWallet": "0x1234...abcd"
    }
  ]
}'

Example Response

{
  "_id": "abc123",
  "totalAmountCents": 100000,
  "totalFeeCents": 8000,
  "feeLineItems": [
    {
      "label": "Service Fee",
      "percentageRate": 5,
      "flatRateCents": 0,
      "amountCents": 5000,
      "feeType": "per_payout_plus_percentage",
      "status": "pending"
    },
    {
      "label": "Platform Fee",
      "percentageRate": 3,
      "flatRateCents": 0,
      "amountCents": 3000,
      "feeType": "flat_rate_plus_percentage",
      "status": "pending"
    }
  ],
  "status": "pending",
  "lineItems": [
    "..."
  ]
}

Preview Distribution FeesGET

/v1/platform/distributions/fee-preview

Returns the fee entries that will be auto-applied to distributions for the target business. If the business has custom distribution fees configured, those are returned; otherwise the global Oncade default fee is returned. Wallet addresses are omitted — they are resolved at distribution creation time.

Required scope: distribution:readRequires: X-Target-Business-Id header

curl -X GET "https://oncade.gg/api/v1/platform/distributions/fee-preview" \
  -H "Authorization: Bearer PLATFORM_API_KEY" \
  -H "X-Oncade-API-Version: v1" \
  -H "X-Target-Business-Id: TARGET_BUSINESS_ID"

Example Response

{
  "fees": [
    {
      "label": "Service Fee",
      "percentage": 5,
      "flat": 0,
      "feeType": "per_payout_plus_percentage"
    }
  ]
}

Create Distribution Fund SessionPOST

/v1/platform/distributions/{distributionId}/fund-sessions

Creates a funding session for a distribution. Returns a URL the business owner visits to fund the distribution. Idempotent by Idempotency-Key.

Required scope: distribution:funds:create

Distribution identifier
Optional metadata echoed back
curl -X POST "https://oncade.gg/api/v1/platform/distributions/abc123/fund-sessions" \
  -H "Authorization: Bearer PLATFORM_API_KEY" \
  -H "X-Oncade-API-Version: v1" \
  -H "Idempotency-Key: 26266259-a5b0-43db-9562-d3c69fef2aae"

Example Response

{
  "sessionKey": "dfs_abc123",
  "url": "https://oncade.gg/fund-distribution?session=dfs_abc123",
  "expiresAt": "2025-01-01T01:00:00.000Z"
}

Get Distribution Fund SessionGET

/v1/platform/distributions/{distributionId}/fund-sessions/{sessionHandle}

Returns the current status of a distribution funding session.

Required scope: distribution:funds:read

Distribution identifier
Session handle returned from create
curl -X GET "https://oncade.gg/api/v1/platform/distributions/abc123/fund-sessions/dfs_abc123" \
  -H "Authorization: Bearer PLATFORM_API_KEY" \
  -H "X-Oncade-API-Version: v1"

Revoke Distribution Fund SessionDELETE

/v1/platform/distributions/{distributionId}/fund-sessions/{sessionHandle}

Revokes a pending distribution funding session so the link can no longer be used to complete funding.

Required scope: distribution:funds:create

Distribution identifier
Session handle returned from create
curl -X DELETE "https://oncade.gg/api/v1/platform/distributions/abc123/fund-sessions/dfs_abc123" \
  -H "Authorization: Bearer PLATFORM_API_KEY" \
  -H "X-Oncade-API-Version: v1"

Example Response

{
  "success": true
}

List Split TemplatesGET

/v1/platform/split-templates

Lists split templates created by this platform for the target business.

Required scope: splitTemplate:readRequires: X-Target-Business-Id header

curl -X GET "https://oncade.gg/api/v1/platform/split-templates" \
  -H "Authorization: Bearer PLATFORM_API_KEY" \
  -H "X-Oncade-API-Version: v1" \
  -H "X-Target-Business-Id: TARGET_BUSINESS_ID"

Example Response

{
  "templates": [],
  "total": 0
}

Create Split TemplatePOST

/v1/platform/split-templates

Creates a new split template for reusable distribution configurations.

Required scope: splitTemplate:createRequires: X-Target-Business-Id header

Template name
Template description
Split mode: percentage or fixed
Array of { email, name, percentage } objects
curl -X POST "https://oncade.gg/api/v1/platform/split-templates" \
  -H "Authorization: Bearer PLATFORM_API_KEY" \
  -H "X-Oncade-API-Version: v1" \
  -H "X-Target-Business-Id: TARGET_BUSINESS_ID" \
  -H "Idempotency-Key: 1627bb42-d05f-45d5-8a14-80f4b2d7e821" \
  -H "Content-Type: application/json" \
  -d '{
  "name": "Team Revenue Split",
  "mode": "percentage",
  "recipients": [
    {
      "email": "lead@example.com",
      "name": "Team Lead",
      "percentage": 60
    },
    {
      "email": "dev@example.com",
      "name": "Developer",
      "percentage": 40
    }
  ]
}'

Get Split TemplateGET

/v1/platform/split-templates/{templateId}

Gets details of a split template created by this platform.

Required scope: splitTemplate:read

Template identifier
curl -X GET "https://oncade.gg/api/v1/platform/split-templates/tmpl_abc123" \
  -H "Authorization: Bearer PLATFORM_API_KEY" \
  -H "X-Oncade-API-Version: v1"

Update Split TemplatePATCH

/v1/platform/split-templates/{templateId}

Updates a split template created by this platform.

Required scope: splitTemplate:update

Template identifier
Template name
Template description
Split mode
Array of recipients
curl -X PATCH "https://oncade.gg/api/v1/platform/split-templates/tmpl_abc123" \
  -H "Authorization: Bearer PLATFORM_API_KEY" \
  -H "X-Oncade-API-Version: v1" \
  -H "Idempotency-Key: 82077373-f785-4fe4-81f4-9886cf045661" \
  -H "Content-Type: application/json" \
  -d '{
  "name": "Updated Template Name"
}'

Delete Split TemplateDELETE

/v1/platform/split-templates/{templateId}

Archives (soft-deletes) a split template created by this platform.

Required scope: splitTemplate:delete

Template identifier
curl -X DELETE "https://oncade.gg/api/v1/platform/split-templates/tmpl_abc123" \
  -H "Authorization: Bearer PLATFORM_API_KEY" \
  -H "X-Oncade-API-Version: v1"

Create Bulk GiftsPOST

/v1/platform/gifts/bulk

Create gift records for recipients without wallets. The caller must compute vault addresses and claim codes using the contract-sdk before calling this endpoint.

Required scope: gift:createRequires: X-Target-Business-Id header

User ID of the sender
Sender's wallet address
Token address for USDC
Array of recipient gift data
Distribution ID to link gifts to
Optional message for claim emails
curl -X POST "https://oncade.gg/api/v1/platform/gifts/bulk" \
  -H "Authorization: Bearer PLATFORM_API_KEY" \
  -H "X-Oncade-API-Version: v1" \
  -H "X-Target-Business-Id: TARGET_BUSINESS_ID" \
  -H "Idempotency-Key: 85c509e4-4e2c-4ffe-b509-55e3b78b38f4" \
  -H "Content-Type: application/json" \
  -d '{
  "senderUserId": "user_abc123",
  "senderWalletAddress": "0x1234...",
  "tokenAddress": "0xUSDC...",
  "recipients": [
    {
      "email": "recipient@example.com",
      "name": "Recipient",
      "amountCents": 5000,
      "vaultAddress": "0xvault...",
      "claimCode": "claim_xxx"
    }
  ],
  "distributionId": "dist_abc123"
}'

Mark Gifts FundedPOST

/v1/platform/gifts/mark-funded

Mark gifts as funded after the transaction and send claim emails to recipients.

Required scope: gift:createRequires: X-Target-Business-Id header

Array of { giftId, claimCode }
Funding transaction hash
Distribution ID
Optional memo for email context
curl -X POST "https://oncade.gg/api/v1/platform/gifts/mark-funded" \
  -H "Authorization: Bearer PLATFORM_API_KEY" \
  -H "X-Oncade-API-Version: v1" \
  -H "X-Target-Business-Id: TARGET_BUSINESS_ID" \
  -H "Idempotency-Key: 8be00bb3-7383-4649-9a8a-b5ad1f2d0591" \
  -H "Content-Type: application/json" \
  -d '{
  "giftData": [
    {
      "giftId": "gift_abc123",
      "claimCode": "claim_xxx"
    }
  ],
  "transactionHash": "0xtxhash...",
  "distributionId": "dist_abc123"
}'

Example Response

{
  "success": true,
  "result": {
    "updatedCount": 1,
    "emailsSent": 1,
    "emailsFailed": 0
  }
}

Lookup EmailsPOST

/v1/platform/lookup-emails

Look up whether recipients have existing accounts with wallets. Useful for preview purposes before creating a distribution.

Required scope: lookup:emailsRequires: X-Target-Business-Id header

Array of email addresses to look up
curl -X POST "https://oncade.gg/api/v1/platform/lookup-emails" \
  -H "Authorization: Bearer PLATFORM_API_KEY" \
  -H "X-Oncade-API-Version: v1" \
  -H "X-Target-Business-Id: TARGET_BUSINESS_ID" \
  -H "Idempotency-Key: 11cb09c7-c8ba-4e87-bfa0-fff22a4e68fe" \
  -H "Content-Type: application/json" \
  -d '{
  "emails": [
    "user1@example.com",
    "user2@example.com"
  ]
}'

Example Response

{
  "results": [
    {
      "email": "user1@example.com",
      "hasAccount": true
    },
    {
      "email": "user2@example.com",
      "hasAccount": false
    }
  ]
}

Webhooks

Configure a webhook URL in your platform settings to receive real-time notifications about events. All webhooks include an HMAC signature for verification.

Webhook Headers

HeaderDescription
x-oncade-signatureHMAC-SHA256 signature of the payload
x-oncade-eventEvent type (e.g., Platform.Link.Completed)
x-oncade-platform-idYour platform ID

Verifying Webhook Signatures

const crypto = require('crypto');

function verifyWebhook(payload, signature, secret) {
  const expected = crypto
    .createHmac('sha256', secret)
    .update(JSON.stringify(payload))
    .digest('hex');
  return crypto.timingSafeEqual(
    Buffer.from(signature),
    Buffer.from(expected)
  );
}

Webhook Events

Link Events

  • Platform.Link.Started - New link session created
  • Platform.Link.Completed - Business approved the link request
  • Platform.Link.Declined - Business declined the link request
  • Platform.Link.Failed - Link session failed due to an error
  • Platform.Grant.Revoked - Business revoked previously granted access

Campaign Events

  • Platform.Campaign.Created - Campaign created via Platform API
  • Platform.Campaign.Updated - Campaign updated via Platform API
  • Platform.Campaign.Deleted - Campaign deleted via Platform API
  • Platform.Campaign.Started - Campaign activated via Platform API
  • Platform.Campaign.Stopped - Campaign deactivated via Platform API
  • Platform.Campaign.EventRecorded - Campaign event recorded and payout triggered

Note: Campaign webhooks are sent to the platform's configured webhook URL. When creating or updating a campaign, you can optionally specify a webhookUrl parameter to configure campaign-specific webhooks. If provided, a webhook secret will be automatically generated and included in the webhook payloads. This allows you to verify webhook authenticity for campaign events.

Split Template Events

  • Platform.SplitTemplate.Created - Template created via Platform API
  • Platform.SplitTemplate.Updated - Template updated via Platform API
  • Platform.SplitTemplate.Deleted - Template archived via Platform API

Invoice Events

  • Platform.Invoice.Created - Invoice created via Platform API
  • Platform.Invoice.Updated - Invoice updated via Platform API
  • Platform.Invoice.Sent - Invoice sent to recipient (draft to sent transition)
  • Platform.Invoice.Cancelled - Invoice cancelled via Platform API
  • Platform.Invoice.Paid - Invoice payment completed

Distribution Events

  • Platform.Distribution.Created - Distribution created via Platform API

Gift Events

  • Platform.Gifts.Funded - Gifts marked as funded and claim emails sent

Example Webhook Payloads

All webhook payloads follow a standard structure with event, data, and timestamp fields. The data object contains event-specific information.

Link Events

Platform.Link.Started

Sent when a new link session is created.

{
  "event": "Platform.Link.Started",
  "data": {
    "sessionKey": "lnk_xyz789",
    "metadata": { "referrer": "partner-dashboard", "internalUserId": "usr_123" }
  },
  "timestamp": "2024-01-10T12:00:00.000Z"
}
Platform.Link.Completed

Sent when a business approves the link request and grants permissions.

{
  "event": "Platform.Link.Completed",
  "data": {
    "sessionKey": "lnk_xyz789",
    "businessId": "65fa1234abcdef5678901234",
    "grantedScopes": ["campaign:create", "campaign:read", "distribution:create"],
    "grantId": "grant_def456",
    "metadata": { "referrer": "partner-dashboard", "internalUserId": "usr_123" }
  },
  "timestamp": "2024-01-10T12:05:00.000Z"
}
Platform.Link.Declined

Sent when a business declines the link request.

{
  "event": "Platform.Link.Declined",
  "data": {
    "sessionKey": "lnk_xyz789",
    "businessId": "65fa1234abcdef5678901234",
    "declineReason": "Not interested at this time",
    "metadata": { "referrer": "partner-dashboard", "internalUserId": "usr_123" }
  },
  "timestamp": "2024-01-10T12:05:00.000Z"
}
Platform.Link.Failed

Sent when a link session fails due to an error (e.g., session expired).

{
  "event": "Platform.Link.Failed",
  "data": {
    "sessionKey": "lnk_xyz789",
    "metadata": { "referrer": "partner-dashboard", "internalUserId": "usr_123" }
  },
  "timestamp": "2024-01-10T13:00:00.000Z"
}
Platform.Grant.Revoked

Sent when a business revokes a previously granted permission (either party can initiate).

{
  "event": "Platform.Grant.Revoked",
  "data": {
    "sessionKey": "lnk_xyz789",
    "businessId": "65fa1234abcdef5678901234",
    "grantId": "grant_def456"
  },
  "timestamp": "2024-02-15T09:30:00.000Z"
}

Campaign Events

Platform.Campaign.Created

Sent when a campaign is created via the Platform API. If a webhook URL was configured for the campaign, the webhookSecret field will be included in the payload.

{
  "event": "Platform.Campaign.Created",
  "data": {
    "campaignId": "cmp_abc123",
    "businessId": "65fa1234abcdef5678901234",
    "name": "Summer Promotion",
    "environment": "live",
    "address": "0x1234567890abcdef1234567890abcdef12345678",
    "chain": "base",
    "webhookSecret": "a1b2c3d4e5f678901234567890abcdef1234567890abcdef1234567890abcdef12"
  },
  "timestamp": "2024-01-10T12:00:00.000Z"
}
Platform.Campaign.Updated

Sent when a campaign is updated via the Platform API. If a webhook URL was configured for the campaign, the webhookSecret field will be included in the payload.

{
  "event": "Platform.Campaign.Updated",
  "data": {
    "campaignId": "cmp_abc123",
    "businessId": "65fa1234abcdef5678901234",
    "name": "Summer Promotion 2024",
    "environment": "live",
    "address": "0x1234567890abcdef1234567890abcdef12345678",
    "chain": "base",
    "webhookSecret": "a1b2c3d4e5f678901234567890abcdef1234567890abcdef1234567890abcdef12"
  },
  "timestamp": "2024-01-15T14:30:00.000Z"
}
Platform.Campaign.Deleted

Sent when a campaign is deleted via the Platform API. If a webhook URL was configured for the campaign, the webhookSecret field will be included in the payload.

{
  "event": "Platform.Campaign.Deleted",
  "data": {
    "campaignId": "cmp_abc123",
    "businessId": "65fa1234abcdef5678901234",
    "name": "Summer Promotion 2024",
    "environment": "live",
    "webhookSecret": "a1b2c3d4e5f678901234567890abcdef1234567890abcdef1234567890abcdef12"
  },
  "timestamp": "2024-03-01T10:00:00.000Z"
}
Platform.Campaign.Started

Sent when a campaign is activated via the Platform API.

{
  "event": "Platform.Campaign.Started",
  "data": {
    "campaignId": "cmp_abc123",
    "businessId": "65fa1234abcdef5678901234",
    "name": "Summer Promotion",
    "environment": "live",
    "address": "0x1234567890abcdef1234567890abcdef12345678",
    "chain": "base"
  },
  "timestamp": "2024-01-10T12:00:00.000Z"
}
Platform.Campaign.Stopped

Sent when a campaign is deactivated via the Platform API.

{
  "event": "Platform.Campaign.Stopped",
  "data": {
    "campaignId": "cmp_abc123",
    "businessId": "65fa1234abcdef5678901234",
    "name": "Summer Promotion",
    "environment": "live",
    "address": "0x1234567890abcdef1234567890abcdef12345678",
    "chain": "base"
  },
  "timestamp": "2024-02-01T09:00:00.000Z"
}
Platform.Campaign.EventRecorded

Sent when a campaign event is recorded and a payout is triggered for a linked user.

{
  "event": "Platform.Campaign.EventRecorded",
  "data": {
    "campaignId": "cmp_abc123",
    "businessId": "65fa1234abcdef5678901234",
    "eventCode": "signup",
    "eventName": "Account Created",
    "userRef": "tuid_xyz789",
    "payoutAmount": 500
  },
  "timestamp": "2024-01-11T14:30:00.000Z"
}

Split Template Events

Platform.SplitTemplate.Created

Sent when a split template is created via the Platform API.

{
  "event": "Platform.SplitTemplate.Created",
  "data": {
    "templateId": "tmpl_abc123",
    "businessId": "65fa1234abcdef5678901234",
    "name": "Team Revenue Split",
    "mode": "percentage",
    "recipientCount": 3
  },
  "timestamp": "2024-01-10T12:00:00.000Z"
}
Platform.SplitTemplate.Updated

Sent when a split template is updated via the Platform API.

{
  "event": "Platform.SplitTemplate.Updated",
  "data": {
    "templateId": "tmpl_abc123",
    "businessId": "65fa1234abcdef5678901234",
    "name": "Team Revenue Split v2",
    "mode": "percentage",
    "recipientCount": 4
  },
  "timestamp": "2024-01-15T14:30:00.000Z"
}
Platform.SplitTemplate.Deleted

Sent when a split template is archived (soft-deleted) via the Platform API.

{
  "event": "Platform.SplitTemplate.Deleted",
  "data": {
    "templateId": "tmpl_abc123",
    "businessId": "65fa1234abcdef5678901234",
    "name": "Team Revenue Split v2",
    "mode": "percentage",
    "recipientCount": 4
  },
  "timestamp": "2024-03-01T10:00:00.000Z"
}

Distribution Events

Platform.Distribution.Created

Sent when a distribution is created via the Platform API.

{
  "event": "Platform.Distribution.Created",
  "data": {
    "distributionId": "dist_abc123",
    "businessId": "65fa1234abcdef5678901234",
    "totalAmountCents": 100000,
    "currency": "USD",
    "recipientCount": 3,
    "status": "pending",
    "templateId": "tmpl_def456",
    "memo": "Q1 2024 Revenue Share"
  },
  "timestamp": "2024-01-10T12:00:00.000Z"
}

Gift Events

Platform.Gifts.Funded

Sent when gifts are marked as funded and claim emails have been dispatched to recipients.

{
  "event": "Platform.Gifts.Funded",
  "data": {
    "distributionId": "dist_abc123",
    "businessId": "65fa1234abcdef5678901234",
    "giftCount": 3,
    "totalAmountCents": 100000,
    "transactionHash": "0xabcdef1234567890abcdef1234567890abcdef1234567890abcdef1234567890"
  },
  "timestamp": "2024-01-10T12:30:00.000Z"
}

See also: Server API Reference | Webhooks Guide