RentalTideRentalTideDocs
Dashboard

Marketing API

Affiliates, cart recovery, and communications

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

NameInTypeRequiredDescription
affiliateIdquerystringYesThe affiliate ID to check

Responses

CodeDescription
200Availability check result
400Missing or invalid affiliate ID
500Server error

Create an affiliate

POST /affiliate

Create a new affiliate with optional custom affiliate ID

Request body

FieldTypeRequiredDescription
customerIdstringYes
namestringYes
emailstringYes
percentageEarnednumberNo
customAffiliateIdstringNo

Responses

CodeDescription
201Affiliate created successfully
400Missing required fields or invalid affiliate ID
409Affiliate ID already exists
500Server error

Get affiliates for a customer

GET /affiliate

Retrieve all affiliates associated with a customer ID

Parameters

NameInTypeRequiredDescription
customerIdquerystringYesThe customer ID to get affiliates for

Responses

CodeDescription
200List of affiliates
400Missing customerId parameter
500Server error

Delete an affiliate

DELETE /affiliate

Delete an affiliate by their affiliate ID

Parameters

NameInTypeRequiredDescription
affiliateIdquerystringYesThe affiliate ID to delete

Responses

CodeDescription
200Affiliate deleted successfully
400Missing affiliateId parameter
404Affiliate not found
500Server error

Update affiliate data

PATCH /affiliate

Perform various affiliate update operations based on action parameter

Parameters

NameInTypeRequiredDescription
actionquerystringYesThe action to perform

Request body

FieldTypeRequiredDescription
affiliateIdstringNo
paidOutnumberNoAmount for addPayout action
percentageEarnednumberNoPercentage for editPercentage action
totalAmountnumberNoTotal amount for addACommission action

Responses

CodeDescription
200Operation completed successfully
400Missing required fields or invalid action
404Affiliate not found
500Server error

Recalculate affiliate earnings

POST /affiliate/recalculate

Recalculates all affiliate earnings from bookings (excludes cancelled bookings)

Request body

FieldTypeRequiredDescription
customerIdstringYesCustomer ID to recalculate affiliates for
affiliateIdstringNoOptional - recalculate for specific affiliate only

Responses

CodeDescription
200Recalculation completed successfully
400Missing required fields
500Server 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

NameInTypeRequiredDescription
locationIdpathstringYesThe location ID to filter cart recovery items

Responses

CodeDescription
200List of cart recovery items
400Missing required parameters
500Internal 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

NameInTypeRequiredDescription
idpathstringYesThe cart recovery item ID

Responses

CodeDescription
200Item deleted successfully
400Missing required parameters
403Access denied - not the owner of the cart
404Item 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

FieldTypeRequiredDescription
customerIdstringYesThe customer ID
locationIdstringYesThe location ID
templateIdstringYesThe template identifier (e.g., booking_confirmation)
rentalIdstringNoThe rental ID (optional, but either rentalId or recipientList is required)
recipientListarrayNoList of email recipients (optional, but either rentalId or recipientList is required)
forceSendEmailbooleanNoForce sending via email
forceSendTextbooleanNoForce sending via SMS

Responses

CodeDescription
200Communication sent successfully
400Missing required fields or validation error
500Server 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

FieldTypeRequiredDescription
tostringYesRecipient email address
firstNamestringNoCustomer's first name
lastNamestringNoCustomer's last name
customMessagestringNoOptional custom message content
recoveryUrlstringYesThe URL for the customer to recover their cart
bookingInfoobjectNo

Responses

CodeDescription
200Cart recovery email sent successfully
400Missing required fields or invalid email format
500Failed 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

FieldTypeRequiredDescription
originalUrlstringYesThe original URL to shorten
metadataobjectNoOptional metadata to associate with the short code

Responses

CodeDescription
200Short code generated successfully
400Missing or invalid URL
500Failed 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

FieldTypeRequiredDescription
phoneNumberstringYesThe recipient phone number
messagestringYesThe SMS message content
customerIdstringNoThe customer ID for tracking
locationIdstringNoThe location ID for tracking
countrystringNoThe country code for phone validation

Responses

CodeDescription
200SMS sent successfully
400Invalid phone number or SMS service not available
500Failed to send 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

FieldTypeRequiredDescription
phoneNumberstringYesThe recipient phone number
messagestringNoOptional custom message (default message will be generated if not provided)
waiverUrlstringYesThe waiver URL (can be relative or absolute)
customerIdstringNoThe customer ID
transactionIdstringNoThe transaction ID
firstNamestringNoCustomer's first name for personalization
lastNamestringNoCustomer's last name
locationIdstringNoThe location ID
countrystringNoThe country code for phone validation

Responses

CodeDescription
200Waiver link sent successfully
400Invalid phone number or missing required fields
500Failed 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

NameInTypeRequiredDescription
idpathstringYesThe cart recovery item ID

Responses

CodeDescription
200Cart recovery item marked as contacted
400Missing cart recovery ID
404Cart recovery item not found
500Failed 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

CodeDescription
200Items needing contact retrieved successfully
500Failed 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

NameInTypeRequiredDescription
locationIdpathstringYesThe location ID
includeContactedquerystringNoWhether to include contacted items in the results

Responses

CodeDescription
200Cart recovery items retrieved successfully
400Missing location ID
500Failed to retrieve cart recovery items

Delete cart recovery item

DELETE /communication/cartRecovery/{id}

Permanently deletes a cart recovery item by ID.

Parameters

NameInTypeRequiredDescription
idpathstringYesThe cart recovery item ID

Responses

CodeDescription
200Cart recovery item deleted successfully
400Missing cart recovery ID
404Cart recovery item not found
500Failed 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

FieldTypeRequiredDescription
phoneNumberstringYesThe phone number to validate
countrystringNoThe country code for validation

Responses

CodeDescription
200Phone validation result
400Missing phone number
500Failed 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

CodeDescription
200Scheduled communications processed
500Failed 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

FieldTypeRequiredDescription
customerIdstringYesThe customer ID
locationIdstringYesThe location ID
templateIdstringYesThe template identifier
recipientEmailstringYesThe recipient email address
rentalIdstringNoOptional rental ID
delayMinutesintegerNoDelay in minutes before sending
triggerstringNoTrigger condition for the communication
conditionsobjectNoAdditional conditions for sending

Responses

CodeDescription
200Communication scheduled successfully
400Missing required fields
500Failed to schedule communication

Cancel a scheduled communication

DELETE /communication/schedule/{scheduleId}

Cancels a previously scheduled communication by its schedule ID.

Parameters

NameInTypeRequiredDescription
scheduleIdpathstringYesThe schedule ID of the communication to cancel

Responses

CodeDescription
200Scheduled communication cancelled successfully
400Missing schedule ID
500Failed 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

NameInTypeRequiredDescription
rentalIdpathstringYesThe rental ID

Responses

CodeDescription
200Scheduled communications retrieved successfully
400Missing rental ID
500Failed 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

NameInTypeRequiredDescription
templateIdpathstringYesThe template identifier

Responses

CodeDescription
200Default template retrieved successfully
400Missing template ID
404Default template not found
500Failed 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

CodeDescription
200Default templates retrieved successfully
500Failed to retrieve default templates

Was this page helpful?
Need help? Contact Support.See what’s new. Check out changelog.Questions? Book a video chat.
Ask AI
Responses are generated using AI and may contain mistakes.
Ask questions about RentalTide and get help with your integration.