Get program, tier, and reward definitions
curl --request POST \
--url https://loyalty.example.com/lip/v1/programs/get \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"context": {
"protocol_version": "<string>",
"profile": "<string>",
"request_id": "<string>",
"idempotency_key": "<string>",
"occurred_at": "2023-11-07T05:31:56Z",
"source": {
"system": "<string>",
"instance": "<string>"
}
},
"program_id": "<string>"
}
'import requests
url = "https://loyalty.example.com/lip/v1/programs/get"
payload = {
"context": {
"protocol_version": "<string>",
"profile": "<string>",
"request_id": "<string>",
"idempotency_key": "<string>",
"occurred_at": "2023-11-07T05:31:56Z",
"source": {
"system": "<string>",
"instance": "<string>"
}
},
"program_id": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
context: {
protocol_version: '<string>',
profile: '<string>',
request_id: '<string>',
idempotency_key: '<string>',
occurred_at: '2023-11-07T05:31:56Z',
source: {system: '<string>', instance: '<string>'}
},
program_id: '<string>'
})
};
fetch('https://loyalty.example.com/lip/v1/programs/get', 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://loyalty.example.com/lip/v1/programs/get",
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([
'context' => [
'protocol_version' => '<string>',
'profile' => '<string>',
'request_id' => '<string>',
'idempotency_key' => '<string>',
'occurred_at' => '2023-11-07T05:31:56Z',
'source' => [
'system' => '<string>',
'instance' => '<string>'
]
],
'program_id' => '<string>'
]),
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://loyalty.example.com/lip/v1/programs/get"
payload := strings.NewReader("{\n \"context\": {\n \"protocol_version\": \"<string>\",\n \"profile\": \"<string>\",\n \"request_id\": \"<string>\",\n \"idempotency_key\": \"<string>\",\n \"occurred_at\": \"2023-11-07T05:31:56Z\",\n \"source\": {\n \"system\": \"<string>\",\n \"instance\": \"<string>\"\n }\n },\n \"program_id\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", 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.post("https://loyalty.example.com/lip/v1/programs/get")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"context\": {\n \"protocol_version\": \"<string>\",\n \"profile\": \"<string>\",\n \"request_id\": \"<string>\",\n \"idempotency_key\": \"<string>\",\n \"occurred_at\": \"2023-11-07T05:31:56Z\",\n \"source\": {\n \"system\": \"<string>\",\n \"instance\": \"<string>\"\n }\n },\n \"program_id\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://loyalty.example.com/lip/v1/programs/get")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"context\": {\n \"protocol_version\": \"<string>\",\n \"profile\": \"<string>\",\n \"request_id\": \"<string>\",\n \"idempotency_key\": \"<string>\",\n \"occurred_at\": \"2023-11-07T05:31:56Z\",\n \"source\": {\n \"system\": \"<string>\",\n \"instance\": \"<string>\"\n }\n },\n \"program_id\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"context": {
"protocol_version": "<string>",
"profile": "<string>",
"request_id": "<string>",
"processed_at": "2023-11-07T05:31:56Z"
},
"program": {
"program_id": "<string>",
"name": "<string>",
"currency": "<string>",
"earning": {
"rate": {
"unit": "<string>",
"amount": 1,
"spend": {
"amount": 2,
"currency": "<string>"
}
},
"minimum_eligible_spend": {
"amount": 1,
"currency": "<string>"
},
"eligible_channels": [
"<string>"
],
"rounding": "<string>",
"exclusions": {
"product_ids": [
"<string>"
],
"category_ids": [
"<string>"
],
"tags": [
"<string>"
],
"line_kinds": [
"<string>"
]
}
},
"accounts": [
{
"unit": "<string>",
"is_primary": true,
"unit_label": "<string>"
}
],
"metrics": [
{
"metric_id": "<string>",
"name": "<string>",
"unit": "<string>",
"description": "<string>"
}
],
"tiers": [
{
"tier_id": "<string>",
"name": "<string>",
"qualification_metric_id": "<string>",
"minimum": 1,
"benefits": [
{
"benefit_id": "<string>",
"name": "<string>",
"description": "<string>",
"metadata": {}
}
],
"earn_multiplier_bps": 500000
}
],
"rewards": [
{
"reward_id": "<string>",
"name": "<string>",
"cost": {
"unit": "<string>",
"amount": 1
},
"effect": {
"type": "<string>",
"target": "<string>",
"amount": {
"amount": 0,
"currency": "<string>"
},
"allocations": [
{
"amount": {
"amount": 0,
"currency": "<string>"
},
"line_id": "<string>"
}
]
},
"funding": [
{
"party_id": "<string>",
"party_type": "<string>",
"share_bps": 5000,
"amount": {
"amount": 0,
"currency": "<string>"
}
}
],
"description": "<string>",
"image_url": "<string>",
"available_from": "2023-11-07T05:31:56Z",
"available_until": "2023-11-07T05:31:56Z",
"metadata": {}
}
],
"description": "<string>",
"account_earning": [
{
"unit": "<string>",
"mode": "<string>",
"amount": 1,
"multiplier_eligible": true,
"spend": {
"amount": 2,
"currency": "<string>"
}
}
],
"tier_policy": {
"metric_id": "<string>",
"period": {
"type": "<string>",
"starts_month": 6,
"starts_day": 16,
"time_zone": "<string>"
},
"effective_from": "<string>"
},
"point_expiration": {
"type": "<string>",
"days": 18250,
"warning_days": [
18250
]
},
"metadata": {}
}
}{
"type": "<string>",
"title": "<string>",
"status": 499,
"detail": "<string>",
"instance": "<string>",
"code": "<string>",
"errors": [
{
"path": "<string>",
"message": "<string>"
}
]
}Programs
Get program, tier, and reward definitions
POST
/
programs
/
get
Get program, tier, and reward definitions
curl --request POST \
--url https://loyalty.example.com/lip/v1/programs/get \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"context": {
"protocol_version": "<string>",
"profile": "<string>",
"request_id": "<string>",
"idempotency_key": "<string>",
"occurred_at": "2023-11-07T05:31:56Z",
"source": {
"system": "<string>",
"instance": "<string>"
}
},
"program_id": "<string>"
}
'import requests
url = "https://loyalty.example.com/lip/v1/programs/get"
payload = {
"context": {
"protocol_version": "<string>",
"profile": "<string>",
"request_id": "<string>",
"idempotency_key": "<string>",
"occurred_at": "2023-11-07T05:31:56Z",
"source": {
"system": "<string>",
"instance": "<string>"
}
},
"program_id": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
context: {
protocol_version: '<string>',
profile: '<string>',
request_id: '<string>',
idempotency_key: '<string>',
occurred_at: '2023-11-07T05:31:56Z',
source: {system: '<string>', instance: '<string>'}
},
program_id: '<string>'
})
};
fetch('https://loyalty.example.com/lip/v1/programs/get', 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://loyalty.example.com/lip/v1/programs/get",
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([
'context' => [
'protocol_version' => '<string>',
'profile' => '<string>',
'request_id' => '<string>',
'idempotency_key' => '<string>',
'occurred_at' => '2023-11-07T05:31:56Z',
'source' => [
'system' => '<string>',
'instance' => '<string>'
]
],
'program_id' => '<string>'
]),
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://loyalty.example.com/lip/v1/programs/get"
payload := strings.NewReader("{\n \"context\": {\n \"protocol_version\": \"<string>\",\n \"profile\": \"<string>\",\n \"request_id\": \"<string>\",\n \"idempotency_key\": \"<string>\",\n \"occurred_at\": \"2023-11-07T05:31:56Z\",\n \"source\": {\n \"system\": \"<string>\",\n \"instance\": \"<string>\"\n }\n },\n \"program_id\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", 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.post("https://loyalty.example.com/lip/v1/programs/get")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"context\": {\n \"protocol_version\": \"<string>\",\n \"profile\": \"<string>\",\n \"request_id\": \"<string>\",\n \"idempotency_key\": \"<string>\",\n \"occurred_at\": \"2023-11-07T05:31:56Z\",\n \"source\": {\n \"system\": \"<string>\",\n \"instance\": \"<string>\"\n }\n },\n \"program_id\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://loyalty.example.com/lip/v1/programs/get")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"context\": {\n \"protocol_version\": \"<string>\",\n \"profile\": \"<string>\",\n \"request_id\": \"<string>\",\n \"idempotency_key\": \"<string>\",\n \"occurred_at\": \"2023-11-07T05:31:56Z\",\n \"source\": {\n \"system\": \"<string>\",\n \"instance\": \"<string>\"\n }\n },\n \"program_id\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"context": {
"protocol_version": "<string>",
"profile": "<string>",
"request_id": "<string>",
"processed_at": "2023-11-07T05:31:56Z"
},
"program": {
"program_id": "<string>",
"name": "<string>",
"currency": "<string>",
"earning": {
"rate": {
"unit": "<string>",
"amount": 1,
"spend": {
"amount": 2,
"currency": "<string>"
}
},
"minimum_eligible_spend": {
"amount": 1,
"currency": "<string>"
},
"eligible_channels": [
"<string>"
],
"rounding": "<string>",
"exclusions": {
"product_ids": [
"<string>"
],
"category_ids": [
"<string>"
],
"tags": [
"<string>"
],
"line_kinds": [
"<string>"
]
}
},
"accounts": [
{
"unit": "<string>",
"is_primary": true,
"unit_label": "<string>"
}
],
"metrics": [
{
"metric_id": "<string>",
"name": "<string>",
"unit": "<string>",
"description": "<string>"
}
],
"tiers": [
{
"tier_id": "<string>",
"name": "<string>",
"qualification_metric_id": "<string>",
"minimum": 1,
"benefits": [
{
"benefit_id": "<string>",
"name": "<string>",
"description": "<string>",
"metadata": {}
}
],
"earn_multiplier_bps": 500000
}
],
"rewards": [
{
"reward_id": "<string>",
"name": "<string>",
"cost": {
"unit": "<string>",
"amount": 1
},
"effect": {
"type": "<string>",
"target": "<string>",
"amount": {
"amount": 0,
"currency": "<string>"
},
"allocations": [
{
"amount": {
"amount": 0,
"currency": "<string>"
},
"line_id": "<string>"
}
]
},
"funding": [
{
"party_id": "<string>",
"party_type": "<string>",
"share_bps": 5000,
"amount": {
"amount": 0,
"currency": "<string>"
}
}
],
"description": "<string>",
"image_url": "<string>",
"available_from": "2023-11-07T05:31:56Z",
"available_until": "2023-11-07T05:31:56Z",
"metadata": {}
}
],
"description": "<string>",
"account_earning": [
{
"unit": "<string>",
"mode": "<string>",
"amount": 1,
"multiplier_eligible": true,
"spend": {
"amount": 2,
"currency": "<string>"
}
}
],
"tier_policy": {
"metric_id": "<string>",
"period": {
"type": "<string>",
"starts_month": 6,
"starts_day": 16,
"time_zone": "<string>"
},
"effective_from": "<string>"
},
"point_expiration": {
"type": "<string>",
"days": 18250,
"warning_days": [
18250
]
},
"metadata": {}
}
}{
"type": "<string>",
"title": "<string>",
"status": 499,
"detail": "<string>",
"instance": "<string>",
"code": "<string>",
"errors": [
{
"path": "<string>",
"message": "<string>"
}
]
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Body
application/json
⌘I