Skip to content

Funding API

Manages podcast funding status and configuration for value-for-value (V4V) payments.

Base Path: /api/funding

Authentication: All endpoints require Bearer token.

Endpoints

MethodPathAuthDescription
GET/statusYesGet user's funding status
POST/setupYesSetup podcast funding

Get Funding Status

Retrieves the current funding configuration for the user.

GET /api/funding/status

Response:

json
{
	"status": {
		"has_funding": true,
		"provider": "alby",
		"lightning_address": "[email protected]",
		"podcast_id": "uuid",
		"created_at": "2025-01-07T10:00:00Z"
	}
}

Fields:

FieldTypeDescription
has_fundingbooleanWhether funding is configured
providerstringFunding provider (e.g., "alby", "custom")
lightning_addressstringLightning Network address
podcast_idUUIDAssociated podcast
created_atstringWhen funding was configured

Setup Funding

Configures funding for a podcast. Requires owner role.

POST /api/funding/setup

Request Body:

json
{
	"podcast_id": "uuid",
	"provider": "alby",
	"lightning_address": "[email protected]"
}

Fields:

FieldTypeRequiredDescription
podcast_idUUIDYesPodcast to configure
providerstringYesFunding provider
lightning_addressstringYesLightning address

Response:

json
{
	"success": true,
	"funding": {
		"provider": "alby",
		"lightning_address": "[email protected]"
	}
}

RSS Feed Integration

When funding is configured, the RSS feed includes Podcasting 2.0 value tags:

xml
<podcast:value type="lightning" method="keysend">
  <podcast:valueRecipient
    name="Host Name"
    type="node"
    address="[email protected]"
    split="100"
  />
</podcast:value>

Supported Providers

ProviderDescription
albyAlby Lightning wallet
customCustom Lightning address

TypeScript Client Usage

typescript
import { createApiClient } from '$api/client';

const client = createApiClient(fetch);

// Get funding status
const statusRes = await client.api.funding.status.$get(
	{},
	{ headers: { Authorization: `Bearer ${token}` } }
);

// Setup funding
const setupRes = await client.api.funding.setup.$post(
	{
		json: {
			podcast_id: 'uuid',
			provider: 'alby',
			lightning_address: '[email protected]'
		}
	},
	{
		headers: { Authorization: `Bearer ${token}` }
	}
);

Internal documentation - Not for public distribution