cURL
curl --request PUT \
--url https://app.masivo.ai/api/storefront/v1/events/redeem/preview \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{}'import requests
url = "https://app.masivo.ai/api/storefront/v1/events/redeem/preview"
payload = {}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({})
};
fetch('https://app.masivo.ai/api/storefront/v1/events/redeem/preview', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://app.masivo.ai/api/storefront/v1/events/redeem/preview",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://app.masivo.ai/api/storefront/v1/events/redeem/preview"
payload := strings.NewReader("{}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.put("https://app.masivo.ai/api/storefront/v1/events/redeem/preview")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.masivo.ai/api/storefront/v1/events/redeem/preview")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{}"
response = http.request(request)
puts response.read_body{
"data": {
"customer_id": "<string>",
"brand_id": "<string>",
"order": {
"purchase_id": "<string>",
"value": 20.95,
"products": [
{
"sku": "<string>",
"amount": 123,
"value": 123,
"discounted_value": 123,
"redeem": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"amount": 1
}
],
"tags": {},
"metadata": {},
"redemptions_result": {
"redeemed": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"amount": 1,
"reward": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"brand_id": "<string>",
"platforms": [
"<string>"
],
"stores": [
"<string>"
],
"channels": [
"<string>"
],
"products": [
"<string>"
],
"name": "<string>",
"description": "<string>",
"conditions": [
[
{
"type": "Order Value",
"operator": "grater than",
"value": 9.95
}
]
],
"attributes": {
"conversion_factor": 0.1
}
},
"error": "<string>"
}
],
"amount": 123,
"discount_value": 123,
"discount_percent": 0.5,
"value": 123
}
}
],
"channel_id": "<string>",
"store_id": "<string>",
"discounted_value": 10.95,
"shipping": {
"value": 3.25,
"discounted_value": 2.25,
"redeem": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"amount": 1
}
],
"tags": {},
"metadata": {},
"redemptions_result": {
"redeemed": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"amount": 1,
"reward": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"brand_id": "<string>",
"platforms": [
"<string>"
],
"stores": [
"<string>"
],
"channels": [
"<string>"
],
"products": [
"<string>"
],
"name": "<string>",
"description": "<string>",
"conditions": [
[
{
"type": "Order Value",
"operator": "grater than",
"value": 9.95
}
]
],
"attributes": {
"conversion_factor": 0.1
}
},
"error": "<string>"
}
],
"amount": 123,
"discount_value": 123,
"discount_percent": 0.5,
"value": 123
}
},
"redeem": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"amount": 1
}
],
"metadata": {},
"redemptions_result": {
"redeemed": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"amount": 1,
"reward": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"brand_id": "<string>",
"platforms": [
"<string>"
],
"stores": [
"<string>"
],
"channels": [
"<string>"
],
"products": [
"<string>"
],
"name": "<string>",
"description": "<string>",
"conditions": [
[
{
"type": "Order Value",
"operator": "grater than",
"value": 9.95
}
]
],
"attributes": {
"conversion_factor": 0.1
}
},
"error": "<string>"
}
],
"amount": 123,
"discount_value": 123,
"discount_percent": 0.5,
"value": 123
}
},
"redemption_steps": [
{
"reward_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"reward_amount": 123,
"target_id": "<string>",
"discount_value": 123,
"before": {
"value": 123,
"amount": 123,
"discount_value": 123,
"discount_percent": 0.5
},
"after": {
"value": 123,
"amount": 123,
"discount_value": 123,
"discount_percent": 0.5
},
"target_before": {
"value": 123,
"amount": 123,
"discount_value": 123,
"discount_percent": 0.5
},
"target_after": {
"value": 123,
"amount": 123,
"discount_value": 123,
"discount_percent": 0.5
},
"error": "<string>"
}
]
}
}{
"error": "<string>",
"details": "<string>"
}Behavior
Preview order
Preview the order as if the given rewards were redeemed. If a wallet reward is restricted to stores, channels, or products, the preview only applies it when the order contains a matching store_id, channel_id, or product sku. Rewards with null e-commerce scope have no e-commerce restriction.
PUT
/
events
/
redeem
/
preview
cURL
curl --request PUT \
--url https://app.masivo.ai/api/storefront/v1/events/redeem/preview \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{}'import requests
url = "https://app.masivo.ai/api/storefront/v1/events/redeem/preview"
payload = {}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({})
};
fetch('https://app.masivo.ai/api/storefront/v1/events/redeem/preview', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://app.masivo.ai/api/storefront/v1/events/redeem/preview",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://app.masivo.ai/api/storefront/v1/events/redeem/preview"
payload := strings.NewReader("{}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.put("https://app.masivo.ai/api/storefront/v1/events/redeem/preview")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.masivo.ai/api/storefront/v1/events/redeem/preview")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{}"
response = http.request(request)
puts response.read_body{
"data": {
"customer_id": "<string>",
"brand_id": "<string>",
"order": {
"purchase_id": "<string>",
"value": 20.95,
"products": [
{
"sku": "<string>",
"amount": 123,
"value": 123,
"discounted_value": 123,
"redeem": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"amount": 1
}
],
"tags": {},
"metadata": {},
"redemptions_result": {
"redeemed": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"amount": 1,
"reward": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"brand_id": "<string>",
"platforms": [
"<string>"
],
"stores": [
"<string>"
],
"channels": [
"<string>"
],
"products": [
"<string>"
],
"name": "<string>",
"description": "<string>",
"conditions": [
[
{
"type": "Order Value",
"operator": "grater than",
"value": 9.95
}
]
],
"attributes": {
"conversion_factor": 0.1
}
},
"error": "<string>"
}
],
"amount": 123,
"discount_value": 123,
"discount_percent": 0.5,
"value": 123
}
}
],
"channel_id": "<string>",
"store_id": "<string>",
"discounted_value": 10.95,
"shipping": {
"value": 3.25,
"discounted_value": 2.25,
"redeem": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"amount": 1
}
],
"tags": {},
"metadata": {},
"redemptions_result": {
"redeemed": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"amount": 1,
"reward": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"brand_id": "<string>",
"platforms": [
"<string>"
],
"stores": [
"<string>"
],
"channels": [
"<string>"
],
"products": [
"<string>"
],
"name": "<string>",
"description": "<string>",
"conditions": [
[
{
"type": "Order Value",
"operator": "grater than",
"value": 9.95
}
]
],
"attributes": {
"conversion_factor": 0.1
}
},
"error": "<string>"
}
],
"amount": 123,
"discount_value": 123,
"discount_percent": 0.5,
"value": 123
}
},
"redeem": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"amount": 1
}
],
"metadata": {},
"redemptions_result": {
"redeemed": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"amount": 1,
"reward": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"brand_id": "<string>",
"platforms": [
"<string>"
],
"stores": [
"<string>"
],
"channels": [
"<string>"
],
"products": [
"<string>"
],
"name": "<string>",
"description": "<string>",
"conditions": [
[
{
"type": "Order Value",
"operator": "grater than",
"value": 9.95
}
]
],
"attributes": {
"conversion_factor": 0.1
}
},
"error": "<string>"
}
],
"amount": 123,
"discount_value": 123,
"discount_percent": 0.5,
"value": 123
}
},
"redemption_steps": [
{
"reward_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"reward_amount": 123,
"target_id": "<string>",
"discount_value": 123,
"before": {
"value": 123,
"amount": 123,
"discount_value": 123,
"discount_percent": 0.5
},
"after": {
"value": 123,
"amount": 123,
"discount_value": 123,
"discount_percent": 0.5
},
"target_before": {
"value": 123,
"amount": 123,
"discount_value": 123,
"discount_percent": 0.5
},
"target_after": {
"value": 123,
"amount": 123,
"discount_value": 123,
"discount_percent": 0.5
},
"error": "<string>"
}
]
}
}{
"error": "<string>",
"details": "<string>"
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Body
application/json
Response
Ok
Show child attributes
Show child attributes
⌘I