This API request stores and updates revenue data for a specific site using the HTTP method PUT. The request includes the following parameters:
AuthorizationstringRequired The authorization token for accessing the API. The header value should be set to "Bearer {your-access-token}", where {your-access-token} is the access token assigned to the user.
The data containing the ad cost information to store or update. The payload should include the following parameters:
CurrencyCodestringRequiredThe appropriate currency code used for the value. This should be in ISO 4217 format. E.g. GBP
ValueintRequiredThe value of the revenue.
RevenueClosedDatestringRequiredThe date and time the revenue was captured. Must be in one of the ISO 8601 formats and in UTC time standard:
LeadDatestringThis can be empty or Must be in one of the ISO 8601 formats and in UTC time standard:
VisitorIdentifierOptionsArrayRequiredAn array of visitor identifiers. Each item in the array should include the following parameters:
KeystringRequiredThe key for the visitor identifier. Accepted Keys: EmailAddress, PhoneNumber, RaId, PayloadValue, CookieValue
ValuestringRequiredThe value for the visitor identifier.
If using the CookieValue identifier you must pass the Google Client ID without the GA.1.1 prefix. e.g. GA1.1.101961087.1756204614 should be sent as 101961087.1756204614
LabelsArray(string)RequiredRevenue Labels, at least one should be set
ReferencestringRequiredA unique reference for the revenue
AdditionalDataPropertiesArrayAn array of additional data properties. Each item in the array should include the following parameters:
NamestringRequiredThe name key for the property, this can be set to anything
ValuestringRequiredThe value for the named property.
The {your-access-token} parameter in the authorization header should be replaced with the appropriate access token.
curl -X PUT \ 'https://rest.rulerapi.com/v1/{siteId}/revenue/upload' \ -H 'Authorization: Bearer {your-access-token}' \ -H 'Content-Type: application/json' \ -d '{ "CurrencyCode": "{currencyCode}", "Value": "{value}", "RevenueClosedDate": "{closedDate}", "LeadDate": "{leadDate}", "VisitorIdentifierOptions": [ { "Key": "{key}", "Value": "{value}" } ], "Labels": [ "{labels[0]}", "{labels[1]}" ], "Reference": "{reference}", "AdditionalDataProperties": [ { "Name": "{name}", "Value": "{value}" } ] }'