This document is the API specification for BoxBilling
Shopping cart management
Get shopping cart contents
.. configuration-block:: .. code-block:: php $result = $api_guest->cart_get($params); .. code-block:: html {{ guest.cart_get() }} .. code-block:: javascript bb.post("guest/cart/get", {})
Completely remove shopping cart contents
.. configuration-block:: .. code-block:: php $result = $api_guest->cart_reset($params); .. code-block:: html {{ guest.cart_reset() }} .. code-block:: javascript bb.post("guest/cart/reset", {})
Set shopping cart currency
currency: | string - New currency code to applied to shopping cart |
---|
.. configuration-block:: .. code-block:: php $result = $api_guest->cart_set_currency($params); .. code-block:: html {{ guest.cart_set_currency() }} .. code-block:: javascript bb.post("guest/cart/set_currency", {})
Retrieve information about currently selected shopping cart currency
.. configuration-block:: .. code-block:: php $result = $api_guest->cart_get_currency($params); .. code-block:: html {{ guest.cart_get_currency() }} .. code-block:: javascript bb.post("guest/cart/get_currency", {})
Apply Promo code to shopping cart
promocode: | string - Promo code string |
---|
.. configuration-block:: .. code-block:: php $result = $api_guest->cart_apply_promo($params); .. code-block:: html {{ guest.cart_apply_promo() }} .. code-block:: javascript bb.post("guest/cart/apply_promo", {})
Removes promo from shopping cart and resets discounted prices if any
.. configuration-block:: .. code-block:: php $result = $api_guest->cart_remove_promo($params); .. code-block:: html {{ guest.cart_remove_promo() }} .. code-block:: javascript bb.post("guest/cart/remove_promo", {})
Removes product from shopping cart
id: | int - Shopping cart item id |
---|
.. configuration-block:: .. code-block:: php $result = $api_guest->cart_remove_item($params); .. code-block:: html {{ guest.cart_remove_item() }} .. code-block:: javascript bb.post("guest/cart/remove_item", {})
Adds product to shopping cart
id: | int - Product ID |
---|
multiple: | bool - Default false. Allow multiple items in cart |
---|---|
period: | string - Billing period |
quantity: | int - Products quantity |
config: | array - Product configuration options |
addons: | array - List of addons ids |
.. configuration-block:: .. code-block:: php $result = $api_guest->cart_add_item($params); .. code-block:: html {{ guest.cart_add_item() }} .. code-block:: javascript bb.post("guest/cart/add_item", {})
Clients API methods
Client signup action.
email: | string - Email |
---|---|
first_name: | string - First name |
password: | string - password |
password_confirm: | string - must be same as password |
auto_login: | bool - Auto login client after signup |
---|---|
last_name: | string - last name |
aid: | string - Alternative id. Usually used by import tools. |
gender: | string - Gender - values: male|female |
country: | string - Country |
city: | string - city |
birthday: | string - Birthday |
type: | string - Identifies client type: company or individual |
company: | string - Company |
company_vat: | string - Company VAT number |
company_number: | string - Company number |
address_1: | string - Address line 1 |
address_2: | string - Address line 2 |
postcode: | string - zip or postcode |
state: | string - country state |
phone: | string - Phone number |
phone_cc: | string - Phone country code |
document_type: | string - Related document type, ie: passport, driving license |
document_nr: | string - Related document number, ie: passport number: LC45698122 |
notes: | string - Notes about client. Visible for admin only |
custom_1: | string - Custom field 1 |
custom_2: | string - Custom field 2 |
custom_3: | string - Custom field 3 |
custom_4: | string - Custom field 4 |
custom_5: | string - Custom field 5 |
custom_6: | string - Custom field 6 |
custom_7: | string - Custom field 7 |
custom_8: | string - Custom field 8 |
custom_9: | string - Custom field 9 |
custom_10: | string - Custom field 10 |
.. configuration-block:: .. code-block:: php $result = $api_guest->client_create($params); .. code-block:: html {{ guest.client_create() }} .. code-block:: javascript bb.post("guest/client/create", {})
Client login action
email: | string - client email |
---|---|
password: | string - client password |
.. configuration-block:: .. code-block:: php $result = $api_guest->client_login($params); .. code-block:: html {{ guest.client_login() }} .. code-block:: javascript bb.post("guest/client/login", {})
Password reset confirmation email will be sent to email.
email: | string - client email |
---|
.. configuration-block:: .. code-block:: php $result = $api_guest->client_reset_password($params); .. code-block:: html {{ guest.client_reset_password() }} .. code-block:: javascript bb.post("guest/client/reset_password", {})
Confirm password reset action
hash: | string - hash received in email |
---|
.. configuration-block:: .. code-block:: php $result = $api_guest->client_confirm_reset($params); .. code-block:: html {{ guest.client_confirm_reset() }} .. code-block:: javascript bb.post("guest/client/confirm_reset", {})
Check if given vat number is valid EU country VAT number This method uses http://isvat.appspot.com/ method to validate VAT
country: | string - Country CODE: FR - France etc. |
---|---|
vat: | string - VAT number |
.. configuration-block:: .. code-block:: php $result = $api_guest->client_is_vat($params); .. code-block:: html {{ guest.client_is_vat() }} .. code-block:: javascript bb.post("guest/client/is_vat", {})
List of required fields for client registration
.. configuration-block:: .. code-block:: php $result = $api_guest->client_required($params); .. code-block:: html {{ guest.client_required() }} .. code-block:: javascript bb.post("guest/client/required", {})
Cron checker
Run cron if is late and web based cron is enabled
.. configuration-block:: .. code-block:: php $result = $api_guest->cron_check($params); .. code-block:: html {{ guest.cron_check() }} .. code-block:: javascript bb.post("guest/cron/check", {})
Get cron settings
.. configuration-block:: .. code-block:: php $result = $api_guest->cron_settings($params); .. code-block:: html {{ guest.cron_settings() }} .. code-block:: javascript bb.post("guest/cron/settings", {})
Tells if cron is late
.. configuration-block:: .. code-block:: php $result = $api_guest->cron_is_late($params); .. code-block:: html {{ guest.cron_is_late() }} .. code-block:: javascript bb.post("guest/cron/is_late", {})
Currency management
Get list of available currencies
.. configuration-block:: .. code-block:: php $result = $api_guest->currency_get_pairs($params); .. code-block:: html {{ guest.currency_get_pairs() }} .. code-block:: javascript bb.post("guest/currency/get_pairs", {})
Get currency by code
code: | string - currency code, ie: USD |
---|
.. configuration-block:: .. code-block:: php $result = $api_guest->currency_get($params); .. code-block:: html {{ guest.currency_get() }} .. code-block:: javascript bb.post("guest/currency/get", {})
Format price by currency settings
convert: | bool - covert to default currency rate. Default - true; |
---|---|
without_currency: | bool - Show only number. No symbols are attached Default - false; |
price: | float - Price to be formated. Default 0 |
code: | string - currency code, ie: USD. Default - default currency |
.. configuration-block:: .. code-block:: php $result = $api_guest->currency_format($params); .. code-block:: html {{ guest.currency_format() }} .. code-block:: javascript bb.post("guest/currency/format", {})
All public methods in this class are exposed to public. Always think what kind of information you are exposing. Emails, passwords and other information should NOT be returned by functions in this class
This module can be called from API or in template
Get readme.md file contents
.. configuration-block:: .. code-block:: php $result = $api_guest->example_readme($params); .. code-block:: html {{ guest.example_readme() }} .. code-block:: javascript bb.post("guest/example/readme", {})
Get Top Songs from iTunes Store
limit: | int - define songs limit |
---|
.. configuration-block:: .. code-block:: php $result = $api_guest->example_top_songs($params); .. code-block:: html {{ guest.example_top_songs() }} .. code-block:: javascript bb.post("guest/example/top_songs", {})
Extensions
Checks if extensions is available
mod: | string - module name to be checked |
---|
.. configuration-block:: .. code-block:: php $result = $api_guest->extension_is_on($params); .. code-block:: html {{ guest.extension_is_on() }} .. code-block:: javascript bb.post("guest/extension/is_on", {})
Return active theme info
.. configuration-block:: .. code-block:: php $result = $api_guest->extension_theme($params); .. code-block:: html {{ guest.extension_theme() }} .. code-block:: javascript bb.post("guest/extension/theme", {})
Retrieve list of available languages
.. configuration-block:: .. code-block:: php $result = $api_guest->extension_languages($params); .. code-block:: html {{ guest.extension_languages() }} .. code-block:: javascript bb.post("guest/extension/languages", {})
Custom forms
Get custom order form details for product
product_id: | int - Product id |
---|
.. configuration-block:: .. code-block:: php $result = $api_guest->formbuilder_get($params); .. code-block:: html {{ guest.formbuilder_get() }} .. code-block:: javascript bb.post("guest/formbuilder/get", {})
Forum management
Get paginated list of forums
.. configuration-block:: .. code-block:: php $result = $api_guest->forum_get_list($params); .. code-block:: html {{ guest.forum_get_list() }} .. code-block:: javascript bb.post("guest/forum/get_list", {})
Get forums list grouped by category name
.. configuration-block:: .. code-block:: php $result = $api_guest->forum_get_categories($params); .. code-block:: html {{ guest.forum_get_categories() }} .. code-block:: javascript bb.post("guest/forum/get_categories", {})
Get forum details
id: | int - forum id |
---|
.. configuration-block:: .. code-block:: php $result = $api_guest->forum_get($params); .. code-block:: html {{ guest.forum_get() }} .. code-block:: javascript bb.post("guest/forum/get", {})
Get paginated list of topics
.. configuration-block:: .. code-block:: php $result = $api_guest->forum_get_topic_list($params); .. code-block:: html {{ guest.forum_get_topic_list() }} .. code-block:: javascript bb.post("guest/forum/get_topic_list", {})
Get topic details
id: | int - topic id |
---|
.. configuration-block:: .. code-block:: php $result = $api_guest->forum_get_topic($params); .. code-block:: html {{ guest.forum_get_topic() }} .. code-block:: javascript bb.post("guest/forum/get_topic", {})
Get topic messages list
forum_topic_id: | int - topic id |
---|
.. configuration-block:: .. code-block:: php $result = $api_guest->forum_get_topic_message_list($params); .. code-block:: html {{ guest.forum_get_topic_message_list() }} .. code-block:: javascript bb.post("guest/forum/get_topic_message_list", {})
Search topic messages
q: | string - query string |
---|
.. configuration-block:: .. code-block:: php $result = $api_guest->forum_search($params); .. code-block:: html {{ guest.forum_search() }} .. code-block:: javascript bb.post("guest/forum/search", {})
Invoice processing
Get invoice details
hash: | string - invoice hash |
---|
.. configuration-block:: .. code-block:: php $result = $api_guest->invoice_get($params); .. code-block:: html {{ guest.invoice_get() }} .. code-block:: javascript bb.post("guest/invoice/get", {})
Update Invoice details. Only unpaid invoice details can be updated.
hash: | string - invoice hash |
---|
gateway_id: | int - selected payment gateway id |
---|
.. configuration-block:: .. code-block:: php $result = $api_guest->invoice_update($params); .. code-block:: html {{ guest.invoice_update() }} .. code-block:: javascript bb.post("guest/invoice/update", {})
Get list of available payment gateways to pay for invoices
format: | string - if format is "pairs" then id=>name values are returned |
---|
.. configuration-block:: .. code-block:: php $result = $api_guest->invoice_gateways($params); .. code-block:: html {{ guest.invoice_gateways() }} .. code-block:: javascript bb.post("guest/invoice/gateways", {})
Process invoice for selected gateway. Returned result can be processed to redirect or to show required information. Returned result depends
on payment gateway.
hash: | string - invoice hash |
---|---|
gateway_id: | int - payment gateway id |
subscription: | bool - is payment subscription |
---|---|
auto_redirect: | bool - should payment adapter automatically redirect client or just print pay now button |
.. configuration-block:: .. code-block:: php $result = $api_guest->invoice_payment($params); .. code-block:: html {{ guest.invoice_payment() }} .. code-block:: javascript bb.post("guest/invoice/payment", {})
Knowledge base API
Get paginated list of knowledge base articles. Returns only active articles.
.. configuration-block:: .. code-block:: php $result = $api_guest->kb_article_get_list($params); .. code-block:: html {{ guest.kb_article_get_list() }} .. code-block:: javascript bb.post("guest/kb/article_get_list", {})
Get active knowledge base article
id: | int - knowledge base article ID. Required only if SLUG is not passed. |
---|---|
slug: | string - knowledge base article slug. Required only if ID is not passed. |
.. configuration-block:: .. code-block:: php $result = $api_guest->kb_article_get($params); .. code-block:: html {{ guest.kb_article_get() }} .. code-block:: javascript bb.post("guest/kb/article_get", {})
Get paginated list of knowledge base categories
.. configuration-block:: .. code-block:: php $result = $api_guest->kb_category_get_list($params); .. code-block:: html {{ guest.kb_category_get_list() }} .. code-block:: javascript bb.post("guest/kb/category_get_list", {})
Get knowledge base categories id, title pairs
.. configuration-block:: .. code-block:: php $result = $api_guest->kb_category_get_pairs($params); .. code-block:: html {{ guest.kb_category_get_pairs() }} .. code-block:: javascript bb.post("guest/kb/category_get_pairs", {})
Get knowledge base category by ID or SLUG
id: | int - knowledge base category ID. Required only if SLUG is not passed. |
---|---|
slug: | string - knowledge base category slug. Required only if ID is not passed. |
.. configuration-block:: .. code-block:: php $result = $api_guest->kb_category_get($params); .. code-block:: html {{ guest.kb_category_get() }} .. code-block:: javascript bb.post("guest/kb/category_get", {})
News and announcements management
Get paginated list of active news items
.. configuration-block:: .. code-block:: php $result = $api_guest->news_get_list($params); .. code-block:: html {{ guest.news_get_list() }} .. code-block:: javascript bb.post("guest/news/get_list", {})
Get news item by ID or SLUG
id: | int - news item ID. Required only if SLUG is not passed. |
---|---|
slug: | string - news item slug. Required only if ID is not passed. |
.. configuration-block:: .. code-block:: php $result = $api_guest->news_get($params); .. code-block:: html {{ guest.news_get() }} .. code-block:: javascript bb.post("guest/news/get", {})
Products management api
Get paginated list of products
show_hidden: | bool - also get hidden products. Default false |
---|
.. configuration-block:: .. code-block:: php $result = $api_guest->product_get_list($params); .. code-block:: html {{ guest.product_get_list() }} .. code-block:: javascript bb.post("guest/product/get_list", {})
Get products pairs. Product id -> title values
.. configuration-block:: .. code-block:: php $result = $api_guest->product_get_pairs($params); .. code-block:: html {{ guest.product_get_pairs() }} .. code-block:: javascript bb.post("guest/product/get_pairs", {})
Get product by ID
id: | int - product id |
---|
.. configuration-block:: .. code-block:: php $result = $api_guest->product_get($params); .. code-block:: html {{ guest.product_get() }} .. code-block:: javascript bb.post("guest/product/get", {})
Get paginated list of product categories
.. configuration-block:: .. code-block:: php $result = $api_guest->product_category_get_list($params); .. code-block:: html {{ guest.product_category_get_list() }} .. code-block:: javascript bb.post("guest/product/category_get_list", {})
Get pairs of product categories
.. configuration-block:: .. code-block:: php $result = $api_guest->product_category_get_pairs($params); .. code-block:: html {{ guest.product_category_get_pairs() }} .. code-block:: javascript bb.post("guest/product/category_get_pairs", {})
Return slider data for product types. Products are grouped by type. You can pass parameter to select product type for slider
Product configuration must have slider_%s keys
type: | string - product type for slider - default = hosting |
---|---|
format: | string - return format. Default is array . You can choose json format, to directly inject to javascript |
.. configuration-block:: .. code-block:: php $result = $api_guest->product_get_slider($params); .. code-block:: html {{ guest.product_get_slider() }} .. code-block:: javascript bb.post("guest/product/get_slider", {})
Domain service management
Get configured TLDs which can be ordered. Shows only enabled TLDs
allow_register: | bool - shows only these TLDs which can be registered |
---|---|
allow_transfer: | bool - shows only these TLDs which can be transferred |
.. configuration-block:: .. code-block:: php $result = $api_guest->servicedomain_tlds($params); .. code-block:: html {{ guest.servicedomain_tlds() }} .. code-block:: javascript bb.post("guest/servicedomain/tlds", {})
Get TLD pricing information
tld: | string - Top level domain, ie: .com |
---|
.. configuration-block:: .. code-block:: php $result = $api_guest->servicedomain_pricing($params); .. code-block:: html {{ guest.servicedomain_pricing() }} .. code-block:: javascript bb.post("guest/servicedomain/pricing", {})
Check if domain is available for registration. Domain registrar must be configured in order to get correct results.
sld: | string - second level domain, ie: mydomain |
---|---|
tld: | string - top level domain, ie: .com |
.. configuration-block:: .. code-block:: php $result = $api_guest->servicedomain_check($params); .. code-block:: html {{ guest.servicedomain_check() }} .. code-block:: javascript bb.post("guest/servicedomain/check", {})
Check if domain can be transferred. Domain registrar must be configured in order to get correct results.
sld: | string - second level domain, ie: mydomain |
---|---|
tld: | string - top level domain, ie: .com |
.. configuration-block:: .. code-block:: php $result = $api_guest->servicedomain_can_be_transferred($params); .. code-block:: html {{ guest.servicedomain_can_be_transferred() }} .. code-block:: javascript bb.post("guest/servicedomain/can_be_transferred", {})
Licensing server
Check license details callback. Request IP is detected automatically You can pass any other parameters to be validated by license plugin.
license: | string - license key |
---|---|
host: | string - hostname where license is installed |
version: | string - software version |
path: | string - software install path |
legacy: | string - deprecated parameter. Returns result in non consistent API result |
---|
.. configuration-block:: .. code-block:: php $result = $api_guest->servicelicense_check($params); .. code-block:: html {{ guest.servicelicense_check() }} .. code-block:: javascript bb.post("guest/servicelicense/check", {})
Solusvm service management
Return operating system templates available on solusVM master server
type: | string - virtualization type |
---|
.. configuration-block:: .. code-block:: php $result = $api_guest->servicesolusvm_get_templates($params); .. code-block:: html {{ guest.servicesolusvm_get_templates() }} .. code-block:: javascript bb.post("guest/servicesolusvm/get_templates", {})
Youhosting service management
Youhosting webhooks listener
.. configuration-block:: .. code-block:: php $result = $api_guest->serviceyouhosting_webhook($params); .. code-block:: html {{ guest.serviceyouhosting_webhook() }} .. code-block:: javascript bb.post("guest/serviceyouhosting/webhook", {})
Return master_domains
.. configuration-block:: .. code-block:: php $result = $api_guest->serviceyouhosting_master_domains($params); .. code-block:: html {{ guest.serviceyouhosting_master_domains() }} .. code-block:: javascript bb.post("guest/serviceyouhosting/master_domains", {})
Spam cheking module management
Returns recaptcha public key
.. configuration-block:: .. code-block:: php $result = $api_guest->spamchecker_recaptcha($params); .. code-block:: html {{ guest.spamchecker_recaptcha() }} .. code-block:: javascript bb.post("guest/spamchecker/recaptcha", {})
Staff methods
Gives ability to create administrator account if no admins exists on the system.
Database structure must be installed before calling this action. bb-config.php file must already be present and configured. Used by automated BoxBilling installer.
email: | string - admin email |
---|---|
password: | string - admin password |
.. configuration-block:: .. code-block:: php $result = $api_guest->staff_create($params); .. code-block:: html {{ guest.staff_create() }} .. code-block:: javascript bb.post("guest/staff/create", {})
Login to admin area and save information to session.
email: | string - admin email |
---|---|
password: | string - admin password |
remember: | string - pass value "1" to create remember me cookie |
---|
.. configuration-block:: .. code-block:: php $result = $api_guest->staff_login($params); .. code-block:: html {{ guest.staff_login() }} .. code-block:: javascript bb.post("guest/staff/login", {})
Public tickets management
Submit new public ticket
name: | string - Ticket author name |
---|---|
email: | string - Ticket author email |
subject: | string - Ticket subject |
message: | string - Ticket message |
.. configuration-block:: .. code-block:: php $result = $api_guest->support_ticket_create($params); .. code-block:: html {{ guest.support_ticket_create() }} .. code-block:: javascript bb.post("guest/support/ticket_create", {})
Get public ticket
hash: | string - public ticket hash |
---|
.. configuration-block:: .. code-block:: php $result = $api_guest->support_ticket_get($params); .. code-block:: html {{ guest.support_ticket_get() }} .. code-block:: javascript bb.post("guest/support/ticket_get", {})
Close public ticket
hash: | string - public ticket hash |
---|
.. configuration-block:: .. code-block:: php $result = $api_guest->support_ticket_close($params); .. code-block:: html {{ guest.support_ticket_close() }} .. code-block:: javascript bb.post("guest/support/ticket_close", {})
Reply to public ticket
hash: | string - public ticket hash |
---|---|
message: | string - public ticket reply message |
.. configuration-block:: .. code-block:: php $result = $api_guest->support_ticket_reply($params); .. code-block:: html {{ guest.support_ticket_reply() }} .. code-block:: javascript bb.post("guest/support/ticket_reply", {})
System methods
Get BoxBilling version
.. configuration-block:: .. code-block:: php $result = $api_guest->system_version($params); .. code-block:: html {{ guest.system_version() }} .. code-block:: javascript bb.post("guest/system/version", {})
Returns company information
.. configuration-block:: .. code-block:: php $result = $api_guest->system_company($params); .. code-block:: html {{ guest.system_company() }} .. code-block:: javascript bb.post("guest/system/company", {})
Returns USA states list
.. configuration-block:: .. code-block:: php $result = $api_guest->system_states($params); .. code-block:: html {{ guest.system_states() }} .. code-block:: javascript bb.post("guest/system/states", {})
Returns list of european union countries
.. configuration-block:: .. code-block:: php $result = $api_guest->system_countries_eunion($params); .. code-block:: html {{ guest.system_countries_eunion() }} .. code-block:: javascript bb.post("guest/system/countries_eunion", {})
Returns list of world countries
.. configuration-block:: .. code-block:: php $result = $api_guest->system_countries($params); .. code-block:: html {{ guest.system_countries() }} .. code-block:: javascript bb.post("guest/system/countries", {})
Returns system parameter by key
key: | string - Parameter name |
---|
.. configuration-block:: .. code-block:: php $result = $api_guest->system_param($params); .. code-block:: html {{ guest.system_param() }} .. code-block:: javascript bb.post("guest/system/param", {})
Return list of available payment periods
.. configuration-block:: .. code-block:: php $result = $api_guest->system_periods($params); .. code-block:: html {{ guest.system_periods() }} .. code-block:: javascript bb.post("guest/system/periods", {})
Gets period title by identifier
code: | string - Period code name, ie: 1M => Monthly |
---|
.. configuration-block:: .. code-block:: php $result = $api_guest->system_period_title($params); .. code-block:: html {{ guest.system_period_title() }} .. code-block:: javascript bb.post("guest/system/period_title", {})
Returns info for paginator according to list
.. configuration-block:: .. code-block:: php $result = $api_guest->system_paginator($params); .. code-block:: html {{ guest.system_paginator() }} .. code-block:: javascript bb.post("guest/system/paginator", {})
If called from template file this function returns current url
.. configuration-block:: .. code-block:: php $result = $api_guest->system_current_url($params); .. code-block:: html {{ guest.system_current_url() }} .. code-block:: javascript bb.post("guest/system/current_url", {})
Check if passed file name template exists for client area
file: | string - template file name, example: mod_index_dashboard.phtml |
---|
.. configuration-block:: .. code-block:: php $result = $api_guest->system_template_exists($params); .. code-block:: html {{ guest.system_template_exists() }} .. code-block:: javascript bb.post("guest/system/template_exists", {})
Get current client locale
.. configuration-block:: .. code-block:: php $result = $api_guest->system_locale($params); .. code-block:: html {{ guest.system_locale() }} .. code-block:: javascript bb.post("guest/system/locale", {})