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

# Storerocket API reference

> API reference for the Storerocket plugin in Corsair: every `storerocket.api.*` operation with its input and output types, taken from the plugin's Zod schemas.

> [!NOTE]
>
> **New to Corsair?** See [API access](https://docs.corsair.dev/concepts/api.md), [authentication](https://docs.corsair.dev/concepts/auth.md), and [error handling](https://docs.corsair.dev/concepts/error-handling).

## Locations

### create

`locations.create`

Create a location; name and city are required

**Risk:** `write`

```ts theme={null}
await corsair.storerocket.api.locations.create({
	projectId: 'PROJECT_ID',
	name: 'Downtown Store',
	city: 'Seattle',
	phone: '555-0101',
	lat: 47.6062,
	lng: -122.3321,
});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `projectId` | `string` | Yes | — |
| `name` | `string` | Yes | — |
| `city` | `string` | Yes | — |
| `slug` | `string` | No | Location slug. |
| `address` | `string \| null` | No | — |
| `address_line_1` | `string \| null` | No | — |
| `address_line_2` | `string \| null` | No | — |
| `display_address` | `string \| null` | No | — |
| `state` | `string \| null` | No | — |
| `postcode` | `string \| null` | No | — |
| `country` | `string \| null` | No | — |
| `lat` | `number \| null` | No | — |
| `lng` | `number \| null` | No | — |
| `phone` | `string \| null` | No | — |
| `email` | `string \| null` | No | — |
| `url` | `string \| null` | No | — |
| `timezone` | `string \| null` | No | — |
| `location_type` | `string \| null` | No | Name of a location type in the project; null restores the default. |
| `marker_id` | `number \| null` | No | Integer ID of a marker in the project; null restores the default. |
| `cover` | `string \| null` | No | Image URL or the project stored image name; null clears the cover. |
| `visible` | `boolean` | No | — |
| `hours` | `object \| null` | No | — |
| `filters` | `string[] \| null` | No | Filter names; replaces the list, \[] or null clears it. |
| `fields` | `Record<string, any> \| null` | No | Named custom fields, such as \{"Manager":"Sam"}; a null value removes the attachment. |
| `callsToAction` | `Record<string, any> \| null` | No | Named calls to action, such as \{"Book":"[https://example.com/book"\&#125](https://example.com/book"\&#125);; a null value removes the attachment. |
| `facebook` | `string \| null` | No | — |
| `instagram` | `string \| null` | No | — |
| `twitter` | `string \| null` | No | — |
| `yelp` | `string \| null` | No | — |
| `youtube` | `string \| null` | No | — |
| `tiktok` | `string \| null` | No | — |

Name and city are required. Omit hours or send hours: \{} for a coming-soon location; a nonempty hours object must include all seven days. Sending both coordinates avoids depending on the geocoder; check the geocoding object in the response, whose status says whether the address was found, only roughly matched, not found, or queued.

> [accordion] hours full type
>
> ```ts theme={null}
> {
>   name?: string,
>   mon?: string | null,
>   tue?: string | null,
>   wed?: string | null,
>   thu?: string | null,
>   fri?: string | null,
>   sat?: string | null,
>   sun?: string | null,
>   monday?: string | null,
>   tuesday?: string | null,
>   wednesday?: string | null,
>   thursday?: string | null,
>   friday?: string | null,
>   saturday?: string | null,
>   sunday?: string | null
> } | null
> ```

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `data` | `object` | Yes | — |
| `geocoding` | `object \| null` | No | — |

> [accordion] data full type
>
> ```ts theme={null}
> {
>   id: string,
>   name?: string | null,
>   slug?: string | null,
>   visible?: boolean | null,
>   address?: string | null,
>   address_line_1?: string | null,
>   address_line_2?: string | null,
>   display_address?: string | null,
>   city?: string | null,
>   state?: string | null,
>   postcode?: string | null,
>   country?: string | null,
>   lat?: number | null,
>   lng?: number | null,
>   phone?: string | null,
>   email?: string | null,
>   url?: string | null,
>   timezone?: string | null,
>   location_type?: string | null,
>   marker_id?: number | null,
>   marker_url?: string | null,
>   cover_image_url?: string | null,
>   hours?: {
>     name?: string | null,
>     mon?: string | null,
>     tue?: string | null,
>     wed?: string | null,
>     thu?: string | null,
>     fri?: string | null,
>     sat?: string | null,
>     sun?: string | null
>   } | null,
>   filters?: any[] | null,
>   fields?: {
>     id?: string | null,
>     name?: string | null,
>     value?: any | null
>   }[] | null,
>   callsToAction?: {
>     id?: string | null,
>     title?: string | null,
>     value?: string | null
>   }[] | null,
>   facebook?: string | null,
>   instagram?: string | null,
>   twitter?: string | null,
>   yelp?: string | null,
>   youtube?: string | null,
>   tiktok?: string | null,
>   socials?: {
>     key?: string | null,
>     label?: string | null,
>     handle?: string | null,
>     url?: string | null,
>     icon?: string | null
>   }[] | null,
>   special_hours?: {
>     window?: {
>       from?: string | null,
>       to?: string | null
>     } | null,
>     dates?: {
>       name?: string | null,
>       start_date?: string | null,
>       end_date?: string | null,
>       hours?: closed | regular | open_24_hours | string | {
>         opens?: string | null,
>         closes?: string | null
>       }[] | null,
>       note?: string | null
>     }[] | null
>   } | null
> }
> ```

> [accordion] geocoding full type
>
> ```ts theme={null}
> {
>   status: found | approximate | not_found | unavailable | queued | string,
>   match?: address | road | place | postcode | city | region | country | string | null
> } | null
> ```

***

### delete

`locations.delete`

Delete a location from a project

**Risk:** `destructive` · **Irreversible**

```ts theme={null}
await corsair.storerocket.api.locations.delete({ projectId: 'PROJECT_ID', locationId: 'LOCATION_ID' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `projectId` | `string` | Yes | — |
| `locationId` | `string` | Yes | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `success` | `true` | Yes | — |

***

### get

`locations.get`

Read one location and its optional attached information

**Risk:** `read`

```ts theme={null}
await corsair.storerocket.api.locations.get({ projectId: 'PROJECT_ID', locationId: 'LOCATION_ID' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `projectId` | `string` | Yes | — |
| `locationId` | `string` | Yes | — |
| `includeHours` | `boolean` | No | — |
| `includeSpecialHours` | `boolean` | No | — |
| `includeFilters` | `boolean` | No | — |
| `includeFields` | `boolean` | No | — |
| `includeCallsToAction` | `boolean` | No | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `data` | `object` | Yes | — |

> [accordion] data full type
>
> ```ts theme={null}
> {
>   id: string,
>   name?: string | null,
>   slug?: string | null,
>   visible?: boolean | null,
>   address?: string | null,
>   address_line_1?: string | null,
>   address_line_2?: string | null,
>   display_address?: string | null,
>   city?: string | null,
>   state?: string | null,
>   postcode?: string | null,
>   country?: string | null,
>   lat?: number | null,
>   lng?: number | null,
>   phone?: string | null,
>   email?: string | null,
>   url?: string | null,
>   timezone?: string | null,
>   location_type?: string | null,
>   marker_id?: number | null,
>   marker_url?: string | null,
>   cover_image_url?: string | null,
>   hours?: {
>     name?: string | null,
>     mon?: string | null,
>     tue?: string | null,
>     wed?: string | null,
>     thu?: string | null,
>     fri?: string | null,
>     sat?: string | null,
>     sun?: string | null
>   } | null,
>   filters?: any[] | null,
>   fields?: {
>     id?: string | null,
>     name?: string | null,
>     value?: any | null
>   }[] | null,
>   callsToAction?: {
>     id?: string | null,
>     title?: string | null,
>     value?: string | null
>   }[] | null,
>   facebook?: string | null,
>   instagram?: string | null,
>   twitter?: string | null,
>   yelp?: string | null,
>   youtube?: string | null,
>   tiktok?: string | null,
>   socials?: {
>     key?: string | null,
>     label?: string | null,
>     handle?: string | null,
>     url?: string | null,
>     icon?: string | null
>   }[] | null,
>   special_hours?: {
>     window?: {
>       from?: string | null,
>       to?: string | null
>     } | null,
>     dates?: {
>       name?: string | null,
>       start_date?: string | null,
>       end_date?: string | null,
>       hours?: closed | regular | open_24_hours | string | {
>         opens?: string | null,
>         closes?: string | null
>       }[] | null,
>       note?: string | null
>     }[] | null
>   } | null
> }
> ```

***

### list

`locations.list`

List locations with filters, include flags and pagination

**Risk:** `read`

```ts theme={null}
await corsair.storerocket.api.locations.list({ projectId: "PROJECT_ID", limit: 25, includeHours: true, filters: [{ field: "city", op: "eq", value: "Seattle" }] });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `projectId` | `string` | Yes | — |
| `page` | `number` | No | — |
| `limit` | `number` | No | Page size from 1 to 100; the API defaults to 15. |
| `includeHours` | `boolean` | No | — |
| `includeSpecialHours` | `boolean` | No | — |
| `includeFilters` | `boolean` | No | — |
| `includeFields` | `boolean` | No | — |
| `includeCallsToAction` | `boolean` | No | — |
| `filters` | `object[]` | No | — |

> [accordion] filters full type
>
> ```ts theme={null}
> {
>   field: name | address | city | state | country | postalCode,
>   op: eq | ne | like,
>   value: string
> }[]
> ```

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `data` | `object[]` | Yes | — |
| `links` | `object \| null` | No | — |
| `meta` | `object \| null` | No | — |

> [accordion] data full type
>
> ```ts theme={null}
> {
>   id: string,
>   name?: string | null,
>   slug?: string | null,
>   visible?: boolean | null,
>   address?: string | null,
>   address_line_1?: string | null,
>   address_line_2?: string | null,
>   display_address?: string | null,
>   city?: string | null,
>   state?: string | null,
>   postcode?: string | null,
>   country?: string | null,
>   lat?: number | null,
>   lng?: number | null,
>   phone?: string | null,
>   email?: string | null,
>   url?: string | null,
>   timezone?: string | null,
>   location_type?: string | null,
>   marker_id?: number | null,
>   marker_url?: string | null,
>   cover_image_url?: string | null,
>   hours?: {
>     name?: string | null,
>     mon?: string | null,
>     tue?: string | null,
>     wed?: string | null,
>     thu?: string | null,
>     fri?: string | null,
>     sat?: string | null,
>     sun?: string | null
>   } | null,
>   filters?: any[] | null,
>   fields?: {
>     id?: string | null,
>     name?: string | null,
>     value?: any | null
>   }[] | null,
>   callsToAction?: {
>     id?: string | null,
>     title?: string | null,
>     value?: string | null
>   }[] | null,
>   facebook?: string | null,
>   instagram?: string | null,
>   twitter?: string | null,
>   yelp?: string | null,
>   youtube?: string | null,
>   tiktok?: string | null,
>   socials?: {
>     key?: string | null,
>     label?: string | null,
>     handle?: string | null,
>     url?: string | null,
>     icon?: string | null
>   }[] | null,
>   special_hours?: {
>     window?: {
>       from?: string | null,
>       to?: string | null
>     } | null,
>     dates?: {
>       name?: string | null,
>       start_date?: string | null,
>       end_date?: string | null,
>       hours?: closed | regular | open_24_hours | string | {
>         opens?: string | null,
>         closes?: string | null
>       }[] | null,
>       note?: string | null
>     }[] | null
>   } | null
> }[]
> ```

> [accordion] links full type
>
> ```ts theme={null}
> {
>   first?: string | null,
>   last?: string | null,
>   prev?: string | null,
>   next?: string | null
> } | null
> ```

> [accordion] meta full type
>
> ```ts theme={null}
> {
>   current_page?: number | null,
>   from?: number | null,
>   last_page?: number | null,
>   path?: string | null,
>   per_page?: number | null,
>   to?: number | null,
>   total?: number | null
> } | null
> ```

***

### replace

`locations.replace`

Replace a location with the PUT contract; omitted markers and types reset to defaults

**Risk:** `write`

```ts theme={null}
await corsair.storerocket.api.locations.replace({
	projectId: 'PROJECT_ID',
	locationId: 'LOCATION_ID',
	name: 'Downtown Store',
	city: 'Seattle',
});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `projectId` | `string` | Yes | — |
| `locationId` | `string` | Yes | — |
| `name` | `string` | Yes | — |
| `city` | `string` | Yes | — |
| `slug` | `string` | No | Location slug. |
| `address` | `string \| null` | No | — |
| `address_line_1` | `string \| null` | No | — |
| `address_line_2` | `string \| null` | No | — |
| `display_address` | `string \| null` | No | — |
| `state` | `string \| null` | No | — |
| `postcode` | `string \| null` | No | — |
| `country` | `string \| null` | No | — |
| `lat` | `number \| null` | No | — |
| `lng` | `number \| null` | No | — |
| `phone` | `string \| null` | No | — |
| `email` | `string \| null` | No | — |
| `url` | `string \| null` | No | — |
| `timezone` | `string \| null` | No | — |
| `location_type` | `string \| null` | No | Name of a location type in the project; null restores the default. |
| `marker_id` | `number \| null` | No | Integer ID of a marker in the project; null restores the default. |
| `cover` | `string \| null` | No | Image URL or the project stored image name; null clears the cover. |
| `visible` | `boolean` | No | — |
| `hours` | `object \| null` | No | — |
| `filters` | `string[] \| null` | No | Filter names; replaces the list, \[] or null clears it. |
| `fields` | `Record<string, any> \| null` | No | Named custom fields, such as \{"Manager":"Sam"}; a null value removes the attachment. |
| `callsToAction` | `Record<string, any> \| null` | No | Named calls to action, such as \{"Book":"[https://example.com/book"\&#125](https://example.com/book"\&#125);; a null value removes the attachment. |
| `facebook` | `string \| null` | No | — |
| `instagram` | `string \| null` | No | — |
| `twitter` | `string \| null` | No | — |
| `yelp` | `string \| null` | No | — |
| `youtube` | `string \| null` | No | — |
| `tiktok` | `string \| null` | No | — |

PUT keeps the existing contract: supplied fields and callsToAction replace their attachments, omitted marker and type selections reset to project defaults, and a nonempty hours object replaces the whole week. Use PATCH when you want to preserve everything you leave out.

> [accordion] hours full type
>
> ```ts theme={null}
> {
>   name?: string,
>   mon?: string | null,
>   tue?: string | null,
>   wed?: string | null,
>   thu?: string | null,
>   fri?: string | null,
>   sat?: string | null,
>   sun?: string | null,
>   monday?: string | null,
>   tuesday?: string | null,
>   wednesday?: string | null,
>   thursday?: string | null,
>   friday?: string | null,
>   saturday?: string | null,
>   sunday?: string | null
> } | null
> ```

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `data` | `object` | Yes | — |
| `geocoding` | `object \| null` | No | — |

> [accordion] data full type
>
> ```ts theme={null}
> {
>   id: string,
>   name?: string | null,
>   slug?: string | null,
>   visible?: boolean | null,
>   address?: string | null,
>   address_line_1?: string | null,
>   address_line_2?: string | null,
>   display_address?: string | null,
>   city?: string | null,
>   state?: string | null,
>   postcode?: string | null,
>   country?: string | null,
>   lat?: number | null,
>   lng?: number | null,
>   phone?: string | null,
>   email?: string | null,
>   url?: string | null,
>   timezone?: string | null,
>   location_type?: string | null,
>   marker_id?: number | null,
>   marker_url?: string | null,
>   cover_image_url?: string | null,
>   hours?: {
>     name?: string | null,
>     mon?: string | null,
>     tue?: string | null,
>     wed?: string | null,
>     thu?: string | null,
>     fri?: string | null,
>     sat?: string | null,
>     sun?: string | null
>   } | null,
>   filters?: any[] | null,
>   fields?: {
>     id?: string | null,
>     name?: string | null,
>     value?: any | null
>   }[] | null,
>   callsToAction?: {
>     id?: string | null,
>     title?: string | null,
>     value?: string | null
>   }[] | null,
>   facebook?: string | null,
>   instagram?: string | null,
>   twitter?: string | null,
>   yelp?: string | null,
>   youtube?: string | null,
>   tiktok?: string | null,
>   socials?: {
>     key?: string | null,
>     label?: string | null,
>     handle?: string | null,
>     url?: string | null,
>     icon?: string | null
>   }[] | null,
>   special_hours?: {
>     window?: {
>       from?: string | null,
>       to?: string | null
>     } | null,
>     dates?: {
>       name?: string | null,
>       start_date?: string | null,
>       end_date?: string | null,
>       hours?: closed | regular | open_24_hours | string | {
>         opens?: string | null,
>         closes?: string | null
>       }[] | null,
>       note?: string | null
>     }[] | null
>   } | null
> }
> ```

> [accordion] geocoding full type
>
> ```ts theme={null}
> {
>   status: found | approximate | not_found | unavailable | queued | string,
>   match?: address | road | place | postcode | city | region | country | string | null
> } | null
> ```

***

### update

`locations.update`

Update selected location fields; omissions keep their saved values

**Risk:** `write`

```ts theme={null}
await corsair.storerocket.api.locations.update({ projectId: 'PROJECT_ID', locationId: 'LOCATION_ID', phone: '555-0101' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `projectId` | `string` | Yes | — |
| `locationId` | `string` | Yes | — |
| `name` | `string` | No | — |
| `city` | `string` | No | — |
| `slug` | `string` | No | Location slug. |
| `address` | `string \| null` | No | — |
| `address_line_1` | `string \| null` | No | — |
| `address_line_2` | `string \| null` | No | — |
| `display_address` | `string \| null` | No | — |
| `state` | `string \| null` | No | — |
| `postcode` | `string \| null` | No | — |
| `country` | `string \| null` | No | — |
| `lat` | `number \| null` | No | — |
| `lng` | `number \| null` | No | — |
| `phone` | `string \| null` | No | — |
| `email` | `string \| null` | No | — |
| `url` | `string \| null` | No | — |
| `timezone` | `string \| null` | No | — |
| `location_type` | `string \| null` | No | Name of a location type in the project; null restores the default. |
| `marker_id` | `number \| null` | No | Integer ID of a marker in the project; null restores the default. |
| `cover` | `string \| null` | No | Image URL or the project stored image name; null clears the cover. |
| `visible` | `boolean` | No | — |
| `hours` | `object \| null` | No | — |
| `filters` | `string[] \| null` | No | Filter names; replaces the list, \[] or null clears it. |
| `fields` | `Record<string, any> \| null` | No | Named custom fields, such as \{"Manager":"Sam"}; a null value removes the attachment. |
| `callsToAction` | `Record<string, any> \| null` | No | Named calls to action, such as \{"Book":"[https://example.com/book"\&#125](https://example.com/book"\&#125);; a null value removes the attachment. |
| `facebook` | `string \| null` | No | — |
| `instagram` | `string \| null` | No | — |
| `twitter` | `string \| null` | No | — |
| `yelp` | `string \| null` | No | — |
| `youtube` | `string \| null` | No | — |
| `tiktok` | `string \| null` | No | — |

PATCH keeps everything you leave out. Send null to clear a field, hours: null to remove the schedule, a null value in fields or callsToAction to remove that attachment, and marker\_id or location\_type null to restore the project default. Invalid input saves no part of the update.

> [accordion] hours full type
>
> ```ts theme={null}
> {
>   name?: string,
>   mon?: string | null,
>   tue?: string | null,
>   wed?: string | null,
>   thu?: string | null,
>   fri?: string | null,
>   sat?: string | null,
>   sun?: string | null,
>   monday?: string | null,
>   tuesday?: string | null,
>   wednesday?: string | null,
>   thursday?: string | null,
>   friday?: string | null,
>   saturday?: string | null,
>   sunday?: string | null
> } | null
> ```

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `data` | `object` | Yes | — |
| `geocoding` | `object \| null` | No | — |

> [accordion] data full type
>
> ```ts theme={null}
> {
>   id: string,
>   name?: string | null,
>   slug?: string | null,
>   visible?: boolean | null,
>   address?: string | null,
>   address_line_1?: string | null,
>   address_line_2?: string | null,
>   display_address?: string | null,
>   city?: string | null,
>   state?: string | null,
>   postcode?: string | null,
>   country?: string | null,
>   lat?: number | null,
>   lng?: number | null,
>   phone?: string | null,
>   email?: string | null,
>   url?: string | null,
>   timezone?: string | null,
>   location_type?: string | null,
>   marker_id?: number | null,
>   marker_url?: string | null,
>   cover_image_url?: string | null,
>   hours?: {
>     name?: string | null,
>     mon?: string | null,
>     tue?: string | null,
>     wed?: string | null,
>     thu?: string | null,
>     fri?: string | null,
>     sat?: string | null,
>     sun?: string | null
>   } | null,
>   filters?: any[] | null,
>   fields?: {
>     id?: string | null,
>     name?: string | null,
>     value?: any | null
>   }[] | null,
>   callsToAction?: {
>     id?: string | null,
>     title?: string | null,
>     value?: string | null
>   }[] | null,
>   facebook?: string | null,
>   instagram?: string | null,
>   twitter?: string | null,
>   yelp?: string | null,
>   youtube?: string | null,
>   tiktok?: string | null,
>   socials?: {
>     key?: string | null,
>     label?: string | null,
>     handle?: string | null,
>     url?: string | null,
>     icon?: string | null
>   }[] | null,
>   special_hours?: {
>     window?: {
>       from?: string | null,
>       to?: string | null
>     } | null,
>     dates?: {
>       name?: string | null,
>       start_date?: string | null,
>       end_date?: string | null,
>       hours?: closed | regular | open_24_hours | string | {
>         opens?: string | null,
>         closes?: string | null
>       }[] | null,
>       note?: string | null
>     }[] | null
>   } | null
> }
> ```

> [accordion] geocoding full type
>
> ```ts theme={null}
> {
>   status: found | approximate | not_found | unavailable | queued | string,
>   match?: address | road | place | postcode | city | region | country | string | null
> } | null
> ```

***

## Projects

### list

`projects.list`

List the projects the token can access

**Risk:** `read`

```ts theme={null}
await corsair.storerocket.api.projects.list({});
```

**Input:** *empty object*

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `data` | `object[]` | Yes | — |

> [accordion] data full type
>
> ```ts theme={null}
> {
>   id: string,
>   name?: string | null,
>   locations?: number | null,
>   status?: string | null,
>   plan?: string | null
> }[]
> ```

***

## Special Hours

### create

`specialHours.create`

Create a special-hours rule, with an optional idempotency key

**Risk:** `write`

```ts theme={null}
await corsair.storerocket.api.specialHours.create({ projectId: "PROJECT_ID", name: "Thanksgiving", holiday_key: "US:thanksgiving-day", start_date: "2026-11-26", hours: "closed", repeats_yearly: true, applies_to: { type: "countries", values: ["US"] }, idempotencyKey: "thanksgiving-2026-us" });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `projectId` | `string` | Yes | — |
| `name` | `string` | Yes | — |
| `start_date` | `string` | Yes | — |
| `end_date` | `string` | No | — |
| `until_further_notice` | `boolean` | No | — |
| `hours` | `closed \| regular \| open_24_hours \| object[]` | Yes | — |
| `repeats_yearly` | `boolean` | No | — |
| `holiday_key` | `string` | No | Stable holiday identifier such as US:thanksgiving-day; needed for repeats\_yearly. |
| `holiday_region` | `string` | No | Where a repeating holiday date is read, e.g. AU-QLD. |
| `note` | `string \| null` | No | — |
| `applies_to` | `object` | Yes | — |
| `idempotencyKey` | `string` | No | Sent as the Idempotency-Key header; the same key with the same body replays the first answer. |

Requires name, start\_date, hours and applies\_to; a missing end\_date means the same day, and until\_further\_notice takes no end\_date. The hours value is "closed", "regular", "open\_24\_hours", or up to six \{opens, closes} ranges. repeats\_yearly needs a yearly holiday\_key on a single day. The same Idempotency-Key with the same body replays the first answer; with a different body it answers 409.

> [accordion] hours full type
>
> ```ts theme={null}
> closed | regular | open_24_hours | {
>   opens: string,
>   closes: string
> }[]
> ```

> [accordion] applies\_to full type
>
> ```ts theme={null}
> {
>   type: all | countries | regions | filters | locations,
>   values?: string[]
> }
> ```

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `data` | `object` | Yes | — |

> [accordion] data full type
>
> ```ts theme={null}
> {
>   id: string,
>   name?: string | null,
>   holiday_key?: string | null,
>   holiday_region?: string | null,
>   start_date?: string | null,
>   end_date?: string | null,
>   until_further_notice?: boolean | null,
>   hours?: closed | regular | open_24_hours | string | {
>     opens?: string | null,
>     closes?: string | null
>   }[] | null,
>   repeats_yearly?: boolean | null,
>   note?: string | null,
>   applies_to?: {
>     type: all | countries | regions | filters | locations | string,
>     values?: string[] | null
>   } | null,
>   source?: string | null,
>   created_at?: string | null,
>   updated_at?: string | null
> }
> ```

***

### delete

`specialHours.delete`

Delete a special-hours rule; locations fall back to weekly hours

**Risk:** `destructive` · **Irreversible**

```ts theme={null}
await corsair.storerocket.api.specialHours.delete({ projectId: 'PROJECT_ID', ruleId: 'k4ZqP0mE7d' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `projectId` | `string` | Yes | — |
| `ruleId` | `string` | Yes | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string` | Yes | — |
| `success` | `true` | Yes | — |

***

### get

`specialHours.get`

Read one special-hours rule

**Risk:** `read`

```ts theme={null}
await corsair.storerocket.api.specialHours.get({ projectId: 'PROJECT_ID', ruleId: 'k4ZqP0mE7d' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `projectId` | `string` | Yes | — |
| `ruleId` | `string` | Yes | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `data` | `object` | Yes | — |

> [accordion] data full type
>
> ```ts theme={null}
> {
>   id: string,
>   name?: string | null,
>   holiday_key?: string | null,
>   holiday_region?: string | null,
>   start_date?: string | null,
>   end_date?: string | null,
>   until_further_notice?: boolean | null,
>   hours?: closed | regular | open_24_hours | string | {
>     opens?: string | null,
>     closes?: string | null
>   }[] | null,
>   repeats_yearly?: boolean | null,
>   note?: string | null,
>   applies_to?: {
>     type: all | countries | regions | filters | locations | string,
>     values?: string[] | null
>   } | null,
>   source?: string | null,
>   created_at?: string | null,
>   updated_at?: string | null
> }
> ```

***

### list

`specialHours.list`

List the holiday and special-hours rules of a project

**Risk:** `read`

```ts theme={null}
await corsair.storerocket.api.specialHours.list({ projectId: 'PROJECT_ID' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `projectId` | `string` | Yes | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `data` | `object[]` | Yes | — |

> [accordion] data full type
>
> ```ts theme={null}
> {
>   id: string,
>   name?: string | null,
>   holiday_key?: string | null,
>   holiday_region?: string | null,
>   start_date?: string | null,
>   end_date?: string | null,
>   until_further_notice?: boolean | null,
>   hours?: closed | regular | open_24_hours | string | {
>     opens?: string | null,
>     closes?: string | null
>   }[] | null,
>   repeats_yearly?: boolean | null,
>   note?: string | null,
>   applies_to?: {
>     type: all | countries | regions | filters | locations | string,
>     values?: string[] | null
>   } | null,
>   source?: string | null,
>   created_at?: string | null,
>   updated_at?: string | null
> }[]
> ```

***

### update

`specialHours.update`

Change selected fields of a special-hours rule

**Risk:** `write`

```ts theme={null}
await corsair.storerocket.api.specialHours.update({ projectId: 'PROJECT_ID', ruleId: 'k4ZqP0mE7d', note: 'Visitor centre closed for renovation' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `projectId` | `string` | Yes | — |
| `ruleId` | `string` | Yes | — |
| `name` | `string` | No | — |
| `start_date` | `string` | No | — |
| `end_date` | `string \| null` | No | — |
| `until_further_notice` | `boolean` | No | — |
| `hours` | `closed \| regular \| open_24_hours \| object[]` | No | — |
| `repeats_yearly` | `boolean` | No | — |
| `holiday_key` | `string \| null` | No | — |
| `holiday_region` | `string \| null` | No | — |
| `note` | `string \| null` | No | — |
| `applies_to` | `object` | No | — |
| `idempotencyKey` | `string` | No | — |

> [accordion] hours full type
>
> ```ts theme={null}
> closed | regular | open_24_hours | {
>   opens: string,
>   closes: string
> }[]
> ```

> [accordion] applies\_to full type
>
> ```ts theme={null}
> {
>   type: all | countries | regions | filters | locations,
>   values?: string[]
> }
> ```

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `data` | `object` | Yes | — |

> [accordion] data full type
>
> ```ts theme={null}
> {
>   id: string,
>   name?: string | null,
>   holiday_key?: string | null,
>   holiday_region?: string | null,
>   start_date?: string | null,
>   end_date?: string | null,
>   until_further_notice?: boolean | null,
>   hours?: closed | regular | open_24_hours | string | {
>     opens?: string | null,
>     closes?: string | null
>   }[] | null,
>   repeats_yearly?: boolean | null,
>   note?: string | null,
>   applies_to?: {
>     type: all | countries | regions | filters | locations | string,
>     values?: string[] | null
>   } | null,
>   source?: string | null,
>   created_at?: string | null,
>   updated_at?: string | null
> }
> ```

***

## Users

### get

`users.get`

Read the profile associated with the token

**Risk:** `read`

```ts theme={null}
await corsair.storerocket.api.users.get({});
```

**Input:** *empty object*

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `data` | `object` | Yes | — |

> [accordion] data full type
>
> ```ts theme={null}
> {
>   id: string,
>   name?: string | null,
>   email?: string | null,
>   company?: string | null,
>   profile_photo_url?: string | null
> }
> ```

***


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