Charter Boats API
Pricing

Resolve Pricing

Get the resolved price for each day in a date range

GET/boats/:id/pricing

Resolve the effective daily price for each day in a date range. Applies the full pricing waterfall: date overrides take priority over seasonal pricing. Days with no season coverage and no override are marked unavailable.

Path Parameters

ParameterTypeDescription
idstringBoat ID (UUID)

Query Parameters

ParameterTypeRequiredDescription
startstringYesStart date (YYYY-MM-DD)
endstringYesEnd date (YYYY-MM-DD)

The range is exclusive of the end date (i.e., start up to but not including end).

Request

curl "https://charter.boats/api/boats/550e8400-e29b-41d4-a716-446655440000/pricing?start=2024-07-01&end=2024-07-08"

Response

{
  "prices": [
    {
      "date": "2024-07-01",
      "price": 500,
      "source": "season",
      "seasonName": "Peak Season",
      "isAvailable": true
    },
    {
      "date": "2024-07-02",
      "price": 500,
      "source": "season",
      "seasonName": "Peak Season",
      "isAvailable": true
    },
    {
      "date": "2024-07-03",
      "price": 500,
      "source": "season",
      "seasonName": "Peak Season",
      "isAvailable": true
    },
    {
      "date": "2024-07-04",
      "price": 600,
      "source": "override",
      "isAvailable": true,
      "note": "Independence Day"
    },
    {
      "date": "2024-07-05",
      "price": 0,
      "source": "override",
      "isAvailable": false,
      "note": "Owner use"
    },
    {
      "date": "2024-07-06",
      "price": 500,
      "source": "season",
      "seasonName": "Peak Season",
      "isAvailable": true
    },
    {
      "date": "2024-07-07",
      "price": 500,
      "source": "season",
      "seasonName": "Peak Season",
      "isAvailable": true
    }
  ],
  "summary": {
    "totalDays": 7,
    "availableDays": 6,
    "unavailableDays": 1,
    "subtotal": 3100,
    "minPrice": 500,
    "maxPrice": 600,
    "avgPrice": 516.67
  }
}

Response Fields

prices array

FieldTypeDescription
datestringDate (YYYY-MM-DD)
pricenumberResolved price for this day (0 if unavailable)
sourcestringseason or override
seasonNamestringName of the matching season (only when source is season)
isAvailablebooleanWhether the date is bookable
notestringNote from a date override (only when source is override)
originalPricenumber | nullPre-discount price (if a seasonal discount applies)
discountPercentagenumber | nullActive discount percentage
discountNamestring | nullName of the discount

summary object

FieldTypeDescription
totalDaysintegerTotal days in the range
availableDaysintegerNumber of bookable days
unavailableDaysintegerNumber of blocked days
subtotalnumberSum of prices for available days
minPricenumberLowest daily price among available days
maxPricenumberHighest daily price among available days
avgPricenumberAverage daily price among available days

Price Sources

  • season: Using a seasonal pricing rule. The matching season's name is included in seasonName.
  • override: Using a date-specific price override. Overrides always take priority over seasons.

Pricing Waterfall

  1. Date override -- if one exists for this date, it wins (can set a custom price or mark unavailable)
  2. Season -- the highest-priority matching season sets the price
  3. No coverage -- if neither exists, the day is unavailable (isAvailable: false, price: 0)

Errors

StatusMessage
400start and end dates are required
400Dates must be in YYYY-MM-DD format

Use Cases

Calculate Booking Total

const res = await fetch(
  `/api/boats/${boatId}/pricing?start=${checkIn}&end=${checkOut}`
);
const { summary } = await res.json();
 
// Add fees
const fees = await fetch(`/api/boats/${boatId}/fees?start=${checkIn}&end=${checkOut}`);
const feeTotal = fees
  .filter(f => f.required)
  .reduce((sum, f) => sum + (f.period === 'per_day' ? f.amount * summary.availableDays : f.amount), 0);
 
const grandTotal = summary.subtotal + feeTotal + 45; // + $45 service fee

Display Calendar Prices

curl "https://charter.boats/api/boats/550e8400-e29b-41d4-a716-446655440000/pricing?start=2024-07-01&end=2024-08-01"

On this page