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

# Ürün Oluşturma

> Modern ödeme altyapısı için güçlü ve esnek API çözümü

> [!NOTE]
>
> Ödeme işlemlerinizde kullanmak üzere ürün oluşturabilirsiniz. Ürünler, ödeme işlemlerinizin temelini oluşturur ve her ürün için fiyat, açıklama gibi bilgileri saklayabilirsiniz.
>
> Detaylı yönetim için Tahsilat arayüzünden ürünlerinizi yönetebilirsiniz.

> [!WARNING]
>
> Tahsilat.com için ödeme işlemlerinde ürün bilgisi zorunludur.

İstek:

```php PHP theme={null}
$tahsilat = new TahsilatClient('sk_test_rwwg...');

$product = $tahsilat->products->create([
    'product_name' => 'Premium Subscription',
    'price' => 9999,
    'description' => 'Monthly premium subscription',
    'metadata' => [
        'category' => 'subscription'
    ]
]);
```

```csharp .NET theme={null}
var tahsilat = new TahsilatClient("sk_test_rwwg...");

var request = new ProductCreateRequest
{
    ProductName = "Premium Subscription",
    Price = 9999,
    Description = "Integration Test Product",
    Metadata = new()
    {
        new Dictionary<string, object>
        {
            ["category"] = "subscription",
        },
    }
};

var response = await tahsilat.Products.CreateAsync(request);
```

```curl cURL theme={null}
curl -L 'https://api.tahsilat.com/v1/products' \
-H 'Content-Type: application/x-www-form-urlencoded' \
-H 'Accept-Language: tr' \
-H 'Authorization: Bearer {access_token}' \
-d 'product_name=Premium Subscription' \
-d 'price=9999' \
-d 'description=Monthly premium subscription' \
-d 'metadata={"category":"subscription"}'
```

Yanıt:

```php PHP theme={null}

^ Tahsilat\Resource\Product {
    "id": 55195540441484
    "merchant_id": 1234567
    "product_name": "Premium Subscription"
    "price": 9999
    "currency_code": "TRY"
    "quantity": 1
    "description": "Monthly premium subscription"
    "product_image": null
    "created_at": "2025-06-11T20:48:31+03:00"
    "updated_at": "2025-06-11T20:48:31+03:00"
    "formatted_price": "99,99"
    "formatted_created_at": "11 Haz, 2025, 20:48"
    "system_id": 7
    "metadata": array:1 [
        0 => array:5 [
            "merchant_id" => "1234567"
            "key" => "category"
            "value" => "subscription"
            "created_at" => "2025-06-11T20:48:31+03:00"
            "updated_at" => "2025-06-11T20:48:31+03:00"
        ]
    ]
    "timeline": array:1 [
        0 => array:5 [
            "type" => "created"
            "order" => 1
            "text" => "Ürün oluşturuldu."
            "date" => "11.06.2025 20:48"
            "icon" => "fa-user-clock"
        ]
    ]
}
```

```csharp .NET theme={null}
{
  "Id": 31733022327942,
  "MerchantId": 1234567,
  "ProductName": "Premium Subscription",
  "Price": 9999,
  "CurrencyCode": "TRY",
  "Quantity": 1,
  "Description": "Integration Test Product",
  "ProductImage": null,
  "CreatedAt": "2025-06-11T20:48:31+03:00",
  "UpdatedAt": "2025-06-11T20:48:31+03:00",
  "FormattedPrice": "99,99",
  "FormattedCreatedAt": "4 Mar, 00:50",
  "SystemId": 2,
  "Metadata": [
    {
      "Key": "category",
      "Value": "subscription"
    }
  ],
  "Timeline": [
    {
      "Type": "created",
      "Order": 1,
      "Text": "Ürün oluşturuldu.",
      "Date": "04.03.2026 00:50",
      "Icon": "fa-user-clock"
    }
  ]
}
```

Ödeme Başlatma

```php PHP theme={null}
$tahsilat = new TahsilatClient('sk_test_rwwg...');

$product = $tahsilat->products->create([
    'product_name' => 'Premium Subscription',
    'price' => 9999,
    'description' => 'Monthly premium subscription',
    'metadata' => [
    'category' => 'subscription'
    ]
]);

$payment = $tahsilat->payments->create([
    'currency' => 'TRY',
    'amount' => 1000,
    'product_ids' => [
        $product->id
    ],
]);
```

```csharp .NET theme={null}
var tahsilat = new TahsilatClient("sk_test_rwwg...");

var productRequest = new ProductCreateRequest
{
    ProductName = "Premium Subscription",
    Price = 9999,
    Description = "Integration Test Product",
    Metadata = new()
    {
        new Dictionary<string, object>
        {
            ["category"] = "subscription",
        },
    }
};

var productResponse = await tahsilat.Products.CreateAsync(productRequest);

var paymentRequest = new PaymentCreateRequest
{
    Amount = 1000,
    Currency = "TRY",
    ProductIds = new List<long> { productResponse.Id },
    Metadata = new()
    {
        new Dictionary<string, object>
        {
            ["order_id"] = 123456,
            ["customer_type"] = "premium"
        },
    },
};

var paymentResponse = await tahsilat.Payments.CreateAsync(paymentRequest);
```

## Zorunlu ve İsteğe Bağlı Parametreler

**product\_name** `string` *required*

Ürünün adı. Bu alan zorunludur ve ürünün tanımlanmasında kullanılır.

**price** `integer` *required*

Ürünün fiyatı. Bu alan zorunludur ve ürünün satış fiyatını belirtir. Fiyat, kuruş cinsinden belirtilmelidir (örneğin, 99,99 TL için 9999).

**description** `string`

Ürünün açıklaması. Bu alan isteğe bağlıdır ancak ürünün ne olduğunu açıklamak için kullanışlıdır.

Açıklama belirtildiği takdirde, Ödeme arayüzünde de görüntülenir.

**is\_recurring** `boolean`

Ürünün abonelik (tekrarlayan ödeme) ürünü olduğunu belirtir. `true` ise `billing_interval` ve `interval_count` zorunludur.
Ayrıntılar için [Abonelik Oluşturma](https://docs.tahsilat.com/api-reference/subscriptions/index.md) sayfasına bakın.

**billing\_interval** `integer`

Abonelik faturalama aralığı: `1` gün, `2` hafta, `3` ay, `4` yıl. Yalnızca `is_recurring=true` ile kullanılır.

**interval\_count** `integer`

Aralık çarpanı (1-366). Örneğin `billing_interval=3`, `interval_count=2` iki ayda bir tahsilat demektir. Yalnızca `is_recurring=true` ile kullanılır.

**metadata** `array`

Ürüne ait ek verileri içeren dizi. Bu parametre isteğe bağlıdır, ancak ürün yönetimi ve raporlaması için önerilir. Örneğin, kategori, stok durumu gibi bilgiler burada saklanabilir.

## Metadata Güncelleme

Ürünün yalnız metadata alanlarını güncellemek için kullanılır. Abonelik başlamış ya da ödemesi başlamış olduğu için adı ve fiyatı değiştirilemeyen ürünlerde de çalışır.

> [!WARNING]
>
> Gönderilen liste mevcut metadata'nın tamamının yerine geçer. Saklamak istediğiniz anahtarları da gönderin; boş liste tüm metadata'yı siler.

```bash cURL theme={null}
curl https://api.tahsilat.com/v1/products/update-metadata/55195540441484 \
-H "Authorization: Bearer ACCESS_TOKEN" \
-d 'metadata[0][key]=category' \
-d 'metadata[0][value]=subscription'
```

**metadata** `array`

Ürüne yazılacak `key` ve `value` çiftleri, en fazla 25 adet. `key` küçük harfle başlar, yalnız küçük harf, rakam ve alt çizgi içerir, en fazla 20 karakterdir. `value` en fazla 200 karakterdir.

Başarılı yanıtta güncel ürün bilgisi döner.

```md Endpoint theme={null}
POST /v1/products
POST /v1/products/:product_id
POST /v1/products/update-metadata/:product_id
GET /v1/products/:product_id
GET /v1/products/search?:sources
DEL /v1/products/:product_id
```

İstek

```php PHP theme={null}
$tahsilat = new TahsilatClient('sk_test_rwwg...');

$product = $tahsilat->products->create([
    'product_name' => 'Premium Subscription',
    'price' => 9999,
    'description' => 'Monthly premium subscription',
    'metadata' => [
        'category' => 'subscription'
    ]
]);
```

```csharp .NET theme={null}
var tahsilat = new TahsilatClient("sk_test_rwwg...");

var request = new ProductCreateRequest
{
    ProductName = "Premium Subscription",
    Price = 9999,
    Description = "Integration Test Product",
    Metadata = new()
    {
        new Dictionary<string, object>
        {
            ["category"] = "subscription",
        },
    }
};

var response = await tahsilat.Products.CreateAsync(request);
```

```curl cURL theme={null}
curl -L 'https://api.tahsilat.com/v1/products' \
-H 'Content-Type: application/x-www-form-urlencoded' \
-H 'Accept-Language: tr' \
-H 'Authorization: Bearer {access_token}' \
-d 'product_name=Premium Subscription' \
-d 'price=9999' \
-d 'description=Monthly premium subscription' \
-d 'metadata={"category":"subscription"}'
```

Yanıt

```php PHP theme={null}
^ Tahsilat\Resource\Product {
    "id": 55195540441484,
    "merchant_id": 1234567,
    "product_name": "Premium Subscription",
    "price": 9999,
    "currency_code": "TRY",
    "quantity": 1,
    "description": "Monthly premium subscription",
    "product_image": null,
    "created_at": "2025-06-11T20:48:31+03:00",
    "updated_at": "2025-06-11T20:48:31+03:00",
    "formatted_price": "99,99",
    "formatted_created_at": "11 Haz, 2025, 20:48",
    "system_id": 7,
    "metadata": array:1 [
        0 => array:5 [
            "merchant_id" => "1234567",
            "key" => "category",
            "value" => "subscription",
            "created_at" => "2025-06-11T20:48:31+03:00",
            "updated_at" => "2025-06-11T20:48:31+03:00"
        ]
    ],
    "timeline": array:1 [
        0 => array:5 [
            "type" => "created",
            "order" => 1,
            "text" => "Ürün oluşturuldu.",
            "date" => "11.06.2025 20:48",
            "icon" => "fa-user-clock"
        ]
    ]
}
```

```csharp .NET theme={null}
{
  "Id": 31733022327942,
  "MerchantId": 1234567,
  "ProductName": "Premium Subscription",
  "Price": 9999,
  "CurrencyCode": "TRY",
  "Quantity": 1,
  "Description": "Integration Test Product",
  "ProductImage": null,
  "CreatedAt": "2025-06-11T20:48:31+03:00",
  "UpdatedAt": "2025-06-11T20:48:31+03:00",
  "FormattedPrice": "99,99",
  "FormattedCreatedAt": "4 Mar, 00:50",
  "SystemId": 2,
  "Metadata": [
    {
      "Key": "category",
      "Value": "subscription"
    }
  ],
  "Timeline": [
    {
      "Type": "created",
      "Order": 1,
      "Text": "Ürün oluşturuldu.",
      "Date": "04.03.2026 00:50",
      "Icon": "fa-user-clock"
    }
  ]
}
```


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