Skip to main content
POST
/
v2
/
simulate_reward
Simulate Reward
curl --request POST \
  --url https://dev.sbx.imprint.co/v2/simulate_reward \
  --header 'Authorization: Basic <encoded-value>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "customer_id": "e2806932-5f1b-4518-8b15-156d773e9496",
  "reward_type": "DELAYED"
}
'
import requests

url = "https://dev.sbx.imprint.co/v2/simulate_reward"

payload = {
"customer_id": "e2806932-5f1b-4518-8b15-156d773e9496",
"reward_type": "DELAYED"
}
headers = {
"Authorization": "Basic <encoded-value>",
"Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.text)
const options = {
method: 'POST',
headers: {Authorization: 'Basic <encoded-value>', 'Content-Type': 'application/json'},
body: JSON.stringify({customer_id: 'e2806932-5f1b-4518-8b15-156d773e9496', reward_type: 'DELAYED'})
};

fetch('https://dev.sbx.imprint.co/v2/simulate_reward', 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://dev.sbx.imprint.co/v2/simulate_reward",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'customer_id' => 'e2806932-5f1b-4518-8b15-156d773e9496',
'reward_type' => 'DELAYED'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Basic <encoded-value>",
"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://dev.sbx.imprint.co/v2/simulate_reward"

payload := strings.NewReader("{\n \"customer_id\": \"e2806932-5f1b-4518-8b15-156d773e9496\",\n \"reward_type\": \"DELAYED\"\n}")

req, _ := http.NewRequest("POST", url, payload)

req.Header.Add("Authorization", "Basic <encoded-value>")
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.post("https://dev.sbx.imprint.co/v2/simulate_reward")
.header("Authorization", "Basic <encoded-value>")
.header("Content-Type", "application/json")
.body("{\n \"customer_id\": \"e2806932-5f1b-4518-8b15-156d773e9496\",\n \"reward_type\": \"DELAYED\"\n}")
.asString();
require 'uri'
require 'net/http'

url = URI("https://dev.sbx.imprint.co/v2/simulate_reward")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Basic <encoded-value>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"customer_id\": \"e2806932-5f1b-4518-8b15-156d773e9496\",\n \"reward_type\": \"DELAYED\"\n}"

response = http.request(request)
puts response.read_body
{
  "debugging_id": "E777214A-2D11-4CAD-9E8F-E1BD71D9FE67"
}
{
"error": {
"type": "BAD_REQUEST_ERROR",
"message": "unsupported reward_type: INVALID, must be STATEMENT or DELAYED"
}
}
{
"error": {
"type": "BAD_REQUEST_ERROR",
"message": "unsupported reward_type: INVALID, must be STATEMENT or DELAYED"
}
}
{
"error": {
"type": "BAD_REQUEST_ERROR",
"message": "unsupported reward_type: INVALID, must be STATEMENT or DELAYED"
}
}
{
"error": {
"type": "BAD_REQUEST_ERROR",
"message": "unsupported reward_type: INVALID, must be STATEMENT or DELAYED"
}
}

Authorizations

Authorization
string
header
required

Basic HTTP authentication. Allowed headers-- Authorization: Basic <base64(api_key_id:api_key_secret)>

Body

application/json
customer_id
string
required
Example:

"e2806932-5f1b-4518-8b15-156d773e9496"

reward_type
enum<string>
required

The type of reward to simulate. Must match the product's configured reward type.

Available options:
STATEMENT,
DELAYED
Example:

"DELAYED"

Response

Reward webhook initiated

debugging_id
string

If you received an unexpected webhook or did not receive a webhook, send debugging id to your imprint team

Example:

"E777214A-2D11-4CAD-9E8F-E1BD71D9FE67"