Skip to main content
POST
/
api
/
product-parents
Create Product Parent
curl --request POST \
  --url https://qwoty.app/api/product-parents \
  --header 'Authorization: <authorization>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "api_name": "<string>",
  "recurrence_type": "<string>",
  "name": "<string>",
  "reference": "<string>",
  "description": "<string>",
  "is_active": true,
  "id_crm": "<string>",
  "id_erp": "<string>",
  "id_accounting": "<string>"
}
'
{
  "success": true,
  "data": {
    "id": "550e8400-e29b-41d4-a716-446655440000",
    "catalog_ids": ["660e8400-e29b-41d4-a716-446655440001"],
    "name": "Premium Widget",
    "api_name": "premium_widget",
    "recurrence_type": "recurring",
    "reference": "PROD-001",
    "description": "High-quality widget for professional use",
    "is_active": true,
    "id_crm": null,
    "id_erp": null,
    "id_accounting": null,
    "created_at": "2024-12-21T10:30:00Z",
    "updated_at": "2024-12-21T10:30:00Z"
  }
}

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
id_crm
string
External CRM ID
id_erp
string
External ERP ID
id_accounting
string
External accounting ID

Examples

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
  }'

Response

success
boolean
Indicates if the request was successful
data
object
The created product parent object with all fields
{
  "success": true,
  "data": {
    "id": "550e8400-e29b-41d4-a716-446655440000",
    "catalog_ids": ["660e8400-e29b-41d4-a716-446655440001"],
    "name": "Premium Widget",
    "api_name": "premium_widget",
    "recurrence_type": "recurring",
    "reference": "PROD-001",
    "description": "High-quality widget for professional use",
    "is_active": true,
    "id_crm": null,
    "id_erp": null,
    "id_accounting": null,
    "created_at": "2024-12-21T10:30:00Z",
    "updated_at": "2024-12-21T10:30:00Z"
  }
}

Error Responses

{
  "success": false,
  "error": "Validation error",
  "details": [
    "Field 'api_name' is required",
    "Field 'recurrence_type' is required (one_off | recurring)"
  ]
}