Reporting

Subscription

The Subscription APIs give you the data about your Tray contract: the packages and add-ons that you bought, the contract periods and the allowances.

Use these endpoints with the Usage APIs to compare your usage with your allowances.

All Subscription endpoints use the POST method. The JSON body is optional.

Key terms

  • Package: The core product of your contract, for example the Embedded package.
  • Add-on: An extra product that you bought with your package, for example more tasks or more workflows.
  • Allowance: The quantity that your contract gives you, for example a number of tasks each billing month.
  • Fair use policy (FUP): A task allowance that comes with a package or add-on. Some FUP values give one task allowance for the full package or add-on (cumulative...TasksFUP). Other FUP values give a task allowance for each unit, for example for each workflow (per...TasksFUP).
  • Contract period: The time from the start to the end of one contract.

Permissions

Use the token of an API user with the Owner or Admin organization role. Refer to API users and tokens.

Only an organization Owner or Admin can give an API user this role. A token of an API user with a different role gets a 403 response.

Allowance values

Allowance values are strings. A value is a number, for example "25", or "Unlimited".

Rate limits

Tray limits the number of requests to the Subscription endpoints: 300 requests each minute and 5,000 requests each hour.

Each response has headers that show the limit and the number of requests that remain, for example RateLimit-Limit, RateLimit-Remaining and RateLimit-Reset. RateLimit-Reset is the number of seconds before the limit for the minute starts again.

If you go above a limit, the response is 429. Wait, then send the request again.

Get Subscription

This endpoint is non-billable.

Gets the packages and add-ons of your contract.

If you do not set a time period, the response contains the contracts that are active now. If you set a time period, the response contains the contracts that are active for some or all of the time period.

Packages

Each package has a status:

status Meaning
active The contract is active.
upcoming expiry The contract is active and ends soon.
renewed The contract is active and you renewed it.
expired The contract is not active.

standardAllowance is the number of workflows that the package includes.

Add-ons

quantity is the number of units that you bought, for example 10 workflows. addonCategory is the type of unit.

Other values

  • organizationStatus is the status of your organization: Active, Trial, Legacy or Unknown.
  • inMultipleRegions is true if your contract has organizations in more than one region. In this case, use the /account Usage endpoints.
  • subscriptionDisplayType lists the types of usage that apply to your contract.

Get Allowances

This endpoint is non-billable.

Gets the allowances of your active contracts.

Field Allowance
workflowsAllowed The number of workflows in the package and the workflow add-ons.
taskAllowed The number of tasks from task add-ons. This does not include fair use policy allowances. For your full task allowance, use Get Usage with usageType Tasks.
capiTaskAllowed The number of tasks from Connectivity API task add-ons.
uaAllowed The number of unique authentications from add-ons.
solutionsAllowed The number of solutions from add-ons.
solutionsInstancesAllowed The number of solution instances from add-ons.

If an allowance is 0, the response does not contain that field.

List Contract Organizations

This endpoint is non-billable.

Gets the IDs of all organizations that are on the same contract as your organization. The list includes organizations in all regions, and your organization.

The Usage endpoints include the usage of all these organizations.

List Contract Periods

This endpoint is non-billable.

Gets the periods of your contracts. Use these periods as the time period for the Usage endpoints.

The period with default set to true is the current contract period. The Get Usage endpoint uses this period if you do not set a time period.

The list is not in a fixed order. Sort it by start.

Was this page helpful?