# Create a service

Method to create a service

Endpoint: POST /services/{location_id}
Version: 1.0.0
Security: BearerPartnerUser

## Security:

  - `BearerPartnerUser` (unknown)
    http bearer Bearer {PartnerToken}, User {UserToken}

## Path parameters:

  - `location_id` (number, required)
    location ID

## Header parameters:

  - `Accept` (string, required)
    e.g. application/vnd.api.v2+json

  - `Content-Type` (string, required)
    application/json

  - `Authorizarion` (string, required)
    Bearer partner_token, User user_token

## Request fields (application/json):

  - `title` (string)
    Service name

  - `category_id` (number)
    Service Category ID

  - `price_min` (number)
    The minimum cost of the service

  - `price_max` (number)
    Maximum cost of the service

  - `duration` (number)
    Service duration, default is 3600 seconds

  - `technical_break_duration` (any)
    Technical break duration in seconds.
- If not provided, defaults to null
- null = use location default (Settings → Appointment Log → Technical Breaks)
- Must be in multiples of 300 (5-minute intervals)
- Maximum value is 3600 (1 hour)

  - `discount` (number)
    Service discount

  - `comment` (string)
    Comment on the service

  - `weight` (number)
    Service weight (used to sort services when displayed)

  - `active` (number)
    Is the service available for online booking? 1 - available, 0 not available.

  - `api_id` (string)
    External Service ID

  - `staff` (array)
    team members who provide the service, along with the duration of the service for each team member

  - `staff.id` (number)
    team member ID

  - `staff.seance_length` (number)
    The duration of the service (in multiples of 15 minutes)

## Response 201:

  - `201` (unknown)
    Created

## Response 201 fields (application/json):

  - `success` (boolean)
    Execution success status (true)

  - `data` (object)
    Object with data

  - `data.id` (number)
    Service ID

  - `data.salon_service_id` (number)
    Service ID for a location on the chain

  - `data.title` (string)
    Service name

  - `data.category_id` (number)
    Identifier of the category in which the service consists

  - `data.price_min` (number)
    Minimum price for the service

  - `data.price_max` (number)
    Maximum price for the service

  - `data.duration` (number)
    Service duration, default is 3600 seconds

  - `data.technical_break_duration` (any)
    Technical break duration in seconds.
- null = use location default (Settings → Appointment Log → Technical Breaks)
- Value in multiples of 300 (5-minute intervals)
- Maximum value is 3600 (1 hour)

  - `data.discount` (number)
    Discount

  - `data.comment` (string)
    Comment on the service

  - `data.weight` (number)
    Service weight (used to sort categories when displayed)

  - `data.active` (number)
    1 - available for online booking, 0 - not available

  - `data.api_id` (string)
    External Service ID

  - `data.staff` (array)
    List of team members providing the service and session duration

  - `data.staff.id` (number)
    team member ID

  - `data.staff.seance_length` (number)
    Service duration (multiple of 15 minutes)

  - `meta` (array)
    Metadata (empty array)

## Response 401:

  - `401` (unknown)
    Unauthorized

## Response 401 fields (application/json):

  - `success` (boolean)
    Response status.
    Example: false

  - `data` (object | null)
    Response data.
    Example: null

  - `meta` (object)
    Additional response data.

  - `meta.message` (string)
    Error message.
    Example: Authentication needed.

## Response 403:

  - `403` (unknown)
    Forbidden

## Response 403 fields (application/json):

  - `success` (boolean)
    Response status.
    Example: false

  - `data` (object | null)
    Response data.
    Example: null

  - `meta` (object)
    Additional response data.

  - `meta.message` (string)
    Error message.
    Example: Access denied.

## Response 404:

  - `404` (unknown)
    Not Found

## Response 404 fields (application/json):

  - `success` (boolean)
    Response status.
    Example: false

  - `data` (object | null)
    Response data.
    Example: null

  - `meta` (object | array)
    Additional response data (empty object or empty array)
    Example: {}

