Billing

billing.Account

Estimated reading: 8 minutes 972 views
Namespace:Billing
REST:https://[hoster-api-host]/1.0/billing/account/rest/{method-name}
Scripting:billing.account.{method-name}

The methods of this service provide billing information about a user account (such as UID, balance, billing history, quotas, etc.) and allow managing it.

Methods :

GetAccount ( appid, session ) :

Returns account information based on the user session.

URL

https://[hoster-api-host]/1.0/billing/account/rest/getaccount

Parameters

  • appid : “string”

    unique identifier of the target application (required for authentication).

  • session : “string”

    user session or personal access token.

Example

Method: POST

https://[hoster-api-host]/1.0/billing/account/rest/getaccount?session=[string]&appid=[string]

Response

  • AccountResponse
    {
       "balance": "BigDecimal",
       "bonus": "BigDecimal",
       "createdOn": "date",
       "credit": "BigDecimal",
       "debit": "BigDecimal",
       "defaultHardNodeGroup": "string",
       "defaultPayMethodId": "string",
       "ebsUserId": "string",
       "email": "string",
       "error": "string",
       "group": "string",
       "groupType": "string",
       "groupWinDomain": "int",
       "hardNodeGroups": [
          "string",
          "..."
       ],
       "isCommerial": "boolean",
       "isEnabled": "boolean",
       "isRegistered": "boolean",
       "language": "string",
       "previousUpdatedGroupOn": "date",
       "reason": "int",
       "result": "int",
       "source": "string",
       "status": "ACTIVE(1) | INACTIVE(2) | DESTROY(3) | DELETED(4)",
       "uid": "int",
       "updatedGroupOn": "date",
       "updatedStatusOn": "date"
    }

GetExtendedAccountBillingHistoryByPeriod ( appid, session, starttime, endtime, [targetAppid] ) :

Returns user’s billing history information for the specified period.

URL

https://[hoster-api-host]/1.0/billing/account/rest/getextendedaccountbillinghistorybyperiod

Parameters

  • appid : “string”
    unique identifier of the target application (required for authentication).
  • session : “string”
    user session or personal access token.
  • starttime : “string”
    start time (UTC) in the ISO 8601 format, e.g. “2022-11-16T00:00:00”.
  • endtime : “string”
    end time (UTC) in the ISO 8601 format, e.g. “2022-11-16T00:00:00”.
  • targetAppid : “string” (optional)
    target environment name (if you want to see billing history for one environment only).

Example

https://[hoster-api-host]/1.0/billing/account/rest/getextendedaccountbillinghistorybyperiod?session=[string]&appid=[string]&endtime=[string]&starttime=[string]&targetAppid=[string]

Response

  • ObjectResponse
    {
    "error": "string",
    "name": "string",
    "object": {
    "billingHistories": [
    {
    "accountGroupType": "post(0) | billing(1) | beta(2) | trial(3)",
    "actualFlexibleCloudletsAmount": "int",
    "appid": "string",
    "billNetworkExtAmount": "double",
    "billStorageAmount": "int",
    "cost": "BigDecimal",
    "count": "long",
    "dateTime": "string",
    "domain": "string",
    "envId": "string",
    "environment": {
    "account": {
    "accountData": [
    "AccountData",
    "..."
    ],
    "autoPayType": "REGULAR(0) | LEVEL(1)",
    "balance": "BigDecimal",
    "bonus": "BigDecimal",
    "credit": "BigDecimal",
    "debit": "BigDecimal",
    "ebsUserId": "string",
    "group": {
    "conversionGroup": "string",
    "conversionGroupName": "string",
    "description": "string",
    "groupPricingModels": [
    {
    "group": {
    "conversionGroup": "string",
    "conversionGroupName": "string",
    "description": "string",
    "groupPricingModels": [
    {
    "group": "Group",
    "hardNodeGroup": "string",
    "isEnabled": "boolean",
    "pricingModel": {
    "description": "string",
    "isDeleted": "boolean",
    "name": "string",
    "reseller": {
    "cert": "string",
    "certKey": "string",
    "comment": "string",
    "distributor": {
    "description": "string",
    "email": "string",
    "isDeleted": "boolean",
    "name": "string",
    "resellers": [
    {
    "cert": "string",
    "certKey": "string",
    "comment": "string",
    "distributor": "Distributor",
    "domain": "string",
    "intermediate": "string",
    "name": "string",
    "ownerUid": "int",
    "regions": [
    {
    "cert": "string",
    "domain": "string",
    "id": "int",
    "intermediate": "string",
    "isSslEnabled": "boolean",
    "key": "string",
    "nginxCert": "string",
    "regionId": "int",
    "resellerId": "int",
    "source502": "string",
    "sslExpireDate": "date",
    "sslType": "string",
    "type": "PLATFORM(0) | REGION(1)"
    },
    "..."
    ],
    "sslEnabled": "boolean",
    "sslExpireDate": "date",
    "sslType": "string",
    "status": "ACTIVE(0) | INACTIVE(1) | STOPPED(2) | SUSPENDED(3)"
    },
    "..."
    ]
    },
    "domain": "string",
    "intermediate": "string",
    "name": "string",
    "ownerUid": "int",
    "regions": [
    {
    "cert": "string",
    "domain": "string",
    "id": "int",
    "intermediate": "string",
    "isSslEnabled": "boolean",
    "key": "string",
    "nginxCert": "string",
    "regionId": "int",
    "resellerId": "int",
    "source502": "string",
    "sslExpireDate": "date",
    "sslType": "string",
    "type": "PLATFORM(0) | REGION(1)"
    },
    "..."
    ],
    "sslEnabled": "boolean",
    "sslExpireDate": "date",
    "sslType": "string",
    "status": "ACTIVE(0) | INACTIVE(1) | STOPPED(2) | SUSPENDED(3)"
    },
    "tariffGrids": [
    {
    "billStrategy": "ALL(0) | PEAK(1) | AVG(2)",
    "description": "string",
    "displayName": "string",
    "items": [
    {
    "description": "string",
    "displayName": "string",
    "name": "string",
    "options": [
    {
    "option": {
    "description": "string",
    "displayName": "string",
    "name": "string"
    },
    "value": "string"
    },
    "..."
    ],
    "order": "int",
    "plan": {
    "billableResourceScope": "NODE(0) | ENVIRONMENT(1) | COMMON(2) | ACCOUNT(3)",
    "chargeOnlyRunning": "boolean",
    "cloudletIncrement": "int",
    "currency": "Currency",
    "description": "string",
    "docUrl": "string",
    "freeResourceScope": "NODE(0) | ENVIRONMENT(1) | COMMON(2) | ACCOUNT(3)",
    "keyword": "string",
    "minCloudletCount": "int",
    "minimumFee": "BigDecimal",
    "minimumFeeResourceAmount": "double",
    "name": "string",
    "overridesTypes": [
    "TariffPlanType",
    "..."
    ],
    "priceType": "RECURRING(0) | ONETIME(1)",
    "recurringInterval": "HOUR(0) | DAY(1) | WEEK(2) | MONTH(3) | YEAR(4)",
    "recurringIntervalCount": "int",
    "resource": {
    "description": "string",
    "name": "string",
    "type": "DEFAULT(0) | EXTERNAL(1) | CUSTOM(2)",
    "unit": "UNIT(0) | MB(1) | MBPS(2) | MHZ(3) | HOUR(4) | MIB(5) | MIBPS(6) | GB(7) | COUNT(8)"
    },
    "sku": "string",
    "strategy": "VOLUME(0) | GRADUATED(1) | ACCUMULATED(2) | FLAT(3)",
    "strategyData": {
    "data": "string",
    "roundingMode": "UP(0) | DOWN(1) | CEILING(2) | FLOOR(3) | HALF_UP(4) | HALF_DOWN(5) | HALF_EVEN(6) | UNNECESSARY(7)",
    "scale": "int",
    "secondary": "Resource",
    "strategyMode": "VOLUME(0) | GRADUATED(1)"
    },
    "tiers": [
    "Tier",
    "..."
    ],
    "type": "FIXED(0) | FLEXIBLE(1) | OPTION(2) | NETWORK(3) | STORAGE(4) | STORAGE_FIXED(5) | LICENCE(6) | EXTERNAL(7) | SUBSCRIPTION(8)",
    "uniqueName": "string"
    }
    },
    "..."
    ],
    "name": "string",
    "nodeType": "string",
    "tariffItems": [
    "TariffGridTariffGridItem",
    "..."
    ]
    },
    "..."
    ],
    "tariffs": [
    {
    "billableResourceScope": "NODE(0) | ENVIRONMENT(1) | COMMON(2) | ACCOUNT(3)",
    "chargeOnlyRunning": "boolean",
    "cloudletIncrement": "int",
    "currency": "Currency",
    "description": "string",
    "docUrl": "string",
    "freeResourceScope": "NODE(0) | ENVIRONMENT(1) | COMMON(2) | ACCOUNT(3)",
    "keyword": "string",
    "minCloudletCount": "int",
    "minimumFee": "BigDecimal",
    "minimumFeeResourceAmount": "double",
    "name": "string",
    "overridesTypes": [
    "TariffPlanType",
    "..."
    ],
    "priceType": "RECURRING(0) | ONETIME(1)",
    "recurringInterval": "HOUR(0) | DAY(1) | WEEK(2) | MONTH(3) | YEAR(4)",
    "recurringIntervalCount": "int",
    "resource": {
    "description": "string",
    "name": "string",
    "type": "DEFAULT(0) | EXTERNAL(1) | CUSTOM(2)",
    "unit": "UNIT(0) | MB(1) | MBPS(2) | MHZ(3) | HOUR(4) | MIB(5) | MIBPS(6) | GB(7) | COUNT(8)"
    },
    "sku": "string",
    "strategy": "VOLUME(0) | GRADUATED(1) | ACCUMULATED(2) | FLAT(3)",
    "strategyData": {
    "data": "string",
    "roundingMode": "UP(0) | DOWN(1) | CEILING(2) | FLOOR(3) | HALF_UP(4) | HALF_DOWN(5) | HALF_EVEN(6) | UNNECESSARY(7)",
    "scale": "int",
    "secondary": {
    "description": "string",
    "name": "string",
    "type": "DEFAULT(0) | EXTERNAL(1) | CUSTOM(2)",
    "unit": "UNIT(0) | MB(1) | MBPS(2) | MHZ(3) | HOUR(4) | MIB(5) | MIBPS(6) | GB(7) | COUNT(8)"
    },
    "strategyMode": "VOLUME(0) | GRADUATED(1)"
    },
    "tiers": [
    {
    "currencyPrice": "double",
    "free": "double",
    "price": "double",
    "trialPeriod": "int",
    "value": "double"
    },
    "..."
    ],
    "type": "FIXED(0) | FLEXIBLE(1) | OPTION(2) | NETWORK(3) | STORAGE(4) | STORAGE_FIXED(5) | LICENCE(6) | EXTERNAL(7) | SUBSCRIPTION(8)",
    "uniqueName": "string"
    },
    "..."
    ],
    "type": "FIXED(0) | FLEXIBLE(1) | HYBRID(2)",
    "uniqueName": "string"
    }
    },
    "..."
    ],
    "isCollaboration": "boolean",
    "isDefault": "boolean",
    "isDeleted": "boolean",
    "isSignup": "boolean",
    "name": "string",
    "quotasValues": [
    "QuotaValue",
    "..."
    ],
    "reseller": "Reseller",
    "type": "post(0) | billing(1) | beta(2) | trial(3)",
    "winDomainId": "int"
    },
    "hardNodeGroup": "string",
    "isEnabled": "boolean",
    "pricingModel": {
    "description": "string",
    "isDeleted": "boolean",
    "name": "string",
    "reseller": {
    "cert": "string",
    "certKey": "string",
    "comment": "string",
    "distributor": "Distributor",
    "domain": "string",
    "intermediate": "string",
    "name": "string",
    "ownerUid": "int",
    "regions": [
    {
    "cert": "string",
    "domain": "string",
    "id": "int",
    "intermediate": "string",
    "isSslEnabled": "boolean",
    "key": "string",
    "nginxCert": "string",
    "regionId": "int",
    "resellerId": "int",
    "source502": "string",
    "sslExpireDate": "date",
    "sslType": "string",
    "type": "PLATFORM(0) | REGION(1)"
    },
    "..."
    ],
    "sslEnabled": "boolean",
    "sslExpireDate": "date",
    "sslType": "string",
    "status": "ACTIVE(0) | INACTIVE(1) | STOPPED(2) | SUSPENDED(3)"
    },
    "tariffGrids": [
    {
    "billStrategy": "ALL(0) | PEAK(1) | AVG(2)",
    "description": "string",
    "displayName": "string",
    "items": [
    "TariffGridItem",
    "..."
    ],
    "name": "string",
    "nodeType": "string",
    "tariffItems": [
    "TariffGridTariffGridItem",
    "..."
    ]
    },
    "..."
    ],
    "tariffs": [
    "TariffPlan",
    "..."
    ],
    "type": "FIXED(0) | FLEXIBLE(1) | HYBRID(2)",
    "uniqueName": "string"
    }
    },
    "..."
    ],
    "isCollaboration": "boolean",
    "isDefault": "boolean",
    "isDeleted": "boolean",
    "isSignup": "boolean",
    "name": "string",
    "quotasValues": [
    {
    "quota": {
    "description": "string",
    "isBusiness": "boolean",
    "isCustom": "boolean",
    "isHidden": "boolean",
    "name": "string",
    "referenceId": "string"
    },
    "type": "PERSONAL(0) | GROUP(1)",
    "value": "int"
    },
    "..."
    ],
    "reseller": "Reseller",
    "type": "post(0) | billing(1) | beta(2) | trial(3)",
    "winDomainId": "int"
    },
    "isEnabled": "boolean",
    "language": "string",
    "note": "string",
    "quotasValues": [
    {
    "quota": "Quota",
    "type": "PERSONAL(0) | GROUP(1)",
    "value": "int"
    },
    "..."
    ],
    "status": "int",
    "sumCostPerHour": "BigDecimal",
    "uid": "int"
    },
    "appid": "string",
    "domain": "string",
    "extraTariffs": [
    {
    "billableResourceScope": "NODE(0) | ENVIRONMENT(1) | COMMON(2) | ACCOUNT(3)",
    "chargeOnlyRunning": "boolean",
    "cloudletIncrement": "int",
    "currency": "Currency",
    "description": "string",
    "docUrl": "string",
    "freeResourceScope": "NODE(0) | ENVIRONMENT(1) | COMMON(2) | ACCOUNT(3)",
    "keyword": "string",
    "minCloudletCount": "int",
    "minimumFee": "BigDecimal",
    "minimumFeeResourceAmount": "double",
    "name": "string",
    "overridesTypes": [
    "TariffPlanType",
    "..."
    ],
    "priceType": "RECURRING(0) | ONETIME(1)",
    "recurringInterval": "HOUR(0) | DAY(1) | WEEK(2) | MONTH(3) | YEAR(4)",
    "recurringIntervalCount": "int",
    "resource": {
    "description": "string",
    "name": "string",
    "type": "DEFAULT(0) | EXTERNAL(1) | CUSTOM(2)",
    "unit": "UNIT(0) | MB(1) | MBPS(2) | MHZ(3) | HOUR(4) | MIB(5) | MIBPS(6) | GB(7) | COUNT(8)"
    },
    "sku": "string",
    "strategy": "VOLUME(0) | GRADUATED(1) | ACCUMULATED(2) | FLAT(3)",
    "strategyData": {
    "data": "string",
    "roundingMode": "UP(0) | DOWN(1) | CEILING(2) | FLOOR(3) | HALF_UP(4) | HALF_DOWN(5) | HALF_EVEN(6) | UNNECESSARY(7)",
    "scale": "int",
    "secondary": "Resource",
    "strategyMode": "VOLUME(0) | GRADUATED(1)"
    },
    "tiers": [
    "Tier",
    "..."
    ],
    "type": "FIXED(0) | FLEXIBLE(1) | OPTION(2) | NETWORK(3) | STORAGE(4) | STORAGE_FIXED(5) | LICENCE(6) | EXTERNAL(7) | SUBSCRIPTION(8)",
    "uniqueName": "string"
    },
    "..."
    ],
    "id": "int",
    "isRemote": "boolean",
    "useObjectHash": "boolean"
    },
    "fixedCloudletsAmount": "int",
    "fixedCloudletsCost": "BigDecimal",
    "fixedCloudletsFreeAmount": "int",
    "flexibleCloudletsAmount": "int",
    "flexibleCloudletsCost": "BigDecimal",
    "flexibleCloudletsFreeAmount": "int",
    "group": "int",
    "hostGroupDisplayName": "string",
    "hostGroupUniqueName": "string",
    "isAggregated": "boolean",
    "isBonus": "boolean",
    "isPaid": "boolean",
    "isRecalculation": "boolean",
    "isRemote": "boolean",
    "isWithdrawn": "boolean",
    "licenceHours": "int",
    "metadata": "string",
    "minFeeResourceAmount": "BigDecimal",
    "networkExtCost": "BigDecimal",
    "networkExtFreeAmount": "double",
    "nodeCount": "long",
    "nodeName": "string",
    "nodeType": "string",
    "nodeid": "int",
    "note": "string",
    "pricingModel": {
    "description": "string",
    "isDeleted": "boolean",
    "name": "string",
    "reseller": {
    "cert": "string",
    "certKey": "string",
    "comment": "string",
    "distributor": "Distributor",
    "domain": "string",
    "intermediate": "string",
    "name": "string",
    "ownerUid": "int",
    "regions": [
    {
    "cert": "string",
    "domain": "string",
    "id": "int",
    "intermediate": "string",
    "isSslEnabled": "boolean",
    "key": "string",
    "nginxCert": "string",
    "regionId": "int",
    "resellerId": "int",
    "source502": "string",
    "sslExpireDate": "date",
    "sslType": "string",
    "type": "PLATFORM(0) | REGION(1)"
    },
    "..."
    ],
    "sslEnabled": "boolean",
    "sslExpireDate": "date",
    "sslType": "string",
    "status": "ACTIVE(0) | INACTIVE(1) | STOPPED(2) | SUSPENDED(3)"
    },
    "tariffGrids": [
    {
    "billStrategy": "ALL(0) | PEAK(1) | AVG(2)",
    "description": "string",
    "displayName": "string",
    "items": [
    "TariffGridItem",
    "..."
    ],
    "name": "string",
    "nodeType": "string",
    "tariffItems": [
    "TariffGridTariffGridItem",
    "..."
    ]
    },
    "..."
    ],
    "tariffs": [
    "TariffPlan",
    "..."
    ],
    "type": "FIXED(0) | FLEXIBLE(1) | HYBRID(2)",
    "uniqueName": "string"
    },
    "reseller": "Reseller",
    "resource": "string",
    "resourceBillableAmount": "BigDecimal",
    "resourceCost": "BigDecimal",
    "resourceFreeAmount": "BigDecimal",
    "resourceFreeCost": "BigDecimal",
    "resourceType": "RESOURCE(0) | OPTION(1) | LICENCE(2) | CUSTOM_SERVICE(3) | EXTERNAL(4)",
    "sku": "string",
    "storageCost": "BigDecimal",
    "storageFreeAmount": "int",
    "strategyType": "VOLUME(0) | GRADUATED(1) | ACCUMULATED(2) | FLAT(3)",
    "type": "string",
    "uid": "int",
    "unit": "UNIT(0) | MB(1) | MBPS(2) | MHZ(3) | HOUR(4) | MIB(5) | MIBPS(6) | GB(7) | COUNT(8)",
    "usedCloudletsAmount": "int",
    "usedNetworkExtAmount": "double",
    "usedStorageAmount": "int",
    "valueGroup": "string"
    },
    "..."
    ],
    "cloudlets": "Cloudlets",
    "end": "date",
    "envs": {
    "(key) string": "(value) Env",
    "...": "..."
    },
    "ips": "Countable",
    "license": {
    "(key) string": "(value) Countable",
    "...": "..."
    },
    "ssl": "Countable",
    "start": "date",
    "storage": "Storage",
    "timeZone": "TimeZone",
    "traffic": "Traffic"
    },
    "reason": "int",
    "result": "int",
    "source": "string",
    "warnings": [
    "string",
    "..."
    ]
    }

GetQuotas( appid, session, [quotasnames] ) :

Returns a list of all (or specified) account quotas with values.

URL

https://[hoster-api-host]/1.0/billing/account/rest/getquotas

Parameters

  • appid : “string”

    unique identifier of the target application (required for authentication).

  • session : “string”

    user session or personal access token.

  • quotasnames : “string” (optional)

    A semicolon-separated list of quota names to be returned.

Example

Method: POST

https://[hoster-api-host]/1.0/billing/account/rest/getquotas?quotasnames=[string]&session=[string]&appid=[string]

Response

  • ArrayResponse
    {
    "array": [
    {
    "description": "string",
    "isBusiness": "boolean",
    "isCustom": "boolean",
    "isHidden": "boolean",
    "name": "string",
    "referenceId": "string"
    },
    "..."
    ],
    "className": "Class",
    "error": "string",
    "expandablePath": [
    "string",
    "..."
    ],
    "reason": "int",
    "result": "int",
    "source": "string"
    }
    

Leave a Comment