Evaluate accrual and available rewards
curl --request POST \
--url https://loyalty.example.com/lip/v1/orders/evaluate \
--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>"
}
},
"member_id": "<string>",
"order": {
"order_id": "<string>",
"scope": {
"program_id": "<string>",
"brand_id": "<string>",
"merchant_id": "<string>",
"location_id": "<string>",
"franchisee_id": "<string>"
},
"channel": "<string>",
"status": "<string>",
"business_date": "<string>",
"placed_at": "2023-11-07T05:31:56Z",
"lines": [
{
"line_id": "<string>",
"kind": "<string>",
"product_id": "<string>",
"quantity": 2,
"unit_price": {
"amount": 0,
"currency": "<string>"
},
"subtotal": {
"amount": 0,
"currency": "<string>"
},
"discount": {
"amount": 0,
"currency": "<string>"
},
"tax": {
"amount": 0,
"currency": "<string>"
},
"sku": "<string>",
"name": "<string>",
"parent_line_id": "<string>",
"category_ids": [
"<string>"
],
"tags": [
"<string>"
],
"loyalty_eligible": true,
"metadata": {}
}
],
"totals": {
"subtotal": {
"amount": 0,
"currency": "<string>"
},
"discount": {
"amount": 0,
"currency": "<string>"
},
"tax": {
"amount": 0,
"currency": "<string>"
},
"tip": {
"amount": 0,
"currency": "<string>"
},
"service_charge": {
"amount": 0,
"currency": "<string>"
},
"total": {
"amount": 0,
"currency": "<string>"
}
},
"order_number": "<string>",
"member_id": "<string>",
"closed_at": "2023-11-07T05:31:56Z",
"tenders": [
{
"tender_id": "<string>",
"type": "<string>",
"amount": {
"amount": 0,
"currency": "<string>"
}
}
],
"metadata": {}
}
}
'import requests
url = "https://loyalty.example.com/lip/v1/orders/evaluate"
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>"
}
},
"member_id": "<string>",
"order": {
"order_id": "<string>",
"scope": {
"program_id": "<string>",
"brand_id": "<string>",
"merchant_id": "<string>",
"location_id": "<string>",
"franchisee_id": "<string>"
},
"channel": "<string>",
"status": "<string>",
"business_date": "<string>",
"placed_at": "2023-11-07T05:31:56Z",
"lines": [
{
"line_id": "<string>",
"kind": "<string>",
"product_id": "<string>",
"quantity": 2,
"unit_price": {
"amount": 0,
"currency": "<string>"
},
"subtotal": {
"amount": 0,
"currency": "<string>"
},
"discount": {
"amount": 0,
"currency": "<string>"
},
"tax": {
"amount": 0,
"currency": "<string>"
},
"sku": "<string>",
"name": "<string>",
"parent_line_id": "<string>",
"category_ids": ["<string>"],
"tags": ["<string>"],
"loyalty_eligible": True,
"metadata": {}
}
],
"totals": {
"subtotal": {
"amount": 0,
"currency": "<string>"
},
"discount": {
"amount": 0,
"currency": "<string>"
},
"tax": {
"amount": 0,
"currency": "<string>"
},
"tip": {
"amount": 0,
"currency": "<string>"
},
"service_charge": {
"amount": 0,
"currency": "<string>"
},
"total": {
"amount": 0,
"currency": "<string>"
}
},
"order_number": "<string>",
"member_id": "<string>",
"closed_at": "2023-11-07T05:31:56Z",
"tenders": [
{
"tender_id": "<string>",
"type": "<string>",
"amount": {
"amount": 0,
"currency": "<string>"
}
}
],
"metadata": {}
}
}
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>'}
},
member_id: '<string>',
order: {
order_id: '<string>',
scope: {
program_id: '<string>',
brand_id: '<string>',
merchant_id: '<string>',
location_id: '<string>',
franchisee_id: '<string>'
},
channel: '<string>',
status: '<string>',
business_date: '<string>',
placed_at: '2023-11-07T05:31:56Z',
lines: [
{
line_id: '<string>',
kind: '<string>',
product_id: '<string>',
quantity: 2,
unit_price: {amount: 0, currency: '<string>'},
subtotal: {amount: 0, currency: '<string>'},
discount: {amount: 0, currency: '<string>'},
tax: {amount: 0, currency: '<string>'},
sku: '<string>',
name: '<string>',
parent_line_id: '<string>',
category_ids: ['<string>'],
tags: ['<string>'],
loyalty_eligible: true,
metadata: {}
}
],
totals: {
subtotal: {amount: 0, currency: '<string>'},
discount: {amount: 0, currency: '<string>'},
tax: {amount: 0, currency: '<string>'},
tip: {amount: 0, currency: '<string>'},
service_charge: {amount: 0, currency: '<string>'},
total: {amount: 0, currency: '<string>'}
},
order_number: '<string>',
member_id: '<string>',
closed_at: '2023-11-07T05:31:56Z',
tenders: [
{
tender_id: '<string>',
type: '<string>',
amount: {amount: 0, currency: '<string>'}
}
],
metadata: {}
}
})
};
fetch('https://loyalty.example.com/lip/v1/orders/evaluate', 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/orders/evaluate",
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>'
]
],
'member_id' => '<string>',
'order' => [
'order_id' => '<string>',
'scope' => [
'program_id' => '<string>',
'brand_id' => '<string>',
'merchant_id' => '<string>',
'location_id' => '<string>',
'franchisee_id' => '<string>'
],
'channel' => '<string>',
'status' => '<string>',
'business_date' => '<string>',
'placed_at' => '2023-11-07T05:31:56Z',
'lines' => [
[
'line_id' => '<string>',
'kind' => '<string>',
'product_id' => '<string>',
'quantity' => 2,
'unit_price' => [
'amount' => 0,
'currency' => '<string>'
],
'subtotal' => [
'amount' => 0,
'currency' => '<string>'
],
'discount' => [
'amount' => 0,
'currency' => '<string>'
],
'tax' => [
'amount' => 0,
'currency' => '<string>'
],
'sku' => '<string>',
'name' => '<string>',
'parent_line_id' => '<string>',
'category_ids' => [
'<string>'
],
'tags' => [
'<string>'
],
'loyalty_eligible' => true,
'metadata' => [
]
]
],
'totals' => [
'subtotal' => [
'amount' => 0,
'currency' => '<string>'
],
'discount' => [
'amount' => 0,
'currency' => '<string>'
],
'tax' => [
'amount' => 0,
'currency' => '<string>'
],
'tip' => [
'amount' => 0,
'currency' => '<string>'
],
'service_charge' => [
'amount' => 0,
'currency' => '<string>'
],
'total' => [
'amount' => 0,
'currency' => '<string>'
]
],
'order_number' => '<string>',
'member_id' => '<string>',
'closed_at' => '2023-11-07T05:31:56Z',
'tenders' => [
[
'tender_id' => '<string>',
'type' => '<string>',
'amount' => [
'amount' => 0,
'currency' => '<string>'
]
]
],
'metadata' => [
]
]
]),
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/orders/evaluate"
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 \"member_id\": \"<string>\",\n \"order\": {\n \"order_id\": \"<string>\",\n \"scope\": {\n \"program_id\": \"<string>\",\n \"brand_id\": \"<string>\",\n \"merchant_id\": \"<string>\",\n \"location_id\": \"<string>\",\n \"franchisee_id\": \"<string>\"\n },\n \"channel\": \"<string>\",\n \"status\": \"<string>\",\n \"business_date\": \"<string>\",\n \"placed_at\": \"2023-11-07T05:31:56Z\",\n \"lines\": [\n {\n \"line_id\": \"<string>\",\n \"kind\": \"<string>\",\n \"product_id\": \"<string>\",\n \"quantity\": 2,\n \"unit_price\": {\n \"amount\": 0,\n \"currency\": \"<string>\"\n },\n \"subtotal\": {\n \"amount\": 0,\n \"currency\": \"<string>\"\n },\n \"discount\": {\n \"amount\": 0,\n \"currency\": \"<string>\"\n },\n \"tax\": {\n \"amount\": 0,\n \"currency\": \"<string>\"\n },\n \"sku\": \"<string>\",\n \"name\": \"<string>\",\n \"parent_line_id\": \"<string>\",\n \"category_ids\": [\n \"<string>\"\n ],\n \"tags\": [\n \"<string>\"\n ],\n \"loyalty_eligible\": true,\n \"metadata\": {}\n }\n ],\n \"totals\": {\n \"subtotal\": {\n \"amount\": 0,\n \"currency\": \"<string>\"\n },\n \"discount\": {\n \"amount\": 0,\n \"currency\": \"<string>\"\n },\n \"tax\": {\n \"amount\": 0,\n \"currency\": \"<string>\"\n },\n \"tip\": {\n \"amount\": 0,\n \"currency\": \"<string>\"\n },\n \"service_charge\": {\n \"amount\": 0,\n \"currency\": \"<string>\"\n },\n \"total\": {\n \"amount\": 0,\n \"currency\": \"<string>\"\n }\n },\n \"order_number\": \"<string>\",\n \"member_id\": \"<string>\",\n \"closed_at\": \"2023-11-07T05:31:56Z\",\n \"tenders\": [\n {\n \"tender_id\": \"<string>\",\n \"type\": \"<string>\",\n \"amount\": {\n \"amount\": 0,\n \"currency\": \"<string>\"\n }\n }\n ],\n \"metadata\": {}\n }\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/orders/evaluate")
.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 \"member_id\": \"<string>\",\n \"order\": {\n \"order_id\": \"<string>\",\n \"scope\": {\n \"program_id\": \"<string>\",\n \"brand_id\": \"<string>\",\n \"merchant_id\": \"<string>\",\n \"location_id\": \"<string>\",\n \"franchisee_id\": \"<string>\"\n },\n \"channel\": \"<string>\",\n \"status\": \"<string>\",\n \"business_date\": \"<string>\",\n \"placed_at\": \"2023-11-07T05:31:56Z\",\n \"lines\": [\n {\n \"line_id\": \"<string>\",\n \"kind\": \"<string>\",\n \"product_id\": \"<string>\",\n \"quantity\": 2,\n \"unit_price\": {\n \"amount\": 0,\n \"currency\": \"<string>\"\n },\n \"subtotal\": {\n \"amount\": 0,\n \"currency\": \"<string>\"\n },\n \"discount\": {\n \"amount\": 0,\n \"currency\": \"<string>\"\n },\n \"tax\": {\n \"amount\": 0,\n \"currency\": \"<string>\"\n },\n \"sku\": \"<string>\",\n \"name\": \"<string>\",\n \"parent_line_id\": \"<string>\",\n \"category_ids\": [\n \"<string>\"\n ],\n \"tags\": [\n \"<string>\"\n ],\n \"loyalty_eligible\": true,\n \"metadata\": {}\n }\n ],\n \"totals\": {\n \"subtotal\": {\n \"amount\": 0,\n \"currency\": \"<string>\"\n },\n \"discount\": {\n \"amount\": 0,\n \"currency\": \"<string>\"\n },\n \"tax\": {\n \"amount\": 0,\n \"currency\": \"<string>\"\n },\n \"tip\": {\n \"amount\": 0,\n \"currency\": \"<string>\"\n },\n \"service_charge\": {\n \"amount\": 0,\n \"currency\": \"<string>\"\n },\n \"total\": {\n \"amount\": 0,\n \"currency\": \"<string>\"\n }\n },\n \"order_number\": \"<string>\",\n \"member_id\": \"<string>\",\n \"closed_at\": \"2023-11-07T05:31:56Z\",\n \"tenders\": [\n {\n \"tender_id\": \"<string>\",\n \"type\": \"<string>\",\n \"amount\": {\n \"amount\": 0,\n \"currency\": \"<string>\"\n }\n }\n ],\n \"metadata\": {}\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://loyalty.example.com/lip/v1/orders/evaluate")
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 \"member_id\": \"<string>\",\n \"order\": {\n \"order_id\": \"<string>\",\n \"scope\": {\n \"program_id\": \"<string>\",\n \"brand_id\": \"<string>\",\n \"merchant_id\": \"<string>\",\n \"location_id\": \"<string>\",\n \"franchisee_id\": \"<string>\"\n },\n \"channel\": \"<string>\",\n \"status\": \"<string>\",\n \"business_date\": \"<string>\",\n \"placed_at\": \"2023-11-07T05:31:56Z\",\n \"lines\": [\n {\n \"line_id\": \"<string>\",\n \"kind\": \"<string>\",\n \"product_id\": \"<string>\",\n \"quantity\": 2,\n \"unit_price\": {\n \"amount\": 0,\n \"currency\": \"<string>\"\n },\n \"subtotal\": {\n \"amount\": 0,\n \"currency\": \"<string>\"\n },\n \"discount\": {\n \"amount\": 0,\n \"currency\": \"<string>\"\n },\n \"tax\": {\n \"amount\": 0,\n \"currency\": \"<string>\"\n },\n \"sku\": \"<string>\",\n \"name\": \"<string>\",\n \"parent_line_id\": \"<string>\",\n \"category_ids\": [\n \"<string>\"\n ],\n \"tags\": [\n \"<string>\"\n ],\n \"loyalty_eligible\": true,\n \"metadata\": {}\n }\n ],\n \"totals\": {\n \"subtotal\": {\n \"amount\": 0,\n \"currency\": \"<string>\"\n },\n \"discount\": {\n \"amount\": 0,\n \"currency\": \"<string>\"\n },\n \"tax\": {\n \"amount\": 0,\n \"currency\": \"<string>\"\n },\n \"tip\": {\n \"amount\": 0,\n \"currency\": \"<string>\"\n },\n \"service_charge\": {\n \"amount\": 0,\n \"currency\": \"<string>\"\n },\n \"total\": {\n \"amount\": 0,\n \"currency\": \"<string>\"\n }\n },\n \"order_number\": \"<string>\",\n \"member_id\": \"<string>\",\n \"closed_at\": \"2023-11-07T05:31:56Z\",\n \"tenders\": [\n {\n \"tender_id\": \"<string>\",\n \"type\": \"<string>\",\n \"amount\": {\n \"amount\": 0,\n \"currency\": \"<string>\"\n }\n }\n ],\n \"metadata\": {}\n }\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"
},
"evaluation_id": "<string>",
"member_id": "<string>",
"order_id": "<string>",
"estimated_accrual": {
"unit": "<string>",
"amount": 123
},
"rewards": [
{
"reward_id": "<string>",
"status": "<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>"
}
}
],
"name": "<string>",
"unavailable_reasons": [
"<string>"
]
}
],
"balances": [
{
"account_id": "<string>",
"member_id": "<string>",
"program_id": "<string>",
"unit": "<string>",
"amount": 123,
"reserved": 1,
"available": 123,
"as_of": "2023-11-07T05:31:56Z",
"unit_label": "<string>"
}
],
"expires_at": "2023-11-07T05:31:56Z",
"estimated_accruals": [
{
"unit": "<string>",
"amount": 123
}
]
}{
"type": "<string>",
"title": "<string>",
"status": 499,
"detail": "<string>",
"instance": "<string>",
"code": "<string>",
"errors": [
{
"path": "<string>",
"message": "<string>"
}
]
}Orders
Evaluate accrual and available rewards
POST
/
orders
/
evaluate
Evaluate accrual and available rewards
curl --request POST \
--url https://loyalty.example.com/lip/v1/orders/evaluate \
--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>"
}
},
"member_id": "<string>",
"order": {
"order_id": "<string>",
"scope": {
"program_id": "<string>",
"brand_id": "<string>",
"merchant_id": "<string>",
"location_id": "<string>",
"franchisee_id": "<string>"
},
"channel": "<string>",
"status": "<string>",
"business_date": "<string>",
"placed_at": "2023-11-07T05:31:56Z",
"lines": [
{
"line_id": "<string>",
"kind": "<string>",
"product_id": "<string>",
"quantity": 2,
"unit_price": {
"amount": 0,
"currency": "<string>"
},
"subtotal": {
"amount": 0,
"currency": "<string>"
},
"discount": {
"amount": 0,
"currency": "<string>"
},
"tax": {
"amount": 0,
"currency": "<string>"
},
"sku": "<string>",
"name": "<string>",
"parent_line_id": "<string>",
"category_ids": [
"<string>"
],
"tags": [
"<string>"
],
"loyalty_eligible": true,
"metadata": {}
}
],
"totals": {
"subtotal": {
"amount": 0,
"currency": "<string>"
},
"discount": {
"amount": 0,
"currency": "<string>"
},
"tax": {
"amount": 0,
"currency": "<string>"
},
"tip": {
"amount": 0,
"currency": "<string>"
},
"service_charge": {
"amount": 0,
"currency": "<string>"
},
"total": {
"amount": 0,
"currency": "<string>"
}
},
"order_number": "<string>",
"member_id": "<string>",
"closed_at": "2023-11-07T05:31:56Z",
"tenders": [
{
"tender_id": "<string>",
"type": "<string>",
"amount": {
"amount": 0,
"currency": "<string>"
}
}
],
"metadata": {}
}
}
'import requests
url = "https://loyalty.example.com/lip/v1/orders/evaluate"
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>"
}
},
"member_id": "<string>",
"order": {
"order_id": "<string>",
"scope": {
"program_id": "<string>",
"brand_id": "<string>",
"merchant_id": "<string>",
"location_id": "<string>",
"franchisee_id": "<string>"
},
"channel": "<string>",
"status": "<string>",
"business_date": "<string>",
"placed_at": "2023-11-07T05:31:56Z",
"lines": [
{
"line_id": "<string>",
"kind": "<string>",
"product_id": "<string>",
"quantity": 2,
"unit_price": {
"amount": 0,
"currency": "<string>"
},
"subtotal": {
"amount": 0,
"currency": "<string>"
},
"discount": {
"amount": 0,
"currency": "<string>"
},
"tax": {
"amount": 0,
"currency": "<string>"
},
"sku": "<string>",
"name": "<string>",
"parent_line_id": "<string>",
"category_ids": ["<string>"],
"tags": ["<string>"],
"loyalty_eligible": True,
"metadata": {}
}
],
"totals": {
"subtotal": {
"amount": 0,
"currency": "<string>"
},
"discount": {
"amount": 0,
"currency": "<string>"
},
"tax": {
"amount": 0,
"currency": "<string>"
},
"tip": {
"amount": 0,
"currency": "<string>"
},
"service_charge": {
"amount": 0,
"currency": "<string>"
},
"total": {
"amount": 0,
"currency": "<string>"
}
},
"order_number": "<string>",
"member_id": "<string>",
"closed_at": "2023-11-07T05:31:56Z",
"tenders": [
{
"tender_id": "<string>",
"type": "<string>",
"amount": {
"amount": 0,
"currency": "<string>"
}
}
],
"metadata": {}
}
}
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>'}
},
member_id: '<string>',
order: {
order_id: '<string>',
scope: {
program_id: '<string>',
brand_id: '<string>',
merchant_id: '<string>',
location_id: '<string>',
franchisee_id: '<string>'
},
channel: '<string>',
status: '<string>',
business_date: '<string>',
placed_at: '2023-11-07T05:31:56Z',
lines: [
{
line_id: '<string>',
kind: '<string>',
product_id: '<string>',
quantity: 2,
unit_price: {amount: 0, currency: '<string>'},
subtotal: {amount: 0, currency: '<string>'},
discount: {amount: 0, currency: '<string>'},
tax: {amount: 0, currency: '<string>'},
sku: '<string>',
name: '<string>',
parent_line_id: '<string>',
category_ids: ['<string>'],
tags: ['<string>'],
loyalty_eligible: true,
metadata: {}
}
],
totals: {
subtotal: {amount: 0, currency: '<string>'},
discount: {amount: 0, currency: '<string>'},
tax: {amount: 0, currency: '<string>'},
tip: {amount: 0, currency: '<string>'},
service_charge: {amount: 0, currency: '<string>'},
total: {amount: 0, currency: '<string>'}
},
order_number: '<string>',
member_id: '<string>',
closed_at: '2023-11-07T05:31:56Z',
tenders: [
{
tender_id: '<string>',
type: '<string>',
amount: {amount: 0, currency: '<string>'}
}
],
metadata: {}
}
})
};
fetch('https://loyalty.example.com/lip/v1/orders/evaluate', 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/orders/evaluate",
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>'
]
],
'member_id' => '<string>',
'order' => [
'order_id' => '<string>',
'scope' => [
'program_id' => '<string>',
'brand_id' => '<string>',
'merchant_id' => '<string>',
'location_id' => '<string>',
'franchisee_id' => '<string>'
],
'channel' => '<string>',
'status' => '<string>',
'business_date' => '<string>',
'placed_at' => '2023-11-07T05:31:56Z',
'lines' => [
[
'line_id' => '<string>',
'kind' => '<string>',
'product_id' => '<string>',
'quantity' => 2,
'unit_price' => [
'amount' => 0,
'currency' => '<string>'
],
'subtotal' => [
'amount' => 0,
'currency' => '<string>'
],
'discount' => [
'amount' => 0,
'currency' => '<string>'
],
'tax' => [
'amount' => 0,
'currency' => '<string>'
],
'sku' => '<string>',
'name' => '<string>',
'parent_line_id' => '<string>',
'category_ids' => [
'<string>'
],
'tags' => [
'<string>'
],
'loyalty_eligible' => true,
'metadata' => [
]
]
],
'totals' => [
'subtotal' => [
'amount' => 0,
'currency' => '<string>'
],
'discount' => [
'amount' => 0,
'currency' => '<string>'
],
'tax' => [
'amount' => 0,
'currency' => '<string>'
],
'tip' => [
'amount' => 0,
'currency' => '<string>'
],
'service_charge' => [
'amount' => 0,
'currency' => '<string>'
],
'total' => [
'amount' => 0,
'currency' => '<string>'
]
],
'order_number' => '<string>',
'member_id' => '<string>',
'closed_at' => '2023-11-07T05:31:56Z',
'tenders' => [
[
'tender_id' => '<string>',
'type' => '<string>',
'amount' => [
'amount' => 0,
'currency' => '<string>'
]
]
],
'metadata' => [
]
]
]),
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/orders/evaluate"
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 \"member_id\": \"<string>\",\n \"order\": {\n \"order_id\": \"<string>\",\n \"scope\": {\n \"program_id\": \"<string>\",\n \"brand_id\": \"<string>\",\n \"merchant_id\": \"<string>\",\n \"location_id\": \"<string>\",\n \"franchisee_id\": \"<string>\"\n },\n \"channel\": \"<string>\",\n \"status\": \"<string>\",\n \"business_date\": \"<string>\",\n \"placed_at\": \"2023-11-07T05:31:56Z\",\n \"lines\": [\n {\n \"line_id\": \"<string>\",\n \"kind\": \"<string>\",\n \"product_id\": \"<string>\",\n \"quantity\": 2,\n \"unit_price\": {\n \"amount\": 0,\n \"currency\": \"<string>\"\n },\n \"subtotal\": {\n \"amount\": 0,\n \"currency\": \"<string>\"\n },\n \"discount\": {\n \"amount\": 0,\n \"currency\": \"<string>\"\n },\n \"tax\": {\n \"amount\": 0,\n \"currency\": \"<string>\"\n },\n \"sku\": \"<string>\",\n \"name\": \"<string>\",\n \"parent_line_id\": \"<string>\",\n \"category_ids\": [\n \"<string>\"\n ],\n \"tags\": [\n \"<string>\"\n ],\n \"loyalty_eligible\": true,\n \"metadata\": {}\n }\n ],\n \"totals\": {\n \"subtotal\": {\n \"amount\": 0,\n \"currency\": \"<string>\"\n },\n \"discount\": {\n \"amount\": 0,\n \"currency\": \"<string>\"\n },\n \"tax\": {\n \"amount\": 0,\n \"currency\": \"<string>\"\n },\n \"tip\": {\n \"amount\": 0,\n \"currency\": \"<string>\"\n },\n \"service_charge\": {\n \"amount\": 0,\n \"currency\": \"<string>\"\n },\n \"total\": {\n \"amount\": 0,\n \"currency\": \"<string>\"\n }\n },\n \"order_number\": \"<string>\",\n \"member_id\": \"<string>\",\n \"closed_at\": \"2023-11-07T05:31:56Z\",\n \"tenders\": [\n {\n \"tender_id\": \"<string>\",\n \"type\": \"<string>\",\n \"amount\": {\n \"amount\": 0,\n \"currency\": \"<string>\"\n }\n }\n ],\n \"metadata\": {}\n }\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/orders/evaluate")
.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 \"member_id\": \"<string>\",\n \"order\": {\n \"order_id\": \"<string>\",\n \"scope\": {\n \"program_id\": \"<string>\",\n \"brand_id\": \"<string>\",\n \"merchant_id\": \"<string>\",\n \"location_id\": \"<string>\",\n \"franchisee_id\": \"<string>\"\n },\n \"channel\": \"<string>\",\n \"status\": \"<string>\",\n \"business_date\": \"<string>\",\n \"placed_at\": \"2023-11-07T05:31:56Z\",\n \"lines\": [\n {\n \"line_id\": \"<string>\",\n \"kind\": \"<string>\",\n \"product_id\": \"<string>\",\n \"quantity\": 2,\n \"unit_price\": {\n \"amount\": 0,\n \"currency\": \"<string>\"\n },\n \"subtotal\": {\n \"amount\": 0,\n \"currency\": \"<string>\"\n },\n \"discount\": {\n \"amount\": 0,\n \"currency\": \"<string>\"\n },\n \"tax\": {\n \"amount\": 0,\n \"currency\": \"<string>\"\n },\n \"sku\": \"<string>\",\n \"name\": \"<string>\",\n \"parent_line_id\": \"<string>\",\n \"category_ids\": [\n \"<string>\"\n ],\n \"tags\": [\n \"<string>\"\n ],\n \"loyalty_eligible\": true,\n \"metadata\": {}\n }\n ],\n \"totals\": {\n \"subtotal\": {\n \"amount\": 0,\n \"currency\": \"<string>\"\n },\n \"discount\": {\n \"amount\": 0,\n \"currency\": \"<string>\"\n },\n \"tax\": {\n \"amount\": 0,\n \"currency\": \"<string>\"\n },\n \"tip\": {\n \"amount\": 0,\n \"currency\": \"<string>\"\n },\n \"service_charge\": {\n \"amount\": 0,\n \"currency\": \"<string>\"\n },\n \"total\": {\n \"amount\": 0,\n \"currency\": \"<string>\"\n }\n },\n \"order_number\": \"<string>\",\n \"member_id\": \"<string>\",\n \"closed_at\": \"2023-11-07T05:31:56Z\",\n \"tenders\": [\n {\n \"tender_id\": \"<string>\",\n \"type\": \"<string>\",\n \"amount\": {\n \"amount\": 0,\n \"currency\": \"<string>\"\n }\n }\n ],\n \"metadata\": {}\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://loyalty.example.com/lip/v1/orders/evaluate")
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 \"member_id\": \"<string>\",\n \"order\": {\n \"order_id\": \"<string>\",\n \"scope\": {\n \"program_id\": \"<string>\",\n \"brand_id\": \"<string>\",\n \"merchant_id\": \"<string>\",\n \"location_id\": \"<string>\",\n \"franchisee_id\": \"<string>\"\n },\n \"channel\": \"<string>\",\n \"status\": \"<string>\",\n \"business_date\": \"<string>\",\n \"placed_at\": \"2023-11-07T05:31:56Z\",\n \"lines\": [\n {\n \"line_id\": \"<string>\",\n \"kind\": \"<string>\",\n \"product_id\": \"<string>\",\n \"quantity\": 2,\n \"unit_price\": {\n \"amount\": 0,\n \"currency\": \"<string>\"\n },\n \"subtotal\": {\n \"amount\": 0,\n \"currency\": \"<string>\"\n },\n \"discount\": {\n \"amount\": 0,\n \"currency\": \"<string>\"\n },\n \"tax\": {\n \"amount\": 0,\n \"currency\": \"<string>\"\n },\n \"sku\": \"<string>\",\n \"name\": \"<string>\",\n \"parent_line_id\": \"<string>\",\n \"category_ids\": [\n \"<string>\"\n ],\n \"tags\": [\n \"<string>\"\n ],\n \"loyalty_eligible\": true,\n \"metadata\": {}\n }\n ],\n \"totals\": {\n \"subtotal\": {\n \"amount\": 0,\n \"currency\": \"<string>\"\n },\n \"discount\": {\n \"amount\": 0,\n \"currency\": \"<string>\"\n },\n \"tax\": {\n \"amount\": 0,\n \"currency\": \"<string>\"\n },\n \"tip\": {\n \"amount\": 0,\n \"currency\": \"<string>\"\n },\n \"service_charge\": {\n \"amount\": 0,\n \"currency\": \"<string>\"\n },\n \"total\": {\n \"amount\": 0,\n \"currency\": \"<string>\"\n }\n },\n \"order_number\": \"<string>\",\n \"member_id\": \"<string>\",\n \"closed_at\": \"2023-11-07T05:31:56Z\",\n \"tenders\": [\n {\n \"tender_id\": \"<string>\",\n \"type\": \"<string>\",\n \"amount\": {\n \"amount\": 0,\n \"currency\": \"<string>\"\n }\n }\n ],\n \"metadata\": {}\n }\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"
},
"evaluation_id": "<string>",
"member_id": "<string>",
"order_id": "<string>",
"estimated_accrual": {
"unit": "<string>",
"amount": 123
},
"rewards": [
{
"reward_id": "<string>",
"status": "<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>"
}
}
],
"name": "<string>",
"unavailable_reasons": [
"<string>"
]
}
],
"balances": [
{
"account_id": "<string>",
"member_id": "<string>",
"program_id": "<string>",
"unit": "<string>",
"amount": 123,
"reserved": 1,
"available": 123,
"as_of": "2023-11-07T05:31:56Z",
"unit_label": "<string>"
}
],
"expires_at": "2023-11-07T05:31:56Z",
"estimated_accruals": [
{
"unit": "<string>",
"amount": 123
}
]
}{
"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
Response
Evaluate accrual and available rewards
Show child attributes
Show child attributes
Opaque, stable identifier within the owning system.
Required string length:
1 - 128Pattern:
^[A-Za-z0-9][A-Za-z0-9._:-]*$Opaque, stable identifier within the owning system.
Required string length:
1 - 128Pattern:
^[A-Za-z0-9][A-Za-z0-9._:-]*$Opaque, stable identifier within the owning system.
Required string length:
1 - 128Pattern:
^[A-Za-z0-9][A-Za-z0-9._:-]*$Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Minimum array length:
1Show child attributes
Show child attributes
⌘I