Spring til indhold

Coupons

Codes guests can enter for additional discounts

The coupon object

Attributes

iduuid

Unique identifier

organization_iduuid
organizations.id

Identifier of the organization this coupon is defined in

created_atread-onlytimestamp with time zone

Creation timestamp

updated_atread-onlytimestamp with time zone

Last modification timestamp

deleted_attimestamp with time zone | null

Timestamp at which the coupon was deleted

codetext

Code guests enter to use the coupon

definitionPriceExpression

Definition of the coupon

descriptiontext

Description of the coupon

ftsread-onlytsvector

Full text search index

quotainteger | null

Maximum number of times the coupon can be used

scopeCouponScope

Scope of the coupon

stackableboolean

Whether the coupon can be used together with other coupons in one booking

Related resources

Embed related resources in the response with the select parameter, for example select=*,organizations(*). Resources related through more than one column need the column as a hint, like table!column(*).

organizations(*)object | null
organizations

The organization referenced by organization_id.

coupon_products(*)array
coupon_products

The coupon products referencing this coupon through coupon_products.coupon_id.

coupon_services(*)array
coupon_services

The coupon services referencing this coupon through coupon_services.coupon_id.

coupon_uses(*)array
coupon_uses

The coupon uses referencing this coupon through coupon_uses.coupon_id.

The coupon object
JSON
{
  "id": "00000000-0000-0000-0000-000000000000",
  "organization_id": "00000000-0000-0000-0000-000000000000",
  "created_at": "2026-10-30T22:26:24.060Z",
  "updated_at": "2026-10-30T22:26:24.060Z",
  "deleted_at": "2026-10-30T22:26:24.060Z",
  "code": "SUMMER24",
  "definition": {},
  "description": "A short description.",
  "quota": 0,
  "scope": "global",
  "stackable": true
}
Including related resources
curl -X GET "https://api.bookingmood.com/v1/coupons?limit=10&select=*,organizations(*),coupon_products(*)" \
  -H "Authorization: Bearer YOUR_API_KEY"

List coupons

Filters

idFilter<uuid>

Unique identifier

organization_idFilter<uuid>
organizations.id

Identifier of the organization this coupon is defined in

created_atFilter<timestamp with time zone>

Creation timestamp

updated_atFilter<timestamp with time zone>

Last modification timestamp

deleted_atFilter<timestamp with time zone | null>

Timestamp at which the coupon was deleted

codeFilter<text>

Code guests enter to use the coupon

definitionFilter<PriceExpression>

Definition of the coupon

descriptionFilter<text>

Description of the coupon

ftsFilter<tsvector>

Full text search index

quotaFilter<integer | null>

Maximum number of times the coupon can be used

scopeFilter<CouponScope>

Scope of the coupon

stackableFilter<boolean>

Whether the coupon can be used together with other coupons in one booking

Responses

200

A list of coupons with the selected columns

206

Partial Content

400

The request is malformed, for example an unknown column or an invalid filter.

401

The API key is missing or invalid.

Error responses have a JSON body with a code, message, details and hint. See the introduction for more on errors.
GET /coupons
curl -X GET "https://api.bookingmood.com/v1/coupons?select=*&limit=10" \
  -H "Authorization: Bearer YOUR_API_KEY"
Example response
JSON
[
  {
    "id": "00000000-0000-0000-0000-000000000000",
    "organization_id": "00000000-0000-0000-0000-000000000000",
    "created_at": "2026-10-30T22:26:24.060Z",
    "updated_at": "2026-10-30T22:26:24.060Z",
    "deleted_at": "2026-10-30T22:26:24.060Z",
    "code": "SUMMER24",
    "definition": {},
    "description": "A short description.",
    "quota": 0,
    "scope": "global",
    "stackable": true
  }
]

Create coupons

Body

Partial<Coupon> | Array<Partial<Coupon>>

Read-only attributes are set by the database and can't be written.

Responses

201

The newly created coupons with the selected columns

400

The request is malformed, for example an unknown column, an invalid filter or an invalid body.

401

The API key is missing or invalid.

403

The API key has no permission for this change, for example when writing rows of another organization.

409

The change conflicts with existing data, for example a duplicate key or a reference to a row that does not exist.

Error responses have a JSON body with a code, message, details and hint. See the introduction for more on errors.
POST /coupons
curl -X POST "https://api.bookingmood.com/v1/coupons" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "code": "SUMMER24",
    "definition": {},
    "description": "A short description.",
    "organization_id": "00000000-0000-0000-0000-000000000000",
    "scope": "global",
    "stackable": true
  }'
Example response
JSON
[
  {
    "id": "00000000-0000-0000-0000-000000000000",
    "organization_id": "00000000-0000-0000-0000-000000000000",
    "created_at": "2026-10-30T22:26:24.060Z",
    "updated_at": "2026-10-30T22:26:24.060Z",
    "deleted_at": "2026-10-30T22:26:24.060Z",
    "code": "SUMMER24",
    "definition": {},
    "description": "A short description.",
    "quota": 0,
    "scope": "global",
    "stackable": true
  }
]

Delete coupons

Filters

Without filters, this request deletes all coupons you have access to. Always filter on at least one column, e.g. id=eq.{id}.

idFilter<uuid>

Unique identifier

organization_idFilter<uuid>
organizations.id

Identifier of the organization this coupon is defined in

created_atFilter<timestamp with time zone>

Creation timestamp

updated_atFilter<timestamp with time zone>

Last modification timestamp

deleted_atFilter<timestamp with time zone | null>

Timestamp at which the coupon was deleted

codeFilter<text>

Code guests enter to use the coupon

definitionFilter<PriceExpression>

Definition of the coupon

descriptionFilter<text>

Description of the coupon

ftsFilter<tsvector>

Full text search index

quotaFilter<integer | null>

Maximum number of times the coupon can be used

scopeFilter<CouponScope>

Scope of the coupon

stackableFilter<boolean>

Whether the coupon can be used together with other coupons in one booking

Responses

200

The deleted coupons with the selected columns. Returns 204 without a body when sending the header Prefer: return=minimal.

400

The request is malformed, for example an unknown column or an invalid filter.

401

The API key is missing or invalid.

403

The API key has no permission for this change, for example when writing rows of another organization.

Error responses have a JSON body with a code, message, details and hint. See the introduction for more on errors.
DELETE /coupons
curl -X DELETE "https://api.bookingmood.com/v1/coupons?id=eq.00000000-0000-0000-0000-000000000000" \
  -H "Authorization: Bearer YOUR_API_KEY"
Example response
JSON
[
  {
    "id": "00000000-0000-0000-0000-000000000000",
    "organization_id": "00000000-0000-0000-0000-000000000000",
    "created_at": "2026-10-30T22:26:24.060Z",
    "updated_at": "2026-10-30T22:26:24.060Z",
    "deleted_at": "2026-10-30T22:26:24.060Z",
    "code": "SUMMER24",
    "definition": {},
    "description": "A short description.",
    "quota": 0,
    "scope": "global",
    "stackable": true
  }
]

Update coupons

Filters

Without filters, this request updates all coupons you have access to. Always filter on at least one column, e.g. id=eq.{id}.

idFilter<uuid>

Unique identifier

organization_idFilter<uuid>
organizations.id

Identifier of the organization this coupon is defined in

created_atFilter<timestamp with time zone>

Creation timestamp

updated_atFilter<timestamp with time zone>

Last modification timestamp

deleted_atFilter<timestamp with time zone | null>

Timestamp at which the coupon was deleted

codeFilter<text>

Code guests enter to use the coupon

definitionFilter<PriceExpression>

Definition of the coupon

descriptionFilter<text>

Description of the coupon

ftsFilter<tsvector>

Full text search index

quotaFilter<integer | null>

Maximum number of times the coupon can be used

scopeFilter<CouponScope>

Scope of the coupon

stackableFilter<boolean>

Whether the coupon can be used together with other coupons in one booking

Body

Partial<Coupon>

Read-only attributes are set by the database and can't be written.

Responses

200

The updated coupons with the selected columns. Returns 204 without a body when sending the header Prefer: return=minimal.

400

The request is malformed, for example an unknown column, an invalid filter or an invalid body.

401

The API key is missing or invalid.

403

The API key has no permission for this change, for example when writing rows of another organization.

409

The change conflicts with existing data, for example a duplicate key or a reference to a row that does not exist.

Error responses have a JSON body with a code, message, details and hint. See the introduction for more on errors.
PATCH /coupons
curl -X PATCH "https://api.bookingmood.com/v1/coupons?id=eq.00000000-0000-0000-0000-000000000000" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "code": "SUMMER24"
  }'
Example response
JSON
[
  {
    "id": "00000000-0000-0000-0000-000000000000",
    "organization_id": "00000000-0000-0000-0000-000000000000",
    "created_at": "2026-10-30T22:26:24.060Z",
    "updated_at": "2026-10-30T22:26:24.060Z",
    "deleted_at": "2026-10-30T22:26:24.060Z",
    "code": "SUMMER24",
    "definition": {},
    "description": "A short description.",
    "quota": 0,
    "scope": "global",
    "stackable": true
  }
]

Få styr på dine bookinger. Opbyg din egen virksomhed.

Bliv en del af de 1200+ uafhængige udlejningsvirksomheder, der bruger Bookingmood til at øge antallet af direkte bookinger og opbygge stærkere relationer til gæsterne.

Start gratis 14-dages prøveperiode