The Billing API provides programmatic access to your invoicing, payment, and subscription data. Use it to build custom billing dashboards, automate payment monitoring, and integrate Data Mammoth billing with your accounting systems.
Base URL
https://api.datamammoth.com/v1/billingList Invoices
Retrieve all invoices for your account.
GET /v1/billing/invoicesQuery Parameters:
| Parameter | Type | Description |
|---|---|---|
status | string | Filter: paid, unpaid, overdue, cancelled |
date_from | string | Start date (ISO 8601 format) |
date_to | string | End date (ISO 8601 format) |
page | integer | Page number |
per_page | integer | Results per page |
curl -X GET "https://api.datamammoth.com/v1/billing/invoices?status=unpaid" \
-H "Authorization: Bearer dm_key_abc123def456"Response:
{
"data": [
{
"id": "inv_2026_0042",
"number": "INV-2026-0042",
"date": "2026-03-01",
"due_date": "2026-03-15",
"subtotal": 30.00,
"tax": 6.30,
"total": 36.30,
"status": "unpaid",
"items": [
{
"description": "VPS Standard — March 2026",
"quantity": 1,
"unit_price": 30.00,
"total": 30.00
}
]
}
],
"meta": {
"total": 1,
"page": 1
}
}Get Invoice Details
GET /v1/billing/invoices/{invoice_id}Returns complete invoice details including line items, taxes, payments, and status.
Account Balance
Check your current account credit balance.
GET /v1/billing/balanceResponse:
{
"data": {
"balance": 125.50,
"currency": "USD"
}
}List Subscriptions
View all active subscriptions.
GET /v1/billing/subscriptionsResponse:
{
"data": [
{
"id": "sub_xyz789",
"service": "VPS Standard",
"server_id": "srv_abc123",
"billing_cycle": "monthly",
"amount": 30.00,
"status": "active",
"next_renewal": "2026-04-01",
"auto_renew": true
}
]
}Payment History
View past payments.
GET /v1/billing/paymentsQuery Parameters:
| Parameter | Type | Description |
|---|---|---|
date_from | string | Start date |
date_to | string | End date |
page | integer | Page number |
{
"data": [
{
"id": "pay_abc123",
"invoice_id": "inv_2026_0041",
"amount": 36.30,
"method": "credit_card",
"status": "completed",
"date": "2026-02-15T10:30:00Z"
}
]
}Use Cases
Automated Invoice Monitoring
Build a script that checks for unpaid invoices and sends alerts:
import requestsresponse = requests.get( "https://api.datamammoth.com/v1/billing/invoices?status=unpaid", headers={"Authorization": "Bearer dm_key_abc123def456"} )
invoices = response.json()["data"] if invoices: print(f"Warning: {len(invoices)} unpaid invoices found!")
Accounting Integration
Export invoice data to your accounting system by periodically fetching invoices and syncing with tools like QuickBooks, Xero, or custom spreadsheets.
Budget Monitoring
Track monthly spending by summing paid invoice amounts within a date range.
What to Do Next
- Support API — Manage support tickets via API.
- API Pagination & Filtering — Navigate large datasets.
- Webhooks — Get billing event notifications.
- API Code Examples — JavaScript — Billing API in Node.js.