Skip to main content

Create package

POST 

/packages

JSON-RPC

packages.create

Request​

Bodyrequired

    companies_idintegerrequired

    Partition ID.

    namestringrequired

    Name.

    Possible values: <= 128 characters

    perioddurationrequired

    Duration of the package (renewal period). To be given in ISO 8601 format.

    currencies_idintegerrequired

    Currency ID.

    statusstring

    Status.

    Possible values: [active, disabled, archive]

    Default value: active
    priorityinteger

    Priority of entitlements application. If there are multiple subscriptions that provide entitlements that match specific event, the subscription with the lowest priority will be used.

    Possible values: >= -2147483647 and <= 2147483647

    Default value: 0
    effective_fromdate-timenullable

    Time-limited package: start timestamp from which the package becomes available for assignment and use by the client.

    Default value: null
    effective_tilldate-timenullable

    Time-limited package: end timestamp till which the package remains available for assignment and use by the client.

    Default value: null
    tag_addstring | nullnullable

    Tag that will be added to the events billed by this package.

    Default value: null
    charge_on_eventboolean

    If True, first subscription fee will be charged when the first event occurs within this package period. Until the fees will not be charged.

    Default value: false
    chargingstring

    Defines when the subscription fee is accounted:

    • pre_activation - the charges are dated at the end of the preceding period (e.g. for the period that starts on Oct 1st, the charges will be dated on Sep 30th).
    • period_start - the charges are dated at the beginning of the current period (e.g. for the period that starts on Oct 1st, the charges will be dated on Oct 1st).

    Possible values: [pre_activation, period_start]

    Default value: pre_activation
    fees object[]

    List of fees applied to the package.

  • Array [
  • typestringrequired

    Type of the fee.

    Possible values: [activation, periodical]

    namestringrequired

    Fee name. This is used to identify the fee in the invoice line items.

    ratedecimalrequired

    Fee value.

    defaultboolean

    If True, the fee is marked as default. In common scenario, the package has only default fees. The discounts, if used, are applied to the default fee. Non-default fees are used for special cases, when you need to outline multiple fees as separate invoice line items.

    Default value: false
    notestring | nullnullable

    Fee note.

    Default value: null
    tagsstring[]

    Tag(s) for the fee. These are intended to be used for determining tax that has to be applied to the fee.

    Default value: []
  • ]
  • charge_setup_feeboolean

    If True, setup fee will be charged regardless of the entitlements usage. Only the cost of the event itself will be counted by the package.

    Default value: true
    discounts object[]

    Discount settings based on the number of package renewals. Not applied if fees are overridden during package activation. The discount is chosen based by finding the largest renew_no that is less than or equal to the number of package renewals. For example, if the package has 3 renewals, and the discount with renew_no equal to 2 is set, then the discount will be applied.

  • Array [
  • renew_nointegerrequired

    Renewal sequential number.

    Possible values: >= 0

    discountdecimalrequired

    Discount value. Value to be given in the same currency as the package fees.

    Possible values: >= 0

  • ]
  • payment_terms_full_chargeboolean

    If True, the package will be charged in full on the first activation and full entitlements will be provided. Only duration will be prorated.

    Default value: false
    renew_advanceduration

    How far in advance to try to renew the package. It is typically good idea to renew the package before the end of the current period, to provide uninterrupted service.

    Default value: PT1H
    renew_duedurationnullable

    For how long to try to renew the package after unsuccessful renewal attempt (e.g. if the client has insufficient funds). After this period, the package will be deactivated.

    Default value: null
    with_taxesboolean

    If True, the system assumes that fees defined for the package already include taxes. In this case taxes will be reversed from the fees when the package is activated.

    Default value: false
    payment_terms_alignboolean

    If True, the package will be prorated on the first activation according to the payment terms (billing cycle) of the client. In this case subscription fees and all entitlements will be prorated.

    Default value: false
    activate_ignore_balanceboolean

    If True, the package will be activated disregarding client balance. This may lead to negative balance for prepaid clients.

    Default value: false
    code_decks_idinteger | nullnullable

    Service entitlement: code deck ID to be used for service limits if defined by code name(s).

    Default value: null
    limits object[]

    Service entitlement: list of service limits.

  • Array [
  • services_idintegerrequired

    Service ID.

    originstringrequired

    Traffic origin: In many cases only orig is used. Use term to include incoming paid events (calls). Use both to include both incoming and outgoing paid events.

    Possible values: [orig, term, both]

    limit_typestringrequired

    Limit type. In case of volume the limit is defined in the units of the respective service. In case of money the limit is defined as cash value and deducted according to the regular rates defined for the client.

    Possible values: [money, volume]

    limitdecimalrequired

    Limit value. Given either in the units of the respective service or as cash value, depending on the limit_type.

    Possible values: >= 0

    codestring | nullnullable

    Code to which limit is applicable. Either code or code_name must be specified.

    Default value: null
    code_namestring | nullnullable

    Code Name to which limit is applicable. Either code or code_name must be specified.

    Default value: null
  • ]
  • dids_qtyinteger

    DID entitlement: DIDs quantity. Only that many DIDs will be possible to assign to the client within this package.

    Possible values: >= 0 and <= 2147483647

    Default value: 0
    dids_hold_daysinteger

    DID entitlement: number of days DIDs are kept on hold after package deactivation. This is used to allow DIDs to "cool down" after they have been used by the client.

    Possible values: >= 0 and <= 2147483647

    Default value: 0
    dids_tagsstring[]

    DID entitlement: allowed DID tags. Use to determine level of DIDs that can be assigned to the client (e.g. gold, premium, etc.).

    Default value: []

Responses​

Package object as has been stored.

Schema
    objectobject

Authorization: X-Api-Key

name: X-Api-Keytype: apiKeyin: headerdescription: Token for API access
curl -L -X POST 'https://docs.jerasoft.net/packages' \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'X-Api-Key: <X-Api-Key>'
Request Collapse all
Auth
Body required
{
  "companies_id": 0,
  "name": "string",
  "period": "string",
  "currencies_id": 0,
  "status": "active",
  "priority": 0,
  "charge_on_event": false,
  "charging": "pre_activation",
  "fees": [
    {
      "type": "activation",
      "name": "string",
      "rate": 0,
      "default": false,
      "tags": [
        "string"
      ]
    }
  ],
  "charge_setup_fee": true,
  "discounts": [
    {
      "renew_no": 0,
      "discount": 0
    }
  ],
  "payment_terms_full_charge": false,
  "renew_advance": "PT1H",
  "with_taxes": false,
  "payment_terms_align": false,
  "activate_ignore_balance": false,
  "limits": [
    {
      "services_id": 0,
      "origin": "orig",
      "limit_type": "money",
      "limit": 0
    }
  ],
  "dids_qty": 0,
  "dids_hold_days": 0,
  "dids_tags": [
    "string"
  ]
}