### POST Request Example Source: https://developers.trendyolefaturam.com/OpenApi/Gelen%20eFatura/reply-incoming-e-invoice An example of a POST request to the /api/invoice/documents/sent-reply endpoint. This snippet demonstrates the basic structure of an API call for sending a reply related to invoice documents. ```http POST /api/invoice/documents/sent-reply ``` -------------------------------- ### Get Application Status By Tax ID - C# HttpClient Request Source: https://developers.trendyolefaturam.com/OpenApi/Di%C4%9Fer/get-application-status-by-tax-id Example of using HttpClient in C# to call the getApplicationStatusByTaxId API. This demonstrates how to fetch application status and customer details in a .NET environment. ```csharp using System; using System.Net.Http; using System.Threading.Tasks; public class ApiClient { public static async Task GetApplicationStatusAsync() { using (HttpClient client = new HttpClient()) { client.BaseAddress = new Uri("https://stage-apigateway.trendyolefaturam.com"); client.DefaultRequestHeaders.Accept.Add(new System.Net.Http.Headers.MediaTypeWithQualityHeaderValue("application/json")); HttpResponseMessage response = await client.GetAsync("/api/invoice/partners/:partnerId/application-status/by-tax-id/:taxId"); response.EnsureSuccessStatusCode(); // Throw an exception if the status code is not a success string responseBody = await response.Content.ReadAsStringAsync(); Console.WriteLine(responseBody); } } public static void Main(string[] args) { GetApplicationStatusAsync().Wait(); } } ``` -------------------------------- ### Get Application Status By Tax ID - Go Native Request Source: https://developers.trendyolefaturam.com/OpenApi/Di%C4%9Fer/get-application-status-by-tax-id Example of how to call the getApplicationStatusByTaxId API using Go's native http package. This demonstrates fetching application status and customer data within a Go application. ```go package main import ( "fmt" "io/ioutil" "net/http" ) func main() { url := "https://stage-apigateway.trendyolefaturam.com/api/invoice/partners/:partnerId/application-status/by-tax-id/:taxId" req, _ := http.NewRequest("GET", url, nil) req.Header.Add("Accept", "application/json") client := &http.Client{} res, err := client.Do(req) if err != nil { panic(err) } defer res.Body.Close() body, err := ioutil.ReadAll(res.Body) if err != nil { panic(err) } fmt.Println(string(body)) } ``` -------------------------------- ### Get Application Status By Tax ID - cURL Request Source: https://developers.trendyolefaturam.com/OpenApi/Di%C4%9Fer/get-application-status-by-tax-id Example of how to call the getApplicationStatusByTaxId API using cURL. This request retrieves the application status and customer details for a given partner and tax ID. ```bash curl -L -X GET 'https://stage-apigateway.trendyolefaturam.com/api/invoice/partners/:partnerId/application-status/by-tax-id/:taxId' \ -H 'Accept: application/json' ``` -------------------------------- ### Create Outgoing E-Invoice by File Request Body (JSON Example) Source: https://developers.trendyolefaturam.com/OpenApi/Giden%20eFatura/create-outgoing-e-invoice-by-file This JSON example demonstrates the structure of a successful response when creating an outgoing e-invoice using an EFatura XML file. It includes fields like currency, local reference ID, status codes, invoice details, sender/receiver information, and timestamps. Note that this is a response example, not a request body example. ```json { "currency": "string", "localReferenceId": "string", "gibStatusCode": 0, "invoiceUuid": "3fa85f64-5717-4562-b3fc-2c963f66afa6", "invoiceId": "string", "prefix": "string", "userId": 0, "source": "PORTAL", "status": 10, "gibStatus": "REPORTED", "taxExcludedPrice": 0, "taxAmount": 0, "discountAmount": 0, "price": 0, "payableAmount": 0, "taxInclusiveAmount": 0, "receiverName": "string", "receiverSurname": "string", "receiverTitle": "string", "receiverTaxId": "string", "scenario": "EARSIVFATURA", "invoiceTypeCode": "SATIS", "xsltCode": "string", "externalCancellationType": "KEP", "issuedAt": "2024-06-05T12:42:41.599Z", "createdAt": "2024-06-05T12:42:41.599Z", "envelopeId": "3fa85f64-5717-4562-b3fc-2c963f66afa6", "targetAlias": "string", "replyNote": "string", "replyGibStatusCode": 0, "replyType": "APPROVED" } ``` -------------------------------- ### EArchive Invoice Creation JSON Example Source: https://developers.trendyolefaturam.com/OpenApi/eAr%C5%9Fiv/create-e-archive An example JSON payload for creating an EArchive invoice. It includes essential fields like invoice ID, currency, pricing details, recipient information, scenario, and status codes. ```json { "id": 0, "autoInvoiceId": false, "currency": "string", "localReferenceId": "string", "gibStatusCode": 0, "invoiceUuid": "3fa85f64-5717-4562-b3fc-2c963f66afa6", "invoiceId": "string", "prefix": "string", "year": 0, "rank": 0, "userId": 0, "source": "PORTAL", "status": 10, "gibStatus": "REPORTED", "taxExcludedPrice": 0, "taxAmount": 0, "discountAmount": 0, "price": 0, "payableAmount": 0, "taxInclusiveAmount": 0, "receiverName": "string", "receiverSurname": "string", "receiverTitle": "string", "receiverTaxId": "string", "scenario": "EARSIVFATURA", "invoiceTypeCode": "SATIS", "xsltCode": "string", "externalCancellationType": "KEP", "issuedAt": "2025-11-27T13:23:18.444Z", "createdAt": "2025-11-27T13:23:18.444Z", "lastUpdatedAt": "2025-11-27T13:23:18.444Z" } ``` -------------------------------- ### Get Application Status By Tax ID - Python HTTP Client Request Source: https://developers.trendyolefaturam.com/OpenApi/Di%C4%9Fer/get-application-status-by-tax-id Example of how to call the getApplicationStatusByTaxId API using Python's http.client library. This allows for programmatic retrieval of application status and customer information. ```python import http.client conn = http.client.HTTPSConnection("stage-apigateway.trendyolefaturam.com") payload = "" headers = { 'Accept': 'application/json' } conn.request("GET", "/api/invoice/partners/:partnerId/application-status/by-tax-id/:taxId", payload, headers) res = conn.getresponse() data = res.read() print(data.decode('utf-8')) ``` -------------------------------- ### Get Application Status By Tax ID - Node.js Axios Request Source: https://developers.trendyolefaturam.com/OpenApi/Di%C4%9Fer/get-application-status-by-tax-id Example of how to call the getApplicationStatusByTaxId API using the popular Axios library in Node.js. This facilitates easy integration for retrieving company application status. ```javascript const axios = require('axios'); const options = { method: 'GET', url: 'https://stage-apigateway.trendyolefaturam.com/api/invoice/partners/:partnerId/application-status/by-tax-id/:taxId', headers: { 'Accept': 'application/json' } }; axios.request(options).then(function (response) { console.log(response.data); }).catch(function (error) { console.error(error); }); ``` -------------------------------- ### Get Application Status By Tax ID - Java Unirest Request Source: https://developers.trendyolefaturam.com/OpenApi/Di%C4%9Fer/get-application-status-by-tax-id Example of using the Unirest library in Java to make a request to the getApplicationStatusByTaxId API. This shows how to retrieve application status and customer information in a Java application. ```java import kong.unirest.HttpResponse; import kong.unirest.Unirest; public class ApplicationStatus { public static void main(String[] args) { HttpResponse response = Unirest.get("https://stage-apigateway.trendyolefaturam.com/api/invoice/partners/:partnerId/application-status/by-tax-id/:taxId") .header("Accept", "application/json") .asString(); System.out.println(response.getBody()); } } ``` -------------------------------- ### File Error Response Example (Problem+JSON) Source: https://developers.trendyolefaturam.com/OpenApi/Giden%20eFatura/create-outgoing-e-invoice-by-file This example illustrates the structure of an error response when an issue occurs during the file processing for creating an e-invoice. It follows the problem+json standard, providing a type URI, HTTP status code, and a human-readable detail message to help diagnose and resolve the error. ```json { "type": "/problem/connection-error" } ``` -------------------------------- ### E-Fatura Status Response Example Source: https://developers.trendyolefaturam.com/OpenApi/Giden%20eFatura/get-outgoing-e-invoice-status This is an example of a successful response when querying the status of an outgoing E-Fatura. It includes the status code, GIB status code, and the invoice UUID. ```JSON { "status": 10, "gibStatusCode": 0, "invoiceUuid": "3fa85f64-5717-4562-b3fc-2c963f66afa6" } ``` -------------------------------- ### Authentication and User Management Source: https://developers.trendyolefaturam.com/OpenApi/trendyol-e-faturam-entegrasyon-dokumani Details on how to authenticate as a partner and obtain tokens for customer transactions. ```APIDOC ## Authentication and User Management ### Partner Sign In #### Description Authenticate using your partner account to obtain an access token. This token is then used to perform various operations within the system. #### Method `POST` #### Endpoint `/signIn` #### Request Body - **username** (string) - Required - Partner account username. - **password** (string) - Required - Partner account password. ### Customer Sign In #### Description After signing in as a partner and obtaining an access token, use this endpoint to get a token for a specific customer. The `userId` and `companyId` returned in the response are essential for subsequent invoice-related requests and should be stored for each customer. #### Method `POST` #### Endpoint `/customerSignIn` #### Parameters *Note: This endpoint likely requires authentication using the partner's access token.* #### Request Body - **customerId** (string) - Required - The ID of the customer for whom to obtain a token. #### Response (Success) - **accessToken** (string) - Token for customer transactions. - **userId** (string) - The unique ID of the customer. - **companyId** (string) - The unique ID of the customer's company. ``` -------------------------------- ### POST /websites/developers_trendyolefaturam/createDespatchAdvice Source: https://developers.trendyolefaturam.com/OpenApi/%C4%B0rsaliye/create-despatch-advice Yeni bir E-Arşiv fatura oluşturmak için kullanılır. Bu endpoint, sipariş bilgileri, alıcı bilgileri, gönderici bilgileri ve banka detayları gibi çeşitli parametreleri kabul eder. ```APIDOC ## POST /websites/developers_trendyolefaturam/createDespatchAdvice ### Description E-Arşiv fatura oluşturma isteğidir. Sipariş bilgileri, alıcı bilgileri, gönderici bilgileri ve banka detayları gibi çeşitli parametreleri kabul eder. ### Method POST ### Endpoint `/websites/developers_trendyolefaturam/createDespatchAdvice` ### Parameters #### Request Body - **autoInvoiceId** (boolean) - Opsiyonel - Varsayılan değer: `true` - **xsltCode** (string) - Opsiyonel - **companyId** (int64) - **Gerekli** - **localReferenceId** (string) - Opsiyonel - Maksimum 127 karakter - **prefix** (string) - Opsiyonel - Maksimum 3 karakter, Sadece büyük harf ve rakamlardan oluşmalı (Regex: `^[A-Z0-9]{3}$`) - **targetAlias** (string) - Opsiyonel - Maksimum 255 karakter - **totalPrice** (int32) - **Gerekli** - **despatchedAt** (date-time) - **Gerekli** - **userId** (int64) - **Gerekli** - **source** (string) - **Gerekli** - Olası Değerler: [`PORTAL`, `WEB`, `MOBILE`, `PARTNER`] - **notes** (string[]) - Opsiyonel - **orderInfos** (object[]) - Opsiyonel - **orderId** (string) - **Gerekli** - Sipariş numarası - **orderDate** (date) - **Gerekli** - Sipariş tarihi - **currencyInfo** (object) - Opsiyonel - Kur bilgileri - **currency** (string) - Opsiyonel - Minimum 2 karakter, Varsayılan değer: `TRY`. Para birimi. - **hasExchange** (boolean) - Opsiyonel - Kur bilgisi kullanılacaksa `true` olmalı. - **calculationRate** (double) - Opsiyonel - Kur bilgisi. - **sourceCurrency** (string) - Opsiyonel - Minimum 2 karakter. Kaynak para birimi. - **targetCurrency** (string) - Opsiyonel - Minimum 2 karakter. Hedef para birimi. - **exchangeDate** (date-time) - Opsiyonel - Kur bilgisinin tarihi. - **recipientInfo** (object) - **Gerekli** - Alıcı bilgileri - **taxId** (string) - **Gerekli** - Minimum 10 karakter. VKN/TCKN bilgisi. - **countryCode** (string) - **Gerekli** - Ülke kodu. Olası Değerler: [`AF`, `AX`, ..., `SS`, `CTR`, `XK`, `BQ`, `SX`, `ZZ`, `XZ`, `SS`]. Varsayılan değer: `TR`. - **city** (string) - **Gerekli** - Minimum 2 karakter. Şehir bilgisi. - **district** (string) - Opsiyonel - Boş olamaz. - **address** (string) - Opsiyonel - Minimum 2 ve maksimum 255 karakter. - **postalCode** (string) - Opsiyonel - Tam olarak 5 karakter. - **phone** (string) - Opsiyonel - Regex: `^\+?[0-9]{7,15}$`. - **email** (string) - Opsiyonel - Minimum 2 karakter. Email adresi. - **name** (string) - **Gerekli** - Minimum 2 ve maksimum 127 karakter. Ad. - **surname** (string) - Opsiyonel - Minimum 2 ve maksimum 255 karakter. Soyad. - **taxOffice** (string) - Opsiyonel - Minimum 2 karakter. Vergi dairesi bilgisi. - **passengerInfo** (object) - Opsiyonel - Yolcu bilgisi - **passportNo** (string) - **Gerekli** - Maksimum 9 karakter. Pasaport numarası. - **passportIssueDate** (date) - Opsiyonel - Pasaport verilme tarihi. - **bankInformation** (object) - Opsiyonel - Banka bilgileri - **bankName** (string) - **Gerekli** - Minimum 2 ve maksimum 127 karakter. Banka ismi. - **bankBranchOfficeName** (string) - **Gerekli** - Minimum 2 ve maksimum 127 karakter. Banka şube ismi. - **accountType** (string) - **Gerekli** - Tam olarak 3 karakter. Hesap türü (Örn. TRY). - **accountNumber** (string) - **Gerekli** - Minimum 3 ve maksimum 63 karakter. Hesap numarası (IBAN). - **paymentNote** (string) - Opsiyonel - Maksimum 255 karakter. Ödeme notu. - **shipmentInfo** (object) - Opsiyonel - **carrier** (object) - Opsiyonel - **taxId** (string) - **Gerekli** - Regex: `^\d{10,11}$`. - **companyName** (string) - **Gerekli** - **city** (string) - Opsiyonel - **district** (string) - Opsiyonel - **driverInfos** (object[]) - Opsiyonel - **driverName** (string) - **Gerekli** - **driverSurname** (string) - **Gerekli** - **driverPhone** (string) - Opsiyonel ### Request Example ```json { "autoInvoiceId": true, "xsltCode": "string", "companyId": 0, "localReferenceId": "string", "prefix": "string", "targetAlias": "string", "totalPrice": 0, "despatchedAt": "YYYY-MM-DDTHH:MM:SSZ", "userId": 0, "source": "PORTAL", "notes": [ "string" ], "orderInfos": [ { "orderId": "string", "orderDate": "YYYY-MM-DD" } ], "currencyInfo": { "currency": "TRY", "hasExchange": true, "calculationRate": 0.0, "sourceCurrency": "string", "targetCurrency": "string", "exchangeDate": "YYYY-MM-DDTHH:MM:SSZ" }, "recipientInfo": { "taxId": "string", "countryCode": "TR", "city": "string", "district": "string", "address": "string", "postalCode": "string", "phone": "string", "email": "string", "name": "string", "surname": "string", "taxOffice": "string" }, "passengerInfo": { "passportNo": "string", "passportIssueDate": "YYYY-MM-DD" }, "bankInformation": { "bankName": "string", "bankBranchOfficeName": "string", "accountType": "TRY", "accountNumber": "string", "paymentNote": "string" }, "shipmentInfo": { "carrier": { "taxId": "string", "companyName": "string", "city": "string", "district": "string" }, "driverInfos": [ { "driverName": "string", "driverSurname": "string", "driverPhone": "string" } ] } } ``` ### Response #### Success Response (200) - **message** (string) - İşlem sonucunu belirten mesaj. - **despatchAdviceId** (string) - Oluşturulan irsaliye/fatura ID'si. #### Response Example ```json { "message": "Başarılı", "despatchAdviceId": "123e4567-e89b-12d3-a456-426614174000" } ``` ``` -------------------------------- ### Environment Information Source: https://developers.trendyolefaturam.com/OpenApi/trendyol-e-faturam-entegrasyon-dokumani Information about the test and live environment Gateway addresses for Trendyol E-Faturam. ```APIDOC ## Environment Information ### Test Environment - **Gateway Address**: `https://stage-apigateway.trendyolefaturam.com` ### Live Environment - **Gateway Address**: `https://apigateway.trendyolefaturam.com` ``` -------------------------------- ### Stylesheet Cannot Be Applied Problem Source: https://developers.trendyolefaturam.com/OpenApi/%C4%B0rsaliye/create-despatch-advice This endpoint addresses issues where a stylesheet cannot be applied. ```APIDOC ## POST /websites/developers_trendyolefaturam ### Description Handles problems where a stylesheet cannot be applied to the e-invoice. ### Method POST ### Endpoint /websites/developers_trendyolefaturam ### Parameters #### Request Body - **title** (string) - A short summary of the problem type. - **status** (int32) - The HTTP status code. - **detail** (string) - A human-readable explanation of the problem. ### Request Example ```json { "title": "Stylesheet Not Found", "status": 404, "detail": "The specified stylesheet could not be located or applied." } ``` ### Response #### Success Response (200) This endpoint typically returns an error response, not a success response with data. #### Response Example ```json { "title": "Stylesheet Application Failed", "status": 500, "detail": "An internal error occurred while trying to apply the stylesheet." } ``` ``` -------------------------------- ### GET /api/invoice/partners/corporate/:taxId Source: https://developers.trendyolefaturam.com/OpenApi/Di%C4%9Fer/get-partner-corporate-info Retrieves corporate customer information for a given Tax ID. This is used by marketplace integrators to get customer details. ```APIDOC ## GET /api/invoice/partners/corporate/:taxId ### Description Retrieves corporate customer information for a given Tax ID. This is used by marketplace integrators to get customer details. ### Method GET ### Endpoint /api/invoice/partners/corporate/:taxId ### Parameters #### Path Parameters - **taxId** (string) - Required - The Tax ID of the corporate customer. ### Request Example ```json { "example": "" } ``` ### Response #### Success Response (200) - **email** (string) - The email address of the corporate customer. - **taxId** (string) - The Tax ID of the corporate customer. - **phone** (string) - The phone number of the corporate customer. - **title** (string) - The name or title of the corporate customer. - **address** (string) - The address of the corporate customer. #### Response Example ```json { "email": "string", "taxId": "string", "phone": "string", "title": "string", "address": "string" } ``` #### Error Response (404) - **partnerCustomerId** (int64) - Identifier for the partner customer. - **title** (string) - A short summary of the problem type. - **status** (int32) - The HTTP status code. - **detail** (string) - A human readable explanation of the problem. - **instance** (uri-reference) - A URI reference that identifies the specific occurrence of the problem. - **taxId** (string) - The Tax ID that was not found. #### Error Response (Default) - **title** (string) - A short summary of the problem type. - **status** (int32) - The HTTP status code. - **detail** (string) - A human readable explanation of the problem. - **instance** (uri-reference) - A URI reference that identifies the specific occurrence of the problem. ``` -------------------------------- ### Get E-Archive Invoice Status (GET Request) Source: https://developers.trendyolefaturam.com/OpenApi/eAr%C5%9Fiv/get-e-archive-status This snippet shows the HTTP GET request to query the status of a specific E-Archive invoice using its UUID. The request requires the invoice UUID as a path parameter. The response will contain the current status of the invoice, or an error if the invoice is not found or another issue occurs. ```http GET /api/invoice/documents/earchive/status/:invoiceUuid ``` -------------------------------- ### ApplicationMismatchProblem Source: https://developers.trendyolefaturam.com/OpenApi/Giden%20eFatura/create-outgoing-e-invoice Problem details when there is an application mismatch. ```APIDOC ## Problem: Application Mismatch ### Description This problem occurs when there is a mismatch between the expected application and the one being used or referenced. ### Fields - **`title`** (string) - A short summary of the problem type. - **`status`** (integer) - The HTTP status code (e.g., 400 Bad Request). - **`detail`** (string) - A human-readable explanation of the application mismatch. - **`instance`** (uri-reference) - A URI reference identifying the specific occurrence of the problem. ### Response Example ```json { "title": "Application Mismatch", "status": 400, "detail": "The application specified does not match the expected application for this resource.", "instance": "/problems/application-mismatch/resource-id" } ``` ``` -------------------------------- ### Customer Sign-In API Source: https://developers.trendyolefaturam.com/OpenApi/Authorization/customer-sign-in This endpoint allows marketplace integrators to authenticate customers and obtain an access token. The integrator must also provide their own authentication token in the header. ```APIDOC ## POST /customerSignIn ### Description This endpoint allows marketplace integrators to authenticate customers and obtain an access token. The integrator must also provide their own authentication token in the header. ### Method POST ### Endpoint /customerSignIn ### Parameters #### Request Body - **email** (string) - Required - Email address of the customer. - **password** (string) - Required - Password of the customer. - **taxId** (string) - Required - VKN / TCKN information. Must be between 10 and 11 characters long. ### Request Example ```json { "email": "customer@example.com", "password": "securepassword", "taxId": "12345678901" } ``` ### Response #### Success Response (200) - **userId** (int64) - The unique identifier for the user. - **companyId** (int64) - The unique identifier for the company. - **partnerCustomerId** (int64) - The unique identifier for the partner customer. - **accessToken** (string) - The authentication token for accessing protected resources. #### Response Example ```json { "userId": 0, "companyId": 0, "partnerCustomerId": 0, "accessToken": "string" } ``` #### Error Responses - **401 Unauthorized**: Token is invalid or expired. - **403 Forbidden**: Email or password is incorrect, or the user account is locked. - **404 Not Found**: Customer information not found. - **default**: General error response. ``` -------------------------------- ### GET /api/invoice/partners/:partnerId/application-status/by-tax-id/:taxId Source: https://developers.trendyolefaturam.com/OpenApi/Di%C4%9Fer/get-application-status-by-tax-id Retrieves the product service status and customer ID information for a company using its Partner ID and Tax ID (VKN/TCKN). ```APIDOC ## GET /api/invoice/partners/:partnerId/application-status/by-tax-id/:taxId ### Description Retrieves the product service status and customer ID information for a company using its Partner ID and Tax ID (VKN/TCKN). ### Method GET ### Endpoint /api/invoice/partners/:partnerId/application-status/by-tax-id/:taxId ### Parameters #### Path Parameters - **partnerId** (int64) - required - Partner ID - **taxId** (string) - required - Tax ID ### Request Example ```json { "partnerId": 1, "taxId": "800319933" } ``` ### Response #### Success Response (200) - **applicationDetail** (object[]) - Product service and application details - **type** (int32) - Product code - **gibStatus** (string) - GIB status code - **activated** (boolean) - Activation information (Default: false) - **activationDate** (date-time) - Activation date - **deactivationDate** (date-time) - Deactivation date - **serviceName** (string) - Product name (Max 63 characters) - **partnerCustomerId** (int64) - Partner customer ID #### Response Example (200) ```json { "applicationDetail": [ { "type": 0, "gibStatus": "string", "activated": false, "activationDate": "2024-06-04T09:35:45.723Z", "deactivationDate": "2024-06-04T09:35:45.723Z", "serviceName": "string" } ], "partnerCustomerId": 0 } ``` #### Error Response (404) - **title** (string) - A short summary of the problem type. - **status** (int32) - The HTTP status code. - **detail** (string) - A human readable explanation specific to this occurrence of the problem. - **instance** (uri-reference) - A URI reference that identifies the specific occurrence of the problem. #### Response Example (404) ```json { "type": "/problem/connection-error", "title": "Service Unavailable", "status": 503, "detail": "Connection to database timed out", "instance": "/problem/connection-error#token-info-read-timed-out" } ``` ``` -------------------------------- ### CorporatePrefixIsUnusableProblem Source: https://developers.trendyolefaturam.com/OpenApi/Giden%20eFatura/create-outgoing-e-invoice Problem details when a corporate prefix is unusable. ```APIDOC ## Problem: Corporate Prefix Is Unusable ### Description This problem indicates that the specified corporate prefix is not valid or cannot be used for the requested operation. ### Fields - **`title`** (string) - A short summary of the problem type. - **`status`** (integer) - The HTTP status code (e.g., 400 Bad Request). - **`detail`** (string) - A human-readable explanation why the corporate prefix is unusable. - **`instance`** (uri-reference) - A URI reference identifying the specific occurrence of the problem. ### Response Example ```json { "title": "Corporate Prefix Is Unusable", "status": 400, "detail": "The corporate prefix provided is not valid or is already in use.", "instance": "/problems/unusable-corporate-prefix/some-prefix" } ``` ``` -------------------------------- ### E-Fatura Not Found Error Response Example Source: https://developers.trendyolefaturam.com/OpenApi/Giden%20eFatura/get-outgoing-e-invoice-status This example shows the JSON response when an outgoing E-Fatura is not found. It includes error details such as a type, title, status code, detail message, and instance URI. ```JSON { "invoiceUuid": "3fa85f64-5717-4562-b3fc-2c963f66afa6", "type": "/problem/connection-error", "title": "Service Unavailable", "status": 503, "detail": "Connection to database timed out", "instance": "/problem/connection-error#token-info-read-timed-out" } ``` -------------------------------- ### E-Fatura Details Source: https://developers.trendyolefaturam.com/OpenApi/Giden%20eFatura/create-outgoing-e-invoice This section outlines the common and specific fields required for creating an e-fatura. It covers packaging information, origin codes, and various conditional fields based on invoice type. ```APIDOC ## E-Fatura Structure ### Description This details the fields for creating an e-fatura, including packaging, origin, and type-specific information. ### Fields - **packagingQuantity** (integer) - Kap adedi - **originCode** (OriginCode) - Ürün menşei bilgisi. Possible values: [`AF`, `AX`, `AL`, `DZ`, ..., `SS`, `CTR`, `XK`, `BQ`, `SX`, `ZZ`, `XZ`, `SS`] - **exportRegisteredAdditionalInfo** (object) - İhraç Kayıtlı faturaları için bilgiler. - **lineId** (string, required) - Fatura numarası. Possible values: `>= 11 characters` and `<= 11 characters` - **requiredCustomsId** (RequiredCustomsId, required) - GTIP kodu. Value must match regular expression `^\d{12}$` - **technologySupportInfo** (object) - Teknoloji Destek faturaları için bilgiler. - **technologySupportType** (TechnologySupportType, required) - Cihaz türü. Possible values: [`TELEPHONE`, `TABLET`] - **imei** (Imei) - Imei numarası. Value must match regular expression `^[0-9]{15}$` - **imei2** (Imei) - Imei numarası. Value must match regular expression `^[0-9]{15}$` - **imei3** (Imei) - Imei numarası. Value must match regular expression `^[0-9]{15}$` - **medicalInvoiceInfo** (object) - İlaç-Tıbbi Cihaz faturaları için bilgiler. - **medicalProductType** (MedicalProductType, required) - Ürün türü. Possible values: [`MEDICINE`, `MEDICAL_DEVICE`, `OTHER`] - **medicineAdditionalInfo** (object[]) - Ürün türü 'MEDICINE' ise doldurulmalıdır. - **gtinNo** (string, required) - GTIN numarası. Value must match regular expression `^\d{13}$` - **batchNo** (string, required) - Lot numarası. Value must match regular expression `^\d{1,155}$` - **sequenceNo** (string, required) - Sıra numarası. Value must match regular expression `^\d{1,155}$` - **expirationDate** (date) - Son kullanma tarihi - **medicalDeviceAdditionalInfo** (object[]) - Ürün türü 'MEDICAL_DEVICE' ise doldurulmalıdır. - **productNo** (string, required) - Ürün numarası. Value must match regular expression `^\d{1,155}$` - **batchNo** (string, required) - Parti/Lot numarası. Value must match regular expression `^\d{1,155}$` - **sequenceNo** (string) - Sıra numarası. Value must match regular expression `^\d{1,155}$` - **manufacturingDate** (date, required) - Üretim tarihi - **marketplaceSaleTypeInvoiceInfo** (object) - HKS faturaları için bilgiler. - **tagNo** (string, required) - Künye numarası. Value must match regular expression `^.{19}$` - **productOwnerName** (string) - Ürün sahibinin adı. Possible values: `>= 2 characters` and `<= 255 characters` - **productOwnerTaxId** (TaxId) - Ürün sahibinin vergi numarası. Value must match regular expression `^\d{10,11}$` - **microExportRequiredCustomsId** (RequiredCustomsId) - Mikro İhracat faturaları için GTIP kodu bilgisi. Value must match regular expression `^\d{12}$` - **chargeUnitSerialNo** (string) - Enerji faturaları için şarj birimi seri numarası bilgisi. Possible values: `<= 127 characters` ### Total Tax Information - **totalTax** (object, required) - Toplam vergi bilgileri. - **totalTaxAmount** (int32, required) - Toplam vergi tutarı. - **subTotalTaxes** (object[], required) - Vergi türlerine göre kırılımlar. - **taxableAmount** (int32, required) - Vergilendirilebilir tutar. - **taxAmount** (int64, required) - Vergi tutarı. - **taxType** (TaxType) - Vergi türü. ``` -------------------------------- ### Get Taxpayer List Download URL (cURL) Source: https://developers.trendyolefaturam.com/OpenApi/M%C3%BCkellef%20Sorgulama/get-all-taxpayers-download-url This snippet shows how to make a GET request to retrieve the download URL for the taxpayer list. It specifies the endpoint and the expected 'Accept' header. This method is useful for scripting and automation. ```bash curl -L -X GET 'https://stage-apigateway.trendyolefaturam.com/api/invoice/taxpayers/download' \ -H 'Accept: text/plain' ``` ```python import http.client conn = http.client.HTTPSConnection("stage-apigateway.trendyolefaturam.com") payload = "" headers = { 'Accept': 'text/plain' } conn.request("GET", "/api/invoice/taxpayers/download", payload, headers) res = conn.getresponse() data = res.read() print(data.decode("utf-8")) ``` ```go package main import ( "fmt" "net/http" "io/ioutil" ) func main() { client := &http.Client{} req, err := http.NewRequest("GET", "https://stage-apigateway.trendyolefaturam.com/api/invoice/taxpayers/download", nil) if err != nil { fmt.Println(err) return } req.Header.Add("Accept", "text/plain") res, err := client.Do(req) if err != nil { fmt.Println(err) return } defer res.Body.Close() body, err := ioutil.ReadAll(res.Body) if err != nil { fmt.Println(err) return } fmt.Println(string(body)) } ``` ```javascript const axios = require('axios'); const options = { method: 'GET', url: 'https://stage-apigateway.trendyolefaturam.com/api/invoice/taxpayers/download', headers: { 'Accept': 'text/plain' } }; axios.request(options).then(function (response) { console.log(response.data); }).catch(function (error) { console.error(error); }); ``` ```csharp using System; using System.Net.Http; using System.Threading.Tasks; public class Example { public static async Task Main() { using (var client = new HttpClient()) { var request = new HttpRequestMessage { Method = HttpMethod.Get, RequestUri = new Uri("https://stage-apigateway.trendyolefaturam.com/api/invoice/taxpayers/download") }; request.Headers.Add("Accept", "text/plain"); var response = await client.SendAsync(request); response.EnsureSuccessStatusCode(); // Throw if not 2xx var body = await response.Content.ReadAsStringAsync(); Console.WriteLine(body); } } } ``` ```java import kong.unirest.HttpResponse; import kong.unirest.Unirest; public class Example { public static void main(String[] args) { HttpResponse response = Unirest.get("https://stage-apigateway.trendyolefaturam.com/api/invoice/taxpayers/download") .header("Accept", "text/plain") .asString(); System.out.println(response.getBody()); } } ``` -------------------------------- ### Get Outgoing E-Invoice Status API Request Source: https://developers.trendyolefaturam.com/OpenApi/Giden%20eFatura/get-outgoing-e-invoice-status This snippet demonstrates how to make a GET request to retrieve the status of an outgoing E-Invoice. It requires the invoice UUID as a path parameter. The successful response includes the status, GIB status code, and invoice UUID. ```HTTP GET /api/invoice/documents/outgoing-einvoice/status/:invoiceUuid ```