Set route for adding new unit count for one account, and one service. Subsequent calls will debounce until calls are complete. After which billing views will update.

Details

Set unit count API Call allows you to manually select the unit count and price assigned to the service associated with a client.

Requirements

Set unit count requires the following items

NOTE: We require the accountId or the clientOid to be present for the API Call to be successful

  • serviceId - This represents the ID for the service. To get the serviceId perform the Get Vendor API Call
  • clientOid - DEPRECATED - This represents the ID for the client importing usage. To get the clientOid see Get Clients
  • accountId - This represents the ID for the Account you created in the Create an Account API Call. To retrieve the accountId, perform the Get Accounts API Call.
  • unitCount - This represents the count of services the account requires

Sample Responses

201 Success - Created service unit count

With a valid GRADIENT-TOKEN and properly mapped Accounts and Services, you will receive a 201 Success message. You will see the imported quantity associated with the appropriate Account and Service within Billing.

401 Unauthorized

Performing this call with an invalid GRADIENT-TOKEN will result in a 401 Unauthorized error. Ensure that you are using the appropriate Vendor and Partner API Keys.

403 Forbidden

If Gradient detects an anomaly with your API Usage, you may encounter 403 errors. Please contact support if you believe this is happening in error.

404 Unknown clients or service is not mapped

When performing the Set unit count API Call, it is normal to encounter 404 errors, so ensure you handle this gracefully. This will happen if a partner does not map all accounts and services that you provide. You cannot view their mappings, so always sync all information when syncing usage.

Sample Response

{
  "statusCode": 404,
  "message": "No account map found with id: 1"
}

429 Request limit reached (100 requests a second)

The Synthesize API is limited to 100 requests per second. If you are sending a lot of information, it is recommended to add pagination to ensure everything is received correctly.

Language
Credentials
Header
Click Try It! to start a request and see the response here!