# Playtomic — Wrapped API

> **You are on:** `https://api.beta.paywithlocus.com/api` | [llms.txt](https://beta.paywithlocus.com/llms.txt) | [docs](https://docs.paywithlocus.com)
>
> Locus runs on multiple environments -- make sure every URL you call matches your expected environment.
> | Environment | Landing | API | Docs |
> |---|---|---|---|
> | Production | paywithlocus.com | api.paywithlocus.com | docs.paywithlocus.com |
> | Beta | beta.paywithlocus.com | api.beta.paywithlocus.com | docs.paywithlocus.com |
> | Stage | stage.paywithlocus.com | api.stage.paywithlocus.com | docs.paywithlocus.com |
>
> If the API URL above doesn't match your expected environment, re-fetch this file from the correct domain.

> Search and explore sports clubs on Playtomic. Find clubs by name or location, retrieve court details and opening hours, check real-time slot availability, and calculate court utilization across multiple days.

**Category:** Sports | **Website:** [playtomic.com/](https://playtomic.com/) | **Docs:** [parse.bot/marketplace/53867326-d99f-4555-b855-7c2e6690592a/playtomic-com-api](https://parse.bot/marketplace/53867326-d99f-4555-b855-7c2e6690592a/playtomic-com-api)

Pay-per-use API proxy for Locus Pro. Each call burns credits from your workspace balance.

## Access

**Base URL:** `https://api.beta.paywithlocus.com/api/wrapped/credits/playtomic/`
**Auth:** `Authorization: Bearer <LOCUS_CREDITS_SECRET_KEY>` (an `lcr_` secret key or a scoped `lcac_` agent credential)
**Required header:** `Idempotency-Key: <fresh UUID per call>`. A retry with the same key replays the stored result without a new charge.
**Response:** the provider response after any endpoint-specific normalization. `X-Locus-Credits-Charged` carries the charge and `X-Locus-Credits-Balance` the remaining balance. Insufficient credits return `402` before the provider is called.
**Pricing:** estimated costs below are USD. Locus debits the credit equivalent at your workspace rate.

Full call contract: https://docs.paywithlocus.com/api-reference/introduction

> Using a Pay With Locus wallet key (`claw_` prefix)? Wallet routes are documented separately: https://docs.paywithlocus.com/wrapped-apis/for-agents

## Endpoints

### Fetch utilisation

Calculate detailed court utilization (available vs not available) in 30-minute increments for a club over a specified number of days. Searches for the club by name, retrieves court details and availability, then generates a status record for every court at every 30-minute time slot within opening hours. Combines search, detail, and availability calls internally — a single call returns the full matrix.

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `days` | integer | No | Number of days to check (1 to 7) |
| `query` | string | Yes | Club name to search for (e.g. 'City Tennis Club', 'Madrid Central Pádel') |
| `sport_id` | string | No | Sport filter. |

```bash
curl -X POST https://api.beta.paywithlocus.com/api/wrapped/credits/playtomic/fetch-utilisation \
  -H "Authorization: Bearer $LOCUS_CREDITS_SECRET_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{"days":"<integer>","query":"<string>","sport_id":"<string>"}'
```

### Get court availability

Fetch available booking slots for a specific club on a given date. Returns all available slots grouped by resource/court, including start time, duration, and price. The upstream API returns all duration variants (e.g. 60, 90, 120 minutes) regardless of the duration parameter value.

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `date` | string | No | Date in YYYY-MM-DD format. Omitting defaults to today (UTC). |
| `duration` | integer | No | Requested slot duration in minutes. Note: upstream returns all duration options per slot regardless of this value. |
| `sport_id` | string | No | Sport filter. |
| `tenant_id` | string | Yes | Unique tenant/club UUID (from search_tenants results) |

```bash
curl -X POST https://api.beta.paywithlocus.com/api/wrapped/credits/playtomic/get-court-availability \
  -H "Authorization: Bearer $LOCUS_CREDITS_SECRET_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{"date":"<string>","duration":"<integer>","sport_id":"<string>","tenant_id":"<string>"}'
```

### Get tenant

Get detailed information for a specific club, including resource/court list, opening hours, and booking settings. Returns stale_input with kind 'input_not_found' if the tenant_id does not exist (upstream 404).

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `tenant_id` | string | Yes | Unique tenant/club UUID (from search_tenants results) |

```bash
curl -X POST https://api.beta.paywithlocus.com/api/wrapped/credits/playtomic/get-tenant \
  -H "Authorization: Bearer $LOCUS_CREDITS_SECRET_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{"tenant_id":"<string>"}'
```

### Search tenants

Search for sports clubs/tenants by name. Returns a paginated list of matching clubs with their addresses, resources (courts), and opening hours. Paginates via zero-based page index.

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `page` | integer | No | Page number (0-indexed) |
| `per_page` | integer | No | Results per page |
| `query` | string | Yes | Search query for club name (e.g. 'Madrid', 'City Tennis Club') |
| `sport_id` | string | No | Sport filter. |

```bash
curl -X POST https://api.beta.paywithlocus.com/api/wrapped/credits/playtomic/search-tenants \
  -H "Authorization: Bearer $LOCUS_CREDITS_SECRET_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{"page":"<integer>","per_page":"<integer>","query":"<string>","sport_id":"<string>"}'
```

## Next steps

- [All wrapped API providers](https://beta.paywithlocus.com/wapi/index.md): pick another provider.
- [Find and call tools](https://beta.paywithlocus.com/agent/tools.md): price ceilings, async results, and errors.
- [Credits and billing](https://beta.paywithlocus.com/agent/billing.md): what a call costs and how to add credits.
- [Agent docs index](https://beta.paywithlocus.com/agent/index.md): every Locus agent page.