> 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="/files/GjFITC910Ysqrcu6sfSk" alt=""><figcaption></figcaption></figure>

**Step 3**\
Install the script:

<figure><img src="/files/QQ9ONo4Ck7wQKWAlXQwD" 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="/files/8ELBEIgKf4oUQST7fhJy" 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="/files/kqfJNEd6SI01Fxo12GI6" alt="" width="375"><figcaption></figcaption></figure></div>

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

<div align="left"><figure><img src="/files/JcjjPHuuCzgH2iEQ9RmO" 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="/files/zTKY2Q8Sl4lOz2QqVufA" 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 %}
