> This page is for version API + Legacy Full.
> For other versions, use one of these documentation indexes:
> - API (default): https://docs.getthera.com/api/llms.txt
> - API + Legacy Read: https://docs.getthera.com/api-legacy-read/llms.txt
> - API + Legacy Full: https://docs.getthera.com/api-legacy-full/llms.txt

> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.getthera.com/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.getthera.com/_mcp/server.

# Get Pay in History

GET https://api.getthera.com/companies/{companyId}/pay-ins

Money the company has sent to Thera. Narrow by status, or to off-platform transfers only, and walk the pages with afterCursor. You only see pay-ins covering contracts you have permission to view.

Reference: https://docs.getthera.com/thera-api/company/bank-api/get-pay-in-history

## Authentication

- `X-Thera-API-Key` header (required) — API Key authentication via header

## Servers

- `https://api.getthera.com` (Production, default)
- `https://api.staging.getthera.com` (Staging)

## Request

### Path parameters

- `companyId` (string, required)

### Query parameters

- `status` (enum, optional)
  - Allowed values: `PENDING`, `POSTED`
- `offPlatformOnly` (boolean, optional)
- `pageSize` (long, optional)
- `afterCursor` (string, optional)
- `startDate` (string, optional) — Only pay-ins effective on or after this date (inclusive, format: YYYY-MM-DD)
- `endDate` (string, optional) — Only pay-ins effective on or before this date (inclusive, format: YYYY-MM-DD)

## Response

### 200

- `history` (list of HistoricalPayIn, required) — Deprecated, please don't use anymore, will be removed next release!
- `payments` (list of HistoricPayment, required)
- `nextCursor` (string, optional)

## Types

### HistoricalPayIn

- `id` (string, required)
- `status` (enum, required)
  - Allowed values: `PENDING`, `POSTED`
- `time` (datetime, required)
- `invoiceCount` (integer, required)
- `currency` (string, required)
- `total` (long, required)
- `autoPaid` (boolean, required)
- `offPlatformReference` (string, optional)

### HistoricPayment

- `paymentId` (string, required)
- `time` (datetime, required)
- `totalAmount` (long, required)
- `currency` (string, required)
- `status` (enum, required)
  - Allowed values: `PENDING`, `POSTED`
- `detail` (HistoricPaymentDetail, required)
- `autoPaid` (boolean, required)

### HistoricPaymentDetail

- `type`: `invoicePayment`
  - `invoiceCount` (integer, required)
  - `subscriptionFee` (long, required) — The contractor fees included in the payment's total, in the same currency and minor units. Zero when none were charged, and always zero for callers who are not org admins.
  - `offPlatformReference` (string, optional)
- `type`: `eorPayIn`
  - `receiptS3Key` (string, optional)
  - `userMap` (map from string to string, optional)
- `type`: `w2SubscriptionFee`
  - `companySubscriptionMonthlyFeeAmount` (long, required)
  - `companySubscriptionPerEmployeeMonthlyFeeAmount` (long, required)
  - `numberOfEmployeeCharged` (long, required)
- `type`: `contractorSubscriptionFee`
  - `companySubscriptionMonthlyFeeAmount` (long, required)
  - `companySubscriptionPerContractorMonthlyFeeAmount` (long, required)
  - `numberOfContractorCharged` (long, required)
- `type`: `miscPayIn`
  - `descriptionForCompany` (string, optional)
  - `receiptS3Key` (string, optional)
- `type`: `refund`
  - `descriptionForCompany` (string, optional)
  - `receiptS3Key` (string, optional)

## Examples

**Response**

```json
{
  "history": [
    {
      "id": "id",
      "status": "PENDING",
      "time": "2024-01-15T09:30:00Z",
      "invoiceCount": 1,
      "currency": "currency",
      "total": 1000000,
      "autoPaid": true,
      "offPlatformReference": "offPlatformReference"
    },
    {
      "id": "id",
      "status": "PENDING",
      "time": "2024-01-15T09:30:00Z",
      "invoiceCount": 1,
      "currency": "currency",
      "total": 1000000,
      "autoPaid": true,
      "offPlatformReference": "offPlatformReference"
    }
  ],
  "payments": [
    {
      "paymentId": "paymentId",
      "time": "2024-01-15T09:30:00Z",
      "totalAmount": 1000000,
      "currency": "currency",
      "status": "PENDING",
      "detail": {
        "type": "invoicePayment",
        "invoiceCount": 1,
        "subscriptionFee": 1000000,
        "offPlatformReference": "offPlatformReference"
      },
      "autoPaid": true
    },
    {
      "paymentId": "paymentId",
      "time": "2024-01-15T09:30:00Z",
      "totalAmount": 1000000,
      "currency": "currency",
      "status": "PENDING",
      "detail": {
        "type": "invoicePayment",
        "invoiceCount": 1,
        "subscriptionFee": 1000000,
        "offPlatformReference": "offPlatformReference"
      },
      "autoPaid": true
    }
  ],
  "nextCursor": "nextCursor"
}
```

**SDK Code**

```python
import requests

url = "https://api.getthera.com/companies/companyId/pay-ins"

headers = {"X-Thera-API-Key": "<apiKey>"}

response = requests.get(url, headers=headers)

print(response.json())
```

```javascript
const url = 'https://api.getthera.com/companies/companyId/pay-ins';
const options = {method: 'GET', headers: {'X-Thera-API-Key': '<apiKey>'}};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go
package main

import (
	"fmt"
	"net/http"
	"io"
)

func main() {

	url := "https://api.getthera.com/companies/companyId/pay-ins"

	req, _ := http.NewRequest("GET", url, nil)

	req.Header.Add("X-Thera-API-Key", "<apiKey>")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby
require 'uri'
require 'net/http'

url = URI("https://api.getthera.com/companies/companyId/pay-ins")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)
request["X-Thera-API-Key"] = '<apiKey>'

response = http.request(request)
puts response.read_body
```

```java
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.get("https://api.getthera.com/companies/companyId/pay-ins")
  .header("X-Thera-API-Key", "<apiKey>")
  .asString();
```

```php
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('GET', 'https://api.getthera.com/companies/companyId/pay-ins', [
  'headers' => [
    'X-Thera-API-Key' => '<apiKey>',
  ],
]);

echo $response->getBody();
```

```csharp
using RestSharp;

var client = new RestClient("https://api.getthera.com/companies/companyId/pay-ins");
var request = new RestRequest(Method.GET);
request.AddHeader("X-Thera-API-Key", "<apiKey>");
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let headers = ["X-Thera-API-Key": "<apiKey>"]

let request = NSMutableURLRequest(url: NSURL(string: "https://api.getthera.com/companies/companyId/pay-ins")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "GET"
request.allHTTPHeaderFields = headers

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```