This article describes the older version of the Revenue API. If you're looking for the newer Monetize 5.0 PUT Records (Revenue) API, click here.
Introduction
This API is designed to allow upload of an account-based revenue file directly into CustomerGauge.
Good to know
Maximum file size:
Please do not upload files larger than 2MB.
Maximum number of records:
Please do not upload files with more than 1,000 records.
Uploadable file types:
We accept CSV, XLS(X), and XML files (note: no JSON files).
API response format:
Our APIs return data in either JSON or XML format (depending on request by .json or .xml).
Order of fields:
Data should provided in the following order (even for XML!):
- Account name
- Revenue amount
- Revenue start date
- Revenue end date
- Revenue type
- Description
Revenue number formatting:
When providing revenue, please don't use thousands separators, and no decimals.
For example, a revenue value of 1,234.12 must be provided as 1234.
Case-insensitive:
Data provided is case-insensitive — the value uploaded for the first time will be displayed.
Revenue Types:
Whether you upload multiple revenue sources in bulk, or upload a single revenue source for one company in the Company Details page, you will need to specify the revenue type.
- ARR: Annual Recurring Revenue. The amount you enter will be split into 12 months and replicated each month within the specified time period, unless the specified time period is less than one year. In that case the amount will be divided by the specified number of months and replicated each month within the specified time period.
- MRR: Monthly Recurring Revenue. The amount you enter will be replicated each month within the specified time period.
- One Time: This should be used for non-subscription purchases/payments; the whole amount will be saved on the starting date.
- Other: This should be used for any other type of revenue; the amount will be split into the number of months within the specified time period.
For example, if you upload $12 000 as ARR over the period 01-01-2016 to 31-12-2016, this amount will be split across the year: $1000 per month across that time period. If you upload the same amount (over the same period) as MRR however, this will be replicated each month, leading to a total annual revenue of $144 000 (12 x 12 000).
Another example: If you upload $12 000 as 'Other' revenue, and you mark the time period as 01-01-2016 to 30-06-2016, the amount will be split over 6 months, with $2000 per month across that time period.
About this API
Resource information
Response formats | JSON (default), XML |
HTTP Method | POST |
Response family | File |
Header | Authorization: Bearer XXXXX |
Resource URL
Europe Production Server: https://api.eu.customergauge.com/v4.1/company/revenue_file_automate.json
US Production Server: https://api.us.customergauge.com/v4.1/company/revenue_file_automate.json
Australia Production Server: https://api.au.customergauge.com/v4.1/company/revenue_file_automate.json
Authentication
OAuth2 Authentication is used to connect to this API. In order to create the Connected App, which is needed to generate the Access Token, Administrator access to CustomerGauge is needed. Once you've created your Connected App, you can acquire a Bearer Access Token by calling our OAuth2/Token API:
curl -X POST -H "Content-Type: application/x-www-form-urlencoded"
-d "grant_type=client_credentials&client_id={{ Client ID }}&client_secret={{ Client Secret }}"
https://auth.{{ apiRegion }}.customergauge.com/oauth2/token
The acquired Bearer Access Token is used in the Authorization header in your API request.
How to call
Parameters
Key | Data | Description |
file | Documents/file_name.csv | Automatically provided when POST-ing a file through HTTP protocol. |
Upload File Example Request
Post your file by calling our API as if posted from a form.
curl -H "Authorization: Bearer XXXXX" -F "file=@LOCAL_LOCATION/file_name.csv" "https://api.eu.customergauge.com/v4.1/company/revenue_file_automate.json"
Example Result
Data states if successful or not. Message reported on successful operation:
{ "Data": { "data": 1 } }
Message reported on failed operation:
{ "Data": false }
Sample files
At the bottom of this document you can find some sample files with the correct format and order.
Not the API you're looking for?
View: