CDNShark Documentation

Reseller API

← Back to Documentation

Reseller API — Credit, Orders & Invoices

Two separate ledgers exist and it is important not to confuse them:

  • Credit transactions are yours — what you spent with CDNShark.
  • Orders and invoices belong to your customers — what was provisioned, for whom.

Every reseller-provisioned invoice is created already paid, settled from your credit. Your customer owes CDNShark nothing; you bill them separately.

Current balance

GET /api/reseller/credit
{
  "credit_balance": 480.00,
  "discount_percent": 25.0,
  "currency": "USD"
}

Credit ledger

GET /api/reseller/credit/transactions?per_page=100

Each entry records the balance before and after, so you can reconcile against your own books:

{
  "id": 9931,
  "type": "reseller_provision_spend",
  "amount": -15.00,
  "balance_before": 495.00,
  "balance_after": 480.00,
  "invoice_id": 20514,
  "note": "Provisioned cdn.example.com (CDN Starter) for customer #4210",
  "meta": {"customer_id": 4210, "order_id": 8842, "plan_id": 3},
  "created_at": "2026-08-01T09:16:03+00:00"
}

Top-ups appear as positive amounts; provisioning appears as negative reseller_provision_spend entries carrying the customer and order id in meta.

Orders

GET /api/reseller/orders?customer_id=4210&status=active
GET /api/reseller/orders/{id}

Covers every order across all your customers. Filter by customer_id or status.

Invoices

GET /api/reseller/invoices?customer_id=4210
GET /api/reseller/invoices/{id}

Invoices carry payment_method: "reseller_credit" and status: "paid". Use them as the authoritative record of what you were charged and when.

Topping up

Top-ups are not exposed through the API — they go through a payment gateway and require an interactive checkout. Add credit in the reseller portal under Credit & Billing.

To avoid running dry mid-integration, subscribe to the reseller.credit.low webhook and set a threshold on your account.