# 5. Tracking Code

## **Payment Query (TrackingCode)**

<mark style="color:blue;">`GET`</mark> `{{Private Base Address}}/api/paywall/private/query/by/trackingcode`

{% hint style="info" %}
**Important:** To use the Payment Query (TrackingCode) service, you must include the **apikeyprivate** and **apiclientprivate** parameters in the **Header** section.\
\
[<mark style="color:green;">**PaymentPrivateAPI Address**</mark>](https://developer.paywall.one/payment-orchestration-integration-document/environment)
{% endhint %}

{% hint style="warning" %}
The payment query service using the tracking number (TrackingCode) returns a maximum of 100 records.
{% endhint %}

<table><thead><tr><th width="224.72265625">Parameter</th><th width="97.78125">Type</th><th width="118.79296875">Compulsory</th><th width="403">Description</th></tr></thead><tbody><tr><td>apikeyprivate</td><td>string</td><td>Yes</td><td><strong>Public Key obtained from the merchant panel.</strong></td></tr><tr><td>apiclientprivate</td><td>string</td><td>Yes</td><td>Public Client obtained from the merchant panel.</td></tr><tr><td>merchantuniquecode</td><td>string </td><td>Optional</td><td>Unique tracking code assigned by you for the payment.</td></tr><tr><td>trackingcode</td><td>string</td><td>Yesa</td><td>Tracking code (TrackingCode) assigned by you for the payment.</td></tr></tbody></table>

**Example Code:**

{% tabs %}
{% tab title="C#" %}

```csharp
using System;
using System.Net.Http;
using System.Threading.Tasks;
using Newtonsoft.Json;

public class Program
{
    private static readonly HttpClient client = new HttpClient();

    private static async Task Main()
    {
        client.DefaultRequestHeaders.Add("apikeyprivate", "%PRIVATEKEY%");
        client.DefaultRequestHeaders.Add("apiclientprivate", "%PRIVATECLIENT%");
        client.DefaultRequestHeaders.Add("merchantuniquecode", "%MerchantUniqueCode%"); // Opsiyonel
        client.DefaultRequestHeaders.Add("trackingcode", "%TrackingCode%");
        var response = await client.GetAsync("{{Private Base Address}}/api/paywall/private/query/by/trackingcode");
        var responseString = await response.Content.ReadAsStringAsync();
        var responseObject = JsonConvert.DeserializeObject<Response>(responseString);
        Console.WriteLine(responseObject.Body.Paywall.StatusName);
    }

    public class Response
    {
        public int ErrorCode { get; set; }
        public bool Result { get; set; }
        public string Message { get; set; }
        public Body Body { get; set; }
    }

    public class Body
    {
        public List<PaywallList> List { get; set; }
    }

    public class PaywallList
    {
        public int PaymentId { get; set; }
        public int ActivityId { get; set; }
        public bool Status { get; set; }
        public string StatusName { get; set; }
        // Define other properties as needed...
    }
}
```

{% endtab %}
{% endtabs %}

**Parameter Descriptions (Returns a list):**

<table><thead><tr><th width="281">Parameter</th><th width="130.33333333333331">Type</th><th>Description</th></tr></thead><tbody><tr><td>PaymentId</td><td>int</td><td>Payment ID</td></tr><tr><td>UniqueCode</td><td>Guid</td><td>Unique tracking number generated by Paywall for the payment</td></tr><tr><td>MerchantUniqueCode</td><td>string</td><td>Unique tracking number generated by Paywall for the payment</td></tr><tr><td>TrackingCode</td><td>string</td><td>Tracking number provided by the merchant at the time of payment initiation</td></tr><tr><td>ActivityId</td><td>int</td><td>Identifier of the last payment activity</td></tr><tr><td>PaymentGatewayId</td><td>int</td><td>Identifier of the payment provider through which the transaction was processed</td></tr><tr><td>PaymentGatewayName</td><td>string</td><td>Name of the payment provider through which the transaction was processed</td></tr><tr><td>PaymentGatewayProviderName</td><td>string</td><td>System name of the payment provider through which the transaction was processed</td></tr><tr><td>IsThreeDSecure</td><td>bool</td><td>Is the transaction 3D secure?</td></tr><tr><td>IsNonThreeDSecure</td><td>bool</td><td>Is the transaction Non-3D secure?</td></tr><tr><td>IsInsuranceSecure</td><td>bool</td><td>Is the transaction insurance-specific (first 8 and last 4 digits)?</td></tr><tr><td>IsProvision</td><td>bool</td><td>Is the transaction pre-authorized?</td></tr><tr><td>IsOtp</td><td>bool</td><td>Is the transaction performed using the OTP method?</td></tr><tr><td>AnySuccessPayment</td><td>bool</td><td>Is there any successful sale within the transaction scope?</td></tr><tr><td>AnySuccessRefund</td><td>bool</td><td>Is there any successful refund within the transaction scope?</td></tr><tr><td>AnySuccessPartialRefund</td><td>bool</td><td>Is there any successful partial refund within the transaction scope?</td></tr><tr><td>AnySuccessCancel</td><td>bool</td><td>Is there any successful cancellation within the transaction scope?</td></tr><tr><td>Status</td><td>boolean</td><td>Status of the last activity, true: successful / false: failed</td></tr><tr><td>StatusName</td><td>string</td><td>Payment status</td></tr><tr><td>StatusId</td><td>int</td><td>Payment status identifier</td></tr><tr><td>TypeName</td><td>string</td><td>Type of the last payment activity</td></tr><tr><td>TypeId</td><td>int</td><td>Identifier of the last payment activity type</td></tr><tr><td>Installment</td><td>int</td><td>Installment information</td></tr><tr><td>CurrencyId</td><td>int</td><td>Payment currency identifier</td></tr><tr><td>CurrencyName</td><td>string</td><td>Payment currency</td></tr><tr><td>PaymentMethodId</td><td>int</td><td>Payment method identifier<br><br>See: <a href="broken-reference">Payment Methods </a></td></tr><tr><td>PaymentMethodName</td><td>string</td><td>Payment method</td></tr><tr><td>PaymentChannelId</td><td>int</td><td><strong>Payment channel identifier</strong><br><br>See: <a href="broken-reference">Payment Channels</a></td></tr><tr><td>PaymentChannelName</td><td>string</td><td>Payment channel</td></tr><tr><td>PaymentTagId</td><td>int</td><td>Payment tag identifier</td></tr><tr><td>PaymentTagName</td><td>string</td><td>Payment tag</td></tr><tr><td>CardNumber</td><td>string</td><td>Masked card number</td></tr><tr><td>CardOwnerName</td><td>string</td><td>Masked cardholder name</td></tr><tr><td>CardBankId</td><td>int</td><td>Identifier of the card's bank</td></tr><tr><td>CardBankName</td><td>string</td><td>Name of the card's bank</td></tr><tr><td>CardBrandId</td><td>int</td><td>Identifier of the card brand</td></tr><tr><td>CardBrandName</td><td>string</td><td>Name of the card brand</td></tr><tr><td>CardTypeId</td><td>int</td><td>Identifier of the card type</td></tr><tr><td>CardTypeName</td><td>string</td><td>Name of the card type</td></tr><tr><td>CardFamilyId</td><td>int</td><td>Identifier of the card family</td></tr><tr><td>CardFamilyName</td><td>string</td><td>Name of the card family</td></tr><tr><td>LastActivityDateTime</td><td>DateTime</td><td>Date and time of the last transaction related to the payment</td></tr><tr><td>PaymentAmount</td><td>decimal</td><td>Total payment amount</td></tr><tr><td>ActivityAmount</td><td>decimal</td><td><p>Last transaction amount</p><p><br><em>Example: If a transaction with a main amount of 1000 TL has a partial refund of 100 TL, this parameter will return 100.</em></p></td></tr><tr><td>IP</td><td>string</td><td>IP address to which the transaction was sent</td></tr><tr><td>ClientIP</td><td>string</td><td>IP address of the device used at the time of the transaction</td></tr><tr><td>AppliedInterest</td><td>bool</td><td>Was installment interest applied to the payment?</td></tr><tr><td>InterestRate</td><td>decimal?</td><td>Applied installment interest rate</td></tr><tr><td>CommissionRate</td><td>decimal?</td><td><p>Commission information applied by the payment provider</p><p><br><em>Returns the value you configured in the Paywall panel.</em></p></td></tr><tr><td>OriginalAmount</td><td>decimal</td><td><p>Original payment amount</p><p><br><em>Example: If the payment amount is 1000 TL and after applying a 100 TL installment interest the total charged becomes 1100 TL, this parameter will return 1000 TL as the original amount before interest was applied.</em></p></td></tr><tr><td>InterestAmount</td><td>decimal?</td><td>If applicable, the applied installment interest amount</td></tr><tr><td>CommissionAmount</td><td>decimal</td><td>Commission amount applied to the payment by the payment institution/bank</td></tr><tr><td>UsedSavedCard</td><td>bool</td><td>Was the payment made using a saved card?</td></tr><tr><td>UsedTempCard</td><td>bool</td><td>Was the payment made using a client-side tokenized card?</td></tr><tr><td>Activities</td><td>List</td><td>All actions related to the transaction (Created, Sale Started, Sale Failed, Cancellation Successful, etc.)</td></tr><tr><td>IsFullyRefunded</td><td>bool</td><td>Information on whether the transaction has been fully canceled/refunded.</td></tr><tr><td>RemainingRefundAmount</td><td>decimal</td><td>Total refundable amount. This amount decreases as partial refunds are made.</td></tr></tbody></table>

{% tabs %}
{% tab title="JSON" %}
{% code lineNumbers="true" %}

```json
{
    "ErrorCodeType": 1,
    "ErrorMessage": null,
    "ErrorCode": 0,
    "Result": true,
    "Message": "",
    "Body": {
        "List": [
            {
                "PaymentId": 4045719,
                "UniqueCode": "5cd67b1e-9b1d-49ee-bf73-96b9d004a73f",
                "MerchantUniqueCode": "b735a618-f775-434e-9a96-b5f3d0502b14",
                "TrackingCode": "tracking-code-1234567890",
                "ActivityId": 8907405,
                "PaymentGatewayId": 1570,
                "PaymentGatewayName": "ProviderConnectionName",
                "PaymentGatewayProviderName": "ProviderSystemName",
                "IsThreeDSecure": false,
                "IsNonThreeDSecure": true,
                "IsInsuranceSecure": false,
                "IsProvision": true,
                "IsOtp": false,
                "AnySuccessPayment": false,
                "AnySuccessRefund": false,
                "AnySuccessPartialRefund": false,
                "AnySuccessCancel": false,
                "Error": {
                    "AnyError": false,
                    "ErrorType": 0,
                    "ErrorMessage": ""
                },
                "Status": false,
                "StatusName": "Finansallaştırma Bekliyor",
                "StatusId": 3,
                "TypeName": "Satış",
                "TypeId": 1,
                "Installment": 1,
                "CurrencyId": 1,
                "CurrencyName": "TRY",
                "PaymentMethodId": 4,
                "PaymentMethodName": "Half Direct Payment",
                "PaymentChannelId": 0,
                "PaymentChannelName": null,
                "PaymentTagId": 0,
                "PaymentTagName": null,
                "CardNumber": "552879******0008",
                "CardOwnerName": "Enes Selman Tütüncü",
                "CardBankId": 55,
                "CardBankName": "T.HALK BANKASI A.Ş.",
                "CardBrandId": 1,
                "CardBrandName": "Master Card",
                "CardTypeId": 1,
                "CardTypeName": "Credit",
                "CardFamilyId": 5,
                "CardFamilyName": "Paraf",
                "LastActivityDateTime": "2025-06-04T23:39:29.0246554",
                "PaymentAmount": 1000.00,
                "ActivityAmount": 1000.00,
                "IP": "78.190.218.158",
                "ClientIP": null,
                "AppliedInterest": false,
                "InterestRate": 0.00,
                "CommissionRate": 0.00,
                "OriginalAmount": 1000.00,
                "InterestAmount": 0.00,
                "CommissionAmount": 0.00,
                "UsedSavedCard": true,
                "UsedTempCard": false
            },
            {
                "PaymentId": 4045718,
                "UniqueCode": "3208b4c0-646b-453a-b555-4685bd62867b",
                "MerchantUniqueCode": "a2720c3b-7490-41cc-adfd-1edfbf5d1177",
                "TrackingCode": "tracking-code-1234567890",
                "ActivityId": 8907402,
                "PaymentGatewayId": 1570,
                "PaymentGatewayName": "ProviderConnectionName",
                "PaymentGatewayProviderName": "ProviderSystemName",
                "IsThreeDSecure": false,
                "IsNonThreeDSecure": true,
                "IsInsuranceSecure": false,
                "IsProvision": true,
                "IsOtp": false,
                "AnySuccessPayment": false,
                "AnySuccessRefund": false,
                "AnySuccessPartialRefund": false,
                "AnySuccessCancel": false,
                "Error": {
                    "AnyError": false,
                    "ErrorType": 0,
                    "ErrorMessage": ""
                },
                "Status": false,
                "StatusName": "Finansallaştırma Bekliyor",
                "StatusId": 3,
                "TypeName": "Satış",
                "TypeId": 1,
                "Installment": 1,
                "CurrencyId": 1,
                "CurrencyName": "TRY",
                "PaymentMethodId": 4,
                "PaymentMethodName": "Half Direct Payment",
                "PaymentChannelId": 0,
                "PaymentChannelName": null,
                "PaymentTagId": 0,
                "PaymentTagName": null,
                "CardNumber": "552879******0008",
                "CardOwnerName": "Enes Selman Tütüncü",
                "CardBankId": 55,
                "CardBankName": "T.HALK BANKASI A.Ş.",
                "CardBrandId": 1,
                "CardBrandName": "Master Card",
                "CardTypeId": 1,
                "CardTypeName": "Credit",
                "CardFamilyId": 5,
                "CardFamilyName": "Paraf",
                "LastActivityDateTime": "2025-06-04T23:39:26.7114128",
                "PaymentAmount": 1000.00,
                "ActivityAmount": 1000.00,
                "IP": "78.190.218.158",
                "ClientIP": null,
                "AppliedInterest": false,
                "InterestRate": 0.00,
                "CommissionRate": 0.00,
                "OriginalAmount": 1000.00,
                "InterestAmount": 0.00,
                "CommissionAmount": 0.00,
                "UsedSavedCard": true,
                "UsedTempCard": false
            },
            {
                "PaymentId": 4045717,
                "UniqueCode": "2da4e8f0-91e2-4a99-8087-0f117be3f648",
                "MerchantUniqueCode": "94fe0960-396a-49f5-a290-bc6454bd12bd",
                "TrackingCode": "tracking-code-1234567890",
                "ActivityId": 8907399,
                "PaymentGatewayId": 1570,
                "PaymentGatewayName": "ProviderConnectionName",
                "PaymentGatewayProviderName": "ProviderSystemName",
                "IsThreeDSecure": false,
                "IsNonThreeDSecure": true,
                "IsInsuranceSecure": false,
                "IsProvision": true,
                "IsOtp": false,
                "AnySuccessPayment": false,
                "AnySuccessRefund": false,
                "AnySuccessPartialRefund": false,
                "AnySuccessCancel": false,
                "Error": {
                    "AnyError": false,
                    "ErrorType": 0,
                    "ErrorMessage": ""
                },
                "Status": false,
                "StatusName": "Finansallaştırma Bekliyor",
                "StatusId": 3,
                "TypeName": "Satış",
                "TypeId": 1,
                "Installment": 1,
                "CurrencyId": 1,
                "CurrencyName": "TRY",
                "PaymentMethodId": 4,
                "PaymentMethodName": "Half Direct Payment",
                "PaymentChannelId": 0,
                "PaymentChannelName": null,
                "PaymentTagId": 0,
                "PaymentTagName": null,
                "CardNumber": "552879******0008",
                "CardOwnerName": "Enes Selman Tütüncü",
                "CardBankId": 55,
                "CardBankName": "T.HALK BANKASI A.Ş.",
                "CardBrandId": 1,
                "CardBrandName": "Master Card",
                "CardTypeId": 1,
                "CardTypeName": "Credit",
                "CardFamilyId": 5,
                "CardFamilyName": "Paraf",
                "LastActivityDateTime": "2025-06-04T23:39:25.2136514",
                "PaymentAmount": 1000.00,
                "ActivityAmount": 1000.00,
                "IP": "78.190.218.158",
                "ClientIP": null,
                "AppliedInterest": false,
                "InterestRate": 0.00,
                "CommissionRate": 0.00,
                "OriginalAmount": 1000.00,
                "InterestAmount": 0.00,
                "CommissionAmount": 0.00,
                "UsedSavedCard": true,
                "UsedTempCard": false
            }
        ]
    }
}
```

{% endcode %}
{% endtab %}
{% endtabs %}
