Charter Boats API
Pricing

Date-Specific Prices

Set custom prices or block specific dates

GET/boats/:id/date-prices

Retrieve date-specific price overrides and availability blocks for a boat within a date range.

Path Parameters

ParameterTypeDescription
idstringBoat ID (UUID)

Query Parameters

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

Request

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

Response

Returns an array of date-price objects, ordered by date ascending.

[
  {
    "id": "dp-1a2b3c...",
    "boat_id": "550e8400-e29b-41d4-a716-446655440000",
    "date": "2024-07-04",
    "price_per_day": 600,
    "is_available": true,
    "note": "Independence Day premium",
    "created_at": "2024-01-15T10:00:00Z"
  },
  {
    "id": "dp-4d5e6f...",
    "boat_id": "550e8400-e29b-41d4-a716-446655440000",
    "date": "2024-07-05",
    "price_per_day": null,
    "is_available": false,
    "note": "Owner use",
    "created_at": "2024-01-15T10:00:00Z"
  }
]

Response Fields

FieldTypeDescription
idstringDate-price ID (UUID)
boat_idstringBoat this override belongs to
datestringDate (YYYY-MM-DD)
price_per_daynumber | nullCustom price, or null if using season price
is_availablebooleanWhether the date is bookable
notestring | nullOptional note/reason
created_atstringISO 8601 timestamp

Errors

StatusMessage
400start and end dates are required

Set Date Prices

POST/boats/:id/date-prices

Create or update date-specific prices and availability. Accepts a single object or an array for bulk operations. Uses upsert -- existing entries for the same boat + date are updated.

Requires authentication as a company member for the boat.

Authentication

X-API-Key: cb_live_xxxxx

Request Body

Single object or array of date-price objects:

FieldTypeRequiredDescription
datestringYesDate (YYYY-MM-DD)
price_per_daynumber | nullNoCustom price (null to clear override)
is_availablebooleanNoDefault: true. Set to false to block the date.
notestring | nullNoOptional note/reason

Request

curl -X POST https://charter.boats/api/boats/550e8400-e29b-41d4-a716-446655440000/date-prices \
  -H "Content-Type: application/json" \
  -H "X-API-Key: cb_live_xxxxx" \
  -d '[
    {
      "date": "2024-07-04",
      "price_per_day": 600,
      "note": "Independence Day"
    },
    {
      "date": "2024-07-05",
      "is_available": false,
      "note": "Owner use"
    },
    {
      "date": "2024-07-06",
      "price_per_day": 550
    }
  ]'

Response

Returns the array of upserted date-price objects.

[
  {
    "id": "dp-1a2b3c...",
    "boat_id": "550e8400-e29b-41d4-a716-446655440000",
    "date": "2024-07-04",
    "price_per_day": 600,
    "is_available": true,
    "note": "Independence Day",
    "created_at": "2024-01-15T10:00:00Z"
  },
  {
    "id": "dp-4d5e6f...",
    "boat_id": "550e8400-e29b-41d4-a716-446655440000",
    "date": "2024-07-05",
    "price_per_day": null,
    "is_available": false,
    "note": "Owner use",
    "created_at": "2024-01-15T10:00:00Z"
  },
  {
    "id": "dp-7g8h9i...",
    "boat_id": "550e8400-e29b-41d4-a716-446655440000",
    "date": "2024-07-06",
    "price_per_day": 550,
    "is_available": true,
    "note": null,
    "created_at": "2024-01-15T10:00:00Z"
  }
]

Errors

StatusMessage
400At least one date price entry required
400Each item must have a valid date (YYYY-MM-DD)
404Boat not found

Use Cases

Block Dates for Maintenance

curl -X POST https://charter.boats/api/boats/550e8400-e29b-41d4-a716-446655440000/date-prices \
  -H "Content-Type: application/json" \
  -H "X-API-Key: cb_live_xxxxx" \
  -d '[
    {"date": "2024-08-01", "is_available": false, "note": "Engine service"},
    {"date": "2024-08-02", "is_available": false, "note": "Engine service"}
  ]'

Holiday Premium Pricing

curl -X POST https://charter.boats/api/boats/550e8400-e29b-41d4-a716-446655440000/date-prices \
  -H "Content-Type: application/json" \
  -H "X-API-Key: cb_live_xxxxx" \
  -d '[
    {"date": "2024-12-24", "price_per_day": 750, "note": "Christmas Eve"},
    {"date": "2024-12-25", "price_per_day": 750, "note": "Christmas Day"},
    {"date": "2024-12-31", "price_per_day": 900, "note": "New Years Eve"}
  ]'

Single Date Override

You can also send a single object instead of an array:

curl -X POST https://charter.boats/api/boats/550e8400-e29b-41d4-a716-446655440000/date-prices \
  -H "Content-Type: application/json" \
  -H "X-API-Key: cb_live_xxxxx" \
  -d '{"date": "2024-07-04", "price_per_day": 600}'

On this page