bill.php¶
Billing management module for handling customer services, invoices, billing lists, and CSV exports.
API Methods¶
| Method | Action | Description |
|---|---|---|
billing_list | get billing records list | Retrieves a list of billing records for a specific service with optional filtering and sorting. |
customer_billings_export | export customer billings to CSV | Generates a CSV export of all billing records for the authenticated customer. |
customer_billings_list | get customer billings list | Returns a list of billing records for the currently authenticated customer. |
customer_invoice_billings | get billings for specific invoice | Retrieves all billing records associated with a specific invoice ID. |
customer_prebill_invoice_ids | get pre-billing invoice IDs | Returns a list of available pre-billing invoice IDs for the authenticated customer. |
customer_services_get | get billing record by id or ident key | Retrieves detailed information about a specific customer service/billing record. |
customer_services_list | get customer services list | Returns a paginated list of services for the authenticated user with various filters. |
server_billings_list | get server billings list | Retrieves a list of billing records associated with a specific server. |
services_list | get services list | Returns a list of available services from the system options. |
bill/billing_list¶
Retrieves a list of billing records for a specific service with optional filtering and sorting.
HTTP method: POST
Parameters:
| Parameter | Required | Type | Description |
|---|---|---|---|
| action | ✅ | string | Method identifier: billing_list |
| token | ✅ | string | Authentication token. |
| params[service_id] | ✅ | integer | The ID of the service to filter billings for. |
| params[period_start] | ❌ | string | Start date for filtering. Accepted formats: YYYY-MM-DD HH:MM:SS, YYYY-MM-DD HH:MM, YYYY-MM-DD. |
| params[period_end] | ❌ | string | End date for filtering. Accepted formats: YYYY-MM-DD HH:MM:SS, YYYY-MM-DD HH:MM, YYYY-MM-DD. |
| params[start] | ❌ | integer | Pagination start offset. |
| params[items] | ❌ | integer | Number of items to return per page. |
| params[sort_order] | ❌ | string | Sorting order. Allowed values: ASC, DESC. |
| params[sort_type] | ❌ | string | Field to sort by. Allowed values: id, period_end, period_start, amount, invoice_id, invoice_paid. |
Request example
Success response example
bill/customer_billings_export¶
Generates a CSV export of all billing records for the authenticated customer.
HTTP method: POST
Parameters:
| Parameter | Required | Type | Description |
|---|---|---|---|
| action | ✅ | string | Method identifier: customer_billings_export |
| token | ✅ | string | Authentication token. |
| customer_id | ✅ | integer | The ID of the customer for whom to export billing records. |
| skip_filters | ✅ | string | Параметр skip_filters |
Request example
Success response example
{
"result": "OK",
"action": "customer_billings_export",
"csv": "Date;Period Start;Period End;Service;Service Type;Entity ID;Region;Invoice;Status;Amount;Currency\n2024-01-01;;2024-02-01;VPS;Standard;123;US;#1;Paid;50.00;EUR",
"filename": "billing_export_2024-01-01_12-00-00.csv",
"records": 1,
"currency": "EUR"
}
bill/customer_billings_list¶
Returns a list of billing records for the currently authenticated customer.
HTTP method: POST
Parameters:
| Parameter | Required | Type | Description |
|---|---|---|---|
| action | ✅ | string | Method identifier: customer_billings_list |
| token | ✅ | string | Authentication token. |
| customer_id | ✅ | integer | The unique identifier of the customer to retrieve billings for. |
Request example
Success response example
bill/customer_invoice_billings¶
Retrieves all billing records associated with a specific invoice ID.
HTTP method: POST
Parameters:
| Parameter | Required | Type | Description |
|---|---|---|---|
| action | ✅ | string | Method identifier: customer_invoice_billings |
| token | ✅ | string | Authentication token. |
| id | ❌ | integer | Invoice ID (if not provided in params[invoice_id]). |
| params[invoice_id] | ❌ | integer | The specific invoice identifier. |
| invoice_id | ✅ | integer | Parameter invoice_id used to identify the invoice. |
Request example
Success response example
bill/customer_prebill_invoice_ids¶
Returns a list of available pre-billing invoice IDs for the authenticated customer.
HTTP method: POST
Parameters:
| Parameter | Required | Type | Description |
|---|---|---|---|
| action | ✅ | string | Method identifier: customer_prebill_invoice_ids |
| token | ✅ | string | Authentication token. |
Request example
Success response example
bill/customer_services_get¶
Retrieves detailed information about a specific customer service/billing record.
HTTP method: POST
Parameters:
| Parameter | Required | Type | Description |
|---|---|---|---|
| action | ✅ | string | Method identifier: customer_services_get |
| token | ✅ | string | Authentication token. |
| params[id] | ❌ | integer | The internal ID of the service. |
| params[customer_id] | ❌ | integer | Customer identifier (automatically set for customers). |
| params[service_ident] | ❌ | string | The 10-character hex billing key. |
| customer_id | ✅ | int | Параметр customer_id |
| ✅ | string | Параметр email |
Request example
Success response example
{
"result": "OK",
"action": "customer_services_get",
"service": {
"id": 5,
"entity_id": 12,
"customer_id": 45,
"server_data": {
"id": 12,
"name": "Server Name"
}
},
"customer": {
"id": 45,
"email": "[email protected]",
"name": "John Doe"
}
}
bill/customer_services_list¶
Returns a paginated list of services for the authenticated user with various filters.
HTTP method: POST
Parameters:
| Parameter | Required | Type | Description |
|---|---|---|---|
| action | ✅ | string | Method identifier: customer_services_list |
| token | ✅ | string | Authentication token. |
| params[id] | ❌ | integer | Filter by service ID. |
| params[email] | ❌ | string | Filter by customer email. |
| params[service_list_id] | ❌ | integer | Filter by service list ID. |
| params[period_end] | ❌ | string | End date filter (YYYY-MM-DD). |
| params[period_start] | ❌ | string | Start date filter (YYYY-MM-DD). |
| params[service_ident] | ❌ | string | Filter by service identifier. |
| params[start] | ❌ | integer | Pagination start offset. |
| params[items] | ❌ | integer | Number of items to return. |
| params[sort_order] | ❌ | string | Field to sort by. Allowed values: id, customer_id, period_end, period_start, service_ident, service_list_id. |
| params[sort_type] | ❌ | string | Sorting order. Allowed values: ASC, DESC. |
| params[key] | ❌ | string | Filter by 10-character billing key. |
| params[date_from] | ❌ | string | Start date filter (YYYY-MM-DD). |
| params[date_to] | ❌ | string | End date filter (YYYY-MM-DD). |
Request example
Success response example
bill/services_list¶
Returns a list of available services from the system options.
HTTP method: POST
Parameters:
| Parameter | Required | Type | Description |
|---|---|---|---|
| action | ✅ | string | The name of the action to perform. |
Request example
Success response example
bill/server_billings_list¶
Retrieves a list of billing records associated with a specific server.
HTTP method: POST
Parameters:
| Parameter | Required | Type | Description |
|---|---|---|---|
| action | ✅ | string | Method identifier: server_billings_list |
| token | ✅ | string | Authentication token. |
| id | ❌ | integer | Server entity ID. If provided, it takes precedence over entity_id in params. |
| params[entity_id] | ❌ | integer | The ID of the server entity to retrieve billings for. |
| entity_id | ✅ | integer | The ID of the server entity for which billing records are retrieved. |
| scope_customer_id | ✅ | int | Параметр scope_customer_id |
Request example