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

GET /rest/channel/6019/facilities/706/tee-times/319255206/invoice?player-count=2 HTTP/1.1
Content-Type: application/json; charset=utf-8
UserName: UserName
Password: Password
Host: sandbox.api.gnsvc.com
Accept-Encoding: gzip, deflate
AdvancedErrorCodes: True

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:



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

GET /rest/channel/5151/facilities/2/tee-times/-935134208/invoice/customer-invoice?customeremail=customer.email%40emailProvider.com&player-count=2&promo-code=APromoCode HTTP/1.1
Content-Type: application/json; charset=utf-8
UserName: UserName
Password: Password
CustomerToken: v2!9SdtxN91odTlY9EHl48M+AhJ4Wx5zSPSSeZQqbMwNw9md7zhA8NeMw3Yght6qnHSX4gtZCWLWdI3hHpfXW-pzzTbsprfdrfpPAEfPIdXxW1Vzl0QEe5DySWIQSzP8ecEZ4zJoX2i-I4AmrF0v6wPjNrBQb10+3-L7AhHOg1Pi+dJYeYt1s34vF4Ob+dqsSbEtv14Q7qgQ6h7mYW20KeJHSWAo+ankzjQfIxt5BysuApi-2obea3lkyndhnrkp5j-pFXz4YC3Y+vAdAwz2kO+Nw==
Host: sandbox.api.gnsvc.com
Accept-Encoding: gzip, deflate
AdvancedErrorCodes: True

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.