# Redmagic — 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 RedMagic's complete product catalog, check real-time stock availability, view pricing and discounts, and compare gaming devices to find the best deal. Search specific products or explore collections to discover the latest RedMagic phones and accessories with up-to-date inventory information.

**Category:** E-commerce | **Website:** [redmagic.gg/](https://redmagic.gg/) | **Docs:** [parse.bot/marketplace/2d409027-136d-4349-b116-18f3ff74ada4/redmagic-gg-api](https://parse.bot/marketplace/2d409027-136d-4349-b116-18f3ff74ada4/redmagic-gg-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/redmagic/`
**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

### Check stock availability

Check real-time stock availability for a product and all its variants. Returns overall availability status and per-variant availability details including SKU.

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `handle` | string | Yes | Product handle (e.g. 'redmagic-11-air', 'redmagic-11-pro'). Obtainable from get_collection_products or search_products results. |

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

### Compare products

Retrieve full product details for multiple products to enable side-by-side comparison. Requires at least 2 product handles. Returns complete product data for each handle that resolves successfully.

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `handles` | string | Yes | Comma-separated product handles, minimum 2 (e.g. 'redmagic-11-pro,redmagic-11-air'). Handles obtainable from get_collection_products or search_products results. |

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

### Get all collections

Retrieve all product collections available on the RedMagic store. Returns collection metadata including title, handle, description, and product count. Each collection groups related products (phones, accessories, deals, etc.).

**Estimated cost:** Metered

_No parameters required._

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

### Get collection products

Retrieve products within a specific collection by its handle. Returns up to 30 products per page with full variant, image, and option data. Pages beyond available products return an empty array.

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `handle` | string | Yes | Collection handle from get_all_collections results (e.g. 'redmagic-phones', 'all-products', 'best-sellers-accessories'). |
| `page` | integer | No | Page number for pagination. |

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

### Get price and discounts

Extract pricing and active discounts for all variants of a product. Calculates discount amount and percentage when a compare_at_price is available and higher than the current price.

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `handle` | string | Yes | Product handle (e.g. 'redmagic-11-pro', 'redmagic-11-air'). Obtainable from get_collection_products or search_products results. |

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

### Get product details

Retrieve full product details for a specific product by its handle. Returns complete product information including all variants with pricing, images, options, and metadata. The response is a flat product object with fields at the top level.

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `handle` | string | Yes | Product handle (e.g. 'redmagic-11-air', 'redmagic-11-pro', 'redmagic-11s-pro'). Obtainable from get_collection_products or search_products results. |

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

### Search products

Search for products using keywords via the Shopify suggest API. Returns matching products with basic details including price, availability, and image. Single-word queries work most reliably; multi-word queries may return fewer results.

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `query` | string | Yes | Search keyword (e.g. 'phone', 'gaming', 'tablet', 'cooler'). |

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

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