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

Consumption Sync (Offline Method)

The offline method is for devices without internet access: the device writes a request file, which is uploaded through the offline portal, and the response file is brought back to the device. Devices that are online use Consumption Sync (Online Method).

Syncs consumption events and device variables for one license, or for every member of a bundle, from a request file. Every event carries its own id and is applied exactly once, so the same file can always be uploaded again safely. The response file tells the device which events were applied, which were rejected and why, and contains a signed license snapshot per product.

Endpoint

  • Method: POST

  • Path: /api/v4/consumption_sync_offline/

  • Description: Applies a batch of consumption events and device variables from an offline request file (base64 payload) and returns the response as a file.

Authentication

Required headers

  • Date (string) — RFC7231 GMT date string

  • Authorization (string) — signature or bearer token

  • Accept: application/json

  • Content-Type: text/plain

Request

Body

The request body is a base64-encoded, stringified JSON envelope containing the sync request object and its signature (see Signature). A request can be up to 4 MB; larger requests are refused with HTTP 413.

Examples


Schema

Request Body

The decoded file is an envelope: { "request": <sync request object>, "signature": <signature> }. The sync request object is the same as for the online method, plus the offline fields date, api_key or client_id, and, for device-bound licenses, signature and the TPM or hardware-key signature.

Request schema (TypeScript + JSON Schema)

TypeScript

JSON Schema (the request object)

The fields of the request object are described on the online method page (license entries, resources and events). The offline-only fields:

  • date (string) — ISO 8601 UTC date the request file was created

  • api_key (string) or client_id (string) — client_id for OAuth-configured accounts

  • signature (string) — the v1 offline signature, required for TPM and hardware-key licenses, see Device-bound licenses

  • licensespring-tpm-signature / licensespring-hardware-key (string) — TPM and hardware-key licenses only


Signature

The envelope signature is an HMAC-SHA256 over the request object, signed with the company shared key (or client secret for OAuth):

1

Step

Build the sync request object, including date and api_key (or client_id).

2

Step

Serialize it to compact JSON.

3

Step

HMAC-SHA256 that JSON string with the signing key and encode the result as base64.

4

Step

Put the same JSON string, unchanged, under request in the envelope, next to signature. The signature is verified over the exact bytes of request as they appear in the file.

Example (Node.js):

Device-bound licenses

For TPM and hardware-key licenses, the request object also carries a v1 offline signature, built like the signature of an offline activation request: HMAC-SHA256("licenseSpring\ndate: <date>\n<license_key or username>\n<hardware_id>\n<api_key or client_id>", signingKey), base64-encoded. For a bundle, use the bundle's license key. The licensespring-tpm-signature or licensespring-hardware-key field then signs that v1 signature. Add these fields before computing the envelope signature.


Finalized payload

Wrap the request JSON and its signature in the envelope and encode it to base64.

Send the resulting base64 string as the raw request body, or as the file field of a multipart request.


Response Body

On success, the endpoint responds with HTTP 200 and the downloadable file sync_response.lic (Content-Disposition: attachment). The file contains the same JSON as the online method response, and the response carries the same LicenseSignature header.

Response schema (TypeScript)
  • request_id — echoes the request file's request_id. Discard a response file whose request_id doesn't match the pending request.

  • processed_ids — every applied event ID, including IDs applied by an earlier sync; remove exactly these from the local journal. count is the total actually applied for them.

  • rejected_ids — events that were not applied, with a code; see Rejection codes for which ones to retry.

  • Anything from the request that appears in neither processed_ids nor rejected_ids, including an omitted product, is still pending and belongs in the next request file.

  • offline_checkout — present when the device holds an offline checkout from a consumption pool. Synced usage is recorded in consumed; a sync never applies more than remaining.

Response signatures

Each product entry in the response file is signed three ways:

  • license_signature — HMAC-SHA256 signature explained in Response Signature.

  • offline_signature — HMAC-SHA256 signature constructed identically to the v1 request signature (see Device-bound licenses), but using the response date value.

  • license_signature_v2 — RSA-SHA256 signature over the product entry's compact JSON, in the key order received, with only the license_signature_v2 field removed.

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: the license entry uses license_key

  • User-based product licenses: the license entry uses username


Errors

These errors fail the whole request: nothing from the file is applied and no response file is produced. The response has an HTTP status code of 400 or higher and the response body contains an error description in the following format:

When one of the licenses in licenses cannot be found or authenticated, the message ends with (product: <code>) so you know which entry caused it. Every entry is checked before anything is written, so the other entries are not applied either.

List of exceptions

missing_headers (400)

The Authorization or Date header is missing

missing_content (400)

The request has no body, or no file in a multipart request

offline_signature_mismatch (401)

The envelope signature does not verify against the request object

missing_parameters (400)

A required field is missing or has the wrong type, including an event without a non-empty string id, or both api_key and client_id are missing

invalid_sync_request (400)

request is not "sync", or schema_version is not 1

unknown_product_code (400)

A product code in licenses was not found

license_not_found (400)

A license in licenses was not found

license_user_not_found (400)

The username is not assigned to the license

device_not_found (400)

The license is not activated on this hardware_id

license_not_active (400)

The license or the device is not active

license_not_enabled (400)

The license is not enabled

blacklisted (400)

This device is blacklisted

tpm_signature_required (400)

The TPM signature is missing and TPM usage is enforced

tpm_signature_mismatch (400)

The TPM signature can't be verified against the TPM public key

hardware_key_required (400)

The hardware-key signature is missing for a hardware-key license

hardware_key_signature_mismatch (401)

The hardware-key signature is invalid

413

The request is larger than 4 MB

If you want to use this API endpoint directly, instead of using an SDK (which does most of the heavy lifting for you), please contact us for additional instructions.


Deactivating after a sync

Deactivate License (Offline Method) does not accept sync events. After a device has synced, the consumptions in its deactivation file must only contain the usage recorded since the last sync, otherwise it is counted twice. Bundle deactivation ignores consumptions, so sync a bundle's usage before deactivating it.


Guide on using Offline Licenses

If any aspect of the offline licensing model remains unclear, see Offline License Activation.

Last updated

Was this helpful?