IPTV API Integration Guide: Build Custom Workflows with the IPTVbp API
Complete guide to the IPTVbp API covering authentication, key endpoints, pagination, rate limits, error handling, and example integrations for custom workflows.
Every IPTV business has unique requirements that go beyond what any single platform can provide out of the box. Maybe you need a custom mobile app for your subscribers. Maybe you want a real-time analytics dashboard tailored to your KPIs. Maybe your CRM needs to pull subscription data automatically.
The IPTVbp API makes all of this possible. It gives you programmatic access to your billing data — customers, subscriptions, products, invoices, and more — so you can build custom integrations and workflows that fit your exact needs.
This guide covers everything you need to start building with the IPTVbp API: authentication, key endpoints, request patterns, error handling, and practical integration examples.
API Authentication
All API requests require authentication. IPTVbp uses API key authentication, which is straightforward to implement and works with any programming language or HTTP client.
Generating an API Key
- Log into your IPTVbp vendor dashboard.
- Navigate to Settings → API Keys.
- Click "Generate New Key" and give it a descriptive name (e.g., "CRM Integration" or "Mobile App").
- Copy the generated key immediately — it will only be shown once.
- Store the key securely. Treat it like a password.
Using the API Key
Include your API key in the Authorization header of every request:
Authorization: Bearer your_api_key_here
Example using cURL:
curl -H "Authorization: Bearer your_api_key_here" \
-H "Content-Type: application/json" \
https://yourdomain.com/api/v1/customers
Example using JavaScript (fetch):
const response = await fetch('https://yourdomain.com/api/v1/customers', {
headers: {
'Authorization': 'Bearer your_api_key_here',
'Content-Type': 'application/json'
}
});
const data = await response.json();
API Key Best Practices
- Use separate keys for each integration. If one key is compromised, you can revoke it without breaking other integrations.
- Never expose keys in client-side code. API keys belong on your server, not in browser JavaScript or mobile app bundles.
- Rotate keys periodically. Generate a new key, update your integrations, then revoke the old one.
- Use environment variables to store keys rather than hardcoding them in source files.
Key API Endpoints
The API is organized around the core resources of your billing platform. Here are the most commonly used endpoints:
Customers
Manage your customer records.
| Method | Endpoint | Description |
|---|---|---|
| GET | /api/v1/customers | List all customers |
| GET | /api/v1/customers/:id | Get a specific customer |
| POST | /api/v1/customers | Create a new customer |
| PATCH | /api/v1/customers/:id | Update a customer |
| DELETE | /api/v1/customers/:id | Delete a customer |
curl -X POST https://yourdomain.com/api/v1/customers \
-H "Authorization: Bearer your_api_key_here" \
-H "Content-Type: application/json" \
-d '{
"email": "[email protected]",
"name": "John Smith",
"password": "securepassword123"
}'
Subscriptions
Manage active and historical subscriptions.
| Method | Endpoint | Description |
|---|---|---|
| GET | /api/v1/subscriptions | List all subscriptions |
| GET | /api/v1/subscriptions/:id | Get a specific subscription |
| POST | /api/v1/subscriptions | Create a new subscription |
| PATCH | /api/v1/subscriptions/:id | Update a subscription |
| POST | /api/v1/subscriptions/:id/cancel | Cancel a subscription |
| POST | /api/v1/subscriptions/:id/renew | Manually renew a subscription |
curl "https://yourdomain.com/api/v1/subscriptions?status=active&productId=prod_123" \
-H "Authorization: Bearer your_api_key_here"
Products
Manage your product catalog.
| Method | Endpoint | Description |
|---|---|---|
| GET | /api/v1/products | List all products |
| GET | /api/v1/products/:id | Get a specific product |
| POST | /api/v1/products | Create a new product |
| PATCH | /api/v1/products/:id | Update a product |
| DELETE | /api/v1/products/:id | Delete a product |
Invoices
Access billing and payment records.
| Method | Endpoint | Description |
|---|---|---|
| GET | /api/v1/invoices | List all invoices |
| GET | /api/v1/invoices/:id | Get a specific invoice |
| POST | /api/v1/invoices/:id/mark-paid | Manually mark as paid |
Pagination
List endpoints return paginated results to keep responses manageable. The API uses cursor-based pagination for consistent performance regardless of dataset size.
Request Parameters
limit— Number of results per page (default: 20, max: 100).cursor— The cursor value from the previous response to fetch the next page.
Response Format
{
"data": [
{ "id": "cust_001", "email": "[email protected]", "name": "Alice" },
{ "id": "cust_002", "email": "[email protected]", "name": "Bob" }
],
"pagination": {
"hasMore": true,
"nextCursor": "cust_002",
"total": 1547
}
}
Paginating Through All Results
async function getAllCustomers(apiKey) {
let allCustomers = [];
let cursor = null;
let hasMore = true;
while (hasMore) { const url = new URL('https://yourdomain.com/api/v1/customers'); url.searchParams.set('limit', '100'); if (cursor) url.searchParams.set('cursor', cursor);
const response = await fetch(url, { headers: { 'Authorization': Bearer ${apiKey} } }); const result = await response.json();
allCustomers = allCustomers.concat(result.data); hasMore = result.pagination.hasMore; cursor = result.pagination.nextCursor; }
return allCustomers; }
Rate Limits
To ensure platform stability, the API enforces rate limits:
- Standard tier: 60 requests per minute.
- Professional tier: 120 requests per minute.
- Enterprise tier: 300 requests per minute.
X-RateLimit-Limit: 60
X-RateLimit-Remaining: 45
X-RateLimit-Reset: 1711720800
When you exceed the rate limit, the API returns a 429 Too Many Requests response. Implement exponential backoff in your integration:
async function apiRequestWithRetry(url, options, maxRetries = 3) {
for (let attempt = 0; attempt <= maxRetries; attempt++) {
const response = await fetch(url, options);
if (response.status === 429) { const retryAfter = parseInt(response.headers.get('Retry-After') || '5'); const backoff = retryAfter 1000 Math.pow(2, attempt); console.log(Rate limited. Retrying in ${backoff}ms...); await new Promise(resolve => setTimeout(resolve, backoff)); continue; }
return response; }
throw new Error('Max retries exceeded'); }
Error Handling
The API uses standard HTTP status codes and returns consistent error payloads:
Status Codes
| Code | Meaning |
|---|---|
| 200 | Success |
| 201 | Created |
| 400 | Bad Request — Invalid parameters |
| 401 | Unauthorized — Invalid or missing API key |
| 403 | Forbidden — Key lacks permission for this action |
| 404 | Not Found — Resource does not exist |
| 409 | Conflict — Resource already exists or state conflict |
| 422 | Unprocessable Entity — Validation failed |
| 429 | Too Many Requests — Rate limit exceeded |
| 500 | Internal Server Error |
Error Response Format
{
"error": {
"code": "validation_error",
"message": "The email field is required.",
"details": [
{
"field": "email",
"message": "This field is required"
}
]
}
}
Robust Error Handling Pattern
async function makeApiRequest(endpoint, options = {}) {
try {
const response = await fetch(https://yourdomain.com/api/v1${endpoint}, {
...options,
headers: {
'Authorization': Bearer ${process.env.IPTVBP_API_KEY},
'Content-Type': 'application/json',
...options.headers
}
});
if (!response.ok) { const errorData = await response.json();
switch (response.status) { case 401: throw new Error('Invalid API key. Check your credentials.'); case 404: throw new Error(Resource not found: ${endpoint}); case 422: const fields = errorData.error.details .map(d => ${d.field}: ${d.message}) .join(', '); throw new Error(Validation failed: ${fields}); case 429: throw new Error('Rate limit exceeded. Implement backoff.'); default: throw new Error(API error ${response.status}: ${errorData.error.message}); } }
return await response.json(); } catch (error) { if (error.name === 'TypeError') { throw new Error('Network error. Check your connection and API URL.'); } throw error; } }
Example Integrations
1. Custom Admin Dashboard
Build a real-time dashboard that displays the metrics you care about most:
// Fetch dashboard data from multiple endpoints in parallel
async function getDashboardData() {
const [customers, subscriptions, invoices] = await Promise.all([
makeApiRequest('/customers?limit=1'),
makeApiRequest('/subscriptions?status=active&limit=1'),
makeApiRequest('/invoices?status=paid&limit=1')
]);
return { totalCustomers: customers.pagination.total, activeSubscriptions: subscriptions.pagination.total, totalRevenue: invoices.pagination.total }; }
Combine this with a frontend framework like React or Vue to build a dashboard that auto-refreshes every few minutes, showing real-time subscriber counts, revenue trends, and churn metrics.
2. Mobile App Integration
Give your subscribers a branded mobile app experience:
// Mobile app: fetch customer's active subscriptions
async function getMySubscriptions(customerId) {
const subs = await makeApiRequest(
/subscriptions?customerId=${customerId}&status=active
);
return subs.data.map(sub => ({ productName: sub.productName, expiresAt: sub.currentPeriodEnd, credentials: sub.credentials, status: sub.status })); }
Your mobile app can display subscription status, credentials, renewal dates, and even allow customers to manage their subscriptions directly.
3. Third-Party CRM Sync
Keep your CRM updated with the latest customer and subscription data:
// Sync customers to HubSpot CRM
async function syncToHubSpot() {
const customers = await getAllCustomers(process.env.IPTVBP_API_KEY);
for (const customer of customers) { const subs = await makeApiRequest( /subscriptions?customerId=${customer.id}&status=active );
await hubspotClient.crm.contacts.basicApi.create({ properties: { email: customer.email, firstname: customer.name, iptv_subscription_status: subs.data.length > 0 ? 'Active' : 'Inactive', iptv_product: subs.data[0]?.productName || 'None', iptv_expiry: subs.data[0]?.currentPeriodEnd || '' } }); } }
Run this sync on a schedule (every hour or daily) to keep your CRM records current without manual data entry.
4. Automated Reporting
Generate and email weekly business reports:
async function generateWeeklyReport() {
const oneWeekAgo = new Date(Date.now() - 7 24 60 60 1000)
.toISOString();
const [newCustomers, newInvoices, cancellations] = await Promise.all([ makeApiRequest(/customers?createdAfter=${oneWeekAgo}), makeApiRequest(/invoices?status=paid&createdAfter=${oneWeekAgo}), makeApiRequest(/subscriptions?status=cancelled&updatedAfter=${oneWeekAgo}) ]);
const totalRevenue = newInvoices.data.reduce( (sum, inv) => sum + parseFloat(inv.amount), 0 );
return { period: Week ending ${new Date().toLocaleDateString()}, newCustomers: newCustomers.pagination.total, revenue: totalRevenue.toFixed(2), cancellations: cancellations.pagination.total, invoicesPaid: newInvoices.pagination.total }; }
Best Practices for API Integration
Cache Responses Where Appropriate
For data that changes infrequently (product catalog, pricing), cache API responses locally rather than fetching on every request. This reduces your API usage and improves performance.
Use Webhooks for Real-Time Updates
Instead of polling the API to detect changes, use webhooks to receive real-time notifications. Reserve API calls for fetching detailed data or performing actions.
Implement Idempotency
When creating resources, check for existing records before creating duplicates. Use unique identifiers like email addresses or external IDs to prevent duplicate customers or subscriptions.
Handle Network Failures
Always implement timeouts, retries with backoff, and circuit breakers in production integrations. Network issues are inevitable — your integration should handle them gracefully.
Version Your Integration
Build your integration against a specific API version and test thoroughly before updating. This prevents breaking changes from disrupting your workflows unexpectedly.
Getting Started
The fastest way to start building with the IPTVbp API:
- Generate an API key from your vendor dashboard.
- Test with cURL or a tool like Postman to explore endpoints and understand response formats.
- Build a small proof of concept — fetch your customer list or create a test subscription.
- Add error handling and retry logic before moving to production.
- Monitor your integration with logging and alerting to catch issues early.
Whether you are building a custom dashboard, integrating with a CRM, creating a mobile app, or automating reports, the IPTVbp API gives you the building blocks to create exactly the workflows your business needs.
Related Articles
Ready to Automate Your IPTV Billing?
Start your free trial and see how IPTVbp automates provisioning, payments, and customer management for your IPTV business.
Related Articles
IPTV Webhook Integrations: Connect Your Billing to Any External Service
Learn how to use webhooks to connect your IPTV billing platform to external services like Zapier, CRMs, and custom scripts for real-time event-driven automation.
How to Set Up Discord Role Automation for IPTV Subscribers
Step-by-step tutorial on automating Discord role assignments for IPTV subscribers, including bot setup, role mapping, verification flows, and multi-server support.
10 Customer Acquisition Channels Every IPTV Provider Should Use
Discover the ten most effective customer acquisition channels for IPTV providers, from organic search and Discord communities to reseller networks and referral programs.