mutation {
  incrementCounter(
    timestamp: "2020-01-11T10:15:30Z"
    subscriptionId: "00000000-0000-0000-0000-000000000000"
    brickId: "00000000-0000-0000-0000-000000000000"
    count: 1
  ) {
    success
  }
}
type IncrementCounterResponse {
  success: Boolean!
}

type Mutation {
  incrementCounter(
    timestamp: DateTime!
    subscriptionId: String!
    brickId: String!
    count: Int!
  ): IncrementCounterResponse!
}

The incrementCounter mutation is designed to increment the final value counter 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.

Mutation Parameters

timestamp
DateTime
required

The timestamp indicating when the counter incrementation occurs.

subscriptionId
String
required

The 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
required

The UUID of the associated Usage Brick.

count
Int
required

The number to increment the counter by (e.g. 1).

Response

success
Boolean
required

This 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, and count are included in the mutation for desired counter incrementation.
  • The count parameter cannot be negative, and should be discrete (not the total amount).
mutation {
  incrementCounter(
    timestamp: "2020-01-11T10:15:30Z"
    subscriptionId: "00000000-0000-0000-0000-000000000000"
    brickId: "00000000-0000-0000-0000-000000000000"
    count: 1
  ) {
    success
  }
}
type IncrementCounterResponse {
  success: Boolean!
}

type Mutation {
  incrementCounter(
    timestamp: DateTime!
    subscriptionId: String!
    brickId: String!
    count: Int!
  ): IncrementCounterResponse!
}