REST API Reference
Complete reference for the Yeld REST API. All endpoints are authenticated and return JSON responses.
Base URL
https://api.yeld.app/v1API 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_tokenGetting 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
/api/businesses/:bizIdGet business details by business ID
Response
{
"id": "uuid",
"bizId": "biz_abc123",
"ownerId": "uuid",
"name": "My Business",
"createdAt": "2024-01-01T00:00:00Z",
"updatedAt": "2024-01-01T00:00:00Z"
}/api/businesses/:bizId/walletGet the business wallet address
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"
}/api/checkout-links/:bizIdList all checkout links for a business
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"
}
]/api/checkout-links/:bizIdCreate a new checkout link
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
}/api/checkout-links/:bizId/:planIdDelete a checkout link
Response
{
"ok": true
}Error Codes
The API uses conventional HTTP response codes to indicate success or failure.
| Status | Description |
|---|---|
| 400 | Bad Request - Invalid input parameters |
| 401 | Unauthorized - Missing or invalid API key |
| 403 | Forbidden - Insufficient permissions |
| 404 | Not Found - Resource doesn't exist |
| 409 | Conflict - Resource already exists |
| 429 | Too Many Requests - Rate limit exceeded |
| 500 | Internal 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