Hoppa till innehåll

Coupon uses

Coupons used in bookings

The coupon use object

Attributes

iduuid

Unique identifier

booking_iduuid
bookings.id

Identifier of the booking the coupon is used in

coupon_iduuid
coupons.id

Identifier of the used coupon

created_atread-onlytimestamp with time zone

Creation timestamp

Related resources

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

bookings(*)object | null
bookings

The booking referenced by booking_id.

coupons(*)object | null
coupons

The coupon referenced by coupon_id.

The coupon use object
JSON
{
  "id": "00000000-0000-0000-0000-000000000000",
  "booking_id": "00000000-0000-0000-0000-000000000000",
  "coupon_id": "00000000-0000-0000-0000-000000000000",
  "created_at": "2026-10-30T22:27:57.301Z"
}
Including related resources
curl -X GET "https://api.bookingmood.com/v1/coupon_uses?limit=10&select=*,bookings(*),coupons(*)" \
  -H "Authorization: Bearer YOUR_API_KEY"

List coupon uses

Filters

idFilter<uuid>

Unique identifier

booking_idFilter<uuid>
bookings.id

Identifier of the booking the coupon is used in

coupon_idFilter<uuid>
coupons.id

Identifier of the used coupon

created_atFilter<timestamp with time zone>

Creation timestamp

Responses

200

A list of coupon uses 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 /coupon_uses
curl -X GET "https://api.bookingmood.com/v1/coupon_uses?select=*&limit=10" \
  -H "Authorization: Bearer YOUR_API_KEY"
Example response
JSON
[
  {
    "id": "00000000-0000-0000-0000-000000000000",
    "booking_id": "00000000-0000-0000-0000-000000000000",
    "coupon_id": "00000000-0000-0000-0000-000000000000",
    "created_at": "2026-10-30T22:27:57.301Z"
  }
]

Create coupon uses

Body

Partial<CouponUse> | Array<Partial<CouponUse>>

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

Responses

201

The newly created coupon uses 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 /coupon_uses
curl -X POST "https://api.bookingmood.com/v1/coupon_uses" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "booking_id": "00000000-0000-0000-0000-000000000000",
    "coupon_id": "00000000-0000-0000-0000-000000000000"
  }'
Example response
JSON
[
  {
    "id": "00000000-0000-0000-0000-000000000000",
    "booking_id": "00000000-0000-0000-0000-000000000000",
    "coupon_id": "00000000-0000-0000-0000-000000000000",
    "created_at": "2026-10-30T22:27:57.301Z"
  }
]

Delete coupon uses

Filters

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

idFilter<uuid>

Unique identifier

booking_idFilter<uuid>
bookings.id

Identifier of the booking the coupon is used in

coupon_idFilter<uuid>
coupons.id

Identifier of the used coupon

created_atFilter<timestamp with time zone>

Creation timestamp

Responses

200

The deleted coupon uses 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 /coupon_uses
curl -X DELETE "https://api.bookingmood.com/v1/coupon_uses?id=eq.00000000-0000-0000-0000-000000000000" \
  -H "Authorization: Bearer YOUR_API_KEY"
Example response
JSON
[
  {
    "id": "00000000-0000-0000-0000-000000000000",
    "booking_id": "00000000-0000-0000-0000-000000000000",
    "coupon_id": "00000000-0000-0000-0000-000000000000",
    "created_at": "2026-10-30T22:27:57.301Z"
  }
]

Update coupon uses

Filters

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

idFilter<uuid>

Unique identifier

booking_idFilter<uuid>
bookings.id

Identifier of the booking the coupon is used in

coupon_idFilter<uuid>
coupons.id

Identifier of the used coupon

created_atFilter<timestamp with time zone>

Creation timestamp

Body

Partial<CouponUse>

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

Responses

200

The updated coupon uses 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 /coupon_uses
curl -X PATCH "https://api.bookingmood.com/v1/coupon_uses?id=eq.00000000-0000-0000-0000-000000000000" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{}'
Example response
JSON
[
  {
    "id": "00000000-0000-0000-0000-000000000000",
    "booking_id": "00000000-0000-0000-0000-000000000000",
    "coupon_id": "00000000-0000-0000-0000-000000000000",
    "created_at": "2026-10-30T22:27:57.301Z"
  }
]

Ta kontroll över dina bokningar. Bygg upp ett eget företag.

Gör som 1200+ oberoende semesterbostadsföretag som använder Bookingmood för att öka antalet direktbokningar och bygga starkare relationer med gästerna.

Starta gratis 14 dags provperiod