> For the complete documentation index, see [llms.txt](https://doc.wearepatchworks.com/product-documentation/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://doc.wearepatchworks.com/product-documentation/connectors-and-instances/patchworks-connectors/swan-retail-system-prebuilt-connector/swan-retail-system-pagination-update-timestamp-response-script.md).

# Swan Retail System - pagination update timestamp response script

## Introduction

[Where required](#paginated-endpoints), **Swan Retail System** endpoints are paginated based on the `amended date` for items, so subsequent queries start from the `amended date` of the last item returned.

For this to work as required, we use a [response script](/product-documentation/process-flows/building-process-flows/process-flow-shapes/standard-shapes/connector-shape/using-connector-shape-response-scripts.md) to add `5 milliseconds` to the time stamp for last items. To implement this you must:

* Install the `Swan Pagination Update Timestamp` response script from the Patchworks marketplace.
* Apply this script to any process flow connector shapes where the **Swan Retail System** connector is used with a [paginated endpoint](#paginated-endpoints).

{% hint style="info" %}
For more information about how response scripts work, please see our [Using connector shape response scripts](/product-documentation/process-flows/building-process-flows/process-flow-shapes/standard-shapes/connector-shape/using-connector-shape-response-scripts.md) page.
{% endhint %}

## Paginated endpoints

Having installed the **Swan Retail System** connector from the Patchworks marketplace, you'll find that two endpoints are configured for pagination:

* `Get web updates`
* `Get web stock`

## Installing the Swan Pagination Update Timestamp script

**Step 1**\
Log into your Patchworks dashboard and navigate to the [marketplace](https://app.wearepatchworks.com/marketplace).

**Step 2**\
Select the scripts tab and locate the `Swan Pagination Update Timestamp` script (use the search field to find it quickly):

<figure><img src="https://2440044887-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FLYNcUBVQwSkOMG6KjZfz%2Fuploads%2F4s5XN6MoSvlUsOjcYCFl%2Fswan%20script.png?alt=media&amp;token=13f9dbee-c43c-48ae-929c-5f54b38840f1" alt=""><figcaption></figcaption></figure>

**Step 3**\
Install the script:

<figure><img src="https://2440044887-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FLYNcUBVQwSkOMG6KjZfz%2Fuploads%2FsKpEL7qy4gG4e2ww5D8L%2Fswan%20script%20install.png?alt=media&amp;token=2b706cf4-9b68-4e2c-bf45-f85893114633" alt=""><figcaption></figcaption></figure>

The script is installed and ready for use when [called from a connector shape in process flows](#applying-the-swan-pagination-update-timestamp-script).

## Applying the Swan Pagination Update Timestamp script

If a process flow includes a [connector shape](/product-documentation/process-flows/building-process-flows/process-flow-shapes/standard-shapes/connector-shape.md) configured to use the **Swan Retail System** connector with a [paginated endpoint](#paginated-endpoints), you must apply the `Swan Pagination Update Timestamp` script to connector settings. To do this, follow the steps below.

**Step 1**\
Click the `settings` icon associated with the [connector shape](/product-documentation/process-flows/building-process-flows/process-flow-shapes/standard-shapes/connector-shape.md):

<div align="left"><figure><img src="https://2440044887-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FLYNcUBVQwSkOMG6KjZfz%2Fuploads%2Fnlpnl6ky8xeZ333MFa2V%2Fswan%20connector%20settings%201.png?alt=media&amp;token=fd3970f4-d264-40d4-a8e1-91c178f552a3" alt="" width="364"><figcaption></figcaption></figure></div>

**Step 2**\
Scroll down to the `response handling` section and click on the `response script` field:

<div align="left"><figure><img src="https://2440044887-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FLYNcUBVQwSkOMG6KjZfz%2Fuploads%2FnjLTFdCFcUl563WlJHCG%2Fswan%20connector%20settings%202.png?alt=media&amp;token=a3bc9215-aab4-4978-9a3d-34938aa190c6" alt="" width="375"><figcaption></figcaption></figure></div>

**Step 3**\
Select the `Swan Pagination Update Timestamp` script:

<div align="left"><figure><img src="https://2440044887-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FLYNcUBVQwSkOMG6KjZfz%2Fuploads%2FmJkKLqys4gjmzhT9LQVC%2Fswan%20connector%20settings%203.png?alt=media&amp;token=173a3674-9f08-4199-9fa5-10e26f1dabd7" alt="" width="375"><figcaption></figcaption></figure></div>

{% hint style="info" %}
Any scripts installed from the marketplace or created by users associated with your company profile are available for selection.
{% endhint %}

**Step 4**\
Select the latest version available:

<div align="left"><figure><img src="https://2440044887-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FLYNcUBVQwSkOMG6KjZfz%2Fuploads%2Fo9ta6D2R6VWedmJ3a0bH%2Fswan%20connector%20settings%204.png?alt=media&amp;token=60e3e5ab-1910-42f2-9eff-e357d6d6f1ee" alt="" width="375"><figcaption></figcaption></figure></div>

**Step 5**\
Save changes. Now whenever this process flow runs, this script is applied to responses.

{% hint style="info" %}
For more information about how response scripts work, please see our [Using connector shape response scripts](/product-documentation/process-flows/building-process-flows/process-flow-shapes/standard-shapes/connector-shape/using-connector-shape-response-scripts.md) page.
{% endhint %}
