# Payment Plan

The subscription system operates by default according to the specified plan. The payment plan is the step where all the necessary features for recurring payments are specified.

Plans have unique names, and one plan can only be associated with one product. If a plan is actively linked to a subscription, it cannot be deleted.

There are five different methods that can be used on plans.

1. [Create Payment Plan](#post-v2-subscription-products-productreferencecode-pricing-plans)
2. [Update Payment Plan](#post-v2-subscription-pricing-plans-pricingplanreferencecode)
3. [List Pricing Plans](#get-v2-subscription-products-productreferencecode-pricing-plans)
4. [Get Payment Plan Detail](#get-v2-subscription-pricing-plans-pricingplanreferencecode)
5. [Delete Payment Plan](#delete-v2-subscription-pricing-plans-pricingplanreferencecode)

### Create Payment Plan

To create a plan, the following details must be provided: product reference number, name, price, currency, payment interval, and other parameters as detailed below.

If a trial period is desired for a subscription, the trialPeriodDays parameter can be used. If this parameter is sent, no subscription will be initiated and no payment will be collected from the card during the specified period.

The Payment Interval parameter specified in the request indicates the payment period. When sending the "WEEKLY" parameter when creating a plan, iyzico will deduct the specified amount from the card every week. Customizing this period is also possible. For example, if you want payments to be collected every 2 weeks, you should send the PaymentInterval value as "WEEKLY" and the paymentIntervalCount value as 2.

{% hint style="info" %}
The planPaymentType parameter is mandatory and can currently only take the value RECURRING.
{% endhint %}

## Create Pricing Plan

> Creates a new pricing plan for a specific product.

```json
{"openapi":"3.0.3","info":{"title":"Subscription Pricing Plan","version":"1.0.0"},"servers":[{"url":"https://api.iyzipay.com","description":"iyzico API"}],"paths":{"/v2/subscription/products/{productReferenceCode}/pricing-plans":{"post":{"summary":"Create Pricing Plan","description":"Creates a new pricing plan for a specific product.","tags":["Pricing Plan"],"parameters":[{"$ref":"#/components/parameters/AuthHeader"},{"$ref":"#/components/parameters/ContentTypeHeader"},{"name":"productReferenceCode","in":"path","required":true,"schema":{"type":"string"},"description":"Reference code of the product the plan will be attached to."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreatePricingPlanRequest"}}}},"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreatePricingPlanResponse"}}}},"400":{"description":"Error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}}},"components":{"parameters":{"AuthHeader":{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"},"description":"Authorization header, IYZWSv2 ile başlayan ve base64 formatında üretilmiş imzalı hash değeridir."},"ContentTypeHeader":{"name":"Content-Type","in":"header","required":true,"schema":{"type":"string"},"description":"Format of the request payload."}},"schemas":{"CreatePricingPlanRequest":{"type":"object","required":["name","price","currencyCode","paymentInterval","planPaymentType"],"properties":{"name":{"type":"string","description":"Pricing plan name."},"price":{"type":"decimal","description":"Amount to charge on each billing period."},"currencyCode":{"type":"string","enum":["TRY","USD","EUR"],"description":"Currency. (For foreign currency, only non-TRY cards are allowed.)"},"paymentInterval":{"type":"string","enum":["DAILY","WEEKLY","MONTHLY","YEARLY"],"description":"Recurrence interval for the subscription charge."},"planPaymentType":{"type":"string","enum":["RECURRING"],"description":"Subscription type."},"paymentIntervalCount":{"type":"integer","description":"Frequency multiplier for the interval. For example, if you set a weekly plan and send **2**, the charge occurs every 2 weeks."},"recurrenceCount":{"type":"integer","description":"Total number of repeats (e.g., **12** → 12 months). If omitted, it continues until the subscription is canceled."},"trialPeriodDays":{"type":"integer","description":"Free trial length in days. If provided, the first charge happens after this period."},"locale":{"type":"string","enum":["tr","en"],"description":"Language of the response and error messages."},"conversationId":{"type":"string","description":"Custom identifier for request tracking."}}},"CreatePricingPlanResponse":{"type":"object","properties":{"status":{"type":"string","enum":["success","failure"],"description":"Result of the operation."},"systemTime":{"type":"integer","description":"Operation time (epoch ms)."},"data":{"type":"object","properties":{"referenceCode":{"type":"string","description":"Reference code of the created plan."},"createdDate":{"type":"integer","description":"Plan creation time (epoch ms)."},"name":{"type":"string","description":"Plan name."},"productReferenceCode":{"type":"string","description":"Product reference code."},"price":{"type":"decimal","description":"Subscription price."},"currencyCode":{"type":"string","enum":["TRY","USD","EUR"],"description":"Currency code."},"paymentInterval":{"type":"string","enum":["DAILY","WEEKLY","MONTHLY","YEARLY"],"description":"Billing interval."},"paymentIntervalCount":{"type":"integer","description":"Interval multiplier."},"planPaymentType":{"type":"string","enum":["RECURRING"],"description":"Subscription type."},"recurrenceCount":{"type":"integer","description":"Number of repeats."},"trialPeriodDays":{"type":"integer","description":"Trial period (days)."},"status":{"type":"string","enum":["ACTIVE"],"description":"Plan status."}}}}},"ErrorResponse":{"type":"object","properties":{"status":{"type":"string","enum":["failure"]},"errorCode":{"type":"string"},"errorMessage":{"type":"string"},"systemTime":{"type":"integer"}}}}}}
```

#### Sample Codes

<table data-view="cards"><thead><tr><th></th></tr></thead><tbody><tr><td><a href="https://github.com/iyzico/iyzipay-php/blob/master/samples/subscription-samples/create_pricing_plan.php">PHP</a></td></tr><tr><td><a href="https://github.com/iyzico/iyzipay-java/blob/master/src/test/java/com/iyzipay/sample/subscription/SubscriptionPricingPlanSample.java#L23">Java</a></td></tr><tr><td><a href="https://github.com/iyzico/iyzipay-dotnet/blob/master/Iyzipay.Samples/SubscriptionPlanSample.cs#L13">.NET</a></td></tr><tr><td><a href="https://github.com/iyzico/iyzipay-node/blob/master/samples/IyzipaySubscriptionSamples.js#L85">Node.Js</a></td></tr><tr><td><a href="https://www.postman.com/iyzico/iyzico/request/uxl6d4z/2-1-create-pricing-plan">Postman</a></td></tr></tbody></table>

## Update Pricing Plan

> This method allows updating \*\*only\*\* the \*\*name\*\* and \*\*trialPeriodDays\*\* fields.   The plan's reference code must be provided as a path parameter.   Updates can be performed via API or the iyzico merchant panel. Active subscriptions are not affected.<br>

```json
{"openapi":"3.0.3","info":{"title":"Subscription Pricing Plan","version":"1.0.0"},"servers":[{"url":"https://api.iyzipay.com","description":"iyzico API"}],"paths":{"/v2/subscription/pricing-plans/{pricingPlanReferenceCode}":{"post":{"summary":"Update Pricing Plan","description":"This method allows updating **only** the **name** and **trialPeriodDays** fields.   The plan's reference code must be provided as a path parameter.   Updates can be performed via API or the iyzico merchant panel. Active subscriptions are not affected.\n","tags":["Pricing Plan"],"parameters":[{"$ref":"#/components/parameters/AuthHeader"},{"$ref":"#/components/parameters/ContentTypeHeader"},{"name":"pricingPlanReferenceCode","in":"path","required":true,"schema":{"type":"string"},"description":"Reference code of the pricing plan to be updated."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdatePricingPlanRequest"}}}},"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdatePricingPlanResponse"}}}},"400":{"description":"Error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}}},"components":{"parameters":{"AuthHeader":{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"},"description":"Authorization header, IYZWSv2 ile başlayan ve base64 formatında üretilmiş imzalı hash değeridir."},"ContentTypeHeader":{"name":"Content-Type","in":"header","required":true,"schema":{"type":"string"},"description":"Format of the request payload."}},"schemas":{"UpdatePricingPlanRequest":{"type":"object","required":["name"],"properties":{"name":{"type":"string","description":"Updated plan name."},"trialPeriodDays":{"type":"integer","description":"Updated trial period (days)."}}},"UpdatePricingPlanResponse":{"type":"object","properties":{"status":{"type":"string","enum":["success","failure"],"description":"Result of the operation."},"systemTime":{"type":"integer","description":"Operation time (epoch ms)."},"data":{"type":"object","properties":{"referenceCode":{"type":"string","description":"Reference code of the updated plan."},"createdDate":{"type":"integer","description":"Plan creation time (epoch ms)."},"name":{"type":"string","description":"Updated plan name."},"price":{"type":"decimal","description":"Plan price."},"paymentInterval":{"type":"string","enum":["DAILY","WEEKLY","MONTHLY","YEARLY"],"description":"Billing interval."},"paymentIntervalCount":{"type":"integer","description":"Interval multiplier."},"trialPeriodDays":{"type":"integer","description":"Updated trial period (days)."},"currencyCode":{"type":"string","enum":["TRY","USD","EUR"],"description":"Currency code."},"productReferenceCode":{"type":"string","description":"Product reference code."},"planPaymentType":{"type":"string","enum":["RECURRING"],"description":"Subscription type."},"status":{"type":"string","enum":["ACTIVE"],"description":"Plan status."},"recurrenceCount":{"type":"integer","description":"Number of repeats."}}}}},"ErrorResponse":{"type":"object","properties":{"status":{"type":"string","enum":["failure"]},"errorCode":{"type":"string"},"errorMessage":{"type":"string"},"systemTime":{"type":"integer"}}}}}}
```

#### Sample Codes

<table data-view="cards"><thead><tr><th></th></tr></thead><tbody><tr><td><a href="https://github.com/iyzico/iyzipay-php/blob/master/samples/subscription-samples/update_pricing_plan.php">PHP</a></td></tr><tr><td><a href="https://github.com/iyzico/iyzipay-java/blob/master/src/test/java/com/iyzipay/sample/subscription/SubscriptionPricingPlanSample.java#L53">Java</a></td></tr><tr><td><a href="https://github.com/iyzico/iyzipay-dotnet/blob/master/Iyzipay.Samples/SubscriptionPlanSample.cs#L51">.NET</a></td></tr><tr><td><a href="https://github.com/iyzico/iyzipay-node/blob/master/samples/IyzipaySubscriptionSamples.js#L107">Node.Js</a></td></tr><tr><td><a href="https://www.postman.com/iyzico/iyzico/request/8h7wmj4/2-2-update-pricing-plan">Postman</a></td></tr></tbody></table>

## List Pricing Plans

> Lists all pricing plans for a given product. The response is paginated.

```json
{"openapi":"3.0.3","info":{"title":"Subscription Pricing Plan","version":"1.0.0"},"servers":[{"url":"https://api.iyzipay.com","description":"iyzico API"}],"paths":{"/v2/subscription/products/{productReferenceCode}/pricing-plans":{"get":{"summary":"List Pricing Plans","description":"Lists all pricing plans for a given product. The response is paginated.","tags":["Pricing Plan"],"parameters":[{"$ref":"#/components/parameters/AuthHeader"},{"$ref":"#/components/parameters/ContentTypeHeader"},{"name":"productReferenceCode","in":"path","required":true,"schema":{"type":"string"},"description":"Product reference code."},{"name":"page","in":"query","schema":{"type":"integer"},"description":"Page number to list."},{"name":"count","in":"query","schema":{"type":"integer"},"description":"Number of records per page."}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListPricingPlanResponse"}}}},"400":{"description":"Error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}}},"components":{"parameters":{"AuthHeader":{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"},"description":"Authorization header, IYZWSv2 ile başlayan ve base64 formatında üretilmiş imzalı hash değeridir."},"ContentTypeHeader":{"name":"Content-Type","in":"header","required":true,"schema":{"type":"string"},"description":"Format of the request payload."}},"schemas":{"ListPricingPlanResponse":{"type":"object","properties":{"status":{"type":"string","enum":["success","failure"]},"systemTime":{"type":"integer"},"data":{"type":"object","properties":{"totalCount":{"type":"integer","description":"Total record count."},"currentPage":{"type":"integer"},"pageCount":{"type":"integer"},"items":{"type":"array","items":{"$ref":"#/components/schemas/CreatePricingPlanResponse/properties/data"}}}}}},"CreatePricingPlanResponse":{"properties":{"data":{"type":"object","properties":{"referenceCode":{"type":"string","description":"Reference code of the created plan."},"createdDate":{"type":"integer","description":"Plan creation time (epoch ms)."},"name":{"type":"string","description":"Plan name."},"productReferenceCode":{"type":"string","description":"Product reference code."},"price":{"type":"decimal","description":"Subscription price."},"currencyCode":{"type":"string","enum":["TRY","USD","EUR"],"description":"Currency code."},"paymentInterval":{"type":"string","enum":["DAILY","WEEKLY","MONTHLY","YEARLY"],"description":"Billing interval."},"paymentIntervalCount":{"type":"integer","description":"Interval multiplier."},"planPaymentType":{"type":"string","enum":["RECURRING"],"description":"Subscription type."},"recurrenceCount":{"type":"integer","description":"Number of repeats."},"trialPeriodDays":{"type":"integer","description":"Trial period (days)."},"status":{"type":"string","enum":["ACTIVE"],"description":"Plan status."}}}}},"ErrorResponse":{"type":"object","properties":{"status":{"type":"string","enum":["failure"]},"errorCode":{"type":"string"},"errorMessage":{"type":"string"},"systemTime":{"type":"integer"}}}}}}
```

#### Sample Codes

<table data-view="cards"><thead><tr><th></th></tr></thead><tbody><tr><td><a href="https://github.com/iyzico/iyzipay-php/blob/master/samples/subscription-samples/list_pricing_plan.php">PHP</a></td></tr><tr><td><a href="https://github.com/iyzico/iyzipay-java/blob/master/src/test/java/com/iyzipay/sample/subscription/SubscriptionPricingPlanListSample.java">Java</a></td></tr><tr><td><a href="https://github.com/iyzico/iyzipay-dotnet/blob/master/Iyzipay.Samples/SubscriptionPlanSample.cs#L116">.NET</a></td></tr><tr><td><a href="https://github.com/iyzico/iyzipay-node/blob/master/samples/IyzipaySubscriptionSamples.js#L144">Node.Js</a></td></tr><tr><td><a href="https://www.postman.com/iyzico/iyzico/request/mfeq6b3/2-4-list-pricing-plans">Postman</a></td></tr></tbody></table>

## Get Pricing Plan Detail

> Returns details of a pricing plan. Merchants can see all details both in the merchant panel and via API.

```json
{"openapi":"3.0.3","info":{"title":"Subscription Pricing Plan","version":"1.0.0"},"servers":[{"url":"https://api.iyzipay.com","description":"iyzico API"}],"paths":{"/v2/subscription/pricing-plans/{pricingPlanReferenceCode}":{"get":{"summary":"Get Pricing Plan Detail","description":"Returns details of a pricing plan. Merchants can see all details both in the merchant panel and via API.","tags":["Pricing Plan"],"parameters":[{"$ref":"#/components/parameters/AuthHeader"},{"$ref":"#/components/parameters/ContentTypeHeader"},{"name":"pricingPlanReferenceCode","in":"path","required":true,"schema":{"type":"string"},"description":"Pricing plan reference code."}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PricingPlanDetailResponse"}}}},"400":{"description":"Error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}}},"components":{"parameters":{"AuthHeader":{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"},"description":"Authorization header, IYZWSv2 ile başlayan ve base64 formatında üretilmiş imzalı hash değeridir."},"ContentTypeHeader":{"name":"Content-Type","in":"header","required":true,"schema":{"type":"string"},"description":"Format of the request payload."}},"schemas":{"PricingPlanDetailResponse":{"type":"object","properties":{"status":{"type":"string","enum":["success","failure"]},"systemTime":{"type":"integer"},"data":{"$ref":"#/components/schemas/CreatePricingPlanResponse/properties/data"}}},"CreatePricingPlanResponse":{"properties":{"data":{"type":"object","properties":{"referenceCode":{"type":"string","description":"Reference code of the created plan."},"createdDate":{"type":"integer","description":"Plan creation time (epoch ms)."},"name":{"type":"string","description":"Plan name."},"productReferenceCode":{"type":"string","description":"Product reference code."},"price":{"type":"decimal","description":"Subscription price."},"currencyCode":{"type":"string","enum":["TRY","USD","EUR"],"description":"Currency code."},"paymentInterval":{"type":"string","enum":["DAILY","WEEKLY","MONTHLY","YEARLY"],"description":"Billing interval."},"paymentIntervalCount":{"type":"integer","description":"Interval multiplier."},"planPaymentType":{"type":"string","enum":["RECURRING"],"description":"Subscription type."},"recurrenceCount":{"type":"integer","description":"Number of repeats."},"trialPeriodDays":{"type":"integer","description":"Trial period (days)."},"status":{"type":"string","enum":["ACTIVE"],"description":"Plan status."}}}}},"ErrorResponse":{"type":"object","properties":{"status":{"type":"string","enum":["failure"]},"errorCode":{"type":"string"},"errorMessage":{"type":"string"},"systemTime":{"type":"integer"}}}}}}
```

#### Sample Codes

<table data-view="cards"><thead><tr><th></th></tr></thead><tbody><tr><td><a href="https://github.com/iyzico/iyzipay-php/blob/master/samples/subscription-samples/retrieve_pricing_plan.php">PHP</a></td></tr><tr><td><a href="https://github.com/iyzico/iyzipay-java/blob/master/src/test/java/com/iyzipay/sample/subscription/SubscriptionPricingPlanSample.java#L76">Java</a></td></tr><tr><td><a href="https://github.com/iyzico/iyzipay-dotnet/blob/master/Iyzipay.Samples/SubscriptionPlanSample.cs#L95">.NET</a></td></tr><tr><td><a href="https://github.com/iyzico/iyzipay-node/blob/master/samples/IyzipaySubscriptionSamples.js#L133">Node.Js</a></td></tr><tr><td><a href="https://www.postman.com/iyzico/iyzico/request/q6nanss/2-3-retrieve-pricing-plan">Postman</a></td></tr></tbody></table>

## Delete Pricing Plan

> Deletes the specified pricing plan by reference code. Plans with active subscriptions or pending updates cannot be deleted.

```json
{"openapi":"3.0.3","info":{"title":"Subscription Pricing Plan","version":"1.0.0"},"servers":[{"url":"https://api.iyzipay.com","description":"iyzico API"}],"paths":{"/v2/subscription/pricing-plans/{pricingPlanReferenceCode}":{"delete":{"summary":"Delete Pricing Plan","description":"Deletes the specified pricing plan by reference code. Plans with active subscriptions or pending updates cannot be deleted.","tags":["Pricing Plan"],"parameters":[{"$ref":"#/components/parameters/AuthHeader"},{"$ref":"#/components/parameters/ContentTypeHeader"},{"name":"pricingPlanReferenceCode","in":"path","required":true,"schema":{"type":"string"},"description":"Reference code of the pricing plan to delete."}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeletePricingPlanResponse"}}}},"400":{"description":"Error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}}},"components":{"parameters":{"AuthHeader":{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"},"description":"Authorization header, IYZWSv2 ile başlayan ve base64 formatında üretilmiş imzalı hash değeridir."},"ContentTypeHeader":{"name":"Content-Type","in":"header","required":true,"schema":{"type":"string"},"description":"Format of the request payload."}},"schemas":{"DeletePricingPlanResponse":{"type":"object","properties":{"status":{"type":"string","enum":["success","failure"]},"systemTime":{"type":"integer"}}},"ErrorResponse":{"type":"object","properties":{"status":{"type":"string","enum":["failure"]},"errorCode":{"type":"string"},"errorMessage":{"type":"string"},"systemTime":{"type":"integer"}}}}}}
```

#### Sample Codes

<table data-view="cards"><thead><tr><th></th></tr></thead><tbody><tr><td><a href="https://github.com/iyzico/iyzipay-php/blob/master/samples/subscription-samples/delete_pricing_plan.php">PHP</a></td></tr><tr><td><a href="https://github.com/iyzico/iyzipay-java/blob/master/src/test/java/com/iyzipay/sample/subscription/SubscriptionPricingPlanSample.java#L84">Java</a></td></tr><tr><td><a href="https://github.com/iyzico/iyzipay-dotnet/blob/master/Iyzipay.Samples/SubscriptionPlanSample.cs#L77">.NET</a></td></tr><tr><td><a href="https://github.com/iyzico/iyzipay-node/blob/master/samples/IyzipaySubscriptionSamples.js#L122">Node.Js</a></td></tr><tr><td><a href="https://www.postman.com/iyzico/iyzico/request/47010871-a51b486e-7872-43e7-92fe-d23678600f86">Postman</a></td></tr></tbody></table>


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.iyzico.com/en/products/subscription/subscription-implementation/payment-plan.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
