# 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. Each call is automatically billed to your wallet in USDC.

## Access

**Base URL:** `https://api.paywithlocus.com/api/wrapped/parse-redmagic-gg-api-2d409027/`
**Auth:** `Authorization: Bearer <LOCUS_API_KEY>`

## 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/parse-redmagic-gg-api-2d409027/check_stock_availability \
  -H "Authorization: Bearer YOUR_LOCUS_API_KEY" \
  -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/parse-redmagic-gg-api-2d409027/compare_products \
  -H "Authorization: Bearer YOUR_LOCUS_API_KEY" \
  -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/parse-redmagic-gg-api-2d409027/get_all_collections \
  -H "Authorization: Bearer YOUR_LOCUS_API_KEY" \
  -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/parse-redmagic-gg-api-2d409027/get_collection_products \
  -H "Authorization: Bearer YOUR_LOCUS_API_KEY" \
  -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/parse-redmagic-gg-api-2d409027/get_price_and_discounts \
  -H "Authorization: Bearer YOUR_LOCUS_API_KEY" \
  -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/parse-redmagic-gg-api-2d409027/get_product_details \
  -H "Authorization: Bearer YOUR_LOCUS_API_KEY" \
  -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/parse-redmagic-gg-api-2d409027/search_products \
  -H "Authorization: Bearer YOUR_LOCUS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"query":"<string>"}'
```
