Skip to main content

Create voucher template

Method POST

https://my.easyweek.io/api/public/v2/voucher-templates

Description: This endpoint creates a voucher template. At least one of service_uuids / good_uuids must be present. An empty array [] means "all"; omitting the key means "not applicable". Omitting branch_uuids (or sending []) means all branches.

Example Request

curl -i -X POST \
https://my.easyweek.io/api/public/v2/voucher-templates \
-H 'Authorization: Bearer <YOUR_SECRET>' \
-H 'Workspace: <YOUR_WORKSPACE>'

Request body

{
"title": "Gift 100",
"primary_color": "blue",
"is_single_charge": false,
"cost": 9000,
"value": 10000,
"is_enabled": true,
"is_online": true,
"description": null,
"notes": null,
"branch_uuids": [],
"service_uuids": [],
"good_uuids": [],
"validity": 12,
"sales_limit": 100,
"is_shown_on_website": true,
"is_shown_in_marketplace": true
}

Body Parameters

  • title (string, required): The voucher template title.
  • primary_color (string, required): A configured color key.
  • is_single_charge (boolean, required): Whether the voucher is spent in a single charge.
  • cost (integer, required): The purchase price in minor units.
  • value (integer, required): The credit granted, in minor units.
  • is_enabled (boolean, required): Whether the template is enabled.
  • is_online (boolean, required): Whether the voucher can be sold online.
  • description (string, optional): The template description.
  • notes (string, optional): Internal notes.
  • branch_uuids (array, optional): Locations the voucher applies to. Omit or [] for all branches.
  • service_uuids (array, optional): Services the voucher applies to. [] means all services. Required if good_uuids is omitted.
  • good_uuids (array, optional): Goods the voucher applies to. [] means all goods. Required if service_uuids is omitted.
  • validity (integer, optional): Validity in months (1–36).
  • sales_limit (integer, optional): Maximum number of sales.
  • is_shown_on_website (boolean, optional): Show on the booking website.
  • is_shown_in_marketplace (boolean, optional): Show in the marketplace.

Example Response

{
"uuid": "d3f1c2b4-6a7e-4b1c-9d0e-1f2a3b4c5d6e",
"title": "Gift 100",
"description": null,
"notes": null,
"primary_color": "blue",
"is_single_charge": false,
"cost": 9000,
"value": 10000,
"is_connected_all_branches": true,
"all_branches_count": 3,
"branches_count": 3,
"is_connected_all_services": true,
"all_services_count": 12,
"services_count": 12,
"is_connected_all_goods": true,
"all_goods_count": 5,
"goods_count": 5,
"vouchers_count": 0,
"activated_vouchers_count": 0,
"validity": 12,
"activate_at": null,
"forces_activation": false,
"activate_after": 0,
"is_enabled": true,
"has_limit_of_sales": true,
"sales_limit": 100,
"is_online": true,
"is_shown_on_website": true,
"is_shown_in_marketplace": true,
"created_at": "2026-07-16T09:00:00+0000"
}