Back to Docs

REST API Reference

Complete reference for the Yeld REST API. All endpoints are authenticated and return JSON responses.

Base URL

https://api.yeld.app/v1

API Version

All endpoints are versioned. Use \`/v1/\` prefix for current version.

Content Type

All endpoints accept and return JSON with \`Content-Type: application/json\`.

Authentication

All API requests require authentication using your API key.

// Include API key in header
Authorization: Bearer YOUR_API_KEY

// Or use Supabase auth token
Authorization: Bearer supabase_jwt_token

Getting an API Key

Generate an API key from your dashboard settings. Keep your API key secure and never expose it in client-side code.

Token Expiration

Supabase tokens expire after 1 hour. API keys don't expire but should be rotated periodically.

Endpoints

GET/api/businesses/:bizId

Get business details by business ID

Requires authentication

Response


{
  "id": "uuid",
  "bizId": "biz_abc123",
  "ownerId": "uuid",
  "name": "My Business",
  "createdAt": "2024-01-01T00:00:00Z",
  "updatedAt": "2024-01-01T00:00:00Z"
}
GET/api/businesses/:bizId/wallet

Get the business wallet address

Requires authentication

Response


{
  "id": "uuid",
  "businessId": "uuid",
  "network": "base-sepolia",
  "asset": "USDC",
  "address": "0x1234567890abcdef...",
  "path": "m/44'/60'/0'/0/0",
  "index": 0,
  "createdAt": "2024-01-01T00:00:00Z"
}
GET/api/checkout-links/:bizId

List all checkout links for a business

Requires authentication

Response


[
  {
    "id": "uuid",
    "businessId": "uuid",
    "planId": "plan_abc123",
    "planName": "Premium Plan",
    "plan": "premium",
    "description": "Full access",
    "price": "50.00",
    "currency": "USDC",
    "network": "base-sepolia",
    "billing": "recurring",
    "createdAt": "2024-01-01T00:00:00Z"
  }
]
POST/api/checkout-links/:bizId

Create a new checkout link

Requires authentication

Request Body


{
  "planName": "Premium Plan",
  "plan": "premium",
  "description": "Monthly subscription",
  "price": "50.00",
  "billing": "recurring",
  "initialFee": "10.00",
  "trialDays": 7,
  "stock": 100
}

Response


{
  "ok": true
}
DELETE/api/checkout-links/:bizId/:planId

Delete a checkout link

Requires authentication

Response


{
  "ok": true
}

Error Codes

The API uses conventional HTTP response codes to indicate success or failure.

StatusDescription
400Bad Request - Invalid input parameters
401Unauthorized - Missing or invalid API key
403Forbidden - Insufficient permissions
404Not Found - Resource doesn't exist
409Conflict - Resource already exists
429Too Many Requests - Rate limit exceeded
500Internal Server Error

Rate Limits

API requests are rate-limited to ensure fair usage and system stability.

Free Tier

100 requests per hour

Pro Tier

1,000 requests per hour

Enterprise

Custom limits available

Rate limit headers are included in all responses: \`X-RateLimit-Limit\`, \`X-RateLimit-Remaining\`, \`X-RateLimit-Reset\`.
Webhooks