Subscription Transactions
A subscription that was started as pending can be activated via this service.
Reference code of the subscription that was started as pending.
a2077643-bab7-4b73-85a5-7676c78d7c66Authorization header; a Base64-encoded signed hash value that begins with IYZWSv2.
Request body content type.
application/jsonReference code of the subscription that was started as pending.
a2077643-bab7-4b73-85a5-7676c78d7c66Successful response
Indicates the result of the request. Returns success if the operation succeeds.
Unix timestamp (milliseconds) of the response.
Error response
POST https://api.iyzipay.com/v2/subscription/subscriptions/009dac1a-00dc-41e8-a92f-2c24b18e27b9/activate
Authorization: IYZWSv2 YXBpS2V5OnNhbmRib....E0OGI1MTE=
Content-Type: application/json
{
"referenceCode": "a2077643-bab7-4b73-85a5-7676c78d7c66"
}
{
"status": "success",
"systemTime": 1687096973255
}Cancels an active subscription.
Reference code of the subscription to cancel.
009dac1a-00dc-41e8-a92f-2c24b18e27b9Authorization header, a signed hash value that starts with IYZWSv2 and is generated in Base64 format.
Content format of the request.
application/jsonSubscription reference code. Can optionally be sent in the request body.
a2077643-bab7-4b73-85a5-7676c78d7c66Successful response
Result of the request. Returns success if the operation is successful.
Server time of the response (epoch ms).
Error response
POST https://api.iyzipay.com/v2/subscription/subscriptions/009dac1a-00dc-41e8-a92f-2c24b18e27b9/cancel
Authorization: IYZWSv2 YXBpS2V5OnNhbmRib....E0OGI1MTE=
Content-Type: application/json
{
"subscriptionReferenceCode": "a2077643-bab7-4b73-85a5-7676c78d7c66"
}
{
"status": "success",
"systemTime": 1687096973255
}If a recurring payment fails for a subscription, use this service to retry the charge and collect the payment.
Authorization header, a signed hash value that starts with IYZWSv2 and is generated in Base64 format.
Content format of the request.
application/jsonReference code of the failed payment. This is the orderReferenceCode value provided in the webhook notification for the failed subscription payment.
009dac1a-00dc-41e8-a92f-2c24b18e27b9Successful response
Result of the request. Returns success if the operation is successful.
Server time of the response (epoch ms).
Error response
POST https://api.iyzipay.com/v2/subscription/operation/retry
Authorization: IYZWSv2 YXBpS2V5OnNhbmRib....E0OGI1MTE=
Content-Type: application/json
{
"referenceCode": "a2077643-bab7-4b73-85a5-7676c78d7c66"
}
{
"status": "success",
"systemTime": 1687096973255
}A failed payment transaction can be retried within a maximum of 160 days. If this period is exceeded, no further payment attempts can be made for the subscription.
You can change or upgrade the plan during the subscription, provided that the new plan belongs to the same product and the billing interval (paymentInterval and paymentIntervalCount) remains the same. Use this service for price changes.
Reference code of the subscription to upgrade.
97fb885d-69e3-49ac-8590-9d05c9c6016eAuthorization header, a signed hash value that starts with IYZWSv2 and is generated in Base64 format.
Content format of the request.
application/jsonWhen the upgrade will take effect. Values:
- NOW: Apply the change immediately.
- NEXT_PERIOD: Apply the change at the next billing period.
NOWPossible values: Reference code of the target pricing plan.
dbffa857-40f5-48d1-9179-e9326ffb942dIf true, includes the trial period of the upgraded plan.
false- true: Recalculates the subscription end date according to the new plan’s recurrenceCount.
- false: Keeps the current plan’s end date and transfers it to the new plan.
trueSuccessful response
Result of the request. Returns success if the operation is successful.
Server time of the response (epoch ms).
Error response
POST https://api.iyzipay.com/v2/subscription/subscriptions/97fb885d-69e3-49ac-8590-9d05c9c6016e/upgrade
Authorization: IYZWSv2 YXBpS2V5OnNhbmRib....E0OGI1MTE=
Content-Type: application/json
{
"newPricingPlanReferenceCode": "dbffa857-40f5-48d1-9179-e9326ffb942d",
"upgradePeriod": "NEXT_PERIOD",
"useTrial": false,
"resetRecurrenceCount": true
}
{
"status": "success",
"systemTime": 1755613834401,
"data": {
"referenceCode": "74726a5a-cc3d-4de8-b08c-3e373ea26842",
"parentReferenceCode": "85626e75-5043-4343-89bd-3cbbf33d15ad",
"pricingPlanReferenceCode": "dbffa857-40f5-48d1-9179-e9326ffb942d",
"customerReferenceCode": "279bb493-6fda-45e9-9368-2373ea43ff8d",
"subscriptionStatus": "ACTIVE",
"trialDays": 0,
"createdDate": 1755613834375,
"startDate": 1756045826566,
"endDate": 1787581826566
}
}Updates the credit card used in a subscription. In cases like payment failure or card expiry, merchants can prompt customers to update their card. The update can only be performed through the iyzico Checkout Form. A ₺1 validation charge is taken and immediately refunded to validate the updated card.
Authorization header, a signed hash value that starts with IYZWSv2 and is generated in Base64 format.
Content format of the request.
application/jsonCallback URL where the update result will be posted.
https://www.merchant.com/callbackReference code of the customer whose card will be updated.
279bb493-6fda-45e9-9368-2373ea43ff8dIf updating on a specific subscription, the subscription reference code (optional).
52c732ba-b449-460b-b553-ab21f9074300Response language preference.
enPossible values: Successful response
Operation result.
Response language.
Operation time (epoch ms).
1755679946462ID sent for request/response correlation. Echoed back in the response.
04c6063d-eb03-4817-ba87-33b81e392ecfToken of the card update checkout form.
83832cc6-89b6-4a83-ac9f-dd996a52b2cbHTML content for the checkout form where card information is updated.
Token validity period (seconds).
1800Error response
POST https://api.iyzipay.com/v2/subscription/card-update/checkoutform/initialize
Authorization: IYZWSv2 YXBpS2V5OnNhbmRib....E0OGI1MTE=
Content-Type: application/json
{
"locale": "en",
"callbackUrl": "https://www.merchant.com/callback",
"customerReferenceCode": "279bb493-6fda-45e9-9368-2373ea43ff8d",
"subscriptionReferenceCode": "52c732ba-b449-460b-b553-ab21f9074300"
}
{
"status": "success",
"locale": "en",
"systemTime": 1755679946462,
"conversationId": "04c6063d-eb03-4817-ba87-33b81e392ecf",
"token": "83832cc6-89b6-4a83-ac9f-dd996a52b2cb",
"checkoutFormContent": "<script type=\"text/javascript\">if (typeof iyziInit == 'undefined') {var iyziInit = {currency:\"TRY\",token:\"83832cc6-89b6-4a83-ac9f-dd996a52b2cb\",price:1.00,...}};</script>",
"tokenExpireTime": 1800
}Returns full details of a subscription by its reference code.
Reference code of the subscription to query.
732a16cc-2ec4-4399-9aab-656cb6f5249eAuthorization header, a signed hash value that starts with IYZWSv2 and is generated in Base64 format.
Content format of the request.
application/jsonSubscription reference code. Can optionally be sent in the request body.
732a16cc-2ec4-4399-9aab-656cb6f5249eSuccessful response
Result of the request.
Server time of the response (epoch ms).
GET https://api.iyzipay.com/v2/subscription/subscriptions/732a16cc-2ec4-4399-9aab-656cb6f5249e
Authorization: IYZWSv2 YXBpS2V5OnNhbmRib....E0OGI1MTE=
Content-Type: application/json
Successful response
{
"status": "success",
"systemTime": 1755617091761,
"data": {
"totalCount": 1,
"currentPage": 1,
"pageCount": 1,
"items": [
{
"referenceCode": "732a16cc-2ec4-4399-9aab-656cb6f5249e",
"parentReferenceCode": "aa86bbf7-176f-432e-8523-7c24cc250af4",
"pricingPlanName": "Payment Plan V2 TEST",
"pricingPlanReferenceCode": "deadd767-7d0a-4ddb-96f2-565ad245773d",
"productName": "test",
"productReferenceCode": "40070483-1a6e-4641-99c0-be513edcf9f2",
"customerEmail": "surnametest@gmail.com",
"customerGsmNumber": "+905554445555",
"customerReferenceCode": "ce88a44d-a4f5-4de9-8bbb-1f170a9be219",
"subscriptionStatus": "UNPAID",
"trialDays": 0,
"createdDate": 1753186413089,
"startDate": 1753186413089,
"endDate": 1753229613089,
"orders": [
{
"referenceCode": "684279ad-5caa-40a0-ae9a-95ec097d696d",
"price": 1.4,
"currencyCode": "TRY",
"startPeriod": 1753190013089,
"endPeriod": 1753193613089,
"orderStatus": "WAITING",
"paymentAttempts": [
{
"conversationId": "90cf2fdc-bb9a-4931-be32-f65312eb379d",
"createdDate": 1753190040185,
"paymentStatus": "FAILED",
"errorCode": "5034",
"errorMessage": "buyerSurname is required"
}
]
},
{
"referenceCode": "0759e5ce-1668-40cb-9570-d0b6eda8d988",
"price": 1.4,
"currencyCode": "TRY",
"startPeriod": 1753186413089,
"endPeriod": 1753190013089,
"orderStatus": "SUCCESS",
"paymentAttempts": [
{
"conversationId": "123456789",
"createdDate": 1753186413090,
"paymentId": 24578296,
"paymentStatus": "SUCCESS"
}
]
}
]
}
]
}
}Retrieve subscription and payment details by filtering with various parameters, or without any parameters. For example, by sending only subscriptionStatus, you can list subscriptions with that status.
Reference code of the subscription to query.
97fb885d-69e3-49ac-8590-9d05c9c6016eCustomer reference code.
279bb493-6fda-45e9-9368-2373ea43ff8dReference code of the pricing plan used in the subscription.
dbffa857-40f5-48d1-9179-e9326ffb942dParent reference code used for matching in subscription updates.
670489f2-9224-4a71-af6c-7044d22f5d73Subscription status filter.
ACTIVEPossible values: Subscription start date.
2025-08-24 14:30:26Subscription end date (epoch ms).
2025-08-24 14:30:26Page number.
1Number of records per page.
20Authorization header, a signed hash value that starts with IYZWSv2 and is generated in Base64 format.
Content format of the request.
application/jsonSuccessful response
Result of the request.
Server time of the response (epoch ms).
Example response for a wrong endpoint (e.g., typo).
GET https://api.iyzipay.com/v2/subscription/subscriptions?startDate=2025-08-24 14:30:26&endDate=2026-08-24 14:30:26&subscriptionStatus=ACTIVE
Authorization: IYZWSv2 YXBpS2V5OnNhbmRib....E0OGI1MTE=
Content-Type: application/json
{
"status": "success",
"systemTime": 1755683471024,
"data": {
"totalCount": 4,
"currentPage": 1,
"pageCount": 1,
"items": [
{
"referenceCode": "74726a5a-cc3d-4de8-b08c-3e373ea26842",
"parentReferenceCode": "85626e75-5043-4343-89bd-3cbbf33d15ad",
"pricingPlanName": "Pricing Plan Name",
"pricingPlanReferenceCode": "dbffa857-40f5-48d1-9179-e9326ffb942d",
"productName": "Tea",
"productReferenceCode": "8d562f84-f8d5-441a-b086-9483fc5133a0",
"customerEmail": "test@mail.com",
"customerGsmNumber": "+905554443322",
"customerReferenceCode": "279bb493-6fda-45e9-9368-2373ea43ff8d",
"subscriptionStatus": "ACTIVE",
"trialDays": 0,
"createdDate": 1755613834375,
"startDate": 1756045826566,
"endDate": 1787581826566,
"orders": [
{
"referenceCode": "0ad2563a-f5b7-4a6c-b6ec-9dc7548493ec",
"price": 10,
"currencyCode": "TRY",
"startPeriod": 1756045826566,
"endPeriod": 1758724226566,
"orderStatus": "WAITING",
"paymentAttempts": []
}
]
},
{
"referenceCode": "52c732ba-b449-460b-b553-ab21f9074300",
"parentReferenceCode": "670489f2-9224-4a71-af6c-7044d22f5d73",
"pricingPlanName": "Pricing Plan Name",
"pricingPlanReferenceCode": "dbffa857-40f5-48d1-9179-e9326ffb942d",
"productName": "Tea",
"productReferenceCode": "8d562f84-f8d5-441a-b086-9483fc5133a0",
"customerEmail": "test@mail.com",
"customerGsmNumber": "+905554443322",
"customerReferenceCode": "279bb493-6fda-45e9-9368-2373ea43ff8d",
"subscriptionStatus": "ACTIVE",
"trialDays": 0,
"createdDate": 1755613786569,
"startDate": 1756045757180,
"endDate": 1787581757180,
"orders": [
{
"referenceCode": "9723fa25-0968-4677-bd9a-559389252b58",
"price": 10,
"currencyCode": "TRY",
"startPeriod": 1756045757180,
"endPeriod": 1758724157180,
"orderStatus": "WAITING",
"paymentAttempts": []
}
]
},
{
"referenceCode": "d5044ccc-f346-4a8c-81e7-272516a330a9",
"parentReferenceCode": "6f0d463e-9a32-47ea-9a17-53d283f7f6ba",
"pricingPlanName": "Pricing Plan Name",
"pricingPlanReferenceCode": "dbffa857-40f5-48d1-9179-e9326ffb942d",
"productName": "Tea",
"productReferenceCode": "8d562f84-f8d5-441a-b086-9483fc5133a0",
"customerEmail": "test@mail.com",
"customerGsmNumber": "+905554443322",
"customerReferenceCode": "279bb493-6fda-45e9-9368-2373ea43ff8d",
"subscriptionStatus": "ACTIVE",
"trialDays": 0,
"createdDate": 1755613607741,
"startDate": 1756045126208,
"endDate": 1787581126208,
"orders": [
{
"referenceCode": "e8c6d7f2-556d-4976-a44f-82e7f5b533c0",
"price": 10,
"currencyCode": "TRY",
"startPeriod": 1756045126208,
"endPeriod": 1758723526208,
"orderStatus": "WAITING",
"paymentAttempts": []
}
]
},
{
"referenceCode": "5e4b1ec2-b0c0-47bf-b1bf-8656355cb82d",
"parentReferenceCode": "7a67a645-3d81-4207-bab4-76beade2f6be",
"pricingPlanName": "Current Plan",
"pricingPlanReferenceCode": "7515f763-5da3-4a35-8f7f-d425ae44ac04",
"productName": "Tea",
"productReferenceCode": "8d562f84-f8d5-441a-b086-9483fc5133a0",
"customerEmail": "test@mail.com",
"customerGsmNumber": "+905554443322",
"customerReferenceCode": "279bb493-6fda-45e9-9368-2373ea43ff8d",
"subscriptionStatus": "ACTIVE",
"trialDays": 5,
"trialStartDate": 1755609729652,
"trialEndDate": 1756041729652,
"createdDate": 1755609702703,
"startDate": 1755609729652,
"orders": [
{
"referenceCode": "664a7e09-8ca2-45d8-9996-b340a94d90cb",
"price": 99.99,
"currencyCode": "TRY",
"startPeriod": 1756041729652,
"endPeriod": 1758720129652,
"orderStatus": "WAITING",
"paymentAttempts": []
}
]
}
]
}
}Last updated
