Billing Accounts API Reference

Use the Billing Accounts API to programmatically retrieve and manage billing account data from external applications. The API supports account creation, account updates, limit management, access permissions, and account activity submission. The Billing Accounts API was previously called the Accounts API.

The API supports the following activity types:

  • Print

  • Copy

  • Credit

  • Debit

  • Set

For conceptual information, see Account Management. For information about managing accounts in the web console, see the Managing Accounts section in that topic.

Authentication

The Billing Accounts API uses OAuth 2.0 client applications. To authenticate, create a client application in Analysis > API > Client Application, select Billing Accounts as the target API, and choose the appropriate access level:

  • Read Only for integrations that only retrieve data.

  • Full for integrations that create or modify data.

HP Insights generates a Client ID and Client Secret for the application. The Client Secret is displayed only once. Copy both credentials and store them securely. Use the credentials to obtain an OAuth 2.0 access token, which must be included in API requests.

For the detailed procedure, see Create a client application in Connecting to APIs to extract data.

Note: For endpoint definitions, request and response schemas, authentication requirements, and examples, refer to the HP US Billing Accounts API documentation or the HP EU Billing Accounts API documentation.

Activity record fields

These fields apply when posting a Credit, Debit, or Set activity via POST /{customer-id}/activities, and are also returned by the GET operation on the same endpoint.

Note: accountId, quantity, and amount are required on every request. activityCorrelationId is returned in GET responses only; it links a refund activity back to the original Print activity it corresponds to.

Field Description
userEmail The email address of the user associated with the activity. Optional for Set, Credit, and Debit activities when the account is a shared account; required in all other cases.
accountId Required. The ID of the account associated with the activity. Make sure to select the correct account.
activityType The type of activity to record: Print, Copy, Credit, Debit, or Set.
fromUser Records the user (or system) that performed the activity. When included in the POST request, the transaction appears in the web console under the user's account details (Usage section) as "Decreased by Admin | adminusername". Automatic failed-release refunds use the value PrintFailureRebate instead of an admin username — this is how to distinguish an automatic refund from a manual credit.
transactionTime Optional. If omitted, defaults to the current UTC time.
quantity Required. An integer value, such as a page count.
amount Required. For Credit activities, specify the number of points as a negative value. For example, a credit of 10 points is submitted as -10. System-generated activities such as PrintFailureRebate refunds also return negative amounts.
activityCorrelationId Returned in GET responses only. Links a system-generated activity, such as a PrintFailureRebate refund, back to the original Print activity it corresponds to.

Print and PrintFailureRebate activity records

A failed print release generates two related activity records:

  • The original job is recorded with activityType Print.

  • The refund is recorded with activityType Credit and fromUser PrintFailureRebate, for the same quantity (page count) as the original job and a negative amount of the same magnitude.

The refund is identified by its fromUser value, not by a distinct activity type — activityType is Credit, the same as a manually applied credit. Both records share the same activityCorrelationId. Example response pair:

{

  "userEmail": "user@example.com",

  "accountId": "56679f2f-367d-4e6c-b0fc-9cf1a72133a1",

  "activityType": "Print",

  "transactionTime": "2026-05-06T21:59:10Z",

  "quantity": 1,

  "amount": 4,

  "activityCorrelationId": "3a2d47ea-827a-4494-98fb-9d7fd1b65d19"

},

{

  "userEmail": "user@example.com",

  "accountId": "56679f2f-367d-4e6c-b0fc-9cf1a72133a1",

  "activityType": "Credit",

  "fromUser": "PrintFailureRebate",

  "transactionTime": "2026-05-06T21:59:12Z",

  "quantity": 1,

  "amount": -4,

  "activityCorrelationId": "3a2d47ea-827a-4494-98fb-9d7fd1b65d19"

}

See Managing Accounts for the procedure to look these up.

Set activity example

The Set activity type is equivalent to the Set to Points action in the web console. While Set to Points in the web console updates balances for individual users, the API function supports bulk updates, allowing administrators to set specific target balances for multiple user accounts at once — for example, resetting all user balances at the start of a new academic term or billing cycle.

Example: reset a user's balance to 0 at the beginning of a new semester.

{

"userEmail": "test@email.com",

"accountId": "ba4122c5-c620-4ba8-aa90-e0e2577b1e48",

"activityType": "Set",

"fromUser": "admin",

"transactionTime": "2025-04-01T00:48:40.634Z",

"quantity": 1,

"amount": 0

}

Credit a user's balance via the API

Use a Credit activity to restore points to a user's account or correct an account balance.

  1. Open the HP US API documentation or HP EU API documentation to review available endpoints and their usage.

  2. Authenticate using a Client ID and Client Secret. See Authentication above if you don't already have credentials.

Note: Make sure to select the correct scope: cloudprint:billing-accounts. This grants permission to modify billing-related activities.

  1. Open POST /{customer-id}/activities in the Activities section of the API.

  2. Enter a customer ID.

  3. In the Request body, set activityType to Credit.

  4. Complete the remaining request fields as described in Activity record fields above.

Note: To distinguish an automatic failed-release refund from a manual credit, check the fromUser value in the activity record. Automatic failed-release refunds use PrintFailureRebate.