Move to Cart [Beta]
Move items to cart from Save for Later list
Contact support for using Save for Later Beta APIs.
Endpoint | request type | API Type |
---|---|---|
https://{{Swym API Endpoint }}/api/v3/lists/sfl/moved-to-cart | POST | shopper |
Query Params
Parameter | Type | Required | Description |
---|---|---|---|
pid | string (Encoded) | Yes | Unique identifier for the store available in Swym Admin |
Form Data
Field | Type | Required | Description | |
---|---|---|---|---|
regid | string | Yes | Unique identifier for the shopper generated by generate-regid | |
sessionid | string | Yes | Session id generated with generate-regId endpoint which does not expire without manual intervention | |
lid | string | Yes | Unique identifier of the save for later list. | |
user-agent | string | Yes | User-Agent header of the app used to access the API | |
items | Array of list items | Yes | Array of products to add to the list. |
Example Curl
curl -X POST '{{Swym API Endpoint}}/api/v3/lists/sfl/moved-to-cart?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}}' \
--data-urlencode 'user-agent={{user-agent}}'\
--data-urlencode 'items=[{"epi":41450466377888,"empi":7168987889824,"du":"https://yourstore.myshopify.com/products/blue-silk-tuxedo"}]'
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.
Placeholders | Descriptions |
---|---|
{{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 save for later list ID value. |
{{user-agent}} | This needs to be replaced with User-Agent header value. |
Success Response
{
"itemsmoved": [
{
"di": "27e0ff4a-e950-4057-aab0-e62fa0821c83",
"bt": "Snowboard Vendor",
"clbls": [],
"uid": "eQfca8LNr0PeDPyEIb7Bz97FxkYqwbhcKMGVT5/rSHQ=",
"dt": "The Complete Snowboard",
"cts": 1699666952862,
"empi": 7168987889824,
"cby": "[email protected]",
"lid": "0b2c578f-7583-4175-b0fe-db5fc31f4b7c",
"du": "https://yourstore.myshopify.com/products/blue-silk-tuxedo",
"pid": "C7vi6wI9s9aa0jE3DY+e2J8R/45MnnDtXYF6xfGNlDQ=",
"epi": 41450466377888,
"cprops": {},
"uts": 1699666952862,
"iu": "https://cdn.shopify.com/s/files/1/0843/0927/8998/products/Main_589fc064-24a2-4236-9eaf-13b2bd35d21d_620x620.jpg?v=1699407350",
"qty": 1,
"uby": "[email protected]",
"pr": 699.95,
"vi": "Ice"
}
],
"itemsfailed": []
}
Error Status codes:
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 Code | Type | Description |
---|---|---|
400 | Bad Request | Your request is invalid, change your request params and query and try again. |
401 | Unauthorised | You 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. |
403 | Forbidden | You are not allowed to request this data. |
404 | Not Found | The specified requested data could not be found. |
500 | Internal Server Error | We had a problem with our server. Try again later. |
503 | Service Unavailable | We're temporarily offline for maintenance. Please try again later. |
Product
An object containing params required for creating, updating or deleting list items
Property Name | Data Type | Required | Description |
---|---|---|---|
epi | int/string | Yes | Variant id of the product to be added |
empi | int/string | Yes | Product id of the product to be added |
du | string | Yes | Canonical uri of the product to be added |
qty | int | optional | Defaults to 1. Quantity included for the add action |
note | string | optional | Optional note |
cprops | object | optional | Map of custom fields |
clbls | array | optional | Array of strings indicating labels, rooms, etc. for HTC. Only one value supported in array. eg: ["Room1"] |
Updated about 1 year ago