Endpoints for managing affiliate programs, cart recovery campaigns, and customer communications.
Affiliates
Check affiliate ID availability
GET /affiliate/check-availability
Check if a given affiliate ID is available for use
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
affiliateId | query | string | Yes | The affiliate ID to check |
Responses
| Code | Description |
|---|---|
200 | Availability check result |
400 | Missing or invalid affiliate ID |
500 | Server error |
Create an affiliate
POST /affiliate
Create a new affiliate with optional custom affiliate ID
Request body
| Field | Type | Required | Description |
|---|---|---|---|
customerId | string | Yes | |
name | string | Yes | |
email | string | Yes | |
percentageEarned | number | No | |
customAffiliateId | string | No |
Responses
| Code | Description |
|---|---|
201 | Affiliate created successfully |
400 | Missing required fields or invalid affiliate ID |
409 | Affiliate ID already exists |
500 | Server error |
Get affiliates for a customer
GET /affiliate
Retrieve all affiliates associated with a customer ID
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
customerId | query | string | Yes | The customer ID to get affiliates for |
Responses
| Code | Description |
|---|---|
200 | List of affiliates |
400 | Missing customerId parameter |
500 | Server error |
Delete an affiliate
DELETE /affiliate
Delete an affiliate by their affiliate ID
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
affiliateId | query | string | Yes | The affiliate ID to delete |
Responses
| Code | Description |
|---|---|
200 | Affiliate deleted successfully |
400 | Missing affiliateId parameter |
404 | Affiliate not found |
500 | Server error |
Update affiliate data
PATCH /affiliate
Perform various affiliate update operations based on action parameter
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
action | query | string | Yes | The action to perform |
Request body
| Field | Type | Required | Description |
|---|---|---|---|
affiliateId | string | No | |
paidOut | number | No | Amount for addPayout action |
percentageEarned | number | No | Percentage for editPercentage action |
totalAmount | number | No | Total amount for addACommission action |
Responses
| Code | Description |
|---|---|
200 | Operation completed successfully |
400 | Missing required fields or invalid action |
404 | Affiliate not found |
500 | Server error |
Recalculate affiliate earnings
POST /affiliate/recalculate
Recalculates all affiliate earnings from bookings (excludes cancelled bookings)
Request body
| Field | Type | Required | Description |
|---|---|---|---|
customerId | string | Yes | Customer ID to recalculate affiliates for |
affiliateId | string | No | Optional - recalculate for specific affiliate only |
Responses
| Code | Description |
|---|---|
200 | Recalculation completed successfully |
400 | Missing required fields |
500 | Server error |
Cart Recovery
Get cart recovery items for a location
GET /cartRecovery/{locationId}
Retrieves all abandoned cart items for the authenticated customer at a specific location
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
locationId | path | string | Yes | The location ID to filter cart recovery items |
Responses
| Code | Description |
|---|---|
200 | List of cart recovery items |
400 | Missing required parameters |
500 | Internal server error |
Delete a cart recovery item
DELETE /cartRecovery/{id}
Deletes an abandoned cart item. Only the owner of the cart can delete it.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
id | path | string | Yes | The cart recovery item ID |
Responses
| Code | Description |
|---|---|
200 | Item deleted successfully |
400 | Missing required parameters |
403 | Access denied - not the owner of the cart |
404 | Item not found |
Communications
Send a templated communication
POST /communication/send-templated
Sends a templated email or SMS communication to recipients. If rentalId is provided, the recipient is determined from the rental's CustomerInfo. If both rentalId and recipientList are provided, all parties receive the communication.
Request body
| Field | Type | Required | Description |
|---|---|---|---|
customerId | string | Yes | The customer ID |
locationId | string | Yes | The location ID |
templateId | string | Yes | The template identifier (e.g., booking_confirmation) |
rentalId | string | No | The rental ID (optional, but either rentalId or recipientList is required) |
recipientList | array | No | List of email recipients (optional, but either rentalId or recipientList is required) |
forceSendEmail | boolean | No | Force sending via email |
forceSendText | boolean | No | Force sending via SMS |
Responses
| Code | Description |
|---|---|
200 | Communication sent successfully |
400 | Missing required fields or validation error |
500 | Server error |
Send cart recovery email
POST /communication/send-cart-recovery-email
Sends a cart recovery email to a customer with optional custom message and booking information. Generates a short URL for tracking.
Request body
| Field | Type | Required | Description |
|---|---|---|---|
to | string | Yes | Recipient email address |
firstName | string | No | Customer's first name |
lastName | string | No | Customer's last name |
customMessage | string | No | Optional custom message content |
recoveryUrl | string | Yes | The URL for the customer to recover their cart |
bookingInfo | object | No |
Responses
| Code | Description |
|---|---|
200 | Cart recovery email sent successfully |
400 | Missing required fields or invalid email format |
500 | Failed to send cart recovery email |
Generate a short code for a URL
POST /communication/generate-short-code
Creates a shortened URL with optional metadata for tracking purposes. Returns the short URL and code with a 30-day expiration.
Request body
| Field | Type | Required | Description |
|---|---|---|---|
originalUrl | string | Yes | The original URL to shorten |
metadata | object | No | Optional metadata to associate with the short code |
Responses
| Code | Description |
|---|---|
200 | Short code generated successfully |
400 | Missing or invalid URL |
500 | Failed to generate short code |
Send an SMS message
POST /communication/send-sms
Sends an SMS message with enhanced error handling and international support. Validates phone number format and SMS service availability.
Request body
| Field | Type | Required | Description |
|---|---|---|---|
phoneNumber | string | Yes | The recipient phone number |
message | string | Yes | The SMS message content |
customerId | string | No | The customer ID for tracking |
locationId | string | No | The location ID for tracking |
country | string | No | The country code for phone validation |
Responses
| Code | Description |
|---|---|
200 | SMS sent successfully |
400 | Invalid phone number or SMS service not available |
500 | Failed to send SMS |
Send waiver link via SMS
POST /communication/send-waiver-link
Sends a waiver link to a customer via SMS. Creates a short link for tracking and sends the SMS with a personalized message.
Request body
| Field | Type | Required | Description |
|---|---|---|---|
phoneNumber | string | Yes | The recipient phone number |
message | string | No | Optional custom message (default message will be generated if not provided) |
waiverUrl | string | Yes | The waiver URL (can be relative or absolute) |
customerId | string | No | The customer ID |
transactionId | string | No | The transaction ID |
firstName | string | No | Customer's first name for personalization |
lastName | string | No | Customer's last name |
locationId | string | No | The location ID |
country | string | No | The country code for phone validation |
Responses
| Code | Description |
|---|---|
200 | Waiver link sent successfully |
400 | Invalid phone number or missing required fields |
500 | Failed to send waiver link |
Mark cart recovery item as contacted
POST /communication/cartRecovery/{id}/contact
Updates a cart recovery item to mark it as contacted with the current timestamp.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
id | path | string | Yes | The cart recovery item ID |
Responses
| Code | Description |
|---|---|
200 | Cart recovery item marked as contacted |
400 | Missing cart recovery ID |
404 | Cart recovery item not found |
500 | Failed to mark as contacted |
Get cart recovery items needing contact
GET /communication/cartRecovery/items-needing-contact
Returns active, uncontacted cart recovery items whose ContactOn time has passed. Used by the cart recovery Lambda.
Responses
| Code | Description |
|---|---|
200 | Items needing contact retrieved successfully |
500 | Failed to retrieve items |
Get cart recovery items for a location
GET /communication/cartRecovery/{locationId}
Retrieves cart recovery items for a specific location with optional filtering and statistics.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
locationId | path | string | Yes | The location ID |
includeContacted | query | string | No | Whether to include contacted items in the results |
Responses
| Code | Description |
|---|---|
200 | Cart recovery items retrieved successfully |
400 | Missing location ID |
500 | Failed to retrieve cart recovery items |
Delete cart recovery item
DELETE /communication/cartRecovery/{id}
Permanently deletes a cart recovery item by ID.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
id | path | string | Yes | The cart recovery item ID |
Responses
| Code | Description |
|---|---|
200 | Cart recovery item deleted successfully |
400 | Missing cart recovery ID |
404 | Cart recovery item not found |
500 | Failed to delete cart recovery item |
Validate a phone number
POST /communication/validate-phone
Validates a phone number for SMS capability with enhanced international support.
Request body
| Field | Type | Required | Description |
|---|---|---|---|
phoneNumber | string | Yes | The phone number to validate |
country | string | No | The country code for validation |
Responses
| Code | Description |
|---|---|
200 | Phone validation result |
400 | Missing phone number |
500 | Failed to validate phone number |
Process scheduled communications
POST /communication/process-scheduled
Cron job endpoint that processes pending scheduled communications. Should be called every 5 minutes to fetch pending communications, send them, and update their status.
Responses
| Code | Description |
|---|---|
200 | Scheduled communications processed |
500 | Failed to process scheduled communications |
Schedule a communication
POST /communication/schedule
Schedules a communication to be sent at a later time based on delay or trigger conditions.
Request body
| Field | Type | Required | Description |
|---|---|---|---|
customerId | string | Yes | The customer ID |
locationId | string | Yes | The location ID |
templateId | string | Yes | The template identifier |
recipientEmail | string | Yes | The recipient email address |
rentalId | string | No | Optional rental ID |
delayMinutes | integer | No | Delay in minutes before sending |
trigger | string | No | Trigger condition for the communication |
conditions | object | No | Additional conditions for sending |
Responses
| Code | Description |
|---|---|
200 | Communication scheduled successfully |
400 | Missing required fields |
500 | Failed to schedule communication |
Cancel a scheduled communication
DELETE /communication/schedule/{scheduleId}
Cancels a previously scheduled communication by its schedule ID.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
scheduleId | path | string | Yes | The schedule ID of the communication to cancel |
Responses
| Code | Description |
|---|---|
200 | Scheduled communication cancelled successfully |
400 | Missing schedule ID |
500 | Failed to cancel scheduled communication |
Get scheduled communications for a rental
GET /communication/schedule/rental/{rentalId}
Retrieves all scheduled communications associated with a specific rental.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
rentalId | path | string | Yes | The rental ID |
Responses
| Code | Description |
|---|---|
200 | Scheduled communications retrieved successfully |
400 | Missing rental ID |
500 | Failed to retrieve scheduled communications |
Get default email template content
GET /communication/templates/defaults/{templateId}
Retrieves the default content for a specific email template by ID.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
templateId | path | string | Yes | The template identifier |
Responses
| Code | Description |
|---|---|
200 | Default template retrieved successfully |
400 | Missing template ID |
404 | Default template not found |
500 | Failed to retrieve default template |
Get all available default templates
GET /communication/templates/defaults
Retrieves a list of all available default email templates with their content.
Responses
| Code | Description |
|---|---|
200 | Default templates retrieved successfully |
500 | Failed to retrieve default templates |

