curl --request POST \
--url https://app.masivo.ai/api/storefront/v1/behavior/events \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"customer_id": "<string>",
"brand_id": "<string>",
"type": "PURCHASE",
"platform": "<string>",
"order": {
"purchase_id": "<string>",
"value": 20.95,
"discounted_value": 10.95,
"products": [
{
"sku": "<string>",
"amount": 123,
"value": 123,
"discounted_value": 123,
"redeem": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"amount": 1
}
],
"tags": {},
"metadata": {}
}
],
"payment_method": "CREDIT",
"channel_id": "<string>",
"store_id": "<string>",
"shipping": {
"value": 3.25,
"discounted_value": 2.25,
"redeem": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"amount": 1
}
],
"tags": {},
"metadata": {}
},
"redeem": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"amount": 1
}
],
"metadata": {}
},
"product": {
"sku": "<string>",
"amount": 123,
"value": 123,
"discounted_value": 123,
"redeem": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"amount": 1
}
],
"tags": {},
"metadata": {}
},
"fulfilled": true,
"reserve": 1,
"redeem": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"amount": 1
}
],
"tags": {},
"referral_code": "<string>",
"metadata": {}
}
'{
"data": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"customer_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"type": "PURCHASE",
"data": {},
"fulfilled": true,
"reserve": 123,
"queue_message_id": "<string>",
"rewarding_campaigns": "<array>",
"status": "PENDING",
"result": {
"wallet": {},
"customer": {},
"gift_card": [
{
"code": "<string>",
"reward_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"customer_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"rewarded_at": "2023-11-07T05:31:56Z",
"description": "<string>",
"expired_at": "2023-11-07T05:31:56Z",
"redeemed_at": "2023-11-07T05:31:56Z"
}
],
"accumulations": [
{
"amount": 123,
"reward_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"campaign_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"brand_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"issued_at": "2023-11-07T05:31:56Z",
"expiration_date": "2023-11-07T05:31:56Z",
"reservation_expires_at": "2023-11-07T05:31:56Z"
}
],
"redemptions": [
{
"amount": 123,
"reward_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"campaign_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"brand_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"issued_at": "2023-11-07T05:31:56Z",
"expiration_date": "2023-11-07T05:31:56Z",
"reservation_expires_at": "2023-11-07T05:31:56Z"
}
],
"transactions": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"brand_id": "<string>",
"event_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"campaign_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"channel_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"store_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"funded_by": "MARKETING",
"event_type": "PURCHASE",
"reward_type": "POINTS",
"reward_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"amount": 123,
"cost": 123,
"details": "<string>",
"type": "ACCUMULATION",
"receiver_id": "<string>",
"sender_id": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"issued_at": "2023-11-07T05:31:56Z",
"attributes": {
"line": {
"amount": 123,
"reward_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"campaign_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"brand_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"issued_at": "2023-11-07T05:31:56Z",
"expiration_date": "2023-11-07T05:31:56Z",
"reservation_expires_at": "2023-11-07T05:31:56Z"
},
"campaign_name": "<string>"
},
"metadata": {}
}
],
"customer_by_tier": [
{}
]
},
"issued_at": "2023-11-07T05:31:56Z",
"processing_at": "2023-11-07T05:31:56Z",
"resolved_at": "2023-11-07T05:31:56Z",
"cancelled_at": "2023-11-07T05:31:56Z",
"expired_at": "2023-11-07T05:31:56Z",
"reversed_at": "2023-11-07T05:31:56Z"
}
}Create a behavior event. This will trigger matching campaigns to offer rewards to the customer.
curl --request POST \
--url https://app.masivo.ai/api/storefront/v1/behavior/events \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"customer_id": "<string>",
"brand_id": "<string>",
"type": "PURCHASE",
"platform": "<string>",
"order": {
"purchase_id": "<string>",
"value": 20.95,
"discounted_value": 10.95,
"products": [
{
"sku": "<string>",
"amount": 123,
"value": 123,
"discounted_value": 123,
"redeem": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"amount": 1
}
],
"tags": {},
"metadata": {}
}
],
"payment_method": "CREDIT",
"channel_id": "<string>",
"store_id": "<string>",
"shipping": {
"value": 3.25,
"discounted_value": 2.25,
"redeem": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"amount": 1
}
],
"tags": {},
"metadata": {}
},
"redeem": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"amount": 1
}
],
"metadata": {}
},
"product": {
"sku": "<string>",
"amount": 123,
"value": 123,
"discounted_value": 123,
"redeem": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"amount": 1
}
],
"tags": {},
"metadata": {}
},
"fulfilled": true,
"reserve": 1,
"redeem": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"amount": 1
}
],
"tags": {},
"referral_code": "<string>",
"metadata": {}
}
'{
"data": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"customer_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"type": "PURCHASE",
"data": {},
"fulfilled": true,
"reserve": 123,
"queue_message_id": "<string>",
"rewarding_campaigns": "<array>",
"status": "PENDING",
"result": {
"wallet": {},
"customer": {},
"gift_card": [
{
"code": "<string>",
"reward_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"customer_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"rewarded_at": "2023-11-07T05:31:56Z",
"description": "<string>",
"expired_at": "2023-11-07T05:31:56Z",
"redeemed_at": "2023-11-07T05:31:56Z"
}
],
"accumulations": [
{
"amount": 123,
"reward_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"campaign_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"brand_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"issued_at": "2023-11-07T05:31:56Z",
"expiration_date": "2023-11-07T05:31:56Z",
"reservation_expires_at": "2023-11-07T05:31:56Z"
}
],
"redemptions": [
{
"amount": 123,
"reward_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"campaign_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"brand_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"issued_at": "2023-11-07T05:31:56Z",
"expiration_date": "2023-11-07T05:31:56Z",
"reservation_expires_at": "2023-11-07T05:31:56Z"
}
],
"transactions": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"brand_id": "<string>",
"event_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"campaign_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"channel_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"store_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"funded_by": "MARKETING",
"event_type": "PURCHASE",
"reward_type": "POINTS",
"reward_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"amount": 123,
"cost": 123,
"details": "<string>",
"type": "ACCUMULATION",
"receiver_id": "<string>",
"sender_id": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"issued_at": "2023-11-07T05:31:56Z",
"attributes": {
"line": {
"amount": 123,
"reward_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"campaign_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"brand_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"issued_at": "2023-11-07T05:31:56Z",
"expiration_date": "2023-11-07T05:31:56Z",
"reservation_expires_at": "2023-11-07T05:31:56Z"
},
"campaign_name": "<string>"
},
"metadata": {}
}
],
"customer_by_tier": [
{}
]
},
"issued_at": "2023-11-07T05:31:56Z",
"processing_at": "2023-11-07T05:31:56Z",
"resolved_at": "2023-11-07T05:31:56Z",
"cancelled_at": "2023-11-07T05:31:56Z",
"expired_at": "2023-11-07T05:31:56Z",
"reversed_at": "2023-11-07T05:31:56Z"
}
}Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
The customer unique identifier in your system
The id of the brand that originate the event
The type of the event
"PURCHASE"
Platform name where the event originated
The order in case of a PURCHASE event
Show child attributes
The product in case of an ADD_TO_CART event
Show child attributes
If the event was fulfilled, when false, rewards to be redeemed will be reserved until fulfilled
The number of days to reserve the rewards
The rewards to redeem in the order
Show child attributes
Include your conditions event tags here
(Optional) The referral code to track the event
Include any additional info here
Event enqueued for processing
Show child attributes