Wiki

Clone wiki

API-2.0 / Location_policy

Method: GET

Path: /policy/location

Return "prevent booking if location not found" policy. This policy helps to decide if booking can be submitted with default location if location not found or customer has to contact support to create booking.

Note:

  • location policy applied to booking only if Multi-Location feature available for account and turned "on" (see Get settings: features -> multiple_locations and features -> booking -> location) AND :
    • booking about to be created by non-logged-in or logged-in customer
    • OR booking address or location about to be updated by logged-in customer
  • use Location for booking to get location by booking address:
    • it is recommended pass zip (postal code) as part of address, otherwise system will try to "guess" postal code by incomplete address using google address lookup and will search location by guessed postal code.

Example of response JSON (book with default location)

{
  "prevent_booking": false
}

Default policy means: default location MUST be used for booking if there is no location linked to provided (or "guessed" by incomplete address) postal code (zip code).

Example of response JSON (prevent booking policy)

{
  "prevent_booking": true,
  "prevent_booking_text": "Sorry, we do not service your area. Please contact us at test@example.com if you have questions."
}
Prevent booking policy means: booking cannot be created/updated if:

  • a) there is no location linked to provided (or "guessed" by incomplete address) postal code (zip code)
  • or b) requested location not linked to requested (or "guessed" by incomplete address) postal code (zip code).

Attempt to save booking having a) or b) will result in validation error with prevent_booking_text message.

Example request:

For production, replace https://acme-sandbox.l27.co with https://<your subdomain>.launch27.com

curl -H "Content-Type: application/json" \
     -X GET -k \
     https://acme-sandbox.l27.co/latest/policy/location

Updated