Set the next billing date of an account
Цей контент ще не доступний вашою мовою.
setAccountNextBillingTime moves the date on which the service plan of an account is charged next. Use it, for example, to align all accounts to the same billing day. updateAccount cannot change this date. It is the Next Billing Date of the account in the panel.
The method moves the end of the paid period, not only the date shown. On the new date, at 00:00 in the account’s time zone, the account is charged for the next period, or its service plan is suspended when the balance is not enough. The following periods are counted from that date. Nothing is refunded or prorated. A plan with a fixed Billing Day charges proportionally up to its day once and then returns to it.
Any customer may call it for its own accounts; accounts of its sub-customers are not reachable. The root customer may call it for any account. The method supports trusted mode with i_customer.
Parameters
Section titled “Parameters”| Name | Type | Required | Description |
|---|---|---|---|
i_account |
int | yes | ID of the account |
next_billing_time |
string | yes | The new date as a string, YYYY-MM-DD, for example 2026-12-01. A time of day and a time zone after the date are accepted and ignored. Today or a later date in the account’s time zone. An empty string or NULL clears the date and restarts the billing cycle (see below) |
Send next_billing_time as a string. A dateTime value is refused.
A date is accepted only when the account’s service plan is Pre-Paid, is not suspended and has charged the account at least once.
Returns
Section titled “Returns”| Name | Type | Description |
|---|---|---|
status |
string | OK. This method returns status, not result |
i_account |
int | ID of the account |
next_billing_time |
string | The new date, YYYY-MM-DD; an empty string when the date was cleared |
paid_until |
string | The date the account was paid up to before the call, YYYY-MM-DD; an empty string when the date was cleared |
Example
Section titled “Example”call("setAccountNextBillingTime", { "i_account": 3092, "next_billing_time": "2026-12-01",}){ "status": "OK", "i_account": 3092, "next_billing_time": "2026-12-01", "paid_until": "2026-11-17",}To restart the billing cycle, send an empty string:
call("setAccountNextBillingTime", {"i_account": 3092, "next_billing_time": ""}){"status": "OK", "i_account": 3092, "next_billing_time": "", "paid_until": ""}Errors
Section titled “Errors”| faultCode | faultString | Cause |
|---|---|---|
400 |
i_account is required and must be an integer. |
i_account is missing or not a number. i_account must be a positive integer. when it is 0 or less |
400 |
next_billing_time must be a string or empty., Could not parse next_billing_time: … |
next_billing_time is not a string, or not a date in YYYY-MM-DD |
400 |
The account has no service plan. |
Assign a service plan first |
400 |
The billing date can be moved for a prepaid service plan only. |
The service plan is Post-Paid |
400 |
The service plan is suspended. The billing date can be moved after the plan is resumed. |
The last charge failed. Add a payment, wait for the charge, then try again |
400 |
The billing date cannot be in the past. |
The date is before today in the account’s time zone |
400 |
The service plan has not been charged yet. Try again after the next billing run. |
The plan has never charged the account, or it was changed and the old plan is not closed yet |
402 |
The call does not identify a customer. In trusted mode, send i_customer |
|
451 |
Account not found |
No such account, or it does not belong to the authenticated customer |
Related
Section titled “Related”- Accounts: the Next Billing Date field
- Service plans: Billing Cycle, Billing Day and Billing Type
- Update an account
- Apply service plan charges
- Get account information