# Loft — 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.

> Browse and search Loft's product catalog, view detailed product information, explore categories and rankings, and discover store locations. Find exactly what you're looking for with powerful search and filtering across their entire online inventory.

**Category:** E-commerce | **Website:** [loft.co.jp/](https://loft.co.jp/) | **Docs:** [parse.bot/marketplace/1ecb9b29-3dd4-4a56-af77-63581f037693/loft-co-jp-api](https://parse.bot/marketplace/1ecb9b29-3dd4-4a56-af77-63581f037693/loft-co-jp-api)

Pay-per-use API proxy for Locus Pro. Each call burns credits from your workspace balance.

## Access

**Base URL:** `https://api.paywithlocus.com/api/wrapped/credits/loft/`
**Auth:** `Authorization: Bearer <LOCUS_CREDITS_SECRET_KEY>` (an `lcr_` secret key or a scoped `lcac_` agent credential)
**Required header:** `Idempotency-Key: <fresh UUID per call>`. A retry with the same key replays the stored result without a new charge.
**Response:** the provider response after any endpoint-specific normalization. `X-Locus-Credits-Charged` carries the charge and `X-Locus-Credits-Balance` the remaining balance. Insufficient credits return `402` before the provider is called.
**Pricing:** estimated costs below are USD. Locus debits the credit equivalent at your workspace rate.

Full call contract: https://docs.paywithlocus.com/api-reference/introduction

> Using a Pay With Locus wallet key (`claw_` prefix)? Wallet routes are documented separately: https://docs.paywithlocus.com/wrapped-apis/for-agents

## Endpoints

### Get categories

Retrieve the full category tree including main categories and their subcategories. Each category has a code usable with get_category_products. No input parameters required.

**Estimated cost:** Metered

_No parameters required._

```bash
curl -X POST https://api.paywithlocus.com/api/wrapped/credits/loft/get-categories \
  -H "Authorization: Bearer $LOCUS_CREDITS_SECRET_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{}'
```

### Get category products

Browse products within a specific category by its category code (obtainable from get_categories). Returns paginated product listings for that category.

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `category_code` | string | Yes | Category code from get_categories (e.g. ccb100001 for Cosmetics, ccb200003 for Cosmetics/Makeup). |
| `page` | integer | No | Page number. |

```bash
curl -X POST https://api.paywithlocus.com/api/wrapped/credits/loft/get-category-products \
  -H "Authorization: Bearer $LOCUS_CREDITS_SECRET_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{"category_code":"<string>","page":"<integer>"}'
```

### Get product details

Retrieve full details for a single product by its JAN/barcode product ID. Returns pricing, stock status, images, specifications, category breadcrumb, and purchase availability. A separate fetch per product — not batched.

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `product_id` | string | Yes | Product ID (JAN/barcode number, e.g. 4550376124245). |

```bash
curl -X POST https://api.paywithlocus.com/api/wrapped/credits/loft/get-product-details \
  -H "Authorization: Bearer $LOCUS_CREDITS_SECRET_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{"product_id":"<string>"}'
```

### Get ranking

Retrieve product rankings by ranking code. Returns products ordered by popularity with their rank position.

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `ranking_code` | string | No | Ranking code (e.g. rr00 for overall ranking). |

```bash
curl -X POST https://api.paywithlocus.com/api/wrapped/credits/loft/get-ranking \
  -H "Authorization: Bearer $LOCUS_CREDITS_SECRET_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{"ranking_code":"<string>"}'
```

### Get store locations

Retrieve store locations. Without shop_id returns a list of all shops with their IDs and names. With shop_id returns detailed information for a specific store.

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `shop_id` | string | No | Shop ID for specific store details. If omitted, lists all shops. |

```bash
curl -X POST https://api.paywithlocus.com/api/wrapped/credits/loft/get-store-locations \
  -H "Authorization: Bearer $LOCUS_CREDITS_SECRET_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{"shop_id":"<string>"}'
```

### Search products

Full-text search over the Loft product catalog. query matches product names and descriptions. Results are paginated and sortable. Each page returns up to limit products with total_count for the full result set.

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `limit` | integer | No | Number of results per page. Accepted values: 20, 40, 80. |
| `page` | integer | No | Page number to retrieve. |
| `query` | string | Yes | Search keyword. |
| `sort` | integer | No | Sort order. |

```bash
curl -X POST https://api.paywithlocus.com/api/wrapped/credits/loft/search-products \
  -H "Authorization: Bearer $LOCUS_CREDITS_SECRET_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{"limit":"<integer>","page":"<integer>","query":"<string>","sort":"<integer>"}'
```

## Next steps

- [All wrapped API providers](https://paywithlocus.com/wapi/index.md): pick another provider.
- [Find and call tools](https://paywithlocus.com/agent/tools.md): price ceilings, async results, and errors.
- [Credits and billing](https://paywithlocus.com/agent/billing.md): what a call costs and how to add credits.
- [Agent docs index](https://paywithlocus.com/agent/index.md): every Locus agent page.