Wiki

Clone wiki

API-2.0 / Get_booking_for_customer

Method: GET

Path: /customer/bookings/:id

Get details of booking.

id (required)

Booking unique ID.

Example response JSON

{
  "id": 1,
  "location": {
    "id": 1,
    "name": "Sandbox",
    "active": true,
    "default": true
  },
  "digest": "NcUHgV93Vkf7Jxgr8P6rvOi3DMLpYvc2",
  "service_date": "2019-08-15T14:30:00Z",
  "arrival_window": 0,
  "address": {
    "full_address": "595 Market St, San Francisco, CA 94105",
    "street": "595 Market St",
    "city": "San Francisco",
    "state": "CA",
    "zip": "94105",
    "latitude": 37.789215,
    "longitude": -122.4008
  },
  "active": true,
  "completed": false,
  "name": "First Last",
  "email": "user@email.com",
  "phone": "462-485-0790",
  "frequency": {
    "id": 1,
    "interval": "o",
    "name": "One Time"
  },
  "payment_method_info": {
    "code": "cash"
  },
  "first_recurring": false,
  "tip_recurring": false,
  "customer_notes": null,
  "services": [
    {
      "id": 1,
      "name": "One Bedroom Apartment Cleaning",
      "price": 99.00,
      "extras": null,
      "pricing_parameters": null,
      "commercial": false,
      "discount_by_frequency": false,
      "discount_by_code": false
    }
  ],
  "teams": [

  ],
  "custom_fields": [

  ],
  "summary": {
    "services": 99.00,
    "pricing_parameters": 0.00,
    "extras": 0.00,
    "discount": 0.00,
    "adjustment": 0.00,
    "revenue": 99.00,
    "tip": 0.00,
    "total": 99.00
  },
  "discount_info": {

  },
  "actions": {
    "edit": true,
    "cancel": true,
    "late_cancel": false,
    "recurring_cancel": false,
    "complete": false
  }
}

Where:

  • id is booking unique ID
  • digest is booking unique ID (one that used in email notifications, etc.)
  • name is customer's name
  • email is customer's email
  • location is booking's location, has attributes:
    • id is location unique ID
    • name is location display name
    • active tells if location is active or archived
    • default tells if location is default location or not
  • service_date is booking service date and time
  • arrival_window is booking arrival window in minutes
  • address is booking address, has following attributes:
    • full_address is formatted address string
    • street is street address part of booking address
    • city is city part of booking address
    • state is state part of booking address
    • zip is zip code (postal code) part of booking address
    • latitude and longitude are geographic coordinates for booking address, may be empty if address geocoding failed
  • phone is customer's contact phone for the booking
  • frequency is booking's frequency, has attributes:
    • id is frequency unique ID
    • name is frequency display name
    • interval is frequency interval (value corresponds to pattern "\Ao|(\d+[dwmy])+\z"; for example: o means one time, 1w means every week, 2m15d means every 2 months and 15 days, etc.)
    • percent is frequency discount (%), present only if discount greater than 0%
    • amount is frequency discount ($), present only if discount greater than $0
    • frequency cannot have both percent and amount discount, so frequency will have only one of them or none of them
  • payment_method_info is booking payment method details, has attributes
    • code is payment method code and is always present
    • text present only if code="stripe", contains brand and last 4 digits of customer's default credit card registered with Stripe
  • services is a list of services linked to booking (see service attributes below)
  • summary is booking price summary, has attributes:
    • services is total price for services (excluding extras and pricing parameters price)
    • extras is total price for extras
    • pricing_parameters is total price for pricing parameters
    • discounts is total amount of discounts (note: some discounts applied before tax and other discounts applied after tax, see discount_info)
    • adjustment is amount of price adjustment for booking
    • revenue is amount of revenue
    • tax present only if account has sales tax feature "on" (see features -> booking -> sales_tax in Get settings) and defined sales tax for booking service date; has attributes:
      • before_tax is total price before tax (before_tax=revenue)
      • tax_percent is tax % applied to the booking
      • tax_amount is calculated tax amount
      • after_tax is total price after tax applied
    • tip is amount of tip
    • total is booking total amount
    • next_total is estimated next booking total amount (can be different because of discounts, non-recurring extras and tip, tax %, price adjustment, first recurring booking frequency discount restriction)
  • discount_info are discounts applied to booking, may have attributes:
    • frequency_amount is booking's discount because of frequency. Important:
      • this discount applied before tax
      • this discount applied to:
        • service and linked pricing parameter prices only if service has discount_by_frequency=true (see Services for booking)
        • extra price only if extra has discount_by_frequency=true (see Services for booking)
      • this discount cannot co-exist with referral discount (referral_amount) or non-stackable discount by code (discount_code)
      • this discount can co-exist with gift card discount (giftcard_amount) or stackable discount by code (discount_code)
    • discount_code is booking's discount because of discount by code. Important:
      • this discount applied before tax
      • this discount applied to:
      • this discount cannot co-exist with referral discount (referral_amount) or gift card discount (giftcard_amount)
      • if discount by code is stackable it can co-exist with frequency discount (frequency_amount)
      • if discount by code is non-stackable it cannot co-exist with frequency discount (frequency_amount)
    • referral_amount is booking's discount (or revard) because of referral program. Important:
      • this discount applied before tax
      • this discount cannot co-exist with gift card discount (giftcard_amount) or discount by code (discount_code) or frequency discount (frequency_amount)
    • giftcard_amount is booking's discount because of gift card. Important:
      • this discount applied "the latest", i.e. after tip
      • this discount cannot co-exist with referral discount (referral_amount) or discount by code (discount_code)
      • this discount can co-exist with frequency discount (frequency_amount)
  • active tells if booking is active or cancelled
  • completed tells if booking completed or not
  • first_recurring tells if booking is first recurring booking or not
  • tip_recurring tells if booking tip is recurring or not
  • customer_notes is a customer's free text notes for booking
  • teams is a list of teams assigned to booking (see team attributes below)
  • custom_fields is a list of custom fields with values (see custom field attributes below)
  • actions are actions available for booking, has attributes:
    • edit tells if booking can be changed by customer or not
    • cancel tells if booking can be cancelled with no cancellation fee or not
    • late_cancel tells if booking can be cancelled with cancellation fee or not
    • recurring_cancel tells if booking applicable for "recurring cancel" procedure
    • edit_tip tells if booking's tip can be modified or not
    • complete always false for customer user
    • show_recurring_options tells if customer should see recurring options or not when:
  • sevice attributes:
    • id is service unique ID
    • name is service display name
    • price is service price per unit (for hourly services it is price per worker/hour)
    • commercial tells if service is commercial (cannot be added to booking by customer) or not
    • hourly only present for hourly services, has attributes:
      • title is display tital for workers (for example "maids")
      • quantity is a number of booked workers
      • minutes is a number of booked minutes per worker
    • discount_by_frequency tells if discount by frequency applicable to service (and linked pricing parameters) price or not
    • discount_by_code tells if discount by code applicable to service (and linked pricing parameters) price or not
    • extras is list of booked extras for service (see extra attributes below)
    • pricing_parameters is list of booked pricing parameters for service (see pricing parameter attributes below)
  • extra attributes:
    • id is extra unique ID
    • name is extra display name
    • quantity is number of booked extra units
    • quantity_based tells if it is possible to book more than one unit for extra or not
    • price is extra's price per unit
    • total is total price for booked units (total=price for quantity=1)
    • description is extra's description (if configured for extra)
    • recurring tells if extra is recurring (should be copied over to next recurring booking when next recurring booking created or not)
    • discount_by_frequency tells if discount by frequency applicable to extra price or not
    • discount_by_code tells if discount by code applicable to extra price or not
  • pricing parameter attributes:
    • id is pricing parameter unique Id
    • name is pricing parameter display name
    • quantity is number booked pricing parameter units
    • price is pricing parameter price per unit
    • total is is total price for booked units (total=price for quantity=1)
    • can_be_removed tells if pricing parameter is not linked to service anymore, so not required for service and can be unlinked from booking (if needed)
  • team attributes:
    • id is team unique ID
    • title is team display name
    • image if present is team image url
  • custom field attributes:
    • id is custom field unique ID
    • title is custom field display title
    • type is type of UI control that should be used to edit custom field value(s) (see Custom fields for booking for types description)
    • value is custom field value for the following types (single_line, multi_line, date, datetime or checkbox)
    • values is list of selected options for booking for custom field, every option has attributes:
      • id is option unique ID
      • label is option display name
      • other is addition explanation provided for option

Example request:

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

Replace BEARER_FROM_LOGIN with bearer from Login

curl -H "Content-Type: application/json" \
     -H 'Authorization: Bearer BEARER_FROM_LOGIN' \
     -X GET -k \
      https://acme-sandbox.l27.co/latest/customer/bookings/1

Response

  • 401 Unauthorized on login failure.
  • 403 Forbidden if customer has no access to booking.
  • 200 OK on success.

Updated