For the complete documentation index, see llms.txt. This page is also available as Markdown.

Add Consumption

Endpoint

  • Method: POST

  • Path: /api/v4/add_consumption

  • Description: Adds 1 or more consumptions to a license (consumption-type licenses only).

Authentication

See License API Authorization.

Required headers

  • Date (string) — RFC7231 GMT date string

  • Authorization (string)

Optional headers

  • licensespring-tpm-signature (string) — TPM licensing signature and algorithm

    • licensespring-tpm-signature: algorithm="ES256",signature=""

  • Accept: application/json

  • Content-Type: application/json

Request

Body parameters

Required:

  • hardware_id (string)

  • product (string)

One of:

  • license_key (string)

  • username (string)

Optional:

  • license_id (number)

  • consumptions (number) — Defaults to 1. Can be negative if allowed.

  • max_overages (number)

  • allow_overages (boolean)

  • event (array of strings) — consumption_add (default) or offline_floating_consumptions_sync (mutually exclusive)

Examples

Schema

Request Body

Request schema (TypeScript + JSON Schema)

TypeScript

JSON Schema

Response Body

Response schema (TypeScript + JSON Schema)

TypeScript

JSON Schema

License Authorization Method

There are two types of product licenses based on how the client application authorizes itself to interact with a license:

  • Key-based product licenses: client interactions with the license have to be authorized using a license_key

  • User-based product licenses: the license has a corresponding "license user" instead of a license key. Client interactions with the license have to be authorized using a username

Errors

If an error occurs, the response will have an HTTP status code of 400 or higher, and the response body will contain an error description in the following format:

Error schema (TypeScript + JSON Schema)

TypeScript

JSON Schema

List of exceptions

unknown_product (400)

Provided product was not found

license_not_found (400)

License with the provided license user not found

license_not_active (400)

The license is not active

license_not_enabled (400)

The license is not enabled

license_not_consumption (400)

The license needs to be of consumption type

license_not_enough_consumptions (400)

Not enough consumptions left

negative_consumptions_not_allowed (400)

Negative consumptions not allowed

device_not_found (400)

An active device matching the hardware_id not found

blacklisted (400)

This device is blacklisted

tpm_invalid_public_key (400)

The TPM public key sent is not valid

tpm_signature_required (400)

The TPM signature is missing from the header and TPM usage is enforced

tpm_signature_missmatch (400)

The TPM signature/algorithm is not ES256 and the signature can't be verified against the TPM public key

Last updated

Was this helpful?