> For the complete documentation index, see [llms.txt](https://docs.mews.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.mews.com/pos-api/guidelines/requests.md).

# Requests

The **Mews POS API** is [REST-based](https://en.wikipedia.org/wiki/REST) and follows the [JSON:API](https://jsonapi.org/) specification for formatting HTTP requests and responses. All requests must include the `Content-Type` header set to the JSON:API media type `application/vnd.api+json`.

## JSON:API

[JSON:API](https://jsonapi.org/) is a widely-used specification for structuring API requests and responses. Understanding this format will help you effectively interact with the **Mews POS API**.

### Key features supported

* **Relationships** – Link resources together. [Learn more about relationships](https://docs.mews.com/pos-api/guidelines/relationships.md).
* **Filtering** – Narrow down results based on selected criteria. [Learn more about filtering](https://docs.mews.com/pos-api/guidelines/filtering.md).
* **Sparse Fieldsets** – Retrieve only the fields you need. [Learn more about sparse fieldsets](https://docs.mews.com/pos-api/guidelines/sparse-fieldsets.md).

For more tools and resources:

* **Client Libraries** – Use libraries from the [JSON:API Implementations](https://jsonapi.org/implementations/) list to streamline development.
* **Media Type** – Ensure that requests use the media type `application/vnd.api+json`.

## Address pattern

All operations in the **Mews POS API** follow a consistent URL structure:

```
[PlatformAddress]/v1/[Resource]/{id}
```

* **PlatformAddress** – The base address of the API (varies by environment: test, demo, production).
* **Resource** – The pluralized name of the target resource (e.g. bills, reservations).
* **id** – Unique identifier of the Resource, used only when referencing a specific Resource.

Example:

```http
https://api.mews.com/pos/v1/invoice-items/31b14937-2524-491f-b0a0-dc0a7393ff3f
```

## Query parameters

The **Mews POS API** supports query parameters for [Relationships](https://docs.mews.com/pos-api/guidelines/relationships.md), [Filtering](https://docs.mews.com/pos-api/guidelines/filtering.md) and [Sparse fieldsets](https://docs.mews.com/pos-api/guidelines/sparse-fieldsets.md).

Example:

```http
https://api.mews.com/pos/v1/invoices?filter[createdAtGt]=2024-07-25T16%3A29%3A35%2B00%3A00
```

## Request body

Each request will include a header with authentication information, and a body with any data needed to perform the operation, formatted as per [JSON:API](https://jsonapi.org/). 'Get' operations, such as [Get invoices](https://github.com/MewsSystems/poc-open-api-docs/blob/main/pos-api/operations/invoices.md#get-invoices), use the `GET` http verb and therefore do not have any data in the request body.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.mews.com/pos-api/guidelines/requests.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
