Subscriber Transactions

After each subscription payment, a default customerReferenceCode is generated for the customer whose details are provided. Currently, this reference code can only be used to retrieve and update customer information.

Customers are created or updated based on the email parameter. For example, a unique reference code, let's say 'A', is generated for a customer when a subscription is created with email address 'X'. If the email address 'X' is used in another subscription, the customer details sent in the request are updated, and once again, a unique reference code 'A' is generated.

There are 3 different methods that can be used on subscribers.

Update Subscriber

All details of a subscriber can be updated via an API request. To do this, a request for updating with the subscriber's reference code and the parameters to be updated is required.

Update Subscriber

POST https://api.iyzipay.com/v2/subscription/customers/{customerReferenceCode}

Request Body

Name
Type
Description

conversationId

String

A value that can be sent during the request and received in the response, used to match the request and response.

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 (Turkish).

name*

String

Name of subscriber

customerReferenceCode*

String

Subscriber reference code.

billingAddress.zipCode

String

Invoice postal code.

billingAddress.address*

String

Invoice address

billingAddress.country*

String

Invoice country.

billingAddress.city*

String

Invoice city.

billingAddress.contactName*

String

Invoice contact name.

identitynumber*

String

National ID of subscriber

surname*

String

Surname of subscriber

shippingAddress.zipCode

String

Shipping postal code.

shippingAddress.address*

String

Shipping address.

shippingAddress.country*

String

Shipping country.

shippingAddress.city*

String

Shipping city.

shippingAddress.contactName*

String

Shipping name

{
    "status":"success",
    "systemTime":1687815662201,
    "data":{
        "referenceCode":"e2378434-3192-426d-a821-59c49583b6d4",
        "createdDate":1687815595481,
        "status":"ACTIVE",
        "name":"John",
        "surname":"Doe",
        "identityNumber":"11111111111",
        "email":"johndoe@iyzico.com",
        "gsmNumber":"+905555555555",
        "contactEmail":"johndoe@iyzico.com",
        "contactGsmNumber":"+905555555111",
        "billingAddress":{
            "address":"Uskudar Burhaniye Mahallesi iyzico A.S",
            "zipCode":"34660",
            "contactName":"John Doe",
            "district":"altunizade",
            "city":"Istanbul",
            "country":"Turkey"
        },
        "shippingAddress":{
            "address":"Uskudar Burhaniye Mahallesi iyzico A.S",
            "zipCode":"34660",
            "contactName":"John Doe",
            "district":"altunizade",
            "city":"Istanbul",
            "country":"Turkey"
        }
    }
}

Update Subscriber Response;

Parameter Name
Type
Description

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

The unique reference code created for the subscriber.

createdDate

Long

The date of subscriber creation.

status

String

Status of subscriber, default is ACTIVE

name

String

Name of subscriber

surname

String

Surname of subscriber

identityNumber

String

National ID of subscriber

email

String

Email address of subscriber

gsmNumber

String

GSM number of subscriber

billingAddress.contactName

String

Invoice contact name.

billingAddress.city

String

Invoice city.

billingAddress.country

String

Invoice country.

billingAddress.address

String

Invoice address.

billingAddress.zipCode

Number

Invoice postal code.

shippingAddress.contactName

String

Shipping contact name.

shippingAddress.city

String

Shipping city.

shippingAddress.country

String

Shipping country.

shippingAddress.address

String

Shipping address.

shippingAddress.zipCode

Number

Shipping zip code.

Get Subscriber

All the details of a subscriber can be retrieved with the reference code specific to that subscriber.

Get Subscriber

GET https://api.iyzipay.com/v2/subscription/customers/{customerReferenceCode}

Request Body

Name
Type
Description

customerReferenceCode*

String

Subscriber reference code.

{
    "status":"success",
    "systemTime":1687816688973,
    "data":{
        "referenceCode":"e2378434-3192-426d-a821-59c49583b6d4",
        "createdDate":1687815595481,
        "status":"ACTIVE",
        "name":"John",
        "surname":"Doe",
        "identityNumber":"11111111111",
        "email":"johndoe@iyzico.com",
        "gsmNumber":"+905555555555",
        "contactEmail":"johndoe@iyzico.com",
        "contactGsmNumber":"+905555555111",
        "billingAddress":{
            "address":"Uskudar Burhaniye Mahallesi iyzico A.S",
            "zipCode":"34660",
            "contactName":"John Doe",
            "district":"altunizade",
            "city":"Istanbul",
            "country":"Turkey"
        },
        "shippingAddress":{
            "address":"Uskudar Burhaniye Mahallesi iyzico A.S",
            "zipCode":"34660",
            "contactName":"John Doe",
            "district":"altunizade",
            "city":"Istanbul",
            "country":"Turkey"
        }
    }
}

Get Subscriber Response;

Parameter Name
Type
Description

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

The unique reference code created for the subscriber.

createdDate

Long

The date of subscriber creation.

status

String

Status of subscriber, default is ACTIVE

name

String

Name of subscriber

surname

String

Surname of subscriber

identityNumber

String

National ID of subscriber

email

String

Email address of subscriber

gsmNumber

String

GSM number of subscriber

billingAddress.contactName

String

Invoice contact name.

billingAddress.city

String

Invoice city.

billingAddress.country

String

Invoice country.

billingAddress.address

String

Invoice address.

billingAddress.zipCode

Number

Invoice postal code.

shippingAddress.contactName

String

Shipping contact name.

shippingAddress.city

String

Shipping city.

shippingAddress.country

String

Shipping country.

shippingAddress.address

String

Shipping address.

shippingAddress.zipCode

Number

Shipping postal code.

List of Subscribers

You can list all subscribers and their details with this request.

List of Subscribers

GET https://api.iyzipay.com/v2/subscription/customers

Request Body

Name
Type
Description

page*

Integer

It retrieves all subscribers for the specified page

count*

Integer

It specifies how many subscribers will be listed per page.

{
    "status":"success",
    "systemTime":1687817022470,
    "data":{
        "totalCount":2,
        "currentPage":1,
        "pageCount":1,
        "items":[
            {
                "referenceCode":"e2378434-3192-426d-a821-59c49583b6d4",
                "createdDate":1687815595481,
                "status":"ACTIVE",
                "name":"John",
                "surname":"Doe",
                "identityNumber":"11111111111",
                "email":"johndoe@iyzico.com",
                "gsmNumber":"+905555555555",
                "contactEmail":"johndoe@iyzico.com",
                "contactGsmNumber":"+905555555111",
                "billingAddress":{
                    "address":"Uskudar Burhaniye Mahallesi iyzico A.S",
                    "zipCode":"34660",
                    "contactName":"John Doe",
                    "district":"altunizade",
                    "city":"Istanbul",
                    "country":"Turkey"
                },
                "shippingAddress":{
                    "address":"Uskudar Burhaniye Mahallesi iyzico A.S",
                    "zipCode":"34660",
                    "contactName":"John Doe",
                    "district":"altunizade",
                    "city":"Istanbul",
                    "country":"Turkey"
                }
            },
            {
                "referenceCode":"deeb305d-053e-412e-bead-bc507f771223",
                "createdDate":1687379184912,
                "status":"ACTIVE",
                "name":"John",
                "surname":"Doe",
                "identityNumber":"11111111111",
                "email":"johndoe2@iyzico.com",
                "gsmNumber":"+905555555555",
                "contactEmail":"johndoe2@iyzico.com",
                "contactGsmNumber":"+905555555111",
                "billingAddress":{
                    "address":"Uskudar Burhaniye Mahallesi iyzico A.S",
                    "zipCode":"34660",
                    "contactName":"John Doe",
                    "district":"altunizade",
                    "city":"Istanbul",
                    "country":"Turkey"
                },
                "shippingAddress":{
                    "address":"Uskudar Burhaniye Mahallesi iyzico A.S",
                    "zipCode":"34660",
                    "contactName":"John Doe",
                    "district":"altunizade",
                    "city":"Istanbul",
                    "country":"Turkey"
                }
            }
        ]
    }
}

List of Subscribers Response;

Parameter Name
Type
Description

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.

totalCount

String

It indicates the total number of results.

currentPage

Integer

It specifies which page the listing is for.

pageCount

Integer

It indicates the total number of pages of results.

items

Array Object

It is an array containing subscriber details.

Last updated