Redeem the loyalty points of a guest

POST https://api.zenoti.com/v1/invoices/{InvoiceId}/payments/loyalty_points

Use this API to redeem a guest’s applicable loyalty points while taking payment for an invoice.

You must specify appropriate details for the InvoiceId parameter in the API request. Optionally, you can provide the required value for the expand parameter.

In addition, you can specify the necessary details for the body parameters.


On this page


Before you begin

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

Endpoint

POST /v1/invoices/{InvoiceId}/payments/loyalty_points

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

Request

Headers

Header Required Description
Authorization Yes bearer {{access_token}}

Path parameters

Parameter Type Required Description
InvoiceId string Yes Mandatory Unique 32-character identifier of the invoice for which this API will redeem the guest's applicable loyalty points.

Query parameters

Parameter Type Required Default Description
expand string No — Optional For example, if you specify the value of this parameter as invoice_details, this API returns the details of the invoice along with the loyalty points-payment details.

Response

Success (201 Created)

{
  "payment": {
    "PaymentOption": {
      "...": "..."
    },
    "TotalAmountPaid": 0.71,
    "AmountPaid": 0.71,
    "TipAmount": {},
    "SSGAmount": {},
    "FeeAmount": {},
    "CashBackAmount": {},
    "TransactionId": "5e7a88f5-f80f-42ae-be53-b03b95b5f65e",
    "PaymentDate": "2020-10-23T04:08:46",
    "CashRegisterId": {}
  },
  "redemptions": {},
  "invoice": {
    "Id": "f9e54f8b-6534-498a-b96e-a05e76f5656f",
    "InvoiceNumber": "RR11450",
    "GroupInvoiceId": {},
    "group_name": {},
    "ReceiptNumber": {},
    "AppointmentGroupId": {},
    "ReservationId": {},
    "IsRebooking": false,
    "Notes": {},
    "GuestId": {},
    "Guest": {
      "...": "..."
    },
    "Price": {
      "...": "..."
    },
    "SaleDate": "2020-10-23T08:51:11",
    "FutureRecurringBillDate": {},
    "guest_checkin_time": {},
    "LinkedInvoiceId": {},
    "Status": 0,
    "InvoiceServices": [
      {
        "...": "..."
      }
    ],
    "InvoiceProducts": [
      {
        "...": "..."
      }
    ],
    "InvoiceMemberships": [
      {
        "...": "..."
      }
    ],
    "InvoiceDayPackages": [
      {
        "...": "..."
      }
    ],
    "InvoiceSeriesPackages": [
      {
        "...": "..."
      }
    ],
    "InvoiceGiftCards": [
      {
        "...": "..."
      }
    ],
    "InvoicePrepaidCards": [
      {
        "...": "..."
      }
    ],
    "Payments": [
      {
        "...": "..."
      }
    ],
    "Redemptions": [
      {
        "...": "..."
      }
    ],
    "RefundItems": {},
    "Lock": false,
    "CanChangeGuest": false,
    "CenterId": "a11f578a-1b81-4de0-8834-915f79e5362b",
    "Center": {
      "...": "..."
    },
    "CollectFeedback": true,
    "IsFeedbackExpired": false,
    "BookingWizardAdvancedMode": false,
    "BookingWizardBottomPanelMode": false,
    "Refunded": false,
    "InvoiceAuthStatus": -3,
    "InvoiceAuthorizationStatus": -3,
    "InvTransactionStatusForAutoPay": -2,
    "InvoiceSource": 0,
    "is_created_from_booking_wizard": false,
    "RemoveBuddyServiceFinishSegment": {},
    "host_id": {},
    "payment_made_by": {},
    "entity_name": {},
    "email_link": {},
    "sms_link": {},
    "appointment_category_id": ""
  },
  "error": {}
}

Response fields

Field Type Description
payment object
payment.PaymentOption object
payment.TotalAmountPaid number
payment.AmountPaid number
payment.TipAmount object
payment.SSGAmount object
payment.FeeAmount object
payment.CashBackAmount object
payment.TransactionId string
payment.PaymentDate string
payment.CashRegisterId object
redemptions object
invoice object
invoice.Id string
invoice.InvoiceNumber string
invoice.GroupInvoiceId object
invoice.group_name object
invoice.ReceiptNumber object
invoice.AppointmentGroupId object
invoice.ReservationId object
invoice.IsRebooking boolean
invoice.Notes object
invoice.GuestId object
invoice.Guest object
invoice.Price object
invoice.SaleDate string
invoice.FutureRecurringBillDate object
invoice.guest_checkin_time object
invoice.LinkedInvoiceId object
invoice.Status integer
invoice.InvoiceServices object[]
invoice.InvoiceProducts object[]
invoice.InvoiceMemberships object[]
invoice.InvoiceDayPackages object[]
invoice.InvoiceSeriesPackages object[]
invoice.InvoiceGiftCards object[]
invoice.InvoicePrepaidCards object[]
invoice.Payments object[]
invoice.Redemptions object[]
invoice.RefundItems object
invoice.Lock boolean
invoice.CanChangeGuest boolean
invoice.CenterId string
invoice.Center object
invoice.CollectFeedback boolean
invoice.IsFeedbackExpired boolean
invoice.BookingWizardAdvancedMode boolean
invoice.BookingWizardBottomPanelMode boolean
invoice.Refunded boolean
invoice.InvoiceAuthStatus integer
invoice.InvoiceAuthorizationStatus integer
invoice.InvTransactionStatusForAutoPay integer
invoice.InvoiceSource integer
invoice.is_created_from_booking_wizard boolean
invoice.RemoveBuddyServiceFinishSegment object
invoice.host_id object
invoice.payment_made_by object
invoice.entity_name object
invoice.email_link object
invoice.sms_link object
invoice.appointment_category_id string
error object

Example

curl --request POST \
  --url 'https://api.zenoti.com/v1/invoices/{InvoiceId}/payments/loyalty_points' \
  --header 'Authorization: bearer {{access_token}}'
const response = await fetch('https://api.zenoti.com/v1/invoices/{InvoiceId}/payments/loyalty_points', {
  method: 'POST',
  headers: {
    'Authorization': 'bearer {{access_token}}'
  },
});
const data = await response.json();
import requests

response = requests.post(
    'https://api.zenoti.com/v1/invoices/{InvoiceId}/payments/loyalty_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.PostAsync(
    "https://api.zenoti.com/v1/invoices/{InvoiceId}/payments/loyalty_points");
var data = await response.Content.ReadAsStringAsync();
require 'net/http'
require 'json'

uri = URI('https://api.zenoti.com/v1/invoices/{InvoiceId}/payments/loyalty_points')
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = true
request = Net::HTTP::Post.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