# Subscriber Transactions

## Update Subscriber

> Update all details of a subscriber via API. Provide the subscriber's \*\*customerReferenceCode\*\* as a path parameter and include the fields to be updated in the request body. At least \*\*one field\*\* in the body is required; only the provided fields will be updated.<br>

```json
{"openapi":"3.0.3","info":{"title":"Subscription - Subscriber Management","version":"1.1.0"},"servers":[{"url":"https://api.iyzipay.com","description":"iyzico API"}],"paths":{"/v2/subscription/customers/{customerReferenceCode}":{"post":{"summary":"Update Subscriber","description":"Update all details of a subscriber via API. Provide the subscriber's **customerReferenceCode** as a path parameter and include the fields to be updated in the request body. At least **one field** in the body is required; only the provided fields will be updated.\n","tags":["Subscription"],"parameters":[{"$ref":"#/components/parameters/AuthHeader"},{"$ref":"#/components/parameters/ContentTypeHeader"},{"name":"customerReferenceCode","in":"path","required":true,"schema":{"type":"string"},"description":"Subscriber reference code."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CustomerUpdateRequest"}}}},"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CustomerUpdateResponse"}}}},"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, a signed hash value that starts with **IYZWSv2** and is generated in Base64 format."},"ContentTypeHeader":{"name":"Content-Type","in":"header","required":true,"schema":{"type":"string"},"description":"Request content type."}},"schemas":{"CustomerUpdateRequest":{"type":"object","description":"Fields to update. All fields are **optional**, but the body must contain at least one property.\n","minProperties":1,"properties":{"name":{"type":"string","description":"First name."},"surname":{"type":"string","description":"Last name."},"email":{"type":"string","description":"Email address."},"gsmNumber":{"type":"string","description":"GSM number. Prefer **+90** format."},"identityNumber":{"type":"string","description":"Turkish National ID Number (11 digits)."},"billingAddress":{"$ref":"#/components/schemas/CustomerAddress"},"shippingAddress":{"$ref":"#/components/schemas/CustomerAddress"}}},"CustomerAddress":{"type":"object","description":"Address information.","properties":{"address":{"type":"string","description":"Address line."},"zipCode":{"type":"string","description":"Postal/ZIP code."},"contactName":{"type":"string","description":"Contact name."},"city":{"type":"string","description":"City."},"district":{"type":"string","description":"District (if any)."},"country":{"type":"string","description":"Country."}}},"CustomerUpdateResponse":{"type":"object","properties":{"status":{"type":"string","enum":["success","failure"],"description":"Indicates the result of the request."},"systemTime":{"type":"integer","description":"The current epoch time in milliseconds at the moment of the response."},"data":{"type":"object","description":"Updated subscriber information.","properties":{"referenceCode":{"type":"string","description":"Subscriber reference code."},"createdDate":{"type":"integer","description":"Subscriber creation time (epoch ms)."},"status":{"type":"string","enum":["ACTIVE"],"description":"Record status."},"name":{"type":"string","description":"First name."},"surname":{"type":"string","description":"Last name."},"identityNumber":{"type":"string","description":"Turkish National ID Number."},"email":{"type":"string","description":"Email address."},"gsmNumber":{"type":"string","description":"GSM number."},"contactEmail":{"type":"string","description":"Contact email."},"contactGsmNumber":{"type":"string","description":"Contact GSM number."},"billingAddress":{"$ref":"#/components/schemas/CustomerAddress"},"shippingAddress":{"$ref":"#/components/schemas/CustomerAddress"}}}}},"ErrorResponse":{"type":"object","properties":{"status":{"type":"string","enum":["failure"],"description":"Indicates the request result (failure)."},"errorCode":{"type":"string","description":"Error code."},"errorMessage":{"type":"string","description":"Error message."},"systemTime":{"type":"integer","description":"The current epoch time in milliseconds at the moment of the response."}}}}}}
```

## Subscriber Detail

> Retrieve all details of a subscriber by its reference code.

```json
{"openapi":"3.0.3","info":{"title":"Subscription - Subscriber Management","version":"1.1.0"},"servers":[{"url":"https://api.iyzipay.com","description":"iyzico API"}],"paths":{"/v2/subscription/customers/{customerReferenceCode}":{"get":{"summary":"Subscriber Detail","description":"Retrieve all details of a subscriber by its reference code.","tags":["Subscription"],"parameters":[{"$ref":"#/components/parameters/AuthHeader"},{"$ref":"#/components/parameters/ContentTypeHeader"},{"name":"customerReferenceCode","in":"path","required":true,"schema":{"type":"string"},"description":"Subscriber reference code."}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CustomerDetailResponse"}}}},"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, a signed hash value that starts with **IYZWSv2** and is generated in Base64 format."},"ContentTypeHeader":{"name":"Content-Type","in":"header","required":true,"schema":{"type":"string"},"description":"Request content type."}},"schemas":{"CustomerDetailResponse":{"type":"object","properties":{"status":{"type":"string","enum":["success","failure"]},"systemTime":{"type":"integer","description":"The current epoch time in milliseconds at the moment of the response."},"data":{"type":"object","description":"Subscriber (customer) details.","properties":{"referenceCode":{"type":"string","description":"Subscriber reference code."},"createdDate":{"type":"integer","description":"Creation time (epoch ms)."},"status":{"type":"string","enum":["ACTIVE"],"description":"Record status."},"name":{"type":"string","description":"First name."},"surname":{"type":"string","description":"Last name."},"identityNumber":{"type":"string","description":"Turkish National ID Number."},"email":{"type":"string","description":"Subscriber email."},"gsmNumber":{"type":"string","description":"Subscriber GSM number."},"contactEmail":{"type":"string","description":"Contact email."},"contactGsmNumber":{"type":"string","description":"Contact GSM number."},"billingAddress":{"$ref":"#/components/schemas/CustomerAddress"},"shippingAddress":{"$ref":"#/components/schemas/CustomerAddress"}}}}},"CustomerAddress":{"type":"object","description":"Address information.","properties":{"address":{"type":"string","description":"Address line."},"zipCode":{"type":"string","description":"Postal/ZIP code."},"contactName":{"type":"string","description":"Contact name."},"city":{"type":"string","description":"City."},"district":{"type":"string","description":"District (if any)."},"country":{"type":"string","description":"Country."}}},"ErrorResponse":{"type":"object","properties":{"status":{"type":"string","enum":["failure"],"description":"Indicates the request result (failure)."},"errorCode":{"type":"string","description":"Error code."},"errorMessage":{"type":"string","description":"Error message."},"systemTime":{"type":"integer","description":"The current epoch time in milliseconds at the moment of the response."}}}}}}
```

## List Subscribers

> List all subscribers with basic details.

```json
{"openapi":"3.0.3","info":{"title":"Subscription - Subscriber Management","version":"1.1.0"},"servers":[{"url":"https://api.iyzipay.com","description":"iyzico API"}],"paths":{"/v2/subscription/customers":{"get":{"summary":"List Subscribers","description":"List all subscribers with basic details.","tags":["Subscription"],"parameters":[{"$ref":"#/components/parameters/AuthHeader"},{"$ref":"#/components/parameters/ContentTypeHeader"},{"name":"page","in":"query","required":false,"schema":{"type":"integer"},"description":"Page number to fetch."},{"name":"count","in":"query","required":false,"schema":{"type":"integer"},"description":"Number of subscribers per page."}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CustomerListResponse"}}}},"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, a signed hash value that starts with **IYZWSv2** and is generated in Base64 format."},"ContentTypeHeader":{"name":"Content-Type","in":"header","required":true,"schema":{"type":"string"},"description":"Request content type."}},"schemas":{"CustomerListResponse":{"type":"object","properties":{"status":{"type":"string","enum":["success","failure"]},"systemTime":{"type":"integer","description":"The current epoch time in milliseconds at the moment of the response."},"data":{"type":"object","description":"Pagination info and subscriber list.","properties":{"totalCount":{"type":"integer","description":"Total number of records."},"currentPage":{"type":"integer","description":"Current page."},"pageCount":{"type":"integer","description":"Total page count."},"items":{"type":"array","description":"Subscriber records.","items":{"type":"object","allOf":[{"$ref":"#/components/schemas/CustomerDetailResponse/properties/data"}]}}}}}},"CustomerDetailResponse":{"properties":{"data":{"type":"object","description":"Subscriber (customer) details.","properties":{"referenceCode":{"type":"string","description":"Subscriber reference code."},"createdDate":{"type":"integer","description":"Creation time (epoch ms)."},"status":{"type":"string","enum":["ACTIVE"],"description":"Record status."},"name":{"type":"string","description":"First name."},"surname":{"type":"string","description":"Last name."},"identityNumber":{"type":"string","description":"Turkish National ID Number."},"email":{"type":"string","description":"Subscriber email."},"gsmNumber":{"type":"string","description":"Subscriber GSM number."},"contactEmail":{"type":"string","description":"Contact email."},"contactGsmNumber":{"type":"string","description":"Contact GSM number."},"billingAddress":{"$ref":"#/components/schemas/CustomerAddress"},"shippingAddress":{"$ref":"#/components/schemas/CustomerAddress"}}}}},"CustomerAddress":{"type":"object","description":"Address information.","properties":{"address":{"type":"string","description":"Address line."},"zipCode":{"type":"string","description":"Postal/ZIP code."},"contactName":{"type":"string","description":"Contact name."},"city":{"type":"string","description":"City."},"district":{"type":"string","description":"District (if any)."},"country":{"type":"string","description":"Country."}}},"ErrorResponse":{"type":"object","properties":{"status":{"type":"string","enum":["failure"],"description":"Indicates the request result (failure)."},"errorCode":{"type":"string","description":"Error code."},"errorMessage":{"type":"string","description":"Error message."},"systemTime":{"type":"integer","description":"The current epoch time in milliseconds at the moment of the response."}}}}}}
```
