---
# System prepended metadata

title: Schedule Engine BYOI

---

# Schedule Engine BYOI

## BYOI Client Endpoints (proposal)

### Request #1 (customer lookup)

```js
// Example request
'GET  https://some-client.com/byoi/customer-lookup?phoneNumber=1234567890'

// Example response
{
    customer: { // Can also be `null`
        id,
        firstName,
        lastName,
        locations: [
            {
                id,
                line1,
                line2, // Optional
                locality, // ex. Miami
                region, // ex. FL
                postalCode,
                countryCode, // ex. US
                isBookingAllowed,
            },
            // ...
        ],
    },
}
```

### Request #2 (calculate availability)

```js
// Example request
'POST  https://some-client.com/byoi/calculate-availability'
{
    isEmergency,
    serviceCodeKey, // Configurable with standard client import
    postalCode,
    phoneNumber,
    startDateTime,
    endDateTime,
}

// Example response
{
    timeslots: [
        {
            label,
            startDateTime, // ex. 2022-02-07T17:00:00.000Z
            endDateTime,
        },
    ],
}
```

### Request #3 (submit booking)

```js
// Example request
'POST  https://some-client.com/byoi/submit-booking'
{

    customer: {
        id,
        firstName,
        lastName,
        phoneNumber,
        location: {
            line1,
            line2, // Optional
            locality, // ex. Miami
            region, // ex. FL
            postalCode,
            countryCode, // ex. US
        },
    },
    appointment: {
        serviceCodeKey,
        startDateTime, // 2022-02-07T17:00:00.000Z
        isEmergency,
        notes,
    },
    sourceTracking: {
        // ...
    },
}

// Example response
{
    success, // true/false
    message,
}
```
