Initialize Subscription
Used to start a subscription with iyzico Checkout Form. Returns the form content and token.
Authorization header, a signed hash value that starts with IYZWSv2 and is produced in Base64 format.
The request content type.
application/jsonLanguage code. Default is tr. Send "en" to create the checkout form in English.
enPossible values: Callback URL to which the payment result will be sent.
https://callbackUrl.comReference code of the plan to start the subscription.
7515f763-5da3-4a35-8f7f-d425ae44ac04Initial status. If PENDING, subscription will not start until activated.
ACTIVEPossible values: Optional correlation value to match request/response pairs.
123456789Successful response
Operation result.
Response language.
Operation time (epoch ms).
1755596201712Echoes the value you sent in the request.
123456789Token of the checkout form.
a9f91f36-2110-4c55-848e-bdd2c7016171HTML content of the checkout form.
Token validity time in seconds.
1800Error response
POST https://api.iyzipay.com/v2/subscription/checkoutform/initialize
Authorization: IYZWSv2 YXBpS2V5OnNhbmRib....E0OGI1MTE=
Content-Type: application/json
{
"callbackUrl": "https://callbackUrl.com",
"pricingPlanReferenceCode": "7515f763-5da3-4a35-8f7f-d425ae44ac04",
"subscriptionInitialStatus": "ACTIVE",
"conversationId": "conversationId",
"customer": {
"name": "John",
"surname": "Stone",
"email": "john@gmail.com",
"gsmNumber": "+905545545512",
"identityNumber": "1234567890",
"billingAddress": {
"address": "Altunizade Mah. Inci Cikmazi Sokak No: 3, Uskudar Istanbul",
"zipCode": "34345",
"contactName": "contactName",
"city": "Istanbul",
"country": "Turkey"
},
"shippingAddress": {
"address": "Altunizade Mah. Inci Cikmazi Sokak No: 3, Uskudar Istanbul",
"zipCode": "34345",
"contactName": "contactName",
"city": "Istanbul",
"country": "Turkey"
}
}
}
{
"status": "success",
"locale": "en",
"systemTime": 1755596201712,
"conversationId": "conversationId",
"token": "a9f91f36-2110-4c55-848e-bdd2c7016171",
"checkoutFormContent": "<script type=\"text/javascript\">if (typeof iyziInit == 'undefined') {var iyziInit = {currency:\"TRY\",token:\"a9f91f36-2110-4c55-848e-bdd2c7016171\",price:1.00,...}};</script>",
"tokenExpireTime": 1800
}After the checkout form flow completes, query the subscription creation result with the returned token.
Token returned by checkout form initialize for this operation.
Optional correlation value you send in the request to match with the response.
Authorization header, a signed hash value that starts with IYZWSv2 and is produced in Base64 format.
The request content type.
application/jsonSuccessful response
Current unix timestamp at the response time.
1755600509451Echoes the value you sent in the request.
123456789Token of the checkout form.
8e86b16e-9c0f-450d-a09d-0fd8a27e5197Error response
GET https://api.iyzipay.com/v2/subscription/checkoutform/1590292b-bed2-4909-8833-6c6f85d7ec17
Authorization: IYZWSv2 YXBpS2V5OnNhbmRib....E0OGI1MTE=
Content-Type: application/json
{
"status": "success",
"systemTime": 1755597000000,
"token": "a9f91f36-2110-4c55-848e-bdd2c7016171",
"data": {
"referenceCode": "8d06cc19-98fb-47a6-ae1f-47f20c4797b4",
"parentReferenceCode": "535094d2-9257-401b-8e38-f08308e37098",
"pricingPlanReferenceCode": "515f763-5da3-4a35-8f7f-d425ae44ac04",
"customerReferenceCode": "775ba402-41f0-4674-968b-43cc787d9366",
"subscriptionStatus": "ACTIVE",
"trialDays": 5,
"trialStartDate": 1755599766595,
"trialEndDate": 1756031766595,
"createdDate": 1755599766595,
"startDate": 1755599766595,
"endDate": 1787567766595
}
}Start a subscription without the hosted checkout form, using your own payment form via NON3D service.
Authorization header, a signed hash value that starts with IYZWSv2 and is produced in Base64 format.
The request content type.
application/jsonReference code of the plan to start the subscription.
7515f763-5da3-4a35-8f7f-d425ae44ac04Optional correlation value to match request/response pairs.
123456789Initial status. If PENDING, subscription will not start until activated.
ACTIVEPossible values: Successful response
Indicates the request result; success if the operation succeeded.
Current unix timestamp at the response time.
Error response
POST https://api.iyzipay.com/v2/subscription/initialize
Authorization: IYZWSv2 YXBpS2V5OnNhbmRib....E0OGI1MTE=
Content-Type: application/json
{
"locale": "en",
"pricingPlanReferenceCode": "7515f763-5da3-4a35-8f7f-d425ae44ac04",
"conversationId": "conv-1001",
"subscriptionInitialStatus": "ACTIVE",
"customer": {
"name": "John",
"surname": "Stone",
"email": "john@gmail.com",
"gsmNumber": "+905545545512",
"identityNumber": "1234567890",
"billingAddress": {
"address": "Altunizade Mah. Inci Cikmazi Sokak No: 3, Uskudar Istanbul",
"contactName": "contactName",
"city": "Istanbul",
"country": "Turkey"
},
"shippingAddress": {
"address": "address",
"zipCode": "zipCode",
"contactName": "contactName",
"city": "city",
"country": "country"
}
},
"paymentCard": {
"cardHolderName": "John Doe",
"cardNumber": "5528790000000008",
"expireMonth": "12",
"expireYear": "2030",
"cvc": "123"
}
}
{
"status": "success",
"systemTime": 1755598000000,
"data": {
"referenceCode": "8d06cc19-98fb-47a6-ae1f-47f20c4797b4",
"parentReferenceCode": "535094d2-9257-401b-8e38-f08308e37098",
"pricingPlanReferenceCode": "515f763-5da3-4a35-8f7f-d425ae44ac04",
"customerReferenceCode": "775ba402-41f0-4674-968b-43cc787d9366",
"subscriptionStatus": "ACTIVE",
"trialDays": 5,
"trialStartDate": 1755599766595,
"trialEndDate": 1756031766595,
"createdDate": 1755599766595,
"startDate": 1755599766595,
"endDate": 1787567766595
}
}If the user already has an active subscription, you can start a new one with customerReferenceCode. If the user does not have an active subscription, no new subscription is started with customerReferenceCode.
Authorization header, a signed hash value that starts with IYZWSv2 and is produced in Base64 format.
The request content type.
application/jsonInitial status. If PENDING, subscription will not start until activated.
ACTIVEPossible values: Reference code of the plan to start the subscription.
7515f763-5da3-4a35-8f7f-d425ae44ac04Reference code of the existing customer. Must already have an active subscription to start a new one with this flow.
279bb493-6fda-45e9-9368-2373ea43ff8dSuccessful response
Operation result.
Operation time (epoch ms).
Error response
POST https://api.iyzipay.com/v2/subscription/initialize/with-customer
Authorization: IYZWSv2 YXBpS2V5OnNhbmRib....E0OGI1MTE=
Content-Type: application/json
{
"subscriptionInitialStatus": "ACTIVE",
"pricingPlanReferenceCode": "7515f763-5da3-4a35-8f7f-d425ae44ac04",
"customerReferenceCode": "279bb493-6fda-45e9-9368-2373ea43ff8d"
}
{
"status": "success",
"systemTime": 1755606762264,
"data": {
"referenceCode": "009dac1a-00dc-41e8-a92f-2c24b18e27b9",
"parentReferenceCode": "f4bb665b-a48a-4100-917f-d7a46b16e586",
"pricingPlanReferenceCode": "7515f763-5da3-4a35-8f7f-d425ae44ac04",
"customerReferenceCode": "279bb493-6fda-45e9-9368-2373ea43ff8d",
"subscriptionStatus": "ACTIVE",
"trialDays": 5,
"trialStartDate": 1755606762238,
"trialEndDate": 1756038762238,
"createdDate": 1755606762238,
"startDate": 1755606762238,
"endDate": 1787574762238
}
}Last updated
