Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/hack4impact-umd/breastfeeding-center-gw/llms.txt

Use this file to discover all available pages before exploring further.

Overview

Client records in Firestore are populated by syncing data from Acuity, Squarespace, and Booqable. This group of endpoints allows manual sync triggers, real-time webhook ingestion from Acuity, and direct retrieval of stored client profiles. All endpoints except POST /clients/hooks/acuity/client require a valid Firebase Auth ID token. Base URL: https://us-east4-breastfeeding-center-gw.cloudfunctions.net/api

GET /clients/all

Returns all client documents stored in Firestore. Auth required: Yes

Example

curl https://us-east4-breastfeeding-center-gw.cloudfunctions.net/api/clients/all \
  -H "Authorization: Bearer <id_token>"

Response

Returns a JSON array of Client objects.
id
string
Firestore document ID for the client.
firstName
string
Client’s first name.
middleName
string
Client’s middle name (optional).
lastName
string
Client’s last name.
email
string
Client’s email address.
dob
string
Date of birth in ISO 8601 format (optional).
phone
string
Phone number (optional).
insurance
string
Insurance provider (optional).
janeId
string
Jane patient number used to link Jane appointment records (optional).
squarespaceCustomerId
string
Squarespace customer ID (optional).
stripeId
string
Stripe customer ID, used for Booqable rental lookups (optional).
baby
Baby[]
Array of baby records associated with this client.
associatedClients
Client[]
Array of other client records linked to this client (e.g. co-parents).

Error codes

StatusReason
403Missing or invalid auth token
500Internal error fetching clients from Firestore

GET /clients/id/:client_id

Returns a single client by their Firestore document ID. Auth required: Yes

Path parameters

client_id
string
required
The Firestore document ID of the client to retrieve.

Example

curl https://us-east4-breastfeeding-center-gw.cloudfunctions.net/api/clients/id/abc123 \
  -H "Authorization: Bearer <id_token>"

Response

Returns a single Client object (same fields as GET /clients/all).

Error codes

StatusReason
403Missing or invalid auth token
404No client document found for the given ID
500Internal error fetching client from Firestore

POST /clients/sync/acuity

Triggers a manual sync of client data from the Acuity Scheduling API into Firestore. Pulls appointments within the given date range and upserts matching client records. Auth required: Yes

Body

startDate
string
ISO 8601 start of the sync window. Defaults to one month ago.
endDate
string
ISO 8601 end of the sync window. Defaults to now.

Example

curl -X POST \
  https://us-east4-breastfeeding-center-gw.cloudfunctions.net/api/clients/sync/acuity \
  -H "Authorization: Bearer <id_token>" \
  -H "Content-Type: application/json" \
  -d '{ "startDate": "2024-01-01T00:00:00.000Z", "endDate": "2024-02-01T00:00:00.000Z" }'

Response

status
string
"OK" on success.
stats
object
Sync statistics including counts of new and updated clients.

Error codes

StatusReason
400Sync failed (returned with error details in the body)
403Missing or invalid auth token

POST /clients/sync/squarespace

Triggers a manual sync of client data from the Squarespace Commerce API into Firestore. Pulls orders within the given date range and upserts matching client records. Auth required: Yes

Body

startDate
string
ISO 8601 start of the sync window. Defaults to one month ago.
endDate
string
ISO 8601 end of the sync window. Defaults to now.

Example

curl -X POST \
  https://us-east4-breastfeeding-center-gw.cloudfunctions.net/api/clients/sync/squarespace \
  -H "Authorization: Bearer <id_token>" \
  -H "Content-Type: application/json" \
  -d '{ "startDate": "2024-01-01T00:00:00.000Z", "endDate": "2024-02-01T00:00:00.000Z" }'

Response

status
string
"OK" on success.
stats
object
Sync statistics including counts of new and updated clients.

Error codes

StatusReason
400Sync failed (returned with error details in the body)
403Missing or invalid auth token

POST /clients/sync/booqable

Triggers a manual sync of client data from Booqable (via the Stripe integration) into Firestore. Pulls rental records within the given date range and upserts matching client records. Auth required: Yes Booqable client data is also synced automatically by the booqableSync scheduled function, which runs every 6 hours over a rolling 1-week window.

Body

startDate
string
ISO 8601 start of the sync window. Defaults to one month ago.
endDate
string
ISO 8601 end of the sync window. Defaults to now.

Example

curl -X POST \
  https://us-east4-breastfeeding-center-gw.cloudfunctions.net/api/clients/sync/booqable \
  -H "Authorization: Bearer <id_token>" \
  -H "Content-Type: application/json" \
  -d '{ "startDate": "2024-01-01T00:00:00.000Z", "endDate": "2024-02-01T00:00:00.000Z" }'

Response

status
string
"OK" on success.
stats
object
Sync statistics including counts of new and updated clients.

Error codes

StatusReason
400Sync failed (returned with error details in the body)
403Missing or invalid auth token

POST /clients/hooks/acuity/client

Acuity webhook endpoint for real-time client sync. Acuity calls this URL whenever an appointment changes. The request is authenticated via Acuity’s HMAC webhook signature — do not call this endpoint directly. Auth required: No (verified via Acuity webhook signature)

Body (sent by Acuity)

id
string
required
Acuity appointment ID for the changed appointment.
action
string
required
The webhook action type. The endpoint is designed for "appointment.changed".

Behavior

  1. Fetches the full appointment from the Acuity API using the provided id.
  2. Upserts the associated client record in Firestore.

Error codes

StatusReason
400Missing appointment ID, or the sync operation failed
403Webhook signature verification failed

Build docs developers (and LLMs) love