Veri Modelleri (Data Models)

API'de kullanılan temel nesnelerin ayrıntılı yapısı, veritabanı şemasıyla eşleşir.

Ürün Nesnesi (Product Object)

Kataloğunuzdaki bir ürünü temsil eder.

{
  "id": "uuid",
  "user_id": "uuid",
  "name": "Kablosuz Kulaklık",
  "image_url": "https://example.com/image.jpg",
  "description": "Premium gürültü önleyici kulaklık",
  "created_at": "2023-11-23T10:00:00Z"
}

Video Nesnesi (Video Object)

Oluşturulan bir videoyu temsil eder.

{
  "id": "uuid",
  "user_id": "uuid",
  "product_id": "uuid",
  "template_id": "uuid",
  "status": "completed", // pending, processing, completed, failed
  "video_url": "https://cdn.example.com/video.mp4",
  "thumbnail_url": "https://cdn.example.com/thumb.jpg",
  "user_prompt": {},
  "credits_used": 10,
  "n8n_job_id": "job_123",
  "error_message": null,
  "created_at": "2023-11-23T10:05:00Z",
  "completed_at": "2023-11-23T10:06:30Z",
  "language": "tr"
}

Şablon Nesnesi (Template Object)

Bir video şablonunu temsil eder.

{
  "id": "uuid",
  "name": "Ürün Tanıtımı",
  "description": "Ürün özelliklerinizi sergileyin",
  "preview_image_url": "https://example.com/preview.jpg",
  "prompt_template": "{{product_name}} hakkında bir video oluştur...",
  "environment": "production",
  "is_active": true,
  "sort_order": 0,
  "created_at": "2023-11-23T10:00:00Z",
  "category": "marketing"
}

İşlem Nesnesi (Transaction Object)

Bir bakiye işlemini temsil eder.

{
  "id": "uuid",
  "user_id": "uuid",
  "amount": 100,
  "type": "purchase", // purchase, video_creation, assistant_usage, refund, bonus
  "description": "Kredi satın alma",
  "video_id": null,
  "transaction_id": "tx_123",
  "product_id": null,
  "platform": "stripe",
  "metadata": {},
  "created_at": "2023-11-23T10:00:00Z"
}