# Collection products list

List products from a JioMart collection slug with optional PIN context, sorting and continuation.

- Platform: [JioMart](https://docs.upscrape.com/docs/platforms/jiomart)
- Capability ID: `jiomart.collection.products.list`
- Cost: 1 credit per request
- Maximum runtime: 30 seconds
- Execute endpoint: `POST https://data.upscrape.com/execute`

## Request

Use the exact public capability ID in the shared execute envelope.

```bash
curl --request POST \
  --url https://data.upscrape.com/execute \
  --header "Authorization: Bearer $UPSCRAPE_API_KEY" \
  --header "Content-Type: application/json" \
  --header "Prefer: wait=30" \
  --data '{
  "input": {
    "page": 1,
    "page_size": 20,
    "pincode": "400001",
    "slug": "groceries"
  },
  "capability": "jiomart.collection.products.list"
}'
```

## Input

Provide a nonblank collection slug. pincode or location may provide request context; conflicting top-level and nested PINs are rejected.

page starts at 1. page_size accepts 1 to 100. Use page_id returned by the response to resume unreturned rows from the same native page.

Keep collection slug, PIN, sort_on and page_size unchanged when following page_id.

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `location` | `object` | No |  |
| `location.city` | `string` | No | City name. |
| `location.pincode` | `string` | No | Postal code (PIN) that sets the delivery location. |
| `location.state` | `string` | No | State or region name. |
| `page` | `integer` | No | Native upstream page number. Use returned page_id continuation to consume every row when page_size is smaller than a native page. At least 1. |
| `page_id` | `string` | No | Use the returned pagination.next_cursor or page.next_id unchanged, with the same query, filter, collection, PIN, sort and page_size. |
| `page_size` | `integer` | No | Maximum products returned from one native page. Returned continuation preserves any remaining rows; no additional native pages are scanned in this call. From 1 to 100. |
| `pincode` | `string` | No | Postal code (PIN) that sets the delivery location. |
| `slug` | `string` | Yes | Slug from the page URL. |
| `sort_on` | `string` | No | Passed unchanged to JioMart; results preserve JioMart's own order. price_asc is not guaranteed to be strictly ascending. No local page sorting. |

### Example input

```json
{
  "page": 1,
  "page_size": 20,
  "pincode": "400001",
  "slug": "groceries"
}
```

## Response

Successful output is returned in `results[0].data`.

Collection products are catalogue observations, not proof that every item is locally stocked for the PIN.

Use page.next_id or pagination.next_cursor unchanged for continuation. Numeric page selects an upstream page.

If price_asc is requested, preserve it as JioMart’s ordering choice rather than describing the result as guaranteed globally ascending.

### Illustrative sample output

This example shows one response. Values and optional fields vary with the data available.

```json
{
  "items": [
    {
      "brand": {
        "_custom_json": {},
        "action": {
          "page": {
            "query": {
              "brand": [
                ""
              ]
            },
            "type": "products"
          },
          "type": "page"
        },
        "name": "reliance",
        "type": "brand",
        "uid": 6
      },
      "discount": "",
      "name": "Lemon 100 g",
      "price": {
        "currency_code": "INR",
        "currency_symbol": "₹",
        "effective": {
          "max": 35,
          "min": 35
        },
        "marked": {
          "max": 35,
          "min": 35
        }
      },
      "sellable": true,
      "slug": "lemon-100-g-mlc80c-72964579",
      "store_ids": [
        3442
      ],
      "type": "product",
      "uid": 72964579
    },
    {
      "brand": {
        "_custom_json": {},
        "action": {
          "page": {
            "query": {
              "brand": [
                ""
              ]
            },
            "type": "products"
          },
          "type": "page"
        },
        "name": "Swamy's",
        "type": "brand",
        "uid": 145980
      },
      "discount": "",
      "name": "Swamy's Idli Dosa Batter 1 kg",
      "price": {
        "currency_code": "INR",
        "currency_symbol": "₹",
        "effective": {
          "max": 55,
          "min": 55
        },
        "marked": {
          "max": 110,
          "min": 110
        }
      },
      "sellable": true,
      "slug": "swamy-s-idli-dosa-batter-1-kg-mknlyu-72446064",
      "store_ids": [
        3442
      ],
      "type": "product",
      "uid": 72446064
    },
    {
      "brand": {
        "_custom_json": {},
        "action": {
          "page": {
            "query": {
              "brand": [
                ""
              ]
            },
            "type": "products"
          },
          "type": "page"
        },
        "name": "reliance",
        "type": "brand",
        "uid": 6
      },
      "discount": "",
      "name": "Onion (Approx. 900 g - 1000 g)",
      "price": {
        "currency_code": "INR",
        "currency_symbol": "₹",
        "effective": {
          "max": 60,
          "min": 60
        },
        "marked": {
          "max": 60,
          "min": 60
        }
      },
      "sellable": true,
      "slug": "onion-1-kg-pack-mffneb-7550741",
      "store_ids": [
        3442
      ],
      "type": "product",
      "uid": 7550741
    }
  ],
  "page": {
    "has_next": true,
    "has_previous": false,
    "item_total": 188000,
    "next_id": "2",
    "type": "cursor"
  },
  "pagination": {
    "has_more": true,
    "next_cursor": "2",
    "total": 188000
  }
}
```
### Illustrative output fields

Derived from the sample above for orientation only. These fields are not a fixed response schema.

| Path | Observed type | Example |
| --- | --- | --- |
| `items` | `array` | 3 items |
| `items` | `array` | 3 items |
| `page` | `object` | 5 fields |
| `page.has_next` | `boolean` | true |
| `page.has_previous` | `boolean` | false |
| `page.item_total` | `integer` | 188000 |
| `page.next_id` | `string` | 2 |
| `page.type` | `string` | cursor |
| `pagination` | `object` | 3 fields |
| `pagination.has_more` | `boolean` | true |
| `pagination.next_cursor` | `string` | 2 |
| `pagination.total` | `integer` | 188000 |

## Execution behavior

A `200` response completed inline. A `202` response was queued; poll `GET /jobs/{id}` until the job reaches `completed` or `failed`. Use an `Idempotency-Key` when retrying must not create a duplicate logical job.

## Related documentation

- [Authentication](https://docs.upscrape.com/docs/api/authentication)
- [Jobs and results](https://docs.upscrape.com/docs/api/jobs)
- [Errors and retries](https://docs.upscrape.com/docs/api/errors)
- [Idempotency](https://docs.upscrape.com/docs/api/idempotency)
