Usage
setGauge Mutation
Use this API to set a Prorated Brick
The setGauge
mutation is designed to increment the prorated gauge for a specific customer in Salesbricks.
To utilize this mutation, follow the authentication steps outlined in the Authentication guide, and ensure that you are using the Usage API Endpoint:
https://api.salesbricks.com/api/v1/usage
Mutation Parameters
timestamp
DateTime
requiredThe timestamp indicating when the gauge is set.
subscriptionId
String
requiredThe UUID of the Salesbricks subscription associated with the customer.
Obtain this value from the Public GraphQL API and store it against your internal account ID for the customer.
brickId
String
requiredThe UUID of the associated Usage Brick.
value
Int
requiredThe number to set the gauge value to (e.g. 1
).
Response
success
Boolean
requiredThis response should be considered an empty response.
Important Notes
- To prevent duplicate requests and avoid over-charging customers, refer to the Idempotent Requests guide.
- Ensure accurate values for
timestamp
,subscriptionId
,brickId
, andvalue
are included in the mutation for desired gauge set. - The
value
parameter cannot be negative, and shouldn’t be discrete (it should be the total/aggregated value).