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.
- Create a Link Session: Call
POST /v1/platform/link-sessionswith the scopes you need. You receive a unique URL and session key. - 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.
- Business Reviews & Approves: The business admin logs into Oncade, reviews the requested permissions, and either approves or declines.
- Receive Webhook: Your platform receives a
Platform.Link.Completedwebhook with thebusinessIdandgrantId. If declined, you receivePlatform.Link.Declined. - Start Operating: Use the
businessIdfrom the grant in yourX-Target-Business-Idheader 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.
- Send an Invite: Call
POST /v1/platform/inviteswith the targetbusinessIdand requested scopes. - Business Reviews: The business receives a notification and can review the invite in their Oncade dashboard.
- Business Responds: They approve or decline the invite. On approval, a grant is automatically created.
- Start Operating: Once approved, use the
businessIdin yourX-Target-Business-Idheader 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 informationplatform.key:manage- Manage API keysplatform.invite:manage- Manage business invitesplatform.grant:manage- Manage business grantsplatform.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:staticcampaign: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
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
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
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
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
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 Link SessionsGET
/v1/platform/link-sessions
List all link sessions for this platform.
Required scope: platform.invite:manage
curl -X GET "https://oncade.gg/api/v1/platform/link-sessions" \
-H "Authorization: Bearer PLATFORM_API_KEY" \
-H "X-Oncade-API-Version: v1"Example Response
{
"sessions": [],
"total": 0
}Create Link SessionPOST
/v1/platform/link-sessions
Create a new link session with specified scopes. Returns a URL that can be shared with any business admin to grant permissions.
Required scope: platform.invite:manage
curl -X POST "https://oncade.gg/api/v1/platform/link-sessions" \
-H "Authorization: Bearer PLATFORM_API_KEY" \
-H "X-Oncade-API-Version: v1" \
-H "Idempotency-Key: 05b19637-3571-40ee-9318-6459f59a9e91" \
-H "Content-Type: application/json" \
-d '{
"requestedScopes": [
"campaign:create",
"distribution:create"
],
"metadata": {
"referrer": "partner-dashboard"
}
}'Example Response
{
"sessionId": "sess_abc123",
"sessionKey": "lnk_xyz789",
"url": "https://oncade.gg/platform-link?session=lnk_xyz789",
"requestedScopes": [
"campaign:create",
"distribution:create"
],
"expiresAt": "2024-01-15T12:00:00.000Z"
}Get Link SessionGET
/v1/platform/link-sessions/{sessionId}
Get details of a specific link session.
Required scope: platform.invite:manage
curl -X GET "https://oncade.gg/api/v1/platform/link-sessions/sess_abc123" \
-H "Authorization: Bearer PLATFORM_API_KEY" \
-H "X-Oncade-API-Version: v1"Cancel Link SessionDELETE
/v1/platform/link-sessions/{sessionId}
Cancel a pending link session.
Required scope: platform.invite:manage
curl -X DELETE "https://oncade.gg/api/v1/platform/link-sessions/sess_abc123" \
-H "Authorization: Bearer PLATFORM_API_KEY" \
-H "X-Oncade-API-Version: v1"Example Response
{
"success": true,
"message": "Link session cancelled"
}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
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
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
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
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
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
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
curl -X DELETE "https://oncade.gg/api/v1/platform/campaigns/cmp_abc123" \
-H "Authorization: Bearer PLATFORM_API_KEY" \
-H "X-Oncade-API-Version: v1"Create Campaign Link SessionPOST
/v1/platform/campaigns/{campaignId}/users/{userRef}/link/initiate
Create an account link session for users to connect to a campaign. Use userRef "new" when the user is not yet known.
Required scope: campaign:users:link:create
curl -X POST "https://oncade.gg/api/v1/platform/campaigns/cmp_abc123/users/new/link/initiate" \
-H "Authorization: Bearer PLATFORM_API_KEY" \
-H "X-Oncade-API-Version: v1" \
-H "Idempotency-Key: 096af060-4c0c-4206-a0cd-ec5b7998d26c" \
-H "Content-Type: application/json" \
-d '{
"email": "player@example.com"
}'Example Response
{
"url": "https://oncade.gg/link?session=session_abc123",
"sessionKey": "session_abc123"
}Get Campaign Link Session DetailsGET
/v1/platform/campaigns/{campaignId}/users/link/details
Returns campaign link session details for a given session handle or token. The campaign must be owned by the platform (createdByPlatformId).
Required scope: campaign:users:link:read
curl -X GET "https://oncade.gg/api/v1/platform/campaigns/cmp_abc123/users/link/details?session=session_xyz" \
-H "Authorization: Bearer PLATFORM_API_KEY" \
-H "X-Oncade-API-Version: v1"Example Response
{
"campaignId": "cmp_abc123",
"campaignName": "Demo Campaign",
"prefilledEmail": "player@example.com",
"status": "approved",
"userRef": "user-ref-123",
"spendPermission": {
"tenantId": "0x123",
"tenantName": "Demo Campaign",
"allowanceUSDC": "250",
"networkKey": "base-sepolia"
}
}Create Campaign Link InvitePOST
/v1/platform/campaigns/{campaignId}/link-invites
Create a shareable link invite code for a campaign. Each visit to the invite URL generates a unique account linking session. Supports optional usage limits and expiration.
Required scope: campaign:users:link:static
curl -X POST "https://oncade.gg/api/v1/platform/campaigns/cmp_abc123/link-invites" \
-H "Authorization: Bearer PLATFORM_API_KEY" \
-H "X-Oncade-API-Version: v1" \
-H "Idempotency-Key: a1b207fb-ba74-4633-adb1-3455614e6042" \
-H "Content-Type: application/json" \
-d '{
"label": "Email blast Feb 2026",
"maxUses": 500
}'Example Response
{
"code": "Ab3Cd5Ef",
"url": "https://oncade.gg/join/Ab3Cd5Ef",
"status": "active",
"maxUses": 500,
"currentUses": 0,
"expiresAt": null
}List Campaign Link InvitesGET
/v1/platform/campaigns/{campaignId}/link-invites
List all link invites for a campaign. Add ?includeRevoked=true to include revoked invites.
Required scope: campaign:users:link:static
curl -X GET "https://oncade.gg/api/v1/platform/campaigns/cmp_abc123/link-invites" \
-H "Authorization: Bearer PLATFORM_API_KEY" \
-H "X-Oncade-API-Version: v1"Example Response
{
"invites": [
{
"code": "Ab3Cd5Ef",
"label": "Email blast",
"status": "active",
"maxUses": 500,
"currentUses": 42,
"url": "https://oncade.gg/join/Ab3Cd5Ef"
}
]
}Update Campaign Link InvitePATCH
/v1/platform/campaigns/{campaignId}/link-invites/{code}
Update a link invite. Can change label, maxUses, expiresAt, or status (active/paused).
Required scope: campaign:users:link:static
curl -X PATCH "https://oncade.gg/api/v1/platform/campaigns/cmp_abc123/link-invites/Ab3Cd5Ef" \
-H "Authorization: Bearer PLATFORM_API_KEY" \
-H "X-Oncade-API-Version: v1" \
-H "Idempotency-Key: deb6d552-3228-4e81-a1a3-7adb5f56fb52"Example Response
{
"code": "Ab3Cd5Ef",
"status": "paused"
}Revoke Campaign Link InviteDELETE
/v1/platform/campaigns/{campaignId}/link-invites/{code}
Permanently revoke a link invite. Revoked invites can no longer be used.
Required scope: campaign:users:link:static
curl -X DELETE "https://oncade.gg/api/v1/platform/campaigns/cmp_abc123/link-invites/Ab3Cd5Ef" \
-H "Authorization: Bearer PLATFORM_API_KEY" \
-H "X-Oncade-API-Version: v1"Example Response
{
"code": "Ab3Cd5Ef",
"status": "revoked"
}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
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
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
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
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"
}Remove Campaign Account Link (Leave Campaign)POST
/v1/platform/campaigns/{campaignId}/users/{userRef}/link/remove
Updates the user's account link for the campaign to expired (unlink). The campaign must be owned by the platform (createdByPlatformId). UserRef is taken from the path. Idempotency-Key header is optional; if provided, it is included in webhook metadata.
Required scope: campaign:users:link:remove
curl -X POST "https://oncade.gg/api/v1/platform/campaigns/cmp_abc123/users/user-ref-123/link/remove" \
-H "Authorization: Bearer PLATFORM_API_KEY" \
-H "X-Oncade-API-Version: v1" \
-H "Idempotency-Key: 34133187-d40f-4fa6-9d09-b13e8aa1b604"Example Response
{
"success": true,
"message": "Account link removed successfully"
}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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
| Header | Description |
|---|---|
x-oncade-signature | HMAC-SHA256 signature of the payload |
x-oncade-event | Event type (e.g., Platform.Link.Completed) |
x-oncade-platform-id | Your 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 createdPlatform.Link.Completed- Business approved the link requestPlatform.Link.Declined- Business declined the link requestPlatform.Link.Failed- Link session failed due to an errorPlatform.Grant.Revoked- Business revoked previously granted access
Campaign Events
Platform.Campaign.Created- Campaign created via Platform APIPlatform.Campaign.Updated- Campaign updated via Platform APIPlatform.Campaign.Deleted- Campaign deleted via Platform APIPlatform.Campaign.Started- Campaign activated via Platform APIPlatform.Campaign.Stopped- Campaign deactivated via Platform APIPlatform.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 APIPlatform.SplitTemplate.Updated- Template updated via Platform APIPlatform.SplitTemplate.Deleted- Template archived via Platform API
Invoice Events
Platform.Invoice.Created- Invoice created via Platform APIPlatform.Invoice.Updated- Invoice updated via Platform APIPlatform.Invoice.Sent- Invoice sent to recipient (draft to sent transition)Platform.Invoice.Cancelled- Invoice cancelled via Platform APIPlatform.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