Fetch User List

Fetches the paginated list contents in a list owned by a logged in shopper.

Endpoint

Endpointrequest typeAPI Type
https://{{Swym> API Endpoint }}/api/v3/lists/fetch-user-listPOSTshopper

Query Params

ParameterTypeRequiredDescription
pidstring (Encoded)YesUnique identifier for the store available in Swym Admin

Form Data

FieldTypeRequiredDescription
regidstringYesUnique identifier for the shopper generated by generate-regid
sessionidstringYesSession id generated with generate-regId endpoint which does not expire without manual intervention
lidstringYesUnique identifier of the list.
nextstringNoNext Token for fetching the next page. If not provided, the first page will be fetched. This token is reset if any of the sort or filter params are updated.
The next token to fetch the next page is provided in the response of a successful API call.
If the next token is null, then the list has reached the end and has no next page.
itemslimitint64NoNumber of items to be returned in a page. The minimum value is 50 and the Maximum value is 100.
The default value if not passed is 50. To update the default value permanently, please contact support.
sortbystring (price/title)NoDisabled by default. Please Contact Support to enable. Column to use for sorting the list contents. Should be one of price or title.
By default, the list is sorted using the timestamp items that were added to the list.
sortorderstring (asc/desc)NoDisabled by default. Please Contact Support to enable. Sort the list contents in ascending or descending order. Should be one of asc or desc.
By default, the list is sorted in descending order.
filterbystring (instock/outofstock)NoDisabled by default. Please Contact Support to enable. Apply filter by conditions to the items.
instock is to fetch items that are currently in stock and outofstock is to fetch items that are currently out of stock. Should be one of instock or outofstock.
By default, no filter by conditions is applied.

📘

Sort and Filter

Please note that sort and filter are not enabled by default and are only available for the Enterprise plan. If you need to sort and filter, please contact the support team to enable it.

Example Curl

curl --location --request POST '{{Swym API Endpoint}}/api/v3/lists/fetch-user-list?pid={{URL Encoded PID}}' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--header 'Accept: application/json' \
--data-urlencode 'sessionid={{sessionid}}' \
--data-urlencode 'regid={{regid}}'
--data-urlencode 'lid={{lid}}'
--data-urlencode 'next={{next}}'
--data-urlencode 'itemslimit={{itemslimit}}'
--data-urlencode 'sortby={{sortby}}'
--data-urlencode 'sortorder={{sortorder}}'
--data-urlencode 'filterby={{filterby}}'

🚧

Curl Placeholders

Assuming these values are provided above, the curl command should work correctly. However, if there are any issues with the API endpoint or the data being passed in the request, there could still be errors that need to be resolved before you can test these APIS.

PlaceholdersDescriptions
{{Swym API Endpoint}}This needs to be replaced with the actual Swym API endpoint URL.
{{URL Encoded PID}}This needs to be replaced with the actual PID value, URL-encoded.
{{regid}}This needs to be replaced with the actual regid value.
{{sessionid}}This needs to be replaced with the actual session ID value.
{{lid}}This needs to be replaced with the actual list ID value.
{{next}}This needs to be replaced with the actual next token value.
{{itemslimit}}This needs to be replaced with the actual items limit value.
{{sortby}}This needs to be replaced with the actual sort by column name.
{{sortorder}}This needs to be replaced with the actual sort order value.
{{filterby}}This needs to be replaced with the actual filter by value.

Success Response

{
    "status": "success",
    "data": {
        "di": "96f35dcb-699d-46ca-ad09-6f9503ca3275",
        "listcontents": [
            {
                "di": "96f35dcb-699d-46ca-ad09-6f9503ca3275",
                "uid": "k6EjhHmacSbNDQW/9ZM24umd2pV5VLUDe44sNcfSunM=",
                "dt": "Cruise 80",
                "cts": 1692168780840,
                "empi": 8571189133593,
                "cby": "[email protected]",
                "lid": "1e086691-b88a-48df-9cac-fa7da8c57827",
                "du": "https://swym-ent-test-store.myshopify.com/products/nordic-cruise-80-boots-2016",
                "pid": "jID7uqlAM3iF/xqAmtL8eFr0kC7nvE/NDXyrLxZ1Y6E=",
                "epi": 46323699646745,
                "id": "4c4eed19-4853-4e93-8eed-1948536e93ea",
                "uts": 1692168780840,
                "_pkey": "k6EjhHma",
                "iu": "https://swym-ent-test-store.myshopify.com/cdn/shop/products/1600x0r_05054201576_620x620.jpg?v=1692122942",
                "_t": 2,
                "uby": "[email protected]",
                "pr": 247,
                "ct": "Ski Boots",
                "vi": "26.5 Black/Black"
            }
        ],
        "lty": "wl",
        "uid": "k6EjhHmacSbNDQW/9ZM24umd2pV5VLUDe44sNcfSunM=",
        "cts": 1692122947783,
        "lname": "My Wishlist",
        "cby": "[email protected]",
        "lid": "1e086691-b88a-48df-9cac-fa7da8c57827",
        "pid": "jID7uqlAM3iF/xqAmtL8eFr0kC7nvE/NDXyrLxZ1Y6E=",
        "st": 1,
        "id": "965d94ac-6927-40ea-9d94-ac692730ea9a",
        "uts": 1692122947783,
        "_pkey": "k6EjhHma",
        "_t": 1,
        "uby": "[email protected]",
        "lhash": "bXktd2lzaGxpc3Q=",
        "cfor": "[email protected]"
    },
    "pagination": {
        "next": "4VmfPRKJ_Ag9zCAWRLL9bbJOhx876Q8yuUOHcEPumvsuQg0Kd7kXIVBelyROiNGmEK75crlDJ63aGzBiO03by-o70uTMOYKMSWXdRWJ-ulDdvaOppau4cIyJ_8Mhw-pZcRAEP6leBXbZ3sN9tNXQMmc1fFANaRCR9hc7AVg8vRDAqkpA74OdKbDRVBpSJYTA"
    }
}
{
  "status": "error",
  "error-code": "user-not-logged-in",
  "error-msg": "User is not logged in. This API only supports logged in users. Please refer our API documentation for more details."
}
{
  "status": "error",
  "error-code": "min-items-limit-not-met",
  "error-msg": "The given items limit is less than 50. The given limit should be between 50 and 100 inclusive. Please refer our API documentation for more details"
}
{
  "status": "error",
  "error-code": "max-items-limit-exceeded",
  "error-msg": "The given items limit is more than 100. The given limit should be between 50 and 100 inclusive. Please refer our API documentation for more details"
}
{
  "status": "error",
  "error-code": "sort-filter-disabled",
  "error-msg": "Sort and filter is disabled. Contact support for enabling these features"
}

Error Response:

If the request is unsuccessful, the API will return a JSON response with an error message and an HTTP status code indicating the type of error that occurred.

Status CodeTypeDescription
400Bad RequestYour request is invalid, change your request params and query and try again.
401UnauthorisedYou are performing an action on a resource that is not granted to the current logged-in user. Additionally, for REST APIs, this could mean your API key is wrong.
404Not FoundThe specified requested data could not be found.
500Internal Server ErrorWe had a problem with our server. Try again later.
503Service UnavailableWe're temporarily offline for maintenance. Please try again later.