# User Payment History

This endpoint returns all payment transactions (subscription payments and one-time purchases) for a given subscriber.

Use the **GET** method to query a subscriber, `subscriberId` is required.

<table data-header-hidden><thead><tr><th width="99.640625"></th><th></th></tr></thead><tbody><tr><td>Method</td><td><h4>  <mark style="color:green;background-color:$primary;"><code>GET</code></mark></h4></td></tr><tr><td>URL</td><td><pre data-overflow="wrap" data-full-width="false"><code>https://api.zotlo.com/v1/transaction?subscriberId=&#x26;paymentType=&#x26;startDate=&#x26;endDate=&#x26;packageId=
</code></pre></td></tr></tbody></table>

## **Request Parameters**

<table><thead><tr><th width="176.16015625">Field</th><th width="115.48828125">Type</th><th>Description</th></tr></thead><tbody><tr><td><code>subscriberId</code></td><td>Required</td><td>The email or phone number used by the user when starting the subscription.</td></tr><tr><td><code>paymentType</code></td><td>Optional</td><td>Filters by payment type. Allowed values: <code>subscription</code>, <code>consumable</code> (one-time payments).</td></tr><tr><td><code>startDate</code></td><td>Optional</td><td>Should be string (YYYY-MM-DD). Returns payments occurring <strong>after</strong> this date.</td></tr><tr><td><code>endDate</code></td><td>Optional</td><td>Should be string (YYYY-MM-DD). Returns payments occurring <strong>before</strong> this date.</td></tr><tr><td>packageId</td><td>Optional</td><td>Filters transactions belonging to a specific package.</td></tr></tbody></table>

## **Sample Request**

{% code overflow="wrap" %}

```js
GET https://api.zotlo.com/v1/transaction?subscriberId=SUBSCRIBER_ID&paymentType=subscription&startDate=2024-01-01&endDate=2024-01-30 HTTP/1.1
AccessKey: ••••••
AccessSecret: ••••••
Content-Type: application/json
ApplicationId: •
Language: ••
```

{% endcode %}

{% hint style="info" %}
You can find your **AccessKey** and **AccessSecret** in the Zotlo Panel under **Developer Tools → API Keys**

Sending **ApplicationId** is optional.
{% endhint %}

## Successful Response

{% code overflow="wrap" %}

```json
{
  "meta": {
    "requestId": "246a8e676214-REQ-659565f64ef8e",
    "httpStatus": 200
  },
  "result": {
    "transactions": [
      {
        "id": 57097,
        "payment_type": "subscription",
        "original_transaction_id": "48e39b30-2820-4d77-9699-221c896fca55",
        "transaction_id": "02c88e3a-f358-4adc-9c21-b979fb698e85",
        "provider_transaction_id": "b9b84a68-980e-404b-a705-45e5d327fdba",
        "package_id": "premium",
        "status": "renewal",
        "purchase_date": "2024-01-02 08:24:14",
        "expire_date": "2024-01-30 07:50:34",
        "original_purchase_date": "2023-11-30 07:50:34",
        "price": "49.00",
        "currency": "TRY",
        "country": "TR",
        "provider_name": "Zotlopos",
        "subscriptionId": 8260,
        "refund": null,
        "exchange": {
          "status": false,
          "detail": []
        }
      },
      {
        "id": 55001,
        "payment_type": "subscription",
        "original_transaction_id": "48e39b30-2820-4d77-9699-221c896fca55",
        "transaction_id": "48e39b30-2820-4d77-9699-221c896fca55",
        "provider_transaction_id": "b793670e-57d1-49df-8dcf-8d14426bd039",
        "package_id": "premium",
        "status": "start_paid",
        "purchase_date": "2023-11-30 07:50:34",
        "expire_date": "2023-12-30 07:50:34",
        "original_purchase_date": "2023-11-30 07:50:34",
        "price": "49.00",
        "currency": "TRY",
        "country": "TR",
        "provider_name": "Zotlo",
        "subscriptionId": 8260,
        "refund": null,
        "exchange": {
          "status": false,
          "detail": []
        }
      }
    ]
  }
}
```

{% endcode %}

## Key **Response Fields**

<table><thead><tr><th width="202.62890625">Field</th><th>Description</th></tr></thead><tbody><tr><td>transaction_id</td><td>Unique ID of the specific payment attempt. </td></tr><tr><td>original_transaction_id</td><td>The root transaction ID for the subscription or consumable order. All renewals reference this same ID.</td></tr><tr><td>payment_type</td><td>Type of payment:<br>• <code>subscription</code> – Subscription payment (start, renewal, trial→paid).<br>• <code>consumable</code> – One-time purchase.</td></tr><tr><td>package_id</td><td>Identifier of the product or subscription package.</td></tr><tr><td>status</td><td>Payment status type:<br>• <code>start_paid</code> – First paid subscription purchase<br>• <code>trial</code> – Trial started<br>• <code>trial_to_paid</code> – Trial converted to paid<br>• <code>renewal</code> – Subscription renewed<br>• <code>reactive</code> – Reactivation payment<br>• <code>consumable</code> – One-time purchase</td></tr><tr><td>purchase_date</td><td>Date and time when this payment attempt succeeded.</td></tr><tr><td>expire_date</td><td>Subscription expiry date for subscription payments (null for consumables).</td></tr><tr><td>original_purchase_date</td><td>First purchase date of the subscription.</td></tr><tr><td>price</td><td>Payment amount.</td></tr><tr><td>currency</td><td>Payment currency (USD, EUR, TRY etc.).</td></tr><tr><td>country</td><td>Country of purchase determined by payment metadata.</td></tr><tr><td>subscriptionId</td><td>Internal Zotlo subscription identifier (only for subscription payments).</td></tr><tr><td>refund</td><td>If the payment was refunded, contains refund metadata. Null otherwise.</td></tr><tr><td>exchange.status</td><td>Indicates whether currency exchange was applied.</td></tr><tr><td>exchange.detail</td><td>Additional exchange rate details if applicable.</td></tr><tr><td>checkout_type</td><td>Payment method (card, PayPal, GPay, ApplePay, etc.).</td></tr><tr><td>custom_parameters</td><td>May contains custom data (App specific user IDs, UTM data, Adjust/AppsFlyer/analytics IDs, IP address, etc.</td></tr></tbody></table>

## **Failed Response**

All failed responses follow the same standard error format.\
(See: [**Error Handling**](https://docs.zotlo.com/integrating-zotlo/api-reference/error-handling))
