Charter Boats
Charter Boats API
Discounts

Discounts

List, create, change and end your company's discount codes

Same in API v1.0 and v1.1

GET/dashboard/discounts?company_id=POST/dashboard/discountsPATCH/dashboard/discounts/:idDELETE/dashboard/discounts/:id

Your company's discounts: codes a guest enters, and the pay-in-full discount. A discount belongs to a company and applies to all its boats or to the boats you name.

Authentication

Requires one of:

  • API key: X-API-Key header with your API key. This is the way to call it from your own systems.
  • Session: a signed-in charter.boats session — what the dashboard uses from the browser. Outside charter.boats a request without a key is stopped by bot protection (HTML 403), so integrations should use the key.

Either way, the account must be a member of the company. Your company's id is the company_id on any boat List Your Fleet returns.

List discounts

GET /dashboard/discounts?company_id=<id> answers the company's active discounts, newest first. Each carries the fields below plus created_by_name, and — when it is aimed at named boats — boat_ids.

Create a discount

POST /dashboard/discounts

FieldTypeRequiredDescription
company_idstringYesYour company
triggerstringNocode (default) — the guest's code; pay_in_full — taken off when the guest pays everything at once
codestringFor codeThe code, stored in capitals. Must be unique. A pay-in-full discount gets one made for it
discount_typestringYespercentage or fixed. Pay-in-full is percentage only
discount_valuenumberYesAbove 0. A percentage is at most 100, a pay-in-full one at most 20
currencystringNoDefault EUR
auto_applybooleanNoDefault true: applied without the guest typing the code. A pay-in-full discount is always applied
all_boatsbooleanNoDefault true. false with boat_ids aims it at those boats
boat_idsarrayNoBoat UUIDs, with all_boats: false
start_date / end_datestringNoThe dates it can be booked between (YYYY-MM-DD); either side may be left open
stay_from / stay_tostringNoThe check-in dates it covers; either side may be left open
descriptionstringNoA description of the discount
max_usesintegerNoHow many times it may be used. Empty for no limit

A company has one active pay-in-full discount at a time. The response is the created discount.

curl -X POST https://charter.boats/api/dashboard/discounts \
  -H "X-API-Key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "company_id": "COMPANY_UUID", "code": "EARLY27", "discount_type": "percentage", "discount_value": 10, "stay_from": "2027-05-01", "stay_to": "2027-06-30" }'

Change a discount

PATCH /dashboard/discounts/:id — send any field of the table above except company_id and trigger, or is_active. boat_ids replaces the named boats when sent with all_boats: false; all_boats: true clears them. A pay-in-full discount keeps its generated code and stays applied automatically. A sent discount_type or discount_value is held to the same rules as on create, checked against the discount as it would stand after the change: a discount_value sent alone must still fit the stored type (at most 100 for a percentage, 20 for pay-in-full), and switching to percentage checks the stored value. The response is the discount.

End a discount

DELETE /dashboard/discounts/:id switches the discount off (is_active: false) and answers { "success": true }.

Errors

StatusMessage
400company_id is required
400company_id, discount_type, and discount_value are required
400code is required for code coupons
400discount_type must be percentage or fixed
400Pay-in-full discounts must be percentage type / Pay-in-full discount is capped at 20%
400Percentage discount cannot exceed 100% / Discount value must be positive
400Coupon ID required
401Invalid API key — a key that belongs to no account
401Invalid API key format — a malformed key
401Authentication required — no key and no signed-in session
403Not a company member
404Coupon not found
409A coupon with this code already exists
409An active pay-in-full discount already exists for this company. …
500Failed to fetch coupons / Failed to create coupon / Failed to update coupon / Failed to deactivate coupon

On this page