This API request stores or updates opportunity 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 opportunity information to store/update. The payload should include the following parameters:
OpportunityValueintRequiredThe value of the opportunity
OpportunityDateTimestringRequiredThe date and time the opportunity was captured. Must be in ISO 8601 format. yyyy-MM-dd
PipelineStagestringRequiredThe stage of the pipeline for the opportunity
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
CurrencyCodestringRequiredThe appropriate currency code used for the Opportunity Value. This should be in ISO 4217 format. E.g. GBP
LabelsArray(string)Opportunity Labels
ReferencestringRequiredA unique reference for the opportunity
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}/opportunity/upload' \ -H 'Authorization: Bearer {your-access-token}' \ -H 'Content-Type: application/json' \ -d '{ "OpportunityValue": "{value}", "OpportunityDateTime": "{datetime}", "PipelineStage": "{pipelinestage}", "VisitorIdentifierOptions": [ { "Key": "{key}", "Value": "{value}" } ], "CurrencyCode": "{currencycode}", "Labels": [ "{labels[0]}", "{labels[1]}" ], "Reference": "{reference}", "AdditionalDataProperties": [ { "Name": "{name}", "Value": "{value}" } ] }'