Skip to main content

Upsert currency sale for user

Definition

This API endpoint allows you to create or update a currency sale for a given user in real time.

Request

GET https://api.inbrain.ai/panelist-api/v1/{userId}/currency-sales

Headers

HeaderDescriptionRequired
X-InBrain-Api-KeyAuthentication API Keytrue

Parameters

Endpoint accepts a user id route parameter and a set of parameters in the body on the request link.

Root parameters

ParameterDescriptionRequired
userIdUnique user identifiertrue
externalIdUnique identifier for the saletrue
descriptionOptional description for the salefalse
startOnStart date of the saletrue
endOnEnd date of the saletrue
multiplierSale multipliertrue
lockedUntildateDate until the currency sale is locked read more

Examples

curl \
--request PUT 'https://api.inbrain.ai/panelist-api/v1/{userId}/currency-sales' \
--header 'X-InBrain-Api-Key: YOUR_API_KEY_HERE' \
--data '{
"externalId": "test",
"description": null,
"startOn": "2023-06-11T21:14:20.8835755Z",
"endOn": "2023-09-25T09:15:20.8835755Z",
"lockedUntil": "2023-08-09T12:10:20.8835755Z",
"multiplier": 3
}'

Response

Response codes

CodeDescriptionReason
200Success
400Bad RequestSome of the request parameters are missing or invalid
401UnauthorizedInvalid API Key
409ConflictCurrency sale is locked
429Too Many RequestsToo many requests in a given amount of time
500Internal Server ErrorServer error occured while processing the request

Success model

Successful response is a 200 OK without a body.

Error model

Error response is a JSON object with the properties given below.

PropertyTypeDescriptionRequired
codestringAPI error codetrue
descriptionstringAPI error descriptiontrue
messagesstring[]Error messages providing further error detailsfalse

Examples