---
# System prepended metadata

title: Product Listing APIs
tags: [XShop]

---

# Product Listing APIs

Product Listing APIs

Last updated: **18-Mar-2024**
Version: **v0.4**
Updated:
- API use default domain and shop token
- List product API support pagination
- Update example data
- Add more pagination parameters to list API

---

### P1. List products

Requires `sku_list` data.
Returns published products only.
Default sorted by product title in ascending order.
Pagination: limit = N (no. of result), page = 1, 2, 3...

```typescript
Request:
GET https://{{default_domain}}/api/product/list?limit=10&page=1
Header: x-shop-token

Response:
200 (OK)
{
    "list": [
        {
            "id": "15881",
            "handler": "-sample--necklace",
            "shop_id": "2",
            "title": "[Sample] Necklace",
            "price": "10.00",
            "compare_at_price": "20.00",
            "default_sku_code": "pb01",
            "default_image": {
                "file_key": "uploader/58bfe14f83eca2363ba64e7e459794da.jpg",
                "file_preview": "https://mysail-paas-dev.oss-cn-shenzhen.aliyuncs.com/uploader/58bfe14f83eca2363ba64e7e459794da.jpg",
                "file_id": "84626"
            },
            "attribute":
            [
                {
                    "specName": "color",
                    "specItems":
                    [
                        "Platinum",
                        "yellow gold",
                        "rose gold"
                    ],
                    "specList":
                    [
                        {
                            "type": "f11a3268",
                            "value": "Platinum",
                            "check": false
                        },
                        {
                            "type": "ee197260",
                            "value": "yellow gold",
                            "check": false
                        },
                        {
                            "type": "e1472ade",
                            "value": "rose gold",
                            "check": false
                        }
                    ]
                },
                {
                    "specName": "size",
                    "specItems":
                    [
                        "big",
                        "small"
                    ],
                    "specList":
                    [
                        {
                            "type": "fc378f5e",
                            "value": "big"
                        },
                        {
                            "type": "43c55cac",
                            "value": "small"
                        }
                    ]
                }
            ],
            "skuList": [
                {
                    "id": "125592",
                    "shop_id": "2",
                    "product_id": "15881",
                    "title": "Platinum·big",
                    "price": "10.00",
                    "compare_at_price": "20.00",
                    "sku_code": "pb01",
                    "spec": {
                      "color": "Platinum",
                      "size": "big"
                    }
                },
                {
                    ...
                }
            ]
        },
        ...
    ],
    "count": 10,
    "page": 1,
    "total": 12
}
```


### P2. Get product details

```typescript
Request:
GET https://{{default_domain}}/api/product/:product_id
Header: x-shop-token

Response:
200 (OK)
{
    "id": "15881",
    "handler": "-sample--necklace",
    "shop_id": "2",
    "title": "[Sample] Necklace",
    "sub_title": "test",
    "price": "10.00",
    "compare_at_price": "20.00",
    "default_sku_code": "pb01",
    "body_html": "<h1>About this item</h1>\n<ul>\n<li><span>4-in-1 carrier: Ditch the stroller and cuddle up close with this 4-in-1 baby body carrier for newborns and toddlers from 8 lbs to 32 lbs! Designed for front carry (2 inward-facing options + forward-facing) and back carry </span></li>\n<li><span>...</span></li>\n</ul>\n</li>\n</ul>\n</li>\n</ul>\n</li>\n</ul>",
    "default_image": {
        "file_key": "uploader/58bfe14f83eca2363ba64e7e459794da.jpg",
        "file_preview": "https://mysail-paas-dev.oss-cn-shenzhen.aliyuncs.com/uploader/58bfe14f83eca2363ba64e7e459794da.jpg",
        "file_id": "84626"
    },
    "images": [
        {
            "file_key": "uploader/58bfe14f83eca2363ba64e7e459794da.jpg",
            "file_preview": "https://mysail-paas-dev.oss-cn-shenzhen.aliyuncs.com/uploader/58bfe14f83eca2363ba64e7e459794da.jpg",
            "file_id": "84626"
        },
        ...
    ],
    "attribute": [
        {
            "specName": "color",
            "specItems": [
                "Platinum",
                "yellow gold",
                "rose gold"
            ],
            "specList": [
                {
                    "type": "f11a3268",
                    "value": "Platinum",
                    "check": false
                },
                {
                    "type": "ee197260",
                    "value": "yellow gold",
                    "check": false
                },
                {
                    "type": "e1472ade",
                    "value": "rose gold",
                    "check": false
                }
            ]
        },
        {
            "specName": "size",
            "specItems": [
                "big",
                "small"
            ],
            "specList": [
                {
                    "type": "fc378f5e",
                    "value": "big"
                },
                {
                    "type": "43c55cac",
                    "value": "small"
                }
            ]
        }
    ],
    "skuList": [
        {
            "id": "125592",
            "shop_id": "2",
            "product_id": "15881",
            "title": "Platinum·big",
            "price": "10.00",
            "compare_at_price": "20.00",
            "sku_code": "pb01",
            "spec": {
                "color": "Platinum",
                "size": "big"
            },
            "image": {
                "file_key": "uploader/58bfe14f83eca2363ba64e7e459794da.jpg",
                "file_preview": "https://mysail-paas-dev.oss-cn-shenzhen.aliyuncs.com/uploader/58bfe14f83eca2363ba64e7e459794da.jpg",
                "file_id": "84626"
            }
        },
        ...
    ]
}
```