### Subscription Response Sample - JSON Source: https://apidocs.iys.org.tr/index This is an example JSON response for a subscription. It includes details like subscription ID, start and expiration dates, package name, status, and consent limits. Note that 'viaCredit' fields may be omitted depending on the service provider. ```json { "subscipritionId": "12345879", "startDate": "2020-06-21 12:24:55", "expirationDate": "2022-06-21 12:24:55", "subscriptionPackageName": "İleti-5 (Seviye 1)", "status": "ACTIVE", "consentLimit": 5000, "consentLimitExceed": false, "usedConsentLimit": 0 } ``` -------------------------------- ### Get Agreements - API Request Example Source: https://apidocs.iys.org.tr/index This snippet demonstrates how to make a GET request to retrieve agreement information. It requires iysCode, brandCode, and reportDate as path parameters. The response includes processStatus, hashValue, hashMethod, and agreementStatus. ```http GET https://api.sandbox.iys.org.tr/sps/{iysCode}/brands/{brandCode}/agreements/{reportDate} ``` -------------------------------- ### Get Retailer Details - JSON Response Example Source: https://apidocs.iys.org.tr/index This JSON object shows a sample response for retrieving detailed information about a specific retailer. It includes fields like title, mersis, alias, name, contact details, city, and town information. ```json { "title": "XYZ Ticaret", "mersis": 56518556720, "alias": "Şişli Mağazası", "name": "Adım Soyadım", "tckn": "57703411244", "mobile": "+905325001111", "city": { "name": "ISTANBUL", "code": "1" }, "town": { "name": "SARIYER", "code": "2" }, "retailerAccessCount": 54856321, "status": "active", "tin": "8450525470" } ``` -------------------------------- ### Get Agreements - Response Sample (JSON) Source: https://apidocs.iys.org.tr/index A sample JSON response for the 'Get Agreements' API call. It indicates the status of the agreement process, including hash details and whether an agreement was reached. ```json { "processStatus": "completed", "hashValue": "f0823d9b19be64c88c0d284a78239761732a33b24cc6b3cb9708d31e3ac5a9de", "hashMethod": "SHA-384", "agreementStatus": false } ``` -------------------------------- ### Email OTP Start API Source: https://apidocs.iys.org.tr/index Initiates the Email OTP verification process for a given recipient. ```APIDOC ## POST /otp-management/api/v1/{iysCode}/email/start ### Description Initiates the Email OTP verification process. Requires an `iysCode` in the path, and recipient's email, template ID, and VKN in the request body. ### Method POST ### Endpoint `/otp-management/api/v1/{iysCode}/email/start` ### Parameters #### Path Parameters - **iysCode** (string) - Required - A unique code assigned by IYS specific to the service provider. #### Request Body - **email** (string) - Required - The recipient's email address. - **templateId** (string) - Required - The template ID for the relevant transaction. - **vkn** (string) - Required - Tax Identification Number. ### Request Example ```json { "email": "ornekeposta@ornekeposta.com", "templateId": "29784", "vkn": "1111111111" } ``` ### Response #### Success Response (200) - **data** (object) - Contains `requestId`. - **requestId** (string) - The ID for the verification request. - **message** (string) - Confirmation message. #### Response Example ```json { "data": { "requestId": "b0cd835f-5298-41ea-b228-530a460f83bf" }, "message": "Email OTP doğrulama süreci başarıyla başlatıldı." } ``` ``` -------------------------------- ### SMS OTP Start API Source: https://apidocs.iys.org.tr/index Initiates the SMS OTP verification process for a given recipient. ```APIDOC ## POST /otp-management/api/v1/{iysCode}/sms/start ### Description Initiates the SMS OTP verification process. Requires an `iysCode` in the path, and recipient's phone number, template ID, and VKN in the request body. ### Method POST ### Endpoint `/otp-management/api/v1/{iysCode}/sms/start` ### Parameters #### Path Parameters - **iysCode** (string) - Required - A unique code assigned by IYS specific to the service provider. #### Request Body - **phoneNumber** (string) - Required - The recipient's mobile phone number. - **templateId** (string) - Required - The template ID for the relevant transaction. - **vkn** (string) - Required - Tax Identification Number. ### Request Example ```json { "phoneNumber": "+905301112233", "templateId": "42271", "vkn": "1234567890" } ``` ### Response #### Success Response (200) - **data** (object) - Contains `requestId`. - **requestId** (string) - The ID for the verification request. - **message** (string) - Confirmation message. #### Response Example ```json { "data": { "requestId": "0754af62-a462-4985-9bf1-dd588a1edd4f" }, "message": "SMS OTP doğrulama süreci başarıyla başlatıldı." } ``` ``` -------------------------------- ### GET /websites/apidocs_iys_tr Source: https://apidocs.iys.org.tr/index Retrieves a list of website documentation resources. The response includes sample data structures and information about response codes and content types. ```APIDOC ## GET /websites/apidocs_iys_tr ### Description Retrieves a list of website documentation resources, including response samples and content types. ### Method GET ### Endpoint /websites/apidocs_iys_tr ### Parameters #### Query Parameters ### Request Example ```json { "message": "GET request to retrieve website documentation" } ``` ### Response #### Success Response (200) - **response_samples** (array) - Contains sample data for various response codes. - **content_type** (string) - The content type of the response. #### Response Example ```json { "response_samples": [ { "code": 200, "data": [ { "name": "Seyhan", "code": 1, "city_code": 1 }, { "name": "Ceyhan", "code": 2, "city_code": 1 } ] }, { "code": 400, "data": { "error": "Bad Request" } }, { "code": 401, "data": { "error": "Unauthorized" } } ], "content_type": "application/json" } ``` ``` -------------------------------- ### GET /otp-management/api/v1/get-clarification-file/{iysCode}/{requestId} Source: https://apidocs.iys.org.tr/index This method allows you to download the summary file (.pdf) of the verification transaction processed via ViA Pass, along with its corresponding timestamp (.tsr) in a .zip format. ```APIDOC ## GET /otp-management/api/v1/get-clarification-file/{iysCode}/{requestId} ### Description This method retrieves a zip file containing the transaction summary (.pdf) and its timestamp (.tsr) for a verification process performed via ViA Pass. The .tsr file proves the existence and integrity of the summary file on a given date. ### Method GET ### Endpoint `/otp-management/api/v1/get-clarification-file/{iysCode}/{requestId}` ### Parameters #### Path Parameters - **iysCode** (integer) - Required - A unique code assigned by IYS for the service provider. - **requestId** (string) - Required - The ID of the verification transaction. ### Request Example ``` (No request body for GET request) ``` ### Response #### Success Response (200) - **application/zip** - A zip file containing `report.pdf` and `result.tsr`. #### Response Example ``` (Binary ZIP file content) ``` #### Error Responses - **400** - Invalid Request - **401** - Missing or Invalid Token - **403** - Access Denied - **500** - Unexpected Server Error ``` -------------------------------- ### POST /websites/apidocs_iys_tr/async/multiple/permission Source: https://apidocs.iys.org.tr/index Bu endpoint, alıcılardan alınan çoklu izinleri IYS sistemine kaydeder. Aynı iletişim adresi için farklı izin durumları aynı istekte gönderilmemelidir. ```APIDOC ## POST /websites/apidocs_iys_tr/async/multiple/permission ### Description Bu endpoint, alıcılardan alınan çoklu izinleri IYS sistemine kaydeder. Aynı iletişim adresi için farklı izin durumları aynı istekte gönderilmemelidir. ### Method POST ### Endpoint /websites/apidocs_iys_tr/async/multiple/permission ### Parameters #### Path Parameters - **iysCode** (integer) - Required - Hizmet sağlayıcıya özel, İYS tarafından tekil olarak atanan İYS numarası bilgisidir. - **brandCode** (integer) - Required - Hizmet sağlayıcının markasına özel, İYS tarafından tekil olarak atanan İYS numarası bilgisidir. #### Request Body Array of: - **recipient** (string) - Required - Alıcının sistemde kayıtlı `telefon numarası` veya `e-posta` bilgisidir. E-posta adresleri `265`, telefon numaraları `15` karakterden daha uzun olamaz. Telefon numaraları E164 uluslararası([+][country code][area code][local phone number]) formata uygun olmalıdır. - **type** (string) - Required - Enum: "ARAMA" "MESAJ" "EPOSTA" - Alıcının izin verdiği iletişim kanalıdır. - **source** (string) - Required - Enum: "HS_FIZIKSEL_ORTAM" "HS_ISLAK_IMZA" "HS_WEB" "HS_CAGRI_MERKEZI" "HS_SOSYAL_MEDYA" "HS_EPOSTA" "HS_MESAJ" "HS_MOBIL" "HS_EORTAM" "HS_ETKINLIK" "HS_2015" "HS_ATM" "HS_KARAR" - Alıcının izin durumu belirlediği kaynaktır. Alıcı tipi `TACIR` ise eklenmesi zorunlu değildir. - **status** (string) - Required - Enum: "ONAY" "RET" - Alıcının izin durumunu gösterir. - **consentDate** (string) - Required - - İznin alındığı tarihtir. Alıcı tipi `TACIR` ise eklenmesi zorunlu değildir. İzinlerin tarih formatı `YYYY-MM-DD HH:mm:ss`, saat dilimi `Türkiye saati` kabul edilir. - **recipientType** (string) - Optional - Enum: "BIREYSEL" "TACIR" - İzin kaydının tacir veya bireysel amaçla alındığını ifade eder. Varsayılan değer: `BIREYSEL`. - **retailerCode** (integer) - Optional - <= 8 - İzin alınmasına aracılık eden bayiye İYS tarafından tekil olarak atanan İYS numarası bilgisidir. - **retailerAccess** (Array of integers) - Optional - <= 3000 items - İzne erişimi olan bayilere İYS tarafından tekil olarak atanan İYS numaralarını gösterir. ### Request Example ```json [ { "recipient": "+905XXXXXXXXX", "type": "MESAJ", "source": "HS_WEB", "status": "ONAY", "consentDate": "2024-04-19 23:59:59", "recipientType": "BIREYSEL", "retailerCode": 12345, "retailerAccess": [1001, 1002] } ] ``` ### Response #### Success Response (200) - **requestId** (string) - Liste halinde çoklu olarak isteği gönderilen izinlerin işleme alındığına ilişkin kaydı taşıyan veridir. Bu değerle izinlerin durumu Çoklu İzin Ekleme İsteği Sorgulama metodunda sorgulanabilir. #### Response Example ```json { "requestId": "f26ab94c7d855113d57ea0c328d9b8b56d09b344aeff4142eb13cbf661b64e89" } ``` ``` -------------------------------- ### İYS API Overview Source: https://apidocs.iys.org.tr/index General information about the İYS API, including base URLs for test and live environments, and contact information for inquiries. ```APIDOC ## İYS API Overview ### Description This section provides general information about the İYS API, including its purpose, version, and access details for test and live environments. ### Base URLs - **Test Environment:** `https://api.sandbox.iys.org.tr` - **Live Environment:** `https://api.iys.org.tr` ### Contact For API change requests, modifications, and suggestions, please send an email to `destek@iys.org.tr`. ``` -------------------------------- ### Test Verisi - İzin Hareketi İletimi (Push) Source: https://apidocs.iys.org.tr/index Bağlantı oluşturulduktan sonra IYS sisteminden gönderilecek test verisi örneğidir. Bu veri, izin hareketlerinin iletileceği formatı gösterir ve 'IYS_' source değerine sahip izin hareketleri ile aynı yapıdadır. ```json { "list": [ { "iysCode": 121212, "brandCode": 121212, "consentDate": "2015-05-01 15:00:00", "creationDate": "2015-05-01 15:00:00", "source": "IYS_MOBIL", "recipient": "pushtest@iys.org.tr", "recipientType": "BIREYSEL", "status": "ONAY", "type": "EPOSTA", "transactionId": "e52ee30512adfcd2a41fb3b4682f5bd61eee5b1c92bda665fc0b7e56644d429d" } ] } ``` -------------------------------- ### POST /otp-management/api/v1/request-history Source: https://apidocs.iys.org.tr/index This method lists the detailed history of a transaction using the `requestId` obtained from ViA Pass services like 'SMS OTP With Transaction Start', 'Email OTP With Transaction Start', 'SMS Short Link With Transaction Start', or 'Email Short Link With Transaction Start'. ```APIDOC ## POST /otp-management/api/v1/request-history ### Description Lists the detailed history of a transaction using its `requestId`. This endpoint retrieves information about past verification attempts initiated through ViA Pass. ### Method POST ### Endpoint `/otp-management/api/v1/request-history` ### Parameters #### Query Parameters - **page** (integer) - Optional - The page number for pagination. Defaults to 1. - **pageSize** (integer) - Optional - The number of items per page. Defaults to 20. #### Request Body - **requestId** (string) - Required - The `requestId` of the transaction whose history is to be queried. ### Request Example ```json { "requestId": "cde1171e-c00f-41e6-a999-3fe32849c98a" } ``` ### Response #### Success Response (200) - **content** (array) - A list of transaction history items. - **requestType** (string) - The type of request (e.g., EMAIL). - **status** (string) - The status of the transaction (e.g., OTP Generation, SUCCESS). - **description** (string) - A description of the transaction status. - **transactionDate** (string) - The date and time of the transaction. - **pagination** (object) - Pagination details. - **currentPage** (integer) - The current page number. - **totalItems** (integer) - The total number of items. - **totalPages** (integer) - The total number of pages. - **elementsInPage** (integer) - The number of elements on the current page. #### Response Example ```json { "content": [ { "requestType": "EMAIL", "status": "OTP Generation", "description": "OTP Generation", "transactionDate": "2025-06-18 17:26:25.187309" }, { "requestType": "EMAIL", "status": "SUCCESS", "description": "OTP Completed", "transactionDate": "2025-06-18 17:26:48.475447" } ], "pagination": { "currentPage": 1, "totalItems": 2, "totalPages": 1, "elementsInPage": 2 } } ``` #### Error Responses - **400** - Invalid Request - **401** - Missing or Invalid Token - **404** - Resource Not Found - **500** - Unexpected Server Error ``` -------------------------------- ### API Usage Guidelines and Rate Limits Source: https://apidocs.iys.org.tr/index Details on how to use the İYS API in the live environment, including IP-based request limits and error handling policies. ```APIDOC ## API Usage Guidelines and Rate Limits (Live Environment) ### Description This section outlines the usage guidelines and rate limits for the İYS API in the live environment. Adherence to these limits is crucial for uninterrupted service. ### Request Limits per IP Address - **General Requests:** Maximum 10 requests per second. - **Single Permission Status Query:** Maximum 1000 requests per hour. - **Permission History Listing:** Maximum 100 requests per hour. - **Token Acquisition:** Maximum 100 requests per hour. ### Performance Monitoring and IP Blacklisting - If the success rate of requests from an IP address falls below 70% in the last 24 hours (for more than 20,000 requests), a notification will be sent. - If the success rate does not rise above 70% within 96 hours following the notification, the IP address sending erroneous requests will be removed from the whitelist. - Client-based error codes (HTTP 400, 401, 403, 404, 422) are considered for failed requests. - Limits may be adjusted progressively, and updates will be announced in the API documentation. ``` -------------------------------- ### GET /info/city Source: https://apidocs.iys.org.tr/index Retrieves a list of all cities with their names and codes. ```APIDOC ## GET /info/city ### Description Retrieves a list of all cities with their names and codes. ### Method GET ### Endpoint /info/city ### Parameters (No parameters for this request) ### Request Example (No request body for this GET request) ### Response #### Success Response (200) A JSON array of city objects, where each object contains: - **name** (string) - The name of the city. - **code** (integer) - The code assigned to the city. #### Response Example ```json [ { "name": "Şırnak Merkez", "code": 923, "city_code": 73 }, { "name": "Uludere", "code": 924, "city_code": 73 } // ... more cities ] ``` #### Error Responses - **400**: Returned if an error occurred during the city information retrieval request. - **401**: Returned for unauthorized access. ``` -------------------------------- ### List Brands with Consent Stats (Bash) Source: https://context7.com/context7/apidocs_iys_tr/llms.txt Hizmet sağlayıcının altındaki tüm markaları, izin istatistikleri ve bayi sayılarıyla birlikte listeler. Bu endpoint, markaların genel durumunu anlamak için kullanışlıdır. ```bash # Markaları listele curl -X GET https://api.sandbox.iys.org.tr/sps/123456/brands \ -H "Authorization: Bearer {access_token}" # Yanıt [ { "brandCode": 545454, "name": "Ana Marka", "master": true, "stats": { "consents": { "approval": 1523, "rejection": 47, "total": 1570 }, "retailers": { "total": 12 } } }, { "brandCode": 545455, "name": "Alt Marka 1", "master": false, "stats": { "consents": { "approval": 845, "rejection": 23, "total": 868 }, "retailers": { "total": 5 } } } ] ``` -------------------------------- ### GET /info/town/{code} Source: https://apidocs.iys.org.tr/index Retrieves information about a specific district based on its code. ```APIDOC ## GET /info/town/{code} ### Description Retrieves information about a specific district based on its code. ### Method GET ### Endpoint /info/town/{code} ### Parameters #### Path Parameters - **code** (integer) - Required - The code assigned to the district. ### Request Example (No request body for this GET request) ### Response #### Success Response (200) - **code** (integer) - The district code. - **name** (string) - The name of the district. - **city_code** (integer) - The code of the city the district belongs to. #### Response Example ```json { "code": 1, "name": "Seyhan", "city_code": 1 } ``` #### Error Responses - **204**: Returned when the requested district information is not found. - **400**: Returned if there was an error retrieving the district information. - **401**: Returned for unauthorized access. ``` -------------------------------- ### İzin Hareketi İletimi (Push) - Bağlantı Oluşturma İstek Gövdesi (JSON) Source: https://apidocs.iys.org.tr/index İzin hareketi iletimi (Push) bağlantısı oluşturmak için gereken istek gövdesidir. URL, izin tipi, kullanıcı adı ve şifre bilgilerini içerir. Belirtilen URL, temel kimlik doğrulama ve HTTPS protokolünü desteklemelidir. ```json { "url": "https://your-access-url.com", "type": "EPOSTA", "username": "your_basic_auth_username", "password": "your_basic_auth_password" } ``` -------------------------------- ### Response Sample for Retailer Access List Query Source: https://apidocs.iys.org.tr/index This snippet shows a sample JSON response for a successful retailer access list query. It includes pagination details like offset, page size, and total count, along with a list of retailers. Each retailer object contains information such as title, MERSIS number, alias, name, TCKN, mobile number, and city/town details. ```json { "pagination": { "offset": 0, "pageSize": 100, "totalCount": 37 }, "list": [ { "title": "XYZ Ticaret", "mersis": "56518556720", "alias": "Şişli Mağazası", "name": "Adım Soyadım", "tckn": "57703411244", "mobile": "+905325001111", "city": { "name": "ISTANBUL", "code": "1" }, "town": { "name": "SARIYER", "code": "2" }, "retailerCode": 54856321 } ] } ``` -------------------------------- ### Start Email OTP Verification via Short URL Source: https://apidocs.iys.org.tr/index Initiates an OTP verification process via a short URL sent through email. Requires the recipient's email address, a template ID, and the sender's VKN. Returns a requestId and the short URL for the verification process. ```json { "email": "ornekeposta@ornekeposta.com", "templateId": "86377", "vkn": "1111111111" } ``` -------------------------------- ### GET /info/city/{code} Source: https://apidocs.iys.org.tr/index Retrieves the information of a specific city using its traffic code. Supports 'IYSAPISecurity' authorization. ```APIDOC ## GET /info/city/{code} ### Description Retrieves the information of a specific city using its traffic code. ### Method GET ### Endpoint `/info/city/{code}` ### Parameters #### Path Parameters - **code** (integer) - Required - The traffic code of the city. ### Request Example (No request body for GET request) ### Response #### Success Response (200) - **code** (string) - The traffic code of the city. - **name** (string) - The name of the city. #### Error Responses - **204** - City not found. - **400** - Failed to retrieve city information. - **401** - Unauthorized. #### Response Example (200) ```json { "code": "34", "name": "Istanbul" } ``` ``` -------------------------------- ### GET /info/town - List Districts Source: https://apidocs.iys.org.tr/index Retrieves a list of all districts with their respective city codes. This endpoint is secured with IYSAPISecurity. ```APIDOC ## GET /info/town ### Description Retrieves a list of all districts along with their corresponding city codes. This endpoint requires IYSAPISecurity authorization. ### Method GET ### Endpoint https://api.sandbox.iys.org.tr/info/town ### Parameters #### Query Parameters * None #### Request Body * None ### Request Example None ### Response #### Success Response (200) - **districts** (array) - A list of district objects, each containing district information and its city code. #### Response Example ```json { "districts": [ { "cityCode": "81", "districtCode": "963", "districtName": "Akçakoca" }, { "cityCode": "81", "districtCode": "964", "districtName": "Düzce Merkez" } // ... other districts ] } ``` #### Error Response (400) - **error** (string) - Description of the error encountered during the district retrieval request. #### Error Response (401) - **error** (string) - Indicates unauthorized access. ``` -------------------------------- ### GET /sps/{iysCode}/brands/{brandCode}/push/registration - Bağlantı Durumu Sorgulama Source: https://apidocs.iys.org.tr/index Bu metot, `İzin Hareketi İletimi (Push) - Bağlantı Oluşturma` metoduyla oluşturulan bağlantıları listelemeyi sağlar. İstek yolunda (Path Param) yer alan iysCode ve brandCode değeri için bağlantı durumları listelenir. ```APIDOC ## GET /sps/{iysCode}/brands/{brandCode}/push/registration ### Description Bu metot, `İzin Hareketi İletimi (Push) - Bağlantı Oluşturma` metoduyla oluşturulan bağlantıları listelemeyi sağlar. İstek yolunda (Path Param) yer alan iysCode ve brandCode değeri için bağlantı durumları listelenir. ### Method GET ### Endpoint `/sps/{iysCode}/brands/{brandCode}/push/registration` ### Parameters #### Path Parameters - **iysCode** (integer) - Required - Hizmet sağlayıcıya özel, İYS tarafından tekil olarak atanan İYS numarası bilgisidir. - **brandCode** (integer) - Required - Hizmet sağlayıcının markasına özel, İYS tarafından tekil olarak atanan İYS numarası bilgisidir. ### Response #### Success Response (200) - **url** (string) - İzin hareketlerinin iletileceği adres bilgisi. - **type** (string) - İzin hareketlerinin iletileceği tür bilgisi. - **registerTime** (string) - Bağlantı durumunun gerçekleştiği tarih bilgisi. - **status** (string) - Bağlantı durum bilgisi. #### Response Example ```json [ { "url": "https://iys.org.tr/sp/10001/brands/10001/push", "type": "ARAMA", "registerTime": "2021-12-01 13:36:31", "status": "Bağlantı Oluşturuldu" }, { "url": "https://iys.org.tr/sp/10001/brands/10001/push", "type": "MESAJ", "registerTime": "2021-12-10 03:25:56", "status": "Bağlantı Oluşturulamadı" } ] ``` ``` -------------------------------- ### Get Access Token (Oauth2) Source: https://apidocs.iys.org.tr/index Obtain or refresh an OAuth2 access token. This endpoint is crucial for authenticating API requests. ```APIDOC ## POST /oauth2/token ### Description Requests an OAuth2 access token, which can be used to authenticate API calls. Supports both initial token requests and token refreshes. ### Method POST ### Endpoint /oauth2/token ### Parameters #### Request Body - **grant_type** (string) - Required - The grant type for the token request (e.g., "client_credentials", "refresh_token"). - **client_id** (string) - Required (for initial request) - The client ID obtained during registration. - **client_secret** (string) - Required (for initial request) - The client secret obtained during registration. - **refresh_token** (string) - Required (for refresh request) - The refresh token received previously. ### Request Example // For initial token request { "grant_type": "client_credentials", "client_id": "YOUR_CLIENT_ID", "client_secret": "YOUR_CLIENT_SECRET" } // For token refresh { "grant_type": "refresh_token", "refresh_token": "YOUR_REFRESH_TOKEN" } ### Response #### Success Response (200) - **access_token** (string) - The obtained access token. - **token_type** (string) - The type of token (e.g., "Bearer"). - **expires_in** (integer) - The token's expiration time in seconds. - **refresh_token** (string) - The refresh token (if applicable). #### Response Example { "access_token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...", "token_type": "Bearer", "expires_in": 3600, "refresh_token": "defg123abc456" } ``` -------------------------------- ### POST /sps/{iysCode}/brands/{brandCode}/push/registration - Bağlantı Oluşturma Source: https://apidocs.iys.org.tr/index Bu metot, İzin Hareketi İletimi (Push) için yeni bir bağlantı oluşturur. Bağlantı bilgileri JSON formatında istek gövdesinde gönderilir. ```APIDOC ## POST /sps/{iysCode}/brands/{brandCode}/push/registration ### Description Bu metot, İzin Hareketi İletimi (Push) için yeni bir bağlantı oluşturur. Bağlantı bilgileri JSON formatında istek gövdesinde gönderilir. ### Method POST ### Endpoint `/sps/{iysCode}/brands/{brandCode}/push/registration` ### Parameters #### Path Parameters - **iysCode** (integer) - Required - Hizmet sağlayıcıya özel, İYS tarafından tekil olarak atanan İYS numarası bilgisidir. - **brandCode** (integer) - Required - Hizmet sağlayıcının markasına özel, İYS tarafından tekil olarak atanan İYS numarası bilgisidir. #### Request Body - **connection** (Array of objects) - Required - Bağlantı bilgisidir. - **url** (string) - Required - Bağlantı adresi. - **type** (string) - Required - Bağlantı türü (örneğin, EPOSTA). - **username** (string) - Required - Servis kullanıcı adı. - **password** (string) - Required - Servis parolası. ### Request Example ```json { "connection": [ { "url": "https://push.iys.org.tr/push/api", "type": "EPOSTA", "username": "Api123", "password": "3Kn.ls76412" } ] } ``` ### Response #### Success Response (200) - **message** (string) - İşlem başarılı mesajı. #### Response Example ```json { "message": "Bağlantı oluşturuldu" } ``` ``` -------------------------------- ### Consent Management (Mutabakat Yönetimi) Source: https://apidocs.iys.org.tr/index Endpoints for managing consent, including detailed explanations and examples. Added in version 0.2.5. ```APIDOC ## POST /consent/manage ### Description Manages consent records. This endpoint provides functionality for various consent operations, with detailed explanations and examples available in the documentation. ### Method POST ### Endpoint /consent/manage ### Parameters #### Request Body - **operation** (string) - Required - The type of consent operation (e.g., "ADD", "UPDATE", "REVOKE"). - **consentDetails** (object) - Required - Details of the consent to be managed. - **recipient** (string) - Required - The recipient of the consent. - **brandCode** (string) - Required - The brand code. - **consentDate** (string) - Required - The date and time of the consent. - **source** (string) - Required - The source of the consent. - **consentType** (string) - Required - The type of consent. - **consentStatus** (string) - Required - The status of the consent. ### Request Example { "operation": "ADD", "consentDetails": { "recipient": "user@example.com", "brandCode": "BRANDX", "consentDate": "2023-10-27T11:00:00Z", "source": "API", "consentType": "MARKETING", "consentStatus": "GRANTED" } } ### Response #### Success Response (200) - **result** (string) - The outcome of the consent operation (e.g., "SUCCESS", "FAILED"). - **message** (string) - A descriptive message about the operation's result. #### Response Example { "result": "SUCCESS", "message": "Consent added successfully." } ``` -------------------------------- ### Manage Retailers: List, Query, and Delete (JavaScript) Source: https://context7.com/context7/apidocs_iys_tr/llms.txt This JavaScript code demonstrates how to list all retailers under a brand, query specific retailer information, and delete a retailer. It requires an access token and uses the Fetch API. ```javascript const retailers = await fetch( 'https://api.sandbox.iys.org.tr/sps/123456/brands/654321/retailers', { headers: { 'Authorization': `Bearer ${accessToken}` } } ); const retailerList = await retailers.json(); const retailer = await fetch( 'https://api.sandbox.iys.org.tr/sps/123456/brands/654321/retailers/58954386', { headers: { 'Authorization': `Bearer ${accessToken}` } } ); await fetch( 'https://api.sandbox.iys.org.tr/sps/123456/brands/654321/retailers/58954386', { method: 'DELETE', headers: { 'Authorization': `Bearer ${accessToken}` } } ); ``` -------------------------------- ### GET /sps/{iysCode}/brands/{brandCode}/retailers Source: https://apidocs.iys.org.tr/index Retrieves a list of retailers matching the provided IYS code and brand code. ```APIDOC ## GET /sps/{iysCode}/brands/{brandCode}/retailers ### Description Retrieves a list of retailers matching the provided IYS code and brand code. ### Method GET ### Endpoint /sps/{iysCode}/brands/{brandCode}/retailers #### Path Parameters - **iysCode** (integer) - Required - The unique IYS number assigned by IYS for the service provider. - **brandCode** (integer) - Required - The unique IYS number assigned by IYS for the service provider's brand. ### Response #### Success Response (200) - **data** (array) - An array of retailer objects. - **retailerCode** (integer) - The unique code for the retailer. - **title** (string) - The commercial title of the retailer. - **name** (string) - The full name of the retailer's authorized person. - **tckn** (string) - TCKN of the retailer's authorized person. - **mobile** (string) - Mobile phone number of the retailer's authorized person. - **city** (object) - The city where the retailer is located. - **town** (object) - The district where the retailer is located. - **status** (string) - The status of the retailer. - **tin** (string) - Tax Identification Number (VKN) or Turkish ID Number (TCKN) of the retailer. - **mersis** (string) - MERSIS number of the retailer. - **alias** (string) - Description of the retailer. - **message** (string) - A message indicating the success of the operation. #### Response Example (200) ```json { "data": [ { "retailerCode": 58954386, "title": "XYZ Ticaret", "name": "Adım Soyadım", "tckn": "57703411244", "mobile": "+905325001111", "city": { "code": "34", "name": "İstanbul" }, "town": { "code": "01", "name": "Kadıköy" }, "status": "active", "tin": "8450525470", "mersis": "56518556720", "alias": "Şişli Mağazası" } ], "message": "Bayi listesi başarıyla getirildi." } ``` #### Error Responses - **400** - Bad Request - **401** - Unauthorized - **403** - Forbidden - **404** - IYS code or brand code not found. - **500** - Internal Server Error ``` -------------------------------- ### GET /integrator/{integratorCode}/subscription Source: https://apidocs.iys.org.tr/index Retrieves subscription information for a partner. Requires the partner's integratorCode in the path. This endpoint is only accessible by partners. ```APIDOC ## Get Partner Subscription Information ### Description Retrieves subscription details for a partner from IYS. The `integratorCode` must be provided as a path parameter. ### Method GET ### Endpoint `/integrator/{integratorCode}/subscription` ### Parameters #### Path Parameters - **integratorCode** (integer) - Required - The unique IYS code assigned to the partner. ### Request Example *(No request body for GET request)* ### Response #### Success Response (200) - **startDate** (string) - The start date of the partner's subscription. - **expirationDate** (string) - The expiration date of the partner's subscription. - **subscriptionPackageName** (string) - The name of the subscription package the partner has. - **subscriptionId** (string) - The ID of the partner's subscription. - **status** (string) - The status of the partner's subscription. Possible values: `ACTIVE`, `PAUSED`, `EXPIRED`, `CLOSED`. - **iysCode** (integer) - The unique IYS number assigned to the partner. #### Response Example (200) ```json { "startDate": "2020-06-21 12:24:55", "expirationDate": "2022-06-21 12:24:55", "subscriptionPackageName": "IO - API Kullanım Lisansı", "subscriptionId": "12345879", "status": "ACTIVE", "iysCode": 74112691 } ``` #### Error Responses - **400** - Bad Request - **401** - Unauthorized - **404** - Subscription not found - **429** - Too Many Requests - **500** - Internal Server Error ``` -------------------------------- ### Add Retailer Information Source: https://apidocs.iys.org.tr/index Creates a new retailer under a given brand and IYS code. This operation requires iysCode and brandCode as path parameters, and a JSON request body containing retailer details such as title, name, TCKN, TIN, city, and town. The response includes the newly generated retailerCode. ```json { "title": "XYZ Ticaret", "mersis": 56518556720, "alias": "Şişli Mağazası", "name": "Adım Soyadım", "tckn": "57703411244", "mobile": "+905325001111", "tin": "8450525470", "city": { "code": "34", "name": "İstanbul" }, "town": { "code": "01", "name": "Kadıköy" }, "status": "active" } ```