Previous Topic

Next Topic

Locate topic in Contents

HSPC/API/Billing

calculate_order

The function calculates prices in an order.

Parameters:

account_id

ID of account the prices are to be calculated for.

hp_sid

Hosting plan series key.

period

Optional parameter in case a period is trial (for_trial parameter is specified) or if a domain hosting plan is purchased. Subscription period.

promo_id

Optional parameter: The ID of promotion to be applied to hosting plan prices.

domain_list

The list of domains.

app_list

The list of application templates IDs.

attribute_list

The list of custom attributes.

sb_plan

Optional parameter: The parameter is to be used only if Sitebuilder service is included in a hosting plan.

If a Sitebuilder site already exists, the Sitebuilder site alias must be passed. If a new Sitebuilder site is to be created, the 'new' value must be passed.

license_list

List of licenses included in a hosting plan. The list of licences is presented as the following hash:

'license_list' => {

'plugin_1' => {

'SITEBUILDER' => {

'feature_list' => [

'500_SITES',

'1YR_PREMIUM_SUPPORT_PACK',

'MULTI_SERVER_CAPABILITY',

'1YR_EMAIL_SUPPORT_PACK'

]

},

'PLESK_75_RELOADED' => {

'addon_list' => {

'PLESK_BATTLEFIELD' => {

'feature_list' => [

'5_BATTLEFIELD_SERVERS'

]

},

'PLESK_CS_GAMESERVER' => {

'feature_list' => []

}

},

'feature_list' => [

'100_DOMAINS',

'TROUBLE_TICKETING_SYSTEM',

'1YR_PREMIUM_SUPPORT_PACK',

'COLDFUSION',

'INEXPENSIVE_SERVER',

'EXPENSIVE_SERVER'

]

}

}

},

 

login

The list can include three parameters:

  • password
  • login
  • forwarding URL

The parameters composition depends upon hosting plan type.

answer_list

The list of answers on a hosting plan questionnaire. Each answer is a list consisting of a question ID and an answer string.

qos_list

Optional parameter. The list of billable resources presented as the following hash:

{

'res_id_1003' => {'res_id' => '1003','value' => '2','multiplier' => '1'},

'res_id_1012' => {'res_id' => '1012','value' => '1','multiplier' => '1'},

...

}

Where:

res_id - is a resource numerical identifier assigned in the Parallels Business Automation - Standard database

multiplier - is a resource units

value - is an additional resource value ordered over the included value.

Returns: ORDER.

SOAP Faults codes:

AFMdenied

Anti-Fraud Manager has stopped an order.

AuthzError

Authorization error.

DomainRequired

Hosting plan requires a domain registration, but no domains were registered.

HPNoApps

Applications specified are not supported by a hosting plan.

HPNoDomainAction

A domain operation specified is not supported.

HPNoDomainAvailable

A domain name is not available for registration.

HPNoDomainReg

Hosting plan does not support domain registration.

HPNoDomainSubscrAllowed

No more domains allowed for a hosting plan. Allowed limit for domains registration is used up.

HPNoLicClasses

Licenses specified are not supported by a hosting plan.

HPNoSB

Sitebuilder service specified is not supported by a hosting plan.

HPNoSecureWhois

A domain hosting plan does not support secure whois service.

HPNoTransferDomainAvailable

A domain specified is not available for transfer in a particular hosting plan.

HPNoTrial

Hosting plan does not support trial periods.

HPSBErrors

Errors connected with Sitebuilder site have occurred during order processing.

InvalidDomain

Invalid domain name was specified.

NoOrderForProvider

Provider tries to place order for themselves.

NoPointerAllowed

Domain pointer operation is not available for a domain specified.

NoQuestion

No question exists in a hosting plan for an answer specified.

NoSubdomain

Subdomain creation is not available for a domain specified.

OrderFailed

Order creation error.

SubscrNotFound

A subscription a domain registration is to be added to does not exist.

TLDNoSuchPeriod

A domain registration period specified does not supported for a TLD.

UserNoVPSPasswd

No password specified for Container.

UserVPSPasswdWeak

Container password does not meet the password strength requirements.

get_hosting_target_list

The function returns the list of subscriptions that already exist for an account.

Parameters:

account_id

Account ID.

Returns: {hosting_target_list => {id => ID, name => STRING, plan_name => STRING, sites_available => NUMBER} }

SOAP Faults codes:

No specific codes.

place_order

The function places order.

Parameters:

account_id

ID of account the prices are to be calculated for.

hp_sid

Hosting plan series key.

period

Optional parameter in case a period is trial (for_trial parameter is specified) or if a domain hosting plan is purchased. Subscription period.

promo_id

Optional parameter: The ID of promotion to be applied to hosting plan prices.

domain_hash

The list of domains. Each domain in this list is presented by the following hash:

{'domain1' => {

domain_name => 'example.com' -- self-explanatory

dm_action => 'register_new' -- action over domain

period => 2, -- registration period in years

whois_privacy => 1|0 -- use whois privacy yes|no

is_manual => 1| 0 -- use manual registration yes|no. Use when importing domain subscription.

expire_time => Expiration date for domain. Use when importing domains. Format: Use any string parsable by Date::Manip (which is, well, just about anything).

contact_hash => {admin => 45, billing => 0, owner => undef} -- mapping of contact types to use for domain to contact IDs. If contact id is 'undef' or '0', it will be created on the basis of account contact information

create_site => 1|0 - create site for this domain or no.

hosting_destination => 56 - Subscription number, for which this domain is bought.

is_default => 1|0 -- If 1, this domain is specified as the default one in the order.

ns_list => [[HOSTNAME, IP], [HOSTNAME, IP], ...] -- list of nameservers for domain. If present,
no DNS hosting service will be provided.

},

'domain2' => { ... },

ext_data => { purpose of domaun usage => 'Business', ... } -- any additional information required by a registrar. This parameter is always the only one in the hash.

}

app_list

The list of application templates IDs.

attribute_list

The list of custom attributes.

sb_plan

Optional parameter: The parameter is to be used only if Sitebuilder service is included in a hosting plan.

If a Sitebuilder site already exists, the Sitebuilder site alias must be passed. If a new Sitebuilder site is to be created, the 'new' value must be passed.

license_list

List of licenses included in a hosting plan.

login

The list can include three parameters:

password

login

forwarding URL

The parameters composition depends upon hosting plan type.

answer_list

The list of answers on a hosting plan questionnaire. Each answer is a list consisting of a question ID and an answer string.

for_trial

If an order is for trial period.

initiator_email

E-mail of a person that has added an order.

initiator_ip

IP address of a person that has added an order.

description

Optional parameter. Order description.

is_free

1 - yes or 0 - no. Optional parameter that can be used by provider only. The parameter specifies whether an order should be free (1) or not (0). If yes, the balance of an order created on a subscription import is adjusted to zero, i,e, a special 'balance correction' string is added to an order. This parameter can be used, for example if a provider wants to import a a subscription or a number of subscriptions into Parallels Business Automation - Standard and it is necessary that a corresponding orders to be generated for these subscriptions will be of a zero amount.
Note: Only provider is allowed to use the is_free parameter. If this parameter is used by a reseller, this will result in SOAP fault (see the list of SOAP Fault Codes below this table).

ext_data

List of extended attributes

qos_list

Optional parameter. The list of billable resources presented as the following hash:

{

'res_id_1003' => {'res_id' => '1003','value' => '2','multiplier' => '1'},

'res_id_1012' => {'res_id' => '1012','value' => '1','multiplier' => '1'},

...

}

Where:

res_id - is a resource numerical identifier assigned in the Parallels Business Automation - Standard database

multiplier - is a resource units

value - is an additional resource value ordered over the included value.

Returns: ORDER.

SOAP Faults codes:

AFMdenied

Anti-Fraud Manager has stopped an order.

AuthzError

Authorization error.

DomainRequired

Hosting plan requires a domain registration, but no domains were registered.

HPNoApps

Applications specified are not supported by a hosting plan.

HPNoDomainAction

A domain operation specified is not supported.

HPNoDomainAvailable

A domain name is not available for registration.

HPNoDomainReg

Hosting plan does not support domain registration.

HPNoDomainSubscrAllowed

No more domains allowed for a hosting plan. Allowed limit for domains registration is used up.

HPNoLicClasses

Licenses specified are not supported by a hosting plan.

HPNoSB

Sitebuilder service specified is not supported by a hosting plan.

HPNoSecureWhois

A domain hosting plan does not support secure whois service.

HPNoTransferDomainAvailable

A domain specified is not available for transfer in a particular hosting plan.

HPNoTrial

Hosting plan does not support trial periods.

HPSBErrors

Errors connected with Sitebuilder site have occurred during order processing.

InvalidDomain

Invalid domain name was specified.

NoOrderForProvider

Provider tries to place order for themselves.

NoPointerAllowed

Domain pointer operation is not available for a domain specified.

NoQuestion

No question exists in a hosting plan for an answer specified.

NoSubdomain

Subdomain creation is not available for a domain specified.

OrderFailed

Order creation error.

OrderFreeDenied

The is_free parameter is used not by provider (for example, reseller tries to create a free order).

OrderExtData

Extended attribute addition error.

SubscrNotFound

A subscription a domain registration is to be added to does not exist.

TLDNoSuchPeriod

A domain registration period specified does not supported for a TLD.

UserNoVPSPasswd

No password specified for Container.

UserVPSPasswdWeak

Container password does not meet the password strength requirements.

create_offline_payment

This function allows creating an offline payment and, at the same moment, applying this payment to a number of documents.

Note: The payment created by this function can be applied to documents with Open or Overdue status. The payment can be applied only to the following types of documents: Order, Invoice, Debit Adjustment, and Payment Request. A payment can be applied only to documents assigned to an account a payment was issued for.

Parameters:

amount

A payment total amount.

account_id

ID of account a payment is issued for.

ref_num

A payment reference number.

doc_list

Optional parameter. List of IDs of documents a payment is to be applied to.

adjust_error_fatal

Optional parameter that defines the function behavior in case of error, depending of a value assigned to this parameter :

If 1, then any error that occurs will stop payment processing and produce SOAP fault DocAdjustError. Errors will be placed into SOAP details.

If 0, then in case errors occur, the function will keep trying to pay documents, but all the errors will be returned.

Returns:

{ result => 1 } if no errors occurred, and offline payment has been placed successfully.

or

{ result => 0, error_info => ARRAYREF } if adjust_error_fatal=0 and some errors occurred.

Example of returned value:

{

'error_info' => [

{

'error_message' => 'Document 103 has been paid',

'document' => '103',

'error_code' => 'DocPaid'

}

],

'result' => '0'

};

SOAP Faults codes:

DocAdjustError

Error adjusting documents!

Document type specific errors:

DocInvalidAccount

Document %DOCID% was not added by the account trying to pay for it.

DocPaid

Document %DOCID% has been paid

DocNotOpen

Document %DOCID% is not open

DocWrongType

Document %DOCID% is of an inappropriate type.

get_order_details

This function allows getting the full information about an order by an order ID.

Parameters:

order_id

An order numerical identifier assigned in the Parallels Business Automation - Standard database.

Returns: ORDER, see Example 2.

SOAP Faults codes:

OrderNotFound

Order not found. This means that no order with the ID specified.

AuthzError

Access Denied.

get_extended_attr_list

The function returns extended attributes available for a particular hosting plan type.

Parameters:

order_type

Order type: corresponds to a hosting plan type, the parameter value (constant) is a hosting plan code used in Store.

Returns value: [ { view_name=>, title=>, value=>, type=> }, .. ]

SOAP Faults codes:

No specific codes.

In This Section

Examples of ORDER Hash

Example of Test Code for create_offline_payment Function

Please send us your feedback on this help page