Create package
POST/packages
packages.create
Request​
- application/json
Bodyrequired
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).
Partition ID.
Name.
Possible values: <= 128 characters
Duration of the package (renewal period). To be given in ISO 8601 format.
Currency ID.
Status.
Possible values: [active
, disabled
, archive
]
active
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
0
Time-limited package: start timestamp from which the package becomes available for assignment and use by the client.
null
Time-limited package: end timestamp till which the package remains available for assignment and use by the client.
null
Tag that will be added to the events billed by this package.
null
If True
, first subscription fee will be charged
when the first event occurs within this package period. Until
the fees will not be charged.
false
Defines when the subscription fee is accounted:
Possible values: [pre_activation
, period_start
]
pre_activation
fees object[]
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.
true
discounts object[]
If True
, the package will be charged
in full on the first activation and full entitlements will be
provided. Only duration will be prorated.
false
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.
PT1H
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.
null
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.
false
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.
false
If True
, the package will be activated
disregarding client balance. This may lead to negative balance
for prepaid clients.
false
Service entitlement: code deck ID to be used for service limits if defined by code name(s).
null
limits object[]
DID entitlement: DIDs quantity. Only that many DIDs will be possible to assign to the client within this package.
Possible values: >= 0
and <= 2147483647
0
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
0
DID entitlement: allowed DID tags. Use to determine level of DIDs that can be assigned to the client (e.g. gold, premium, etc.).
[]
Responses​
- 200
- 400
- 401
- 404
- 422
- 500
Package object as has been stored.
- application/json
- Schema
- Example (auto)
Schema
{}
The request contains invalid arguments or is malformed
- application/json
- Schema
- Example (auto)
Schema
error object
{
"error": {
"message": "Invalid request",
"data": {
"name": "Empty value is not allowed",
"payment_terms_id": "Object \"payment_terms(123)\" was not found!"
}
}
}
Access is not authorized
- application/json
- Schema
- Example (auto)
Schema
error object
{
"error": {
"message": "utoken-auth-failed: Authentication Failed: IP 10.0.0.1 is not allowed",
"data": {
"code": "utoken-auth-failed",
"message": "Authentication Failed: IP 10.0.0.1 is not allowed"
}
}
}
Requested object was not found
- application/json
- Schema
- Example (auto)
Schema
error object
{
"error": {
"message": "not_found: Object \"clients(123)\" was not found!",
"data": {
"code": "not_found",
"message": "Object \"clients(123)\" was not found!",
"object_name": "clients",
"object_id": "123"
}
}
}
A logical error occurred, making the request unprocessable
- application/json
- Schema
- Example (auto)
Schema
error object
{
"error": {
"message": "invoices-zero-amount: Impossible to create an invoice with zero amount",
"data": {
"code": "invoices-zero-amount",
"message": "Impossible to create an invoice with zero amount"
}
}
}
An unexpected error occurred
- application/json
- Schema
- Example (auto)
Schema
error object
{
"error": {
"message": "An unexpected error occurred"
}
}
Authorization: X-Api-Key
name: X-Api-Keytype: apiKeyin: headerdescription: Token for API access
- curl
- python
- nodejs
- php
- CURL
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>'