Reseller API — Getting Started
The Reseller API lets a third-party provider sell CDNShark from their own billing system: create customers, order services for them, and reconcile the charges. It is a separate surface from the Customer API and requires a reseller account.
How billing works
This is the single most important thing to understand before you integrate.
- Every order is charged to your credit balance, at your wholesale price (list price minus your reseller discount).
- Your customer never pays CDNShark. You bill them yourself, at whatever price you choose, through your own system.
- An order placed with insufficient credit is rejected with
402 Payment Requiredand does not provision anything.
Top up your balance in the reseller portal under Credit & Billing, or check it any time via GET /api/reseller/credit.
Base URL
https://cdnshark.com/api/reseller
Authentication
Create a token in the reseller portal under API Tokens. Send it as a bearer token on every request:
Authorization: Bearer YOUR_RESELLER_TOKEN
Tokens are scoped by ability — grant only what your integration needs:
| Ability | Grants |
|---|---|
reseller:catalog:read | Plans, wholesale pricing, product availability |
reseller:customers:read | List and read your customers |
reseller:customers:write | Create, edit and suspend customers |
reseller:services:read | List and read provisioned services |
reseller:services:write | Order, suspend and reactivate services |
reseller:billing:read | Credit balance, ledger, orders, invoices |
reseller:usage:read | Bandwidth and storage metering |
reseller:webhooks:read | Read subscriptions and delivery history |
reseller:webhooks:write | Manage webhook subscriptions |
reseller:sso | Mint delegated-login links for your customers |
Your first call
Check what you can sell and what it costs you:
curl -H "Authorization: Bearer $TOKEN" \
"https://cdnshark.com/api/reseller/plans?type=cdn"
The response quotes both the public list price and your_price after your discount, alongside your current balance:
{
"discount_percent": 25.0,
"credit_balance": 480.00,
"data": [
{
"id": 3,
"name": "CDN Starter",
"type": "cdn",
"list_price": 20.00,
"your_price": 15.00,
"your_setup_fee": 0.00,
"your_total": 15.00,
"terms": 30
}
]
}
Response codes
| Code | Meaning |
|---|---|
200 / 201 | Success |
400 | Missing Idempotency-Key on an order endpoint |
401 | Missing or invalid token |
402 | Insufficient credit — includes the shortfall |
403 | Token lacks the required ability, or not a reseller account |
404 | Resource does not exist, or is not yours |
409 | A request with the same idempotency key is still running |
422 | Validation failed, or an idempotency key was reused with a different body |
429 | Rate limited |
A 404 is deliberately returned instead of 403 for resources belonging to another reseller, so the API never confirms that an id exists.
Rate limits
The Reseller API has its own limit, separate from the Customer API — 300 requests per minute by default, counted per reseller. Contact support if your integration needs more.