Retrieve the loyalty points history of a guest

GET https://api.zenoti.com/v1/guests/{guestId}/points

This API helps you to retrieve the loyalty points history of the specified guest.

You must specify the unique identifier of the guest as guest_id in the API request. You can also use the pagination feature by passing page_num and num_records query parameters if you have a large number of records to be displayed. By default, page_num is set as 1 and num_records is set as 10. num_records cannot be more than 100: which means that the maximum records per page cannot be more than 100.

Before you begin

Permission: Manage API Keys (on the Administrator security object) — Required to access Zenoti APIs.

Endpoint

GET /v1/guests/{guestId}/points

Base URL: https://api.zenoti.com

Request

Headers

Header Required Description
Authorization Yes bearer {{access_token}}

Path parameters

Parameter Type Required Description
guestid string Yes Unique identifier of the guest for whom we are retrieving the loyalty points.

Query parameters

Parameter Type Required Default Description
view_grooming_points integer (int32) No — Optional Indicates whether grooming-related LPs are to be viewed.
page_num integer (int32) No 1 Optional Number of the display page. Default value is 1.
num_records integer (int32) No 10 Optional Number of records per page. Default value is 10.
sort_ascending boolean No true Optional Indicates whether the displayed records are to be sorted in ascending order. Default value is true.

Response

Success (200 OK)

{
  "guest_points": {
    "balance_points": 35,
    "balance_amount": 35,
    "exchange_rate": 1,
    "tier_details": {
      "...": "..."
    },
    "guest_points_details": [
      {
        "...": "..."
      }
    ]
  },
  "error": {}
}

Response fields

Field Type Description
guest_points object
guest_points.balance_points integer
guest_points.balance_amount integer
guest_points.exchange_rate integer
guest_points.tier_details object
guest_points.guest_points_details object[]
error object

Example

curl --request GET \
  --url 'https://api.zenoti.com/v1/guests/{guestId}/points' \
  --header 'Authorization: bearer {{access_token}}'
const response = await fetch('https://api.zenoti.com/v1/guests/{guestId}/points', {
  method: 'GET',
  headers: {
    'Authorization': 'bearer {{access_token}}'
  },
});
const data = await response.json();
import requests

response = requests.get(
    'https://api.zenoti.com/v1/guests/{guestId}/points',
    headers={
        'Authorization': 'bearer {{access_token}}',
    },
)
data = response.json()
using var client = new HttpClient();
client.DefaultRequestHeaders.Add("Authorization", "bearer {{access_token}}");
var response = await client.GetAsync(
    "https://api.zenoti.com/v1/guests/{guestId}/points");
var data = await response.Content.ReadAsStringAsync();
require 'net/http'
require 'json'

uri = URI('https://api.zenoti.com/v1/guests/{guestId}/points')
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = true
request = Net::HTTP::Get.new(uri)
request['Authorization'] = 'bearer {{access_token}}'
response = http.request(request)
data = JSON.parse(response.body)

Error codes

Status Description
400 400
401 Unauthorized -- invalid or expired access token
429 Too many requests -- rate limit exceeded