Guest API¶
This document is the API specification for BoxBilling
Cart¶
Shopping cart management
guest/cart/get¶
Get shopping cart contents
API call examples¶
- PHP
$result = $api_guest->cart_get($params);
- HTML
{{ guest.cart_get() }}
- JavaScript
bb.post("guest/cart/get", {})
guest/cart/reset¶
Completely remove shopping cart contents
API call examples¶
- PHP
$result = $api_guest->cart_reset($params);
- HTML
{{ guest.cart_reset() }}
- JavaScript
bb.post("guest/cart/reset", {})
guest/cart/set_currency¶
Set shopping cart currency
Required parameters¶
currency: | string - New currency code to applied to shopping cart |
---|
API call examples¶
- PHP
$result = $api_guest->cart_set_currency($params);
- HTML
{{ guest.cart_set_currency() }}
- JavaScript
bb.post("guest/cart/set_currency", {})
guest/cart/get_currency¶
Retrieve information about currently selected shopping cart currency
API call examples¶
- PHP
$result = $api_guest->cart_get_currency($params);
- HTML
{{ guest.cart_get_currency() }}
- JavaScript
bb.post("guest/cart/get_currency", {})
guest/cart/apply_promo¶
Apply Promo code to shopping cart
Required parameters¶
promocode: | string - Promo code string |
---|
API call examples¶
- PHP
$result = $api_guest->cart_apply_promo($params);
- HTML
{{ guest.cart_apply_promo() }}
- JavaScript
bb.post("guest/cart/apply_promo", {})
guest/cart/remove_promo¶
Removes promo from shopping cart and resets discounted prices if any
API call examples¶
- PHP
$result = $api_guest->cart_remove_promo($params);
- HTML
{{ guest.cart_remove_promo() }}
- JavaScript
bb.post("guest/cart/remove_promo", {})
guest/cart/remove_item¶
Removes product from shopping cart
Required parameters¶
id: | int - Shopping cart item id |
---|
API call examples¶
- PHP
$result = $api_guest->cart_remove_item($params);
- HTML
{{ guest.cart_remove_item() }}
- JavaScript
bb.post("guest/cart/remove_item", {})
guest/cart/add_item¶
Adds product to shopping cart
Required parameters¶
id: | int - Product ID |
---|
Optional parameters¶
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 |
API call examples¶
- PHP
$result = $api_guest->cart_add_item($params);
- HTML
{{ guest.cart_add_item() }}
- JavaScript
bb.post("guest/cart/add_item", {})
Client¶
Clients API methods
guest/client/create¶
Client signup action.
Required parameters¶
email: | string - Email |
---|---|
first_name: | string - First name |
password: | string - password |
password_confirm: | |
string - must be same as password |
Optional parameters¶
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 |
API call examples¶
- PHP
$result = $api_guest->client_create($params);
- HTML
{{ guest.client_create() }}
- JavaScript
bb.post("guest/client/create", {})
guest/client/login¶
Client login action
Required parameters¶
email: | string - client email |
---|---|
password: | string - client password |
API call examples¶
- PHP
$result = $api_guest->client_login($params);
- HTML
{{ guest.client_login() }}
- JavaScript
bb.post("guest/client/login", {})
guest/client/reset_password¶
Password reset confirmation email will be sent to email.
Required parameters¶
email: | string - client email |
---|
API call examples¶
- PHP
$result = $api_guest->client_reset_password($params);
- HTML
{{ guest.client_reset_password() }}
- JavaScript
bb.post("guest/client/reset_password", {})
guest/client/confirm_reset¶
Confirm password reset action
Required parameters¶
hash: | string - hash received in email |
---|
API call examples¶
- PHP
$result = $api_guest->client_confirm_reset($params);
- HTML
{{ guest.client_confirm_reset() }}
- JavaScript
bb.post("guest/client/confirm_reset", {})
guest/client/is_vat¶
Check if given vat number is valid EU country VAT number This method uses http://isvat.appspot.com/ method to validate VAT
Required parameters¶
country: | string - Country CODE: FR - France etc. |
---|---|
vat: | string - VAT number |
API call examples¶
- PHP
$result = $api_guest->client_is_vat($params);
- HTML
{{ guest.client_is_vat() }}
- JavaScript
bb.post("guest/client/is_vat", {})
Cron¶
Cron checker
guest/cron/check¶
Run cron if is late and web based cron is enabled
API call examples¶
- PHP
$result = $api_guest->cron_check($params);
- HTML
{{ guest.cron_check() }}
- JavaScript
bb.post("guest/cron/check", {})
Currency¶
Currency management
guest/currency/get_pairs¶
Get list of available currencies
API call examples¶
- PHP
$result = $api_guest->currency_get_pairs($params);
- HTML
{{ guest.currency_get_pairs() }}
- JavaScript
bb.post("guest/currency/get_pairs", {})
guest/currency/get¶
Get currency by code
Required parameters¶
code: | string - currency code, ie: USD |
---|
API call examples¶
- PHP
$result = $api_guest->currency_get($params);
- HTML
{{ guest.currency_get() }}
- JavaScript
bb.post("guest/currency/get", {})
guest/currency/format¶
Format price by currency settings
Optional parameters¶
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 |
API call examples¶
- PHP
$result = $api_guest->currency_format($params);
- HTML
{{ guest.currency_format() }}
- JavaScript
bb.post("guest/currency/format", {})
Example¶
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
Extension¶
Extensions
guest/extension/is_on¶
Checks if extensions is available
Required parameters¶
mod: | string - module name to be checked |
---|
API call examples¶
- PHP
$result = $api_guest->extension_is_on($params);
- HTML
{{ guest.extension_is_on() }}
- JavaScript
bb.post("guest/extension/is_on", {})
Formbuilder¶
Custom forms
Forum¶
Forum management
guest/forum/get_list¶
Get paginated list of forums
API call examples¶
- PHP
$result = $api_guest->forum_get_list($params);
- HTML
{{ guest.forum_get_list() }}
- JavaScript
bb.post("guest/forum/get_list", {})
guest/forum/get_categories¶
Get forums list grouped by category name
API call examples¶
- PHP
$result = $api_guest->forum_get_categories($params);
- HTML
{{ guest.forum_get_categories() }}
- JavaScript
bb.post("guest/forum/get_categories", {})
guest/forum/get¶
Get forum details
Required parameters¶
id: | int - forum id |
---|
API call examples¶
- PHP
$result = $api_guest->forum_get($params);
- HTML
{{ guest.forum_get() }}
- JavaScript
bb.post("guest/forum/get", {})
guest/forum/get_topic_list¶
Get paginated list of topics
API call examples¶
- PHP
$result = $api_guest->forum_get_topic_list($params);
- HTML
{{ guest.forum_get_topic_list() }}
- JavaScript
bb.post("guest/forum/get_topic_list", {})
guest/forum/get_topic¶
Get topic details
Required parameters¶
id: | int - topic id |
---|
API call examples¶
- PHP
$result = $api_guest->forum_get_topic($params);
- HTML
{{ guest.forum_get_topic() }}
- JavaScript
bb.post("guest/forum/get_topic", {})
guest/forum/get_topic_message_list¶
Get topic messages list
Required parameters¶
forum_topic_id: | int - topic id |
---|
API call examples¶
- PHP
$result = $api_guest->forum_get_topic_message_list($params);
- HTML
{{ guest.forum_get_topic_message_list() }}
- JavaScript
bb.post("guest/forum/get_topic_message_list", {})
Invoice¶
Invoice processing
guest/invoice/get¶
Get invoice details
Required parameters¶
hash: | string - invoice hash |
---|
API call examples¶
- PHP
$result = $api_guest->invoice_get($params);
- HTML
{{ guest.invoice_get() }}
- JavaScript
bb.post("guest/invoice/get", {})
guest/invoice/update¶
Update Invoice details. Only unpaid invoice details can be updated.
Required parameters¶
hash: | string - invoice hash |
---|
Optional parameters¶
gateway_id: | int - selected payment gateway id |
---|
API call examples¶
- PHP
$result = $api_guest->invoice_update($params);
- HTML
{{ guest.invoice_update() }}
- JavaScript
bb.post("guest/invoice/update", {})
guest/invoice/gateways¶
Get list of available payment gateways to pay for invoices
Optional parameters¶
format: | string - if format is “pairs” then id=>name values are returned |
---|
API call examples¶
- PHP
$result = $api_guest->invoice_gateways($params);
- HTML
{{ guest.invoice_gateways() }}
- JavaScript
bb.post("guest/invoice/gateways", {})
guest/invoice/payment¶
Process invoice for selected gateway. Returned result can be processed to redirect or to show required information. Returned result depends
on payment gateway.
Required parameters¶
hash: | string - invoice hash |
---|---|
gateway_id: | int - payment gateway id |
Optional parameters¶
subscription: | bool - is payment subscription |
---|---|
auto_redirect: | bool - should payment adapter automatically redirect client or just print pay now button |
API call examples¶
- PHP
$result = $api_guest->invoice_payment($params);
- HTML
{{ guest.invoice_payment() }}
- JavaScript
bb.post("guest/invoice/payment", {})
Kb¶
Knowledge base API
guest/kb/article_get_list¶
Get paginated list of knowledge base articles. Returns only active articles.
API call examples¶
- PHP
$result = $api_guest->kb_article_get_list($params);
- HTML
{{ guest.kb_article_get_list() }}
- JavaScript
bb.post("guest/kb/article_get_list", {})
guest/kb/article_get¶
Get active knowledge base article
Required parameters¶
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. |
API call examples¶
- PHP
$result = $api_guest->kb_article_get($params);
- HTML
{{ guest.kb_article_get() }}
- JavaScript
bb.post("guest/kb/article_get", {})
guest/kb/category_get_list¶
Get paginated list of knowledge base categories
API call examples¶
- PHP
$result = $api_guest->kb_category_get_list($params);
- HTML
{{ guest.kb_category_get_list() }}
- JavaScript
bb.post("guest/kb/category_get_list", {})
guest/kb/category_get_pairs¶
Get knowledge base categories id, title pairs
API call examples¶
- PHP
$result = $api_guest->kb_category_get_pairs($params);
- HTML
{{ guest.kb_category_get_pairs() }}
- JavaScript
bb.post("guest/kb/category_get_pairs", {})
guest/kb/category_get¶
Get knowledge base category by ID or SLUG
Required parameters¶
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. |
API call examples¶
- PHP
$result = $api_guest->kb_category_get($params);
- HTML
{{ guest.kb_category_get() }}
- JavaScript
bb.post("guest/kb/category_get", {})
News¶
News and announcements management
guest/news/get_list¶
Get paginated list of active news items
API call examples¶
- PHP
$result = $api_guest->news_get_list($params);
- HTML
{{ guest.news_get_list() }}
- JavaScript
bb.post("guest/news/get_list", {})
guest/news/get¶
Get news item by ID or SLUG
Required parameters¶
id: | int - news item ID. Required only if SLUG is not passed. |
---|---|
slug: | string - news item slug. Required only if ID is not passed. |
API call examples¶
- PHP
$result = $api_guest->news_get($params);
- HTML
{{ guest.news_get() }}
- JavaScript
bb.post("guest/news/get", {})
Product¶
Products management api
guest/product/get_list¶
Get paginated list of products
Optional parameters¶
show_hidden: | bool - also get hidden products. Default false |
---|
API call examples¶
- PHP
$result = $api_guest->product_get_list($params);
- HTML
{{ guest.product_get_list() }}
- JavaScript
bb.post("guest/product/get_list", {})
guest/product/get_pairs¶
Get products pairs. Product id -> title values
API call examples¶
- PHP
$result = $api_guest->product_get_pairs($params);
- HTML
{{ guest.product_get_pairs() }}
- JavaScript
bb.post("guest/product/get_pairs", {})
guest/product/get¶
Get product by ID
Required parameters¶
id: | int - product id |
---|
API call examples¶
- PHP
$result = $api_guest->product_get($params);
- HTML
{{ guest.product_get() }}
- JavaScript
bb.post("guest/product/get", {})
guest/product/category_get_list¶
Get paginated list of product categories
API call examples¶
- PHP
$result = $api_guest->product_category_get_list($params);
- HTML
{{ guest.product_category_get_list() }}
- JavaScript
bb.post("guest/product/category_get_list", {})
guest/product/category_get_pairs¶
Get pairs of product categories
API call examples¶
- PHP
$result = $api_guest->product_category_get_pairs($params);
- HTML
{{ guest.product_category_get_pairs() }}
- JavaScript
bb.post("guest/product/category_get_pairs", {})
guest/product/get_slider¶
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
Optional parameters¶
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 |
API call examples¶
- PHP
$result = $api_guest->product_get_slider($params);
- HTML
{{ guest.product_get_slider() }}
- JavaScript
bb.post("guest/product/get_slider", {})
Servicedomain¶
Domain service management
guest/servicedomain/tlds¶
Get configured TLDs which can be ordered. Shows only enabled TLDs
Optional parameters¶
allow_register: | bool - shows only these TLDs which can be registered |
---|---|
allow_transfer: | bool - shows only these TLDs which can be transferred |
API call examples¶
- PHP
$result = $api_guest->servicedomain_tlds($params);
- HTML
{{ guest.servicedomain_tlds() }}
- JavaScript
bb.post("guest/servicedomain/tlds", {})
guest/servicedomain/pricing¶
Get TLD pricing information
Required parameters¶
tld: | string - Top level domain, ie: .com |
---|
API call examples¶
- PHP
$result = $api_guest->servicedomain_pricing($params);
- HTML
{{ guest.servicedomain_pricing() }}
- JavaScript
bb.post("guest/servicedomain/pricing", {})
guest/servicedomain/check¶
Check if domain is available for registration. Domain registrar must be configured in order to get correct results.
Required parameters¶
sld: | string - second level domain, ie: mydomain |
---|---|
tld: | string - top level domain, ie: .com |
API call examples¶
- PHP
$result = $api_guest->servicedomain_check($params);
- HTML
{{ guest.servicedomain_check() }}
- JavaScript
bb.post("guest/servicedomain/check", {})
guest/servicedomain/can_be_transferred¶
Check if domain can be transferred. Domain registrar must be configured in order to get correct results.
Required parameters¶
sld: | string - second level domain, ie: mydomain |
---|---|
tld: | string - top level domain, ie: .com |
API call examples¶
- PHP
$result = $api_guest->servicedomain_can_be_transferred($params);
- HTML
{{ guest.servicedomain_can_be_transferred() }}
- JavaScript
bb.post("guest/servicedomain/can_be_transferred", {})
Servicelicense¶
Licensing server
guest/servicelicense/check¶
Check license details callback. Request IP is detected automatically You can pass any other parameters to be validated by license plugin.
Required parameters¶
license: | string - license key |
---|---|
host: | string - hostname where license is installed |
version: | string - software version |
path: | string - software install path |
Optional parameters¶
legacy: | string - deprecated parameter. Returns result in non consistent API result |
---|
API call examples¶
- PHP
$result = $api_guest->servicelicense_check($params);
- HTML
{{ guest.servicelicense_check() }}
- JavaScript
bb.post("guest/servicelicense/check", {})
Servicesolusvm¶
Solusvm service management
guest/servicesolusvm/get_templates¶
Return operating system templates available on solusVM master server
Required parameters¶
type: | string - virtualization type |
---|
API call examples¶
- PHP
$result = $api_guest->servicesolusvm_get_templates($params);
- HTML
{{ guest.servicesolusvm_get_templates() }}
- JavaScript
bb.post("guest/servicesolusvm/get_templates", {})
Serviceyouhosting¶
Youhosting service management
Spamchecker¶
Spam cheking module management
Staff¶
Staff methods
guest/staff/create¶
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.
Required parameters¶
email: | string - admin email |
---|---|
password: | string - admin password |
API call examples¶
- PHP
$result = $api_guest->staff_create($params);
- HTML
{{ guest.staff_create() }}
- JavaScript
bb.post("guest/staff/create", {})
guest/staff/login¶
Login to admin area and save information to session.
Required parameters¶
email: | string - admin email |
---|---|
password: | string - admin password |
Optional parameters¶
remember: | string - pass value “1” to create remember me cookie |
---|
API call examples¶
- PHP
$result = $api_guest->staff_login($params);
- HTML
{{ guest.staff_login() }}
- JavaScript
bb.post("guest/staff/login", {})
Support¶
Public tickets management
guest/support/ticket_create¶
Submit new public ticket
Required parameters¶
name: | string - Ticket author name |
---|---|
email: | string - Ticket author email |
subject: | string - Ticket subject |
message: | string - Ticket message |
API call examples¶
- PHP
$result = $api_guest->support_ticket_create($params);
- HTML
{{ guest.support_ticket_create() }}
- JavaScript
bb.post("guest/support/ticket_create", {})
guest/support/ticket_get¶
Get public ticket
Required parameters¶
hash: | string - public ticket hash |
---|
API call examples¶
- PHP
$result = $api_guest->support_ticket_get($params);
- HTML
{{ guest.support_ticket_get() }}
- JavaScript
bb.post("guest/support/ticket_get", {})
guest/support/ticket_close¶
Close public ticket
Required parameters¶
hash: | string - public ticket hash |
---|
API call examples¶
- PHP
$result = $api_guest->support_ticket_close($params);
- HTML
{{ guest.support_ticket_close() }}
- JavaScript
bb.post("guest/support/ticket_close", {})
guest/support/ticket_reply¶
Reply to public ticket
Required parameters¶
hash: | string - public ticket hash |
---|---|
message: | string - public ticket reply message |
API call examples¶
- PHP
$result = $api_guest->support_ticket_reply($params);
- HTML
{{ guest.support_ticket_reply() }}
- JavaScript
bb.post("guest/support/ticket_reply", {})
System¶
System methods
guest/system/version¶
Get BoxBilling version
API call examples¶
- PHP
$result = $api_guest->system_version($params);
- HTML
{{ guest.system_version() }}
- JavaScript
bb.post("guest/system/version", {})
guest/system/company¶
Returns company information
API call examples¶
- PHP
$result = $api_guest->system_company($params);
- HTML
{{ guest.system_company() }}
- JavaScript
bb.post("guest/system/company", {})
guest/system/states¶
Returns USA states list
API call examples¶
- PHP
$result = $api_guest->system_states($params);
- HTML
{{ guest.system_states() }}
- JavaScript
bb.post("guest/system/states", {})
guest/system/countries_eunion¶
Returns list of european union countries
API call examples¶
- PHP
$result = $api_guest->system_countries_eunion($params);
- HTML
{{ guest.system_countries_eunion() }}
- JavaScript
bb.post("guest/system/countries_eunion", {})
guest/system/countries¶
Returns list of world countries
API call examples¶
- PHP
$result = $api_guest->system_countries($params);
- HTML
{{ guest.system_countries() }}
- JavaScript
bb.post("guest/system/countries", {})
guest/system/param¶
Returns system parameter by key
Required parameters¶
key: | string - Parameter name |
---|
API call examples¶
- PHP
$result = $api_guest->system_param($params);
- HTML
{{ guest.system_param() }}
- JavaScript
bb.post("guest/system/param", {})
guest/system/periods¶
Return list of available payment periods
API call examples¶
- PHP
$result = $api_guest->system_periods($params);
- HTML
{{ guest.system_periods() }}
- JavaScript
bb.post("guest/system/periods", {})
guest/system/period_title¶
Gets period title by identifier
Required parameters¶
code: | string - Period code name, ie: 1M => Monthly |
---|
API call examples¶
- PHP
$result = $api_guest->system_period_title($params);
- HTML
{{ guest.system_period_title() }}
- JavaScript
bb.post("guest/system/period_title", {})
guest/system/paginator¶
Returns info for paginator according to list
API call examples¶
- PHP
$result = $api_guest->system_paginator($params);
- HTML
{{ guest.system_paginator() }}
- JavaScript
bb.post("guest/system/paginator", {})
guest/system/current_url¶
If called from template file this function returns current url
API call examples¶
- PHP
$result = $api_guest->system_current_url($params);
- HTML
{{ guest.system_current_url() }}
- JavaScript
bb.post("guest/system/current_url", {})
guest/system/template_exists¶
Check if passed file name template exists for client area
Required parameters¶
file: | string - template file name, example: mod_index_dashboard.phtml |
---|
API call examples¶
- PHP
$result = $api_guest->system_template_exists($params);
- HTML
{{ guest.system_template_exists() }}
- JavaScript
bb.post("guest/system/template_exists", {})