curl --request GET \
--url https://sandbox.catchbackcards.com/api/partner/v2/customers/{customer}/rewards \
--header 'Authorization: Bearer <token>'import requests
url = "https://sandbox.catchbackcards.com/api/partner/v2/customers/{customer}/rewards"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://sandbox.catchbackcards.com/api/partner/v2/customers/{customer}/rewards', 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://sandbox.catchbackcards.com/api/partner/v2/customers/{customer}/rewards",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://sandbox.catchbackcards.com/api/partner/v2/customers/{customer}/rewards"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://sandbox.catchbackcards.com/api/partner/v2/customers/{customer}/rewards")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://sandbox.catchbackcards.com/api/partner/v2/customers/{customer}/rewards")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"rewards": {
"customer": "user-1842",
"xp": 23150,
"tier": {
"id": "gold",
"name": "Gold",
"xp": 20000
},
"next_tier": {
"id": "emerald",
"name": "Emerald",
"xp": 100000,
"xp_needed": 76850
},
"next_milestone": {
"xp": 40000,
"xp_needed": 16850,
"pack_type": "silver",
"pack_name": "Silver"
},
"unopened_reward_packs": 1
}
}{
"error": "This program pays through customer wallets: read GET /wallets/{address}/tokens",
"code": "NOT_PARTNER_SETTLED"
}{
"error": "Missing or malformed API key"
}{
"error": "Rewards are not turned on for this program. Ask your CatchBack contact.",
"code": "REWARDS_NOT_ENABLED"
}{
"error": "Too many requests. Slow down.",
"code": "RATE_LIMITED",
"retry_after_seconds": 23
}{
"error": "Something went wrong. Retrying is safe: send the same Idempotency-Key if the request had one."
}{
"error": "Could not load the partner program; try again."
}Get a customer's rewards
non-crypto programs with rewards on only. Customer rewards.
The customer’s progress on the VIP ladder: lifetime xp (1 per $1 of the packs they opened, at their price on your statement; never resets, and reward packs earn none), the highest tier reached (never lost), the next_tier and next_milestone, and how many reward packs wait to open. A customer you have never sold to gets zeros, not a 404. Create an order answers accepted before the pack opens, so read this after the order’s nft_order.updated reaches in_vault.
curl --request GET \
--url https://sandbox.catchbackcards.com/api/partner/v2/customers/{customer}/rewards \
--header 'Authorization: Bearer <token>'import requests
url = "https://sandbox.catchbackcards.com/api/partner/v2/customers/{customer}/rewards"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://sandbox.catchbackcards.com/api/partner/v2/customers/{customer}/rewards', 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://sandbox.catchbackcards.com/api/partner/v2/customers/{customer}/rewards",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://sandbox.catchbackcards.com/api/partner/v2/customers/{customer}/rewards"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://sandbox.catchbackcards.com/api/partner/v2/customers/{customer}/rewards")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://sandbox.catchbackcards.com/api/partner/v2/customers/{customer}/rewards")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"rewards": {
"customer": "user-1842",
"xp": 23150,
"tier": {
"id": "gold",
"name": "Gold",
"xp": 20000
},
"next_tier": {
"id": "emerald",
"name": "Emerald",
"xp": 100000,
"xp_needed": 76850
},
"next_milestone": {
"xp": 40000,
"xp_needed": 16850,
"pack_type": "silver",
"pack_name": "Silver"
},
"unopened_reward_packs": 1
}
}{
"error": "This program pays through customer wallets: read GET /wallets/{address}/tokens",
"code": "NOT_PARTNER_SETTLED"
}{
"error": "Missing or malformed API key"
}{
"error": "Rewards are not turned on for this program. Ask your CatchBack contact.",
"code": "REWARDS_NOT_ENABLED"
}{
"error": "Too many requests. Slow down.",
"code": "RATE_LIMITED",
"retry_after_seconds": 23
}{
"error": "Something went wrong. Retrying is safe: send the same Idempotency-Key if the request had one."
}{
"error": "Could not load the partner program; try again."
}Authorizations
Your API key, sent as a bearer token, with the scope nft:orders. A production key starts cb_live_ and works only at https://catchbackcards.com; a sandbox key starts cb_test_ and works only at https://sandbox.catchbackcards.com (production refuses one with 401 SANDBOX_KEY). Keep it on your servers: never in a browser, app or wallet. Use a separate key per environment. A request from a country on our sanctions list gets a 403 with Access denied, whether or not it has a valid key. See Authentication and keys.
Path Parameters
Your own id for the customer, as you sent it as customer on Create an order. 1-128 characters of A-Za-z0-9_.:-, not dots alone; never personal data. Case-sensitive.
Your own id for a customer on a non-crypto program, 1-128 characters of A-Za-z0-9_.:-, not dots alone. Use something stable that is not personal data (your internal user id, never an email address or phone number). Ids are yours alone. Leading and trailing spaces are trimmed, and ids are case-sensitive (User-1 and user-1 are two customers).
^(?!\.+$)[A-Za-z0-9_.:-]{1,128}$"user-1842"

