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

# Create Product Parent

> Create a new product parent in your workspace

## Authorization

**Authorization** `string` *required*

Bearer token for authentication. Format: `Bearer qwoty_your_token`

## Request Body

**api\_name** `string` *required*

Unique API identifier (snake\_case)

**recurrence\_type** `string` *required*

Billing model. Allowed values: `one_off`, `recurring`

**name** `string` *required*

Product parent name

**reference** `string`

Internal reference

**description** `string`

Product description

**is\_active** `boolean` (default: true)

Active status

**identifiers** `object`

External system identifiers

**Identifiers**

**identifiers.crm** `string`

CRM identifier

**identifiers.erp** `string`

ERP identifier

**identifiers.accounting** `string`

Accounting identifier

## Examples

```bash cURL theme={null}
curl -X POST https://qwoty.app/api/product-parents \
  -H "Authorization: Bearer qwoty_your_token" \
  -H "Content-Type: application/json" \
  -d '{
    "api_name": "premium_widget",
    "recurrence_type": "recurring",
    "name": "Premium Widget",
    "description": "High-quality widget for professional use",
    "reference": "PROD-001",
    "is_active": true
  }'
```

```javascript JavaScript theme={null}
const response = await fetch('https://qwoty.app/api/product-parents', {
  method: 'POST',
  headers: {
    Authorization: 'Bearer qwoty_your_token',
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
    api_name: 'premium_widget',
    recurrence_type: 'recurring',
    name: 'Premium Widget',
    description: 'High-quality widget for professional use',
    reference: 'PROD-001',
    is_active: true,
  }),
})

const data = await response.json()
```

```python Python theme={null}
import requests

response = requests.post(
    'https://qwoty.app/api/product-parents',
    headers={
        'Authorization': 'Bearer qwoty_your_token',
        'Content-Type': 'application/json'
    },
    json={
        'api_name': 'premium_widget',
        'recurrence_type': 'recurring',
        'name': 'Premium Widget',
        'description': 'High-quality widget for professional use',
        'reference': 'PROD-001',
        'is_active': True
    }
)

data = response.json()
```

## Response

**success** `boolean`

Indicates if the request was successful

**data** `object`

The created product parent object with all fields

```json Success Response theme={null}
{
  "success": true,
  "data": {
    "id": "550e8400-e29b-41d4-a716-446655440000",
    "catalogs": [
      {
        "id": "660e8400-e29b-41d4-a716-446655440001",
        "name": "Main Catalog",
        "api_name": "catalog_main"
      }
    ],
    "name": "Premium Widget",
    "api_name": "premium_widget",
    "recurrence_type": "recurring",
    "reference": "PROD-001",
    "description": "High-quality widget for professional use",
    "is_active": true,
    "identifiers": {
      "crm": null,
      "erp": null,
      "accounting": null
    },
    "created_at": "2024-12-21T10:30:00Z",
    "updated_at": "2024-12-21T10:30:00Z"
  }
}
```

## Error Responses

```json Validation Error theme={null}
{
  "error": "Validation error",
  "details": [
    "Field 'api_name' is required",
    "Field 'recurrence_type' is required (one_off | recurring)"
  ]
}
```

```json Unauthorized theme={null}
{
  "error": "Invalid or expired token"
}
```


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