Delete List

Delete an existing list and its contents.

Delete a shoppers list and its list contents on a single call.

Endpoint

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

Query Params

ParameterTypeRequiredDescription
pidstring (Encoded)YesUnique identifier for the store available in Swym Admin
limitint64NoMaximum number of records to return
offsetint64NoNumber of records to skip

Form Data

FieldTypeRequiredDescription
lidstringYesUnique identifier of the list
regidstringYesUnique identifier for the shopper generated by generate-regid endpoint
sessionidstringYesSession id generated with generate-regId endpoint which does not expire without manual intervention

Example Curl


curl -X POST \
     --url '{{Swym API Endpoint }}/api/v3/lists/delete-list?pid={{Url Encoded PID}}' \
     --header 'Content-Type: application/x-www-form-urlencoded' \
     --header 'Accept: application/json' \
     --data-urlencode 'regid={{regid}}' \
     --data-urlencode 'sessionid={{sessionid}}' \
     --data-urlencode 'lid={{lid}}'

var myHeaders = new Headers();
myHeaders.append("Content-Type", "application/x-www-form-urlencoded");

var urlencoded = new URLSearchParams();
urlencoded.append("regid", "{{regid}}");
urlencoded.append("sessionid", "{{sessionID}}");
urlencoded.append("lid", "{{lid}}");
urlencoded.append("a", "[{\"empi\": 6693670256663,\"epi\": 40440734482455,\"du\": \"https://sample-store.myshopify.com/products/small-hulumanu-black\"}]");

var requestOptions = {
  method: 'POST',
  headers: myHeaders,
  body: urlencoded,
  redirect: 'follow'
};

fetch("{{Swym API Endpoint}}/api/v3/lists/update-ctx?pid={{URL Encoded PID}}", requestOptions)
  .then(response => response.text())
  .then(result => console.log(result))
  .catch(error => console.log('error', error));

🚧

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.

Success Response

The below responses are what you would get based on being logged in or an authenticated user.

{
    "di": "Z+/ywr3MW/NoY3W2jnNN5GRWUm9Ye/4/7DlUMYWCh60=-API", // Unique identifier for the device
    "userinfo": null, // User information associated with the list (not present in this example)
    "lty": "wl", // List type
    "cts": 1681110226853, // Creation timestamp (in milliseconds since epoch)
    "lname": "My Example", // List name
    "lid": "95cd0bcb-585f-436b-9141-dfa922ebf80c", // Unique identifier for the list.
    "pid": "1f0WvUYRaFyM6/cno5z1H2oAYI7tbUWbcGA1kY=", // Unique identifier for the store
    "st": 1, // List status (1 = active, 0 = inactive)
    "uts": 1681110226853, // Last update timestamp (in milliseconds since epoch)
    "lhash": "bXktdGVzdC1saXN0" // Base64-encoded hash of the list name and attributes
}

{
    "di": "91b43457-b092-46ca-bd6c-91ecc2f04dd5", // device id, a unique identifier for the device
    "lty": "wl", // list type, in this case "wl" stands for wishlist
    "uid": "uH7nZUNswsC6ejml9x7cZqDb1xgCMEqgds7jk+GIfrg=", // user id, a unique identifier for the user
    "cts": 1681408180376, // creation timestamp, the time at which the record was created (in Unix milliseconds)
    "cnt": 0, // count, the number of items in the list
    "lname": "Example Name", // list name, the name given to the list
    "cby": "[email protected]", // created by, the email address of the user who created the list
    "lid": "f3c4a7bd-1fb7-4c85-8df9-73d1de186cfe", // list id, a unique identifier for the list
    "pid": "1f0WvUYRaFyM6/cno5z1H2oAYI7tbU76V+nWbcGA1kY=", // parent id, a unique identifier for the parent item, if applicable
    "st": 1, // status, an integer representing the status of the list (e.g., active, deleted, etc.)
    "id": "e8c0f47c-84f8-4a66-80f4-7c84f82a66b7", // id, a unique identifier for the record
    "uts": 1681408180376, // update timestamp, the time at which the record was last updated (in Unix milliseconds)
    "_pkey": "uH7nZUNs", // partition key, a key used for partitioning the data in the database
    "_t": 1, // type, an integer representing the type of the record
    "itemcmnts": 0, // item comments, the number of comments on items in the list
    "uby": "[email protected]", // updated by, the email address of the user who last updated the list
    "lhash": "ZGVsZXRlZC1saXN0LW5hbWU=", // list hash, a hashed representation of the list name
    "cfor": "[email protected]" // created for, the email address of the user for whom the list was created
}

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.
401UnauthorizedYou 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.
403ForbiddenYou are not allowed to request this data.
404Not FoundThe specified requested data could not be found.
429Too Many RequestsYou're raising too many requests! Slow down!
500Internal Server ErrorWe had a problem with our server. Try again later.
503Service UnavailableWe're temporarily offline for maintenance. Please try again later.