Store/Update Revenue

This API request stores and updates revenue data for a specific site using the HTTP method PUT. The request includes the following parameters:

Headers:

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.

Request Body(JSON payload):

The data containing the ad cost information to store or update. The payload should include the following parameters:

CurrencyCodestringRequired

The appropriate currency code used for the value. This should be in ISO 4217 format. E.g. GBP

ValueintRequired

The value of the revenue.

RevenueClosedDatestringRequired

The date and time the revenue was captured. Must be in one of the ISO 8601 formats:

  • yyyy-MM-dd
  • yyyy-MM-ddTHH:mm:ss
  • yyyy-MM-ddTHH:mm:ss.ffffff
LeadDatestring

This can be empty or Must be in oe of the ISO 8601 formats:

  • yyyy-MM-dd
  • yyyy-MM-ddTHH:mm:ss
  • yyyy-MM-ddTHH:mm:ss.ffffff
VisitorIdentifierOptionsArrayRequired

An array of visitor identifiers. Each item in the array should include the following parameters:

KeystringRequired

The key for the visitor identifier. Accepted Keys: EmailAddress, PhoneNumber, RaId, PayloadValue, CookieValue

ValuestringRequired

The value for the visitor identifier.

LabelsArray(string)Required

Revenue Labels, at least one should be set


The {your-access-token} parameter in the authorization header should be replaced with the appropriate access token.

Request
PUT
{siteId}/revenue/upload
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]}" ] }'
Response
Status: 201