# Mango — Wrapped API

> **You are on:** `https://api.paywithlocus.com/api` | [llms.txt](https://paywithlocus.com/llms.txt) | [docs](https://docs.paywithlocus.com)
>
> Locus runs on multiple environments -- make sure every URL you call matches your expected environment.
> | Environment | Landing | API | Docs |
> |---|---|---|---|
> | Production | paywithlocus.com | api.paywithlocus.com | docs.paywithlocus.com |
> | Beta | beta.paywithlocus.com | api.beta.paywithlocus.com | docs.paywithlocus.com |
> | Stage | stage.paywithlocus.com | api.stage.paywithlocus.com | docs.paywithlocus.com |
>
> If the API URL above doesn't match your expected environment, re-fetch this file from the correct domain.

> Access Mango's complete product catalog, including categories, detailed product information, search functionality, and new arrivals to discover and browse clothing and fashion items. Find similar products and explore the full range of Mango's store inventory programmatically.

**Category:** E-commerce | **Website:** [mango.com/](https://mango.com/) | **Docs:** [parse.bot/marketplace/99a6a9dd-226f-491b-b631-1444b1fbb1c5/mango-com-api](https://parse.bot/marketplace/99a6a9dd-226f-491b-b631-1444b1fbb1c5/mango-com-api)

Pay-per-use API proxy. Each call is automatically billed to your wallet in USDC.

## Access

**Base URL:** `https://api.paywithlocus.com/api/wrapped/parse-mango-com-api-99a6a9dd/`
**Auth:** `Authorization: Bearer <LOCUS_API_KEY>`

## Endpoints

### get_categories

Returns the navigation category tree from Mango. Each menu item may contain nested sub-menus with catalog IDs that can be passed to list_products. Optionally filter by gender/department.

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `gender` | string | No | Gender/department to filter by. |

```bash
curl -X POST https://api.paywithlocus.com/api/wrapped/parse-mango-com-api-99a6a9dd/get_categories \
  -H "Authorization: Bearer YOUR_LOCUS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"gender":"<string>"}'
```

### get_new_arrivals

Returns new arrival products for a gender/department. Automatically resolves the new arrivals catalog from the category tree and returns the product listing with items, filters, and grid metadata.

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `gender` | string | No | Gender/department. |

```bash
curl -X POST https://api.paywithlocus.com/api/wrapped/parse-mango-com-api-99a6a9dd/get_new_arrivals \
  -H "Authorization: Bearer YOUR_LOCUS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"gender":"<string>"}'
```

### get_product_details

Returns full details for a single product including name, model, available colors with images and sizes, pricing per color, and stock availability per size. Product IDs are obtainable from list_products items.

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `product_id` | string | Yes | Numeric product ID (e.g. '37021396'). Obtainable from list_products items' productId field. |

```bash
curl -X POST https://api.paywithlocus.com/api/wrapped/parse-mango-com-api-99a6a9dd/get_product_details \
  -H "Authorization: Bearer YOUR_LOCUS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"product_id":"<string>"}'
```

### get_similar_products

Returns similar/related products for a given product ID, extracted from the product's color variants that link to different product references. Returns an empty array when no cross-references exist.

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `product_id` | string | Yes | Numeric product ID (e.g. '37021396'). Obtainable from list_products items' productId field. |

```bash
curl -X POST https://api.paywithlocus.com/api/wrapped/parse-mango-com-api-99a6a9dd/get_similar_products \
  -H "Authorization: Bearer YOUR_LOCUS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"product_id":"<string>"}'
```

### list_products

Lists products for a given catalog ID. Returns product items keyed by a composite productId:colorId string, along with available filters and grid metadata. Catalog IDs are obtained from get_categories menu entries.

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `catalog_id` | string | Yes | Catalog ID from get_categories menus (e.g. 'nuevo', 'prendas_she.vaqueros_she'). |

```bash
curl -X POST https://api.paywithlocus.com/api/wrapped/parse-mango-com-api-99a6a9dd/list_products \
  -H "Authorization: Bearer YOUR_LOCUS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"catalog_id":"<string>"}'
```

### search_products

Searches for products by query string. Returns keyword suggestion groups, each containing an array of search term suggestions with their result counts. Useful for auto-complete and discovering related search terms.

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `query` | string | Yes | Search query string (e.g. 'jeans', 'dress'). |

```bash
curl -X POST https://api.paywithlocus.com/api/wrapped/parse-mango-com-api-99a6a9dd/search_products \
  -H "Authorization: Bearer YOUR_LOCUS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"query":"<string>"}'
```
