> For the complete documentation index, see [llms.txt](https://galmis.gitbook.io/serializer-product-tracking/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://galmis.gitbook.io/serializer-product-tracking/getting-started/sharing-and-integration/development-api-reference/app-proxy-rest-api.md).

# App Proxy REST API

The app provides a secure REST API to the internal items' data via Shopify's [app proxy](https://shopify.dev/apps/online-store/app-proxies) **/apps/serializer/items** endpoint using **HTTP GET** method.&#x20;

The endpoint accepts the following API query filters:

| Filter name          | Type    | Description                                                                                                                                        |
| -------------------- | ------- | -------------------------------------------------------------------------------------------------------------------------------------------------- |
| **orderId**          | Integer | Shopify's numeric order ID.                                                                                                                        |
| **customerId**       | Integer | Shopify's numeric customer ID.                                                                                                                     |
| **productVariantId** | Integer | Shopify's numeric product variant ID.                                                                                                              |
| **lineItemId**       | Integer | Shopify's numeric line item ID.                                                                                                                    |
| **serialNumber**     | String  | Manually entered serial number.                                                                                                                    |
| **itemId**           | String  | Globally unique item ID generated by the app.                                                                                                      |
| **itemRef**          | String  | It filters results by serialNumber or itemId. The filter may be helpful when the store uses both serialNumber and itemId fields as serial numbers. |
| **cursor**           | String  | Results are limited to 100 items per request. The filter provides a capability to paginate through the results.                                    |

{% hint style="info" %}
The API endpoint requires at least one of the following filters to be used: **orderId**, **customerId**, **serialNumber**, **itemId** or **itemRef**. For example, `GET /apps/serializer/items?orderId=4460047270069`.
{% endhint %}

The endpoint response contains the following JSON data:

| Field name      | Type           | Description                                               |
| --------------- | -------------- | --------------------------------------------------------- |
| **previous**    | String         | Cursor to the previous page                               |
| **hasPrevious** | Boolean        | It highlights whether the previous page exists            |
| **next**        | String         | Cursor to the next page                                   |
| **hasNext**     | String         | It highlights whether the next page exists                |
| **results**     | Array of items | See the table below for the information about item fields |

Item fields:

| Field name           | Type                                                                                                                                                                                                                                                                             | Description                                                                      |
| -------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- |
| **lineItemId**       | Integer                                                                                                                                                                                                                                                                          | Shopify's numeric line item ID                                                   |
| **productVariantId** | Integer                                                                                                                                                                                                                                                                          | Shopify's numeric customer ID                                                    |
| **itemId**           | String                                                                                                                                                                                                                                                                           | Globally unique item ID generated by the app. It can be used as a serial number. |
| **serialNumber**     | String or undefined (not populated)                                                                                                                                                                                                                                              | Manually entered serial number                                                   |
| **warrantyDuration** | <p>Undefined (not populated), null or JSON object containing the following fields:<br></p><ul><li><strong>unit</strong> - string. Possible values are "day", "month" or "year".</li><li><strong>value</strong> - integer, the minimum value is 1.</li></ul>                      | Warranty duration for the item                                                   |
| **customFields**     | <p>Undefined (not populated for the saved items before the "Custom fields" feature release) or an array of JSON objects containing the following fields:<br></p><ul><li>key - string. Max length - 30 characters.</li><li>value - string. Max length - 200 characters.</li></ul> | It contains a list of all custom field values and keys associated with the item  |
| **orderId**          | Integer                                                                                                                                                                                                                                                                          | Shopify's numeric order ID                                                       |
| **createdAt**        | UTC timestamp in ISO-8601 format, string representation                                                                                                                                                                                                                          | Date and time when the item was first saved in the app's database                |
| **updatedAt**        | UTC timestamp in ISO-8601 format, string representation                                                                                                                                                                                                                          | Date and time the item was last updated in the app's database                    |
