> ## Documentation Index
> Fetch the complete documentation index at: https://firmly.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# API Reference

> Complete reference documentation for Firmly APIs

## Base URL

All API requests are made to:

```
https://api.firmly.work
```

## Authentication

All endpoints require authentication via the `x-firmly-authorization` header:

```bash theme={null}
curl -X GET https://api.firmly.work/api/v2/domains/staging.luma.gift/cart \
  -H "x-firmly-authorization: YOUR_ACCESS_TOKEN"
```

See [Authentication](https://firmly.mintlify.site/api-reference/authentication/browser-session.md) for obtaining access tokens.

## Request Format

* **Content-Type**: `application/json` for all POST/PUT requests
* **Accept**: `application/json`
* **Domain Parameter**: Most endpoints require a merchant domain (e.g., `staging.luma.gift`)

## Response Format

All responses return JSON with consistent structure:

### Success Response

```json theme={null}
{
  "cart_id": "cart_123",
  "line_items": [...],
  "total": { "value": 99.99, "currency": "USD" }
}
```

### Error Response

```json theme={null}
{
  "code": 400,
  "error": "ErrorCode",
  "description": "Human-readable error message"
}
```

## HTTP Status Codes

| Status | Description |
| - | - |
| 200 | Success |
| 400 | Bad Request - Invalid parameters |
| 401 | Unauthorized - Invalid or missing token |
| 404 | Not Found - Resource doesn't exist |
| 409 | Conflict - Business logic error |
| 422 | Unprocessable Entity - Validation failed |
| 500 | Internal Server Error |

## API Versioning

Firmly provides two API versions:

* **v1** - Simple Cart API endpoints
* **v2** - Full Cart API endpoints

Version is specified in the URL path: `/api/v1/` or `/api/v2/`

## Available APIs

> [card] [Authentication](https://firmly.mintlify.site/api-reference/authentication/browser-session.md)
>
> Token generation and session management

> [card] [Catalog](https://firmly.mintlify.site/api-reference/catalog/overview.md)
>
> Browse products and retrieve variant information

> [card] [Session](https://firmly.mintlify.site/api-reference/session/overview.md)
>
> Manage device sessions and preferences

> [card] [Cart Management](https://firmly.mintlify.site/api-reference/cart-management/overview.md)
>
> Core cart operations for Full Cart API

> [card] [Simple Cart](https://firmly.mintlify.site/api-reference/simple-cart-api/cart/get-cart.md)
>
> Streamlined cart operations for standard shipping

> [card] [Promotions](https://firmly.mintlify.site/api-reference/promotions/overview.md)
>
> Apply and manage promotional codes

> [card] [Shipment Configuration](https://firmly.mintlify.site/api-reference/shipment-configuration/overview.md)
>
> Configure fulfillment and shipping methods

> [card] [Addon Management](https://firmly.mintlify.site/api-reference/addon-management/overview.md)
>
> Manage warranties and protection plans

> [card] [Checkout](https://firmly.mintlify.site/api-reference/checkout/overview.md)
>
> Complete the purchase flow

> [card] [Payment](https://firmly.mintlify.site/api-reference/payment/get-public-key.md)
>
> Secure payment processing

## Common Headers

### Required Headers

| Header | Description | Example |
| - | - | - |
| `x-firmly-authorization` | Access token from authentication | `Bearer eyJhbGc...` |

### Optional Headers

| Header | Description | Example |
| - | - | - |
| `x-firmly-request-id` | Unique request identifier for tracking | `req_123abc` |

## Rate Limits

Contact support for current rate limit information.

## Support

* **API Status**: [status.firmly.work](https://status.firmly.work)
* **Support**: [support@firmly.work](mailto:support@firmly.work)

## Need Implementation Help?

> [card] [Implementation Guides](https://firmly.mintlify.site/guides/choosing-your-api.md)
>
> Step-by-step guides for building with Firmly APIs


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.