Skip to content

Partners API

API for managing the partner system, provider referrals, and commissions

Overview

Partners API is used for:

  • Manage referral links
  • View referral statistics
  • Manage sellers in the network
  • View commission earnings

Endpoints

Referral

Create a referral link

http
POST /api/rpc/partners/referral/create

Body

json
{
  "campaign": "summer2025"
}

Response

json
{
  "id": "ref_123",
  "link": "https://booking-platform.com/ref/abc123",
  "code": "abc123"
}

List Referrals

Get a list of referred accounts

http
GET /api/rpc/partners/referral/list

Response

json
[
  {
    "id": "ref_123",
    "referredName": "ABC Barbershop",
    "status": "signed_up",
    "commission": 500,
    "createdAt": "2025-01-15T10:00:00Z"
  }
]

Referral Stats

View referral statistics

http
GET /api/rpc/partners/referral/stats

Seller

List Sellers

Get a list of sellers in the network

http
GET /api/rpc/partners/seller/list

Seller Performance

View seller performance

http
GET /api/rpc/partners/seller/:id/performance

Commission

View commission earnings

http
GET /api/rpc/partners/commission

Response

json
{
  "totalEarned": 15000,
  "pendingPayout": 3000,
  "paidOut": 12000,
  "history": [
    {
      "id": "com_123",
      "amount": 500,
      "status": "paid",
      "date": "2025-01-15"
    }
  ]
}

Example Code

typescript
// Create referral link
const referral = await fetch('/api/rpc/partners/referral/create', {
  method: 'POST',
  headers: {
    'Authorization': 'Bearer YOUR_API_KEY',
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({ campaign: 'summer2025' }),
});

// View statistics
const stats = await fetch('/api/rpc/partners/referral/stats', {
  headers: { 'Authorization': 'Bearer YOUR_API_KEY' },
});

Released under the MIT License.