Generating a Customer Invoice
Next, you must generate an invoice statement for the customer. Invoices take into account the rate ID you are attempting to book, as well
as any promotional codes you wish to specify with the reservation.
The general URI for invoice generation is:
/rest/channel/{channelId}/facilities/{facilityId}/tee-times/{teeTimeRateId}/invoice
There are two means to generate an invoice. The first, GetTeeTimeInvoice, generates a simple checkout-ready invoice decoupled from any
particular customer - to that end, note that this method does not require the presence of a customer token. The last,
GetTeeTimeInvoiceForCustomer, couples a tee time with a customer, and allows the application of a promo code to a tee time rate to elucidate
the final price at checkout.
This is the calling convention for GetTeeTimeInvoice:
HTTP Request
HTTP Response
Note the "player-count" parameter - this parameter is required for both GetTeeTimeInvoice and GetTeeTimeInvoiceForCustomer. This parameter
influences the generation of the invoice: pricing, for instance, will be scaled to the total number of players specified by this parameter. If the
method is called with the parameter "verify=true", the tee sheet will be queried to determine that the total number of seats requested (via the
"player-count" parameter) will be available at booking. Please see the API Specification for more information about
the parameters that may be used to call these methods.
The response object has much in common with the rate set object, but there are a few items to note:
-
The PreDiscountPricing field reflects pricing metrics for the tee time before any discounts are applied. In
the case of a call to GetTeeTimeInvoice, PreDiscountPricing will look the same as Pricing
(below).
-
The Pricing field denotes pricing metrics after promo codes and implicit customer discounts (such as transaction
fee waivers for a customer account) have been applied.
-
Each of the above pricing objects contain six fields:
- DueAtCourse: the amount to be rendered to the course by the customer upon arrival at the facility to play.
- DueOnline: the amount to be collected for GolfNow at the time of reservation.
- GreensFees: the amont of greens fees for the tee time - generally dictates the DueOnline/DueAtCourse amounts.
- TaxesAndFees: the combined total of all taxes and fees applicable to the sale.
- SalesTaxTotal: the total sales tax imputed by the sale.
- TransactionFeeTotal: the total transaction fee that GolfNow will collect as a result of the sale.
-
Note that each "price" field is a complex object consisting of a CurrencyCode (the currency code accepted at
the booking facility), and the Amount of money for that price metric.
-
The DiscountsApplied array contains a list of all imputed discounted after promo codes and transaction fee
waivers. It will always contain a "DiscountFromMarketRate" discount, which is the amount of savings off of the market rate
for that tee time.
-
The RestrictedRateMessage is a note sent with all resident-restricted rates. These rates require proof of
residency near the facility to be booked. If this field is set, their is a residency restriction in place and the message
should be advertised to the customer as a warning that they must account for residency restrictions at the facility. Restricted
rates may be detected by examining the RateTagCodes array associated with a tee time: those containing the
"RO" or "RR" tags may be considered to hold residency restrictions.
-
PromoCodeApplied and PromoCodeSuccessMessage are fields that are simultaneously populated
when a promo code is applied. PromoCodeApplied will show the promo code you attempted to add to the invoice
itself, and PromoCodeSuccessMessage displays a result message based upon the application of the promo code.
These fields are null/blank in the event that no promo code is applied.
GetTeeTimeInvoiceForCustomer requires a customer email address. As previously mentioned, you may also specify promo codes with this call,
which will alter the Pricing field in the response object. Keep in mind that this method requires the presence of
a customer token in the HTTP headers. Continuing with our example, we will generate an invoice against TeeTimeRateID -935134208.
HTTP Request
HTTP Response
As you can see in the result set, the property Pricing.TransactionFeeTotal is half that of the original (PreDiscountPricing.TransactionFeeTotal).
Consequently, other, related properties (Pricing.TaxesAndFees for example) were adjusted down as well.
Click to continue to: Reservation Claims and Booking a Tee Time.
Return to the end-to-end example index.