Subscription Product
The subscription primarily built around plans, and plans must be associated with products. To create a product, it is sufficient to provide only the name parameter.
A product can have multiple payment plans, and it is possible to perform all these operations both through the API and the iyzico merchant panel.
The product name is a unique value, and it is possible to create unlimited products that will be distinct from each other.
There are five different methods that can be used on products.
A product can be deleted only if it does not have an associated plan. If a product associated with a plan needs to be deleted, the associated plan must be deleted first.
Create Product
The Subscription API collects recurring payments based on payment plans, and each payment plan is associated with at least one product. There are no limitations on the number of products, and a product can be created simply by sending the name information.
Create Product
POST
https://api.iyzipay.com/v2/subscription/products
Request Body
locale
String
It is used to set the language of the text returned as a result of the iyzico request. The default value is tr.
name*
String
Product name. It must be a unique name. An existing name cannot be given to another product
conversationId
String
It is a value that you can send during the request and receive in the response, used to match the request and response. The most common usage is the product number of the merchant
Description
String
Product description. This description can be shown to customers or it can be a note on your side.
Create Product Response;
status
String
It indicates the result of the request. If the transaction is successful, it returns a 'success' value
systemTime
Long
The returned result is the current Unix timestamp value at that moment.
referenceCode
String
It is a unique reference code for the created product. It is used to update or delete a product, view product details, and create a plan for the product.
createdDate
Long
Date of product creation
name
String
Name of product
description
String
Product description. If it was sent during the request, this information is returned in the response.
pricingPlans
Array
It shows the plans associated with the product. It comes empty when the product is created as there are no plans associated with it at that time
Create Product Sample Codes
Update Product
Update Product
POST
https://api.iyzipay.com/v2/subscription/products/{reference_code}
Request Body
productReferenceCode*
String
It is a unique reference code for the created product. It is used to update or delete a product, view product details, and create a plan for the product.
locale
String
It is used to set the language of the text returned as a result of the iyzico request. The default value is tr.
Description
String
Product description. This description can be shown to customers or it can be a note on your side.
name*
String
Product name. It must be a unique name. An existing name cannot be given to another product
Update Product Response;
status
String
It indicates the result of the request. If the transaction is successful, it returns a 'success' value
systemTime
Long
The returned result is the current Unix timestamp value at that moment.
data.referenceCode
String
It is a unique reference code for the created product. It is used to update or delete a product, view product details, and create a plan for the product.
data.createdDate
Long
Date of product creation.
data.name
String
Name of product.
data.description
String
Product description. If it was sent during the request, this information is returned in the response.
data.status
String
It indicates the status of the product. The default is ACTIVE.
data.pricingPlans
Array
It displays the plans associated with the product.
Update Product Sample Codes;
Delete Product
Products can be deleted both through the API and the iyzico merchant panel as long as there are no associated plans with them.
Delete Product
DELETE
https://api.iyzipay.com/v2/subscription/products/{reference_code}
Request Body
productReferenceCode*
String
Unique reference code for the product.
Delete Product Response;
status
String
It indicates the result of the request. If the transaction is successful, it returns a 'success' value
systemTime
Long
The returned result is the current Unix timestamp value at that moment.
Get Product
Product details can be accessed through an API request. To do this, it is sufficient to specify the product reference code in the request.
Get Product
GET
https://api.iyzipay.com/v2/subscription/products/{reference_code}
Request Body
productReferenceCode*
String
Unique reference code for the product.
Get Product Response;
status
String
It indicates the result of the request. If the transaction is successful, it returns a 'success' value
systemTime
Long
The returned result is the current Unix timestamp value at that moment.
data.referenceCode
String
Unique reference code for the product.
data.createdDate
Long
Date of product creation.
data.name
String
Name of product.
data.description
String
Product description. If it was sent during the request, this information is returned in the response.
data.status
String
It indicates the status of the product. The default is ACTIVE.
data.pricingPlans
Array
It displays the plans associated with the product.
List Products
The product listing is used to access all products and plans associated with the products. The paging method is used to shorten response time and reduce response size. This allows you to quickly retrieve the list of products page by page.
List Products
GET
https://api.iyzipay.com/v2/subscription/products
Request Body
page*
Integer
It retrieves all the products for the specified page.
count*
Integer
It specifies how many products will be listed per page
List Products Response;
status
String
It indicates the result of the request. If the transaction is successful, it returns a 'success' value
systemTime
Long
The returned result is the current Unix timestamp value at that moment.
data.totalCount
String
It indicates the total number of results.
data.currentPage
Integer
Hangi sayfa için listeleme yapıldığını belirtir.
data.pageCount
Integer
It specifies which page the listing is for.
data.items
Array Object
It is an array containing product details.
Last updated