Create Booking

Book a Tee Time

To book a tee time send a request to below url.

POST /api/v4/bookings
  • Json body parameters.
    • facilityId (Type: Integer) ID of the facility.
    • teetime (Type: Date yyyy-mm-dd HH:MM:ss) Date of the booking
    • course (Type: String) Name of the course.
    • players (Type: Integer) Number of players participating in the booking (between 1-4).
    • teeId (Type: Integer) ID of the tee time.
    • holes (Type: Integer) Number of holes (9 or 18).
    • productId (Type: Int) Id of the Product.
    • contactFirstName (Type: String) First name of the contact person for this booking.
    • contactLastName (Type: String) Last name of the contact person for this booking.
    • contactPhone (Type: String) Phone number.
    • contactEmail (Type: String) E-mail.
    • netRate (Type: BigDecimal) Total amount that we need to send facility for given tee slot. (Optional Field)
    • extraProduct (Type: ExtraProduct(mid(Type: Integer), quantity(Type: Integer))) ExtraProduct for Booking (Optional Field)
    • comments (Type: String): Comment for booking (Optional Field).

An example request could look like this :

curl -X POST -H 'Content-Type:application/json'  --user [[username]]:[[password]] '[[base-url]]/api/v4/bookings'
    -d '{"facilityId":"1",
        "teetime":"2024-08-20 07:20:00",
        "course":"Champions course",
        "players":3,
        "teeId":4250490,
        "holes":9,
        "productId": 108,
        "contactName":"James Smith",
        "contactPhone":"07712345678",
        "contactEmail":"james.smith@gmail.com"
        "extraProduct": [
            {
              "mid": 274,
              "quantity": 2
            },
            {
              "mid": 259,
              "quantity": 2
            }
        ],
        "comments":"This is a test comment"
    }'
  • Successful response (application/json)
    {
        "success": true,
        "data": {
            "bookingId": "ZG1234"
        }
    }
    

Book Multiple Tee Time

To book multiple tee time send a request to below url.

POST /api/v4/bookings

Json body parameters.

  • As List of
    • facilityId (Type: Integer) ID of the facility.
    • teetime (Type: Date yyyy-mm-dd HH:MM:ss) Date of the booking
    • course (Type: String) Name of the course.
    • players (Type: Integer) Number of players participating in the booking (between 1-4).
    • teeId (Type: Integer) ID of the tee time.
    • holes (Type: Integer) Number of holes (9 or 18).
    • productId (Type: Int) Id of the Product.
    • contactFirstName (Type: String) First name of the contact person for this booking.
    • contactLastName (Type: String) Last name of the contact person for this booking.
    • contactPhone (Type: String) Phone number.
    • contactEmail (Type: String) E-mail.
    • netRate (Type: BigDecimal) Total amount that we need to send facility for given tee slot. (Optional Field)
    • extraProduct (Type: ExtraProduct(mid(Type: Integer), quantity(Type: Integer)), Optional) ExtraProduct for Booking (Optional Field)
    • comments (Type: String): Comment for booking (Optional Field).
    • linkedTeeTimeRef (Type: String): Must be valid UUID. Used in linked teetimes booking. (Optional Field)

An example request could look like this :

curl -X POST -H 'Content-Type:application/json'  --user [[username]]:[[password]] '[[base-url]]/api/v4/bookings'
    -d '[
          {
            "facilityId":"1",
            "teetime":"2024-08-20 07:20:00",
            "course":"Champions course",
            "players":3,
            "contactPhone":"07712345678",
            "contactEmail":"james.smith@gmail.com",
            "contactName":"James Smith",
            "holes":9,
            "productId": 108,
            "teeId":4250490,
            "extraProduct": [
            {
              "mid": 274,
              "quantity": 2
            },
            {
              "mid": 259,
              "quantity": 2
            }
            ],
            "comments":"This is a test comment"
          },
          {
            "facilityId":"1",
            "teetime":"2024-08-21 07:20:00",
            "course":"Champions course",
            "players":3,
            "contactPhone":"07712345678",
            "contactEmail":"james.smith@gmail.com",
            "contactName":"James Smith",
            "holes":9,
            "productId": 109,
            "teeId":4250524,
            "extraProduct": [
            {
              "mid": 261,
              "quantity": 1
            },
            {
              "mid": 272,
              "quantity": 2
            }
            ],
            "comments":This is a test comment"
          }
        ]'
  • Successful response (application/json)
    {
        "success": true,
        "data": {
            "groupId": 16,
            "bookingIds": [
                {
                    "bookingId": "ZG_xl_DEMO-ZestSalesChannel1_2024-08-20T07:20_511ffa3d",
                    "teetime": "2024-08-20T07:20:00",
                    "courseId": 380
                },
                {
                    "bookingId": "ZG_xl_DEMO-ZestSalesChannel1_2024-08-21T07:20_b83a651a",
                    "teetime": "2024-08-21T07:20:00",
                    "courseId": 380
                }
            ]
        }
    }
    

Book Multiple Tee Time With Payment

To book multiple tee time along with payment send a request to below url.

POST /api/v4/bookings

Json body parameters.

  • details: As List of
    • facilityId (Type: Integer) ID of the facility.
    • teetime (Type: Date yyyy-mm-dd HH:MM:ss) Date of the booking
    • course (Type: String) Name of the course.
    • players (Type: Integer) Number of players participating in the booking (between 1-4).
    • teeId (Type: Integer) ID of the tee time.
    • holes (Type: Integer) Number of holes (9 or 18).
    • productId (Type: Int) Id of the Product.
    • contactFirstName (Type: String) First name of the contact person for this booking.
    • contactLastName (Type: String) Last name of the contact person for this booking.
    • contactPhone (Type: String) Phone number.
    • contactEmail (Type: String) E-mail.
    • netRate (Type: BigDecimal) Total amount that we need to send facility for given tee slot. (Optional Field)
    • extraProduct:As List of [mid(Type: Integer), quantity(Type: Integer)] ExtraProduct for Booking (Optional Field)
    • comments (Type: String): Comment for booking (Optional Field).
    • linkedTeeTimeRef (Type: String): Must be valid UUID. Used in linked teetimes booking. (Optional Field)
  • paymentIntent (Type: String): Payment Intent Id for booking (Optional Field)

An example request could look like this :

curl -X POST -H 'Content-Type:application/json'  --user [[username]]:[[password]] '[[base-url]]/api/v4/bookings'
    -d '{
          "details": [
            {
              "facilityId":"1",
              "teetime":"2024-08-20 07:20:00",
              "course":"Champions course",
              "players":3,
              "contactPhone":"07712345678",
              "contactEmail":"james.smith@gmail.com",
              "contactName":"James Smith",
              "holes":9,
              "productId": 108,
              "teeId":4250490,
              "extraProduct": [
              {
                "mid": 274,
                "quantity": 2
              },
              {
                "mid": 259,
                "quantity": 2
              }
              ],
              "comments":"This is a test comment"
            },
            {
              "facilityId":"1",
              "teetime":"2024-08-21 07:20:00",
              "course":"Champions course",
              "players":3,
              "contactPhone":"07712345678",
              "contactEmail":"james.smith@gmail.com",
              "contactName":"James Smith",
              "holes":9,
              "productId": 109,
              "teeId":4250524,
              "extraProduct": [
              {
                "mid": 261,
                "quantity": 1
              },
              {
                "mid": 272,
                "quantity": 2
              }
              ],
            "comments":"This is a test comment"
            }
          ],
          "paymentIntent":"pi_3KvjDRJ95B5ufks60z6LjwRE"
        }'
  • Successful response (application/json)
    {
        "success": true,
        "data": {
            "groupId": 16,
            "bookingIds": [
                {
                    "bookingId": "ZG_xl_DEMO-ZestSalesChannel1_2024-08-20T07:20_511ffa3d",
                    "teetime": "2024-08-20T07:20:00",
                    "courseId": 380
                },
                {
                    "bookingId": "ZG_xl_DEMO-ZestSalesChannel1_2024-08-21T07:20_b83a651a",
                    "teetime": "2024-08-21T07:20:00",
                    "courseId": 380
                }
            ]
        }
    }
    

Booking of Product with Holes greater than Course Holes (Linked TeeTimes)

Few things should be considered when booking product with Holes greater than Course Holes.

  • If a product have more holes than are available in a single round of the course, it must be assigned a linked tee time reference.
  • All linked tee time references must be valid UUIDs.
  • Each linked tee time group must contain only one green fee product.
  • All players in a linked tee time group must be equal and should share same linkedTeeTimeRef.
  • The same green fee product should be used consistently across all rounds in the linked tee time group.
  • The total number of holes across the linked tee times must be sufficient to satisfy the green fee product’s required holes.

Common Error Response From Booking

When attempting to make a booking via the API, there are instances where the process may encounter errors resulting in a failure to complete the booking. In such cases, the API responds with an HTTP Status Code 400 along with specific error messages to indicate the nature of the failure.

Below are some common error messages you may encounter when a booking fails:

  • It appears that the Tee Sheet Servers are currently unresponsive. Please try again. If the error persists, kindly reach out to our support for further assistance.
  • Transfer of funds from Zest Stripe to Facility Stripe failed for booking with request id ${requestId}. Please try again. If the error persists, kindly reach out to our support for further assistance.
  • It appears that Booking Creation has failed. Please try again. If the error persists, kindly reach out to our support for further assistance.
  • It appears that payment (PI) has failed. Please try again. If the error persists, kindly reach out to our support for further assistance.
  • It appears that payment (PV) has failed. Please try again. If the error persists, kindly reach out to our support for further assistance.
  • There seems to be an issue with the tee times in your cart. Please try searching and booking your desired tee times again. If the error persists, kindly reach out to our support for further assistance.
  • Unfortunately, we were unable to process your booking at the moment. Please try again, and if the error persists, kindly reach out to our support for further assistance.