POST
/
behavior
/
events
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",
  "order": {
    "purchase_id": "<string>",
    "channel_id": "<string>",
    "store_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": {}
      }
    ],
    "shipping": {
      "value": 3.25,
      "discounted_value": 2.25,
      "redeem": [
        {
          "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
          "amount": 1
        }
      ],
      "tags": {},
      "metadata": {}
    },
    "payment_method": "CREDIT",
    "redeem": [
      {
        "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
        "amount": 1
      }
    ],
    "metadata": {}
  },
  "fulfilled": true,
  "reserve": 1,
  "redeem": [
    {
      "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
      "amount": 1
    }
  ],
  "tags": {},
  "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": [
      "<any>"
    ],
    "status": "PENDING",
    "result": {},
    "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"
  }
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Body

application/json
customer_id
string
required

The customer unique identifier in your system

brand_id
string
required

The id of the brand that originate the event

type
string
required

The type of the event

Example:

"PURCHASE"

order
object

The order in case of a PURCHASE event

fulfilled
boolean
default:true

If the event was fulfilled, when false, rewards to be redeemed will be reserved until fulfilled

reserve
number
default:1

The number of days to reserve the rewards

redeem
object[]

The rewards to redeem in the order

tags
object

Include your conditions event tags here

metadata
object

Include any additional info here

Response

200
application/json
Event enqueued for processing
data
object