> ## Documentation Index
> Fetch the complete documentation index at: https://developers.lightyshare.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Options and services

> Manage listings, options, unavailabilities and services

## Listings

* `GET /products?page=1&perPage=50&archived=false`
* `POST /products/{id}/archive`, `restore`, `publish`, `unpublish`
* `GET /products/{id}/unavailabilities`
* `POST /products/{id}/unavailabilities`, `DELETE /unavailabilities/{id}`

Create an unavailability with `{"startAt": "2027-03-01T00:00:00+01:00", "endAt": "2027-03-03T00:00:00+01:00", "quantity": 1}`. It answers `201`, or `422 invalid_unavailability`.

## Options

An option is a listing rented with another one.

```bash theme={null}
curl -X POST -H "Authorization: Bearer YOUR_TOKEN" -H "Content-Type: application/json" \
  -d '{"product": {"title": "Extra battery", "rent": 12, "cost": 100, "quantity": 2}}' \
  https://www.lightyshare.com/api/token-secured/options
```

* `GET /options`, `PUT /options/{id}`
* `PUT /products/{id}/options` with `{"optionIds": [1, 2]}` replaces the options of a listing

## Services

```bash theme={null}
curl -X POST -H "Authorization: Bearer YOUR_TOKEN" -H "Content-Type: application/json" \
  -d '{"name": "Loading help", "description": "On site, on departure day", "computeType": "fixed", "basePrice": 30, "validated": true}' \
  https://www.lightyshare.com/api/token-secured/services
```

`computeType`: `fixed`, `unit`, `hourly`, `daily`, `per_distance`. It cannot change once set. The free plan limits the number of services.

* `GET /services`, `PUT /services/{id}`
* `POST /services/{id}/archive`, `restore`, `toggle`


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.