# Polar.sh Integration via LowCodeAPI

**Last Updated**: February 10, 2026

## Overview
Polar.sh API for managing products, prices, checkout, orders, subscriptions, benefits, webhooks, customers, and organizations

**Categories:**
- {'id': 'payment-processing', 'name': 'Payment Processing'}

## Base Endpoint
https://api.lowcodeapi.com/polarsh

**Important**: Always include the provider name in the URL path after `api.lowcodeapi.com/`

## Authentication
**Type:** TOKEN

**Official Documentation:** https://polar.sh/docs/api-reference/introduction

## URL Format (Important)

LowCodeAPI supports two URL formats. **Always try the New Format first**, then fall back to Old Format if needed.

### New Format (Priority)
- Path parameters stay in the URL path
- Do NOT include path parameters as query parameters
- Example: `https://api.lowcodeapi.com/{provider}/resource/{id}?api_token=XXX`

### Old Format (Fallback)
- Path parameters become query parameters
- Example: `https://api.lowcodeapi.com/{provider}/resource/id?id={id}&api_token=XXX`

### Decision Flow for AI Agents
1. Always use **New Format** first - keep path parameters in the URL path
2. If you get a 404 or error, try **Old Format** with sanitized path
3. Log which format worked for future requests to this provider

## API Categories

## Common Endpoints

### List products

**Method:** GET
**LowCodeAPI Path:** /products

**New Format URL:**
https://api.lowcodeapi.com/polarsh/products?api_token=YOUR_API_TOKEN

**Old Format URL:**
https://api.lowcodeapi.com/polarsh/v1/products?api_token=YOUR_API_TOKEN

**Query Parameters:**

| Parameter | Type | Description |
|-----------|------|-------------|
| limit | integer |  |
| page | integer |  |

**Example Request (New Format):**

```bash
curl -X GET 'https://api.lowcodeapi.com/polarsh/products?api_token=YOUR_API_TOKEN'
```

**Official Documentation:** https://polar.sh/docs/api-reference/products/list

### Create product

**Method:** POST
**LowCodeAPI Path:** /products

**New Format URL:**
https://api.lowcodeapi.com/polarsh/products?api_token=YOUR_API_TOKEN

**Old Format URL:**
https://api.lowcodeapi.com/polarsh/v1/products?api_token=YOUR_API_TOKEN

**Request Body:**

| Field | Type | Description |
|-------|------|-------------|
| description | string |  |
| metadata | object |  |
| name | string |  |

**Example Request (New Format):**

```bash
curl -X POST 'https://api.lowcodeapi.com/polarsh/products?api_token=YOUR_API_TOKEN'
```

**Official Documentation:** https://polar.sh/docs/api-reference/products/create

### Get product

**Method:** GET
**LowCodeAPI Path:** /products/{product_id}

**New Format URL:**
https://api.lowcodeapi.com/polarsh/products/{product_id}?api_token=YOUR_API_TOKEN

**Old Format URL:**
https://api.lowcodeapi.com/polarsh/v1/products/product_id?product_id={product_id}&api_token=YOUR_API_TOKEN

**Path Parameters:**

| Parameter | Type | Description |
|-----------|------|-------------|
| product_id | string |  |

**Example Request (New Format):**

```bash
curl -X GET 'https://api.lowcodeapi.com/polarsh/products/{product_id}?api_token=YOUR_API_TOKEN'
```

**Official Documentation:** https://polar.sh/docs/api-reference/products/get

### Update product

**Method:** PATCH
**LowCodeAPI Path:** /products/{product_id}

**New Format URL:**
https://api.lowcodeapi.com/polarsh/products/{product_id}?api_token=YOUR_API_TOKEN

**Old Format URL:**
https://api.lowcodeapi.com/polarsh/v1/products/product_id?product_id={product_id}&api_token=YOUR_API_TOKEN

**Path Parameters:**

| Parameter | Type | Description |
|-----------|------|-------------|
| product_id | string |  |

**Request Body:**

| Field | Type | Description |
|-------|------|-------------|
| description | string |  |
| metadata | object |  |
| name | string |  |

**Example Request (New Format):**

```bash
curl -X PATCH 'https://api.lowcodeapi.com/polarsh/products/{product_id}?api_token=YOUR_API_TOKEN'
```

**Official Documentation:** https://polar.sh/docs/api-reference/products/update

### Delete product

**Method:** DELETE
**LowCodeAPI Path:** /products/{product_id}

**New Format URL:**
https://api.lowcodeapi.com/polarsh/products/{product_id}?api_token=YOUR_API_TOKEN

**Old Format URL:**
https://api.lowcodeapi.com/polarsh/v1/products/product_id?product_id={product_id}&api_token=YOUR_API_TOKEN

**Path Parameters:**

| Parameter | Type | Description |
|-----------|------|-------------|
| product_id | string |  |

**Example Request (New Format):**

```bash
curl -X DELETE 'https://api.lowcodeapi.com/polarsh/products/{product_id}?api_token=YOUR_API_TOKEN'
```

**Official Documentation:** https://polar.sh/docs/api-reference/products/delete

### List prices

**Method:** GET
**LowCodeAPI Path:** /prices

**New Format URL:**
https://api.lowcodeapi.com/polarsh/prices?api_token=YOUR_API_TOKEN

**Old Format URL:**
https://api.lowcodeapi.com/polarsh/v1/prices?api_token=YOUR_API_TOKEN

**Query Parameters:**

| Parameter | Type | Description |
|-----------|------|-------------|
| limit | integer |  |
| page | integer |  |
| product_id | string |  |

**Example Request (New Format):**

```bash
curl -X GET 'https://api.lowcodeapi.com/polarsh/prices?api_token=YOUR_API_TOKEN'
```

**Official Documentation:** https://polar.sh/docs/api-reference/prices/list

### Create price

**Method:** POST
**LowCodeAPI Path:** /prices

**New Format URL:**
https://api.lowcodeapi.com/polarsh/prices?api_token=YOUR_API_TOKEN

**Old Format URL:**
https://api.lowcodeapi.com/polarsh/v1/prices?api_token=YOUR_API_TOKEN

**Request Body:**

| Field | Type | Description |
|-------|------|-------------|
| amount | integer |  |
| currency | string |  |
| metadata | object |  |
| product_id | string |  |
| recurring | object |  |

**Example Request (New Format):**

```bash
curl -X POST 'https://api.lowcodeapi.com/polarsh/prices?api_token=YOUR_API_TOKEN'
```

**Official Documentation:** https://polar.sh/docs/api-reference/prices/create

### Get price

**Method:** GET
**LowCodeAPI Path:** /prices/{price_id}

**New Format URL:**
https://api.lowcodeapi.com/polarsh/prices/{price_id}?api_token=YOUR_API_TOKEN

**Old Format URL:**
https://api.lowcodeapi.com/polarsh/v1/prices/price_id?price_id={price_id}&api_token=YOUR_API_TOKEN

**Path Parameters:**

| Parameter | Type | Description |
|-----------|------|-------------|
| price_id | string |  |

**Example Request (New Format):**

```bash
curl -X GET 'https://api.lowcodeapi.com/polarsh/prices/{price_id}?api_token=YOUR_API_TOKEN'
```

**Official Documentation:** https://polar.sh/docs/api-reference/prices/get

### Update price

**Method:** PATCH
**LowCodeAPI Path:** /prices/{price_id}

**New Format URL:**
https://api.lowcodeapi.com/polarsh/prices/{price_id}?api_token=YOUR_API_TOKEN

**Old Format URL:**
https://api.lowcodeapi.com/polarsh/v1/prices/price_id?price_id={price_id}&api_token=YOUR_API_TOKEN

**Path Parameters:**

| Parameter | Type | Description |
|-----------|------|-------------|
| price_id | string |  |

**Request Body:**

| Field | Type | Description |
|-------|------|-------------|
| metadata | object |  |

**Example Request (New Format):**

```bash
curl -X PATCH 'https://api.lowcodeapi.com/polarsh/prices/{price_id}?api_token=YOUR_API_TOKEN'
```

**Official Documentation:** https://polar.sh/docs/api-reference/prices/update

### Delete price

**Method:** DELETE
**LowCodeAPI Path:** /prices/{price_id}

**New Format URL:**
https://api.lowcodeapi.com/polarsh/prices/{price_id}?api_token=YOUR_API_TOKEN

**Old Format URL:**
https://api.lowcodeapi.com/polarsh/v1/prices/price_id?price_id={price_id}&api_token=YOUR_API_TOKEN

**Path Parameters:**

| Parameter | Type | Description |
|-----------|------|-------------|
| price_id | string |  |

**Example Request (New Format):**

```bash
curl -X DELETE 'https://api.lowcodeapi.com/polarsh/prices/{price_id}?api_token=YOUR_API_TOKEN'
```

**Official Documentation:** https://polar.sh/docs/api-reference/prices/delete


## Usage Examples

### Example 1: Basic Chat Completion

Creating a simple text completion or chat message:

```bash
# Create a chat completion - no path parameters needed
curl -X POST "https://api.lowcodeapi.com/polarsh/v1/chat/completions?api_token=YOUR_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "your-model-name",
    "messages": [
      {"role": "user", "content": "Hello, how can you help me?"}
    ]
  }'

# Response includes generated content
```

### Example 2: Text Generation with Path Parameters

Generating text with specific model settings:

```bash
# Generate content using a specific model
curl -X POST "https://api.lowcodeapi.com/polarsh/v1/models/generate?api_token=YOUR_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "prompt": "Write a short poem about technology",
    "max_tokens": 100
  }'

# Or if the provider uses model in the path:
curl -X POST "https://api.lowcodeapi.com/polarsh/v1/models/{MODEL_ID}:generateContent?api_token=YOUR_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "contents": [{"parts": [{"text": "Write a short story"}]}]
  }'
```

### Example 3: List Available Models

```bash
# Get list of available models
curl -X GET "https://api.lowcodeapi.com/polarsh/v1/models?api_token=YOUR_API_TOKEN"
```

## Error Handling

LowCodeAPI returns standard HTTP status codes. Common errors:

| Status Code | Description |
|-------------|-------------|
| 200 | Success - Request completed successfully |
| 400 | Bad Request - Invalid parameters or request body |
| 401 | Unauthorized - Invalid or missing API token |
| 403 | Forbidden - Insufficient permissions |
| 404 | Not Found - Endpoint or resource doesn't exist |
| 429 | Too Many Requests - Rate limit exceeded |
| 500 | Server Error - Provider API error |

All error responses include error details:

```json
{
  "data": {
    "error": {
      "message": "Error description",
      "code": "ERROR_CODE"
    }
  }
}
```

## Complete Endpoint Reference

| Endpoint | Method | Category |
|----------|--------|----------|
| List products | GET | Products |
| Create product | POST | Products |
| Get product | GET | Products |
| Update product | PATCH | Products |
| Delete product | DELETE | Products |
| List prices | GET | Prices |
| Create price | POST | Prices |
| Get price | GET | Prices |
| Update price | PATCH | Prices |
| Delete price | DELETE | Prices |
| Create checkout | POST | Checkout |
| Get checkout | GET | Checkout |
| List orders | GET | Orders |
| Get order | GET | Orders |
| Update order | PATCH | Orders |
| Generate order invoice | POST | Orders |
| List subscriptions | GET | Subscriptions |
| Get subscription | GET | Subscriptions |
| Update subscription | PATCH | Subscriptions |
| Cancel subscription | POST | Subscriptions |
| List benefits | GET | Benefits |
| Create benefit | POST | Benefits |
| Get benefit | GET | Benefits |
| Update benefit | PATCH | Benefits |
| Delete benefit | DELETE | Benefits |
| List webhooks | GET | Webhooks |
| Create webhook | POST | Webhooks |
| Get webhook | GET | Webhooks |
| Update webhook | PATCH | Webhooks |
| Delete webhook | DELETE | Webhooks |
| List customers | GET | Customers |
| Create customer | POST | Customers |
| Get customer | GET | Customers |
| Update customer | PATCH | Customers |
| Delete customer | DELETE | Customers |
| Get organization | GET | Organizations |
| Update organization | PATCH | Organizations |
| Create customer session | POST | Customer Sessions |
| Get customer session | GET | Customer Sessions |
| List customer orders | GET | Customer Portal |
| Get customer order | GET | Customer Portal |
| List customer subscriptions | GET | Customer Portal |
| Get customer subscription | GET | Customer Portal |
| List customer benefits | GET | Customer Portal |
| Validate license key | POST | License Keys |
| Activate license key | POST | License Keys |
| Deactivate license key | POST | License Keys |
| Upload file | POST | Files |
| Get file | GET | Files |
| Delete file | DELETE | Files |

## API Definition Endpoints

You can fetch the complete API specification for this provider:

**New Format (OpenAPI spec):**
```bash
curl 'https://backend.lowcodeapi.com/polarsh/openapi'
```

**Old Format (API definition):**
```bash
curl 'https://backend.lowcodeapi.com/polarsh/definition'
```

## Response Format

All responses are wrapped in a `data` key:

```json
{
  "data": {
    // Actual response from provider (object or array)
  }
}
```