Store/Update Opportunity

This API request stores or updates opportunity 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 opportunity information to store/update. The payload should include the following parameters:

OpportunityValueintRequired

The value of the opportunity

OpportunityDateTimestringRequired

The date and time the opportunity was captured. Must be in ISO 8601 format. yyyy-MM-dd

PipelineStagestringRequired

The stage of the pipeline for the opportunity

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.

CurrencyCodestringRequired

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

LabelsArray(string)

Opportunity Labels


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

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