> ## Documentation Index
> Fetch the complete documentation index at: https://docs.tangoanalytics.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Ar inbound api

# Tango AR Inbound (Cash Receipt Confirmation) API

> Generated from `Tango AR Inbound API Integration Design Specification V1.0.docx` in SharePoint folder `02 Lease Integrations`.
> OAS spec: [`ar-inbound-api.yaml`](./ar-inbound-api.yaml)

## Overview

Async REST API for posting AR cash receipt confirmations to Tango. Tango updates billing status and check information; visible in Lease Financials → Receivables.

**Owner:** Tango Analytics
**Spec version:** 1.0
**Status:** Draft (auto-generated — needs review)

## Base URLs

| Environment | URL |
| - | - |
| Production | `https://api.tangoanalytics.com` |
| Test (SIT/UAT) | `https://testapi.tangoanalytics.com` |

## Authentication

Headers `x-client` + `x-api-key`.

## Endpoints

| Method | Path | Summary |
| - | - | - |
| PUT | `/v1/leasemgmt/receivables` | Submit AR confirmations (async). |
| GET | `/v1/batch/status?gu_id=...` | Poll processing status. |

### `PUT /v1/leasemgmt/receivables`

```json theme={null}
{
  "records": [
    {
      "lease_receivable_id": "92392",
      "invoice_id": "92392",
      "invoice_number": "98733",
      "receivable_status": "RECEIVED",
      "check_number": "2369",
      "check_date": "07/16/2020",
      "check_amount": "510.00",
      "applied_amount": "510.00",
      "late_fee_amount": "10.00",
      "last_late_fee_date": "07/16/2020"
    }
  ]
}
```

### `GET /v1/batch/status?gu_id=...`

The completed-state shape differs slightly from other Tango APIs — there is **no `total_records` field**, and `errors[]` carries `record_key` + `record_value` + `errormessage`:

```json theme={null}
{
  "status": "Completed",
  "status_message": "X out Y receivable records updated successfully",
  "errors": [
    { "record_key": "83620", "record_value": "98743", "errormessage": "Lease_receivable_id is missing or empty" }
  ]
}
```

## Data model

| Field | Type | Required | Notes |
| - | - | - | - |
| `lease_receivable_id` | NUMBER | ✅ | Tango unique billing ID |
| `invoice_id` | VARCHAR | – | |
| `invoice_number` | VARCHAR | – | |
| `receivable_status` | VARCHAR | ✅ | Allowed: `PAID` / `VOID` (per validation #4) |
| `check_number` | VARCHAR | ✅ | |
| `check_date` | DATE `MM/DD/YYYY` | ✅ | |
| `check_amount` | NUMBER | ✅ | |
| `applied_amount` | NUMBER | ✅ | |
| `late_fee_amount` | NUMBER | conditional | Required when sending a late-fee record |
| `last_late_fee_date` | DATE | conditional | Required if `late_fee_amount` present |

## Validations

1. `lease_receivable_id` NULL → `lease_receivable_id is missing or empty`
2. `lease_receivable_id` not in Tango → `Invalid Lease receivable Id`
3. `receivable_status` NULL → `receivable_status is missing or empty`
4. `receivable_status` not in (`PAID`, `VOID`) → `Invalid receivable_status`
5. `check_number` NULL → `check_number is missing or empty`
6. `check_date` NULL → `check_date is missing or empty`
7. `check_date` not `MM/DD/YYYY` → `check_date value is not a valid date string`
8. `check_amount` NULL → `check_amount is missing or empty`
9. `applied_amount` NULL → `Applied amount is not present`
10. `late_fee_amount` present and `last_late_fee_date` not → `last_late_fee_date is missing or empty`
11. `late_fee_amount` not numeric → `late_fee_amount is not a number`
12. `last_late_fee_date` not `MM/DD/YYYY` → `last_late_fee_date is not a valid date string`

## Open Questions / Assumptions

* [ ] **`receivable_status` value mismatch**: sample shows `"RECEIVED"`, but validation #4 enforces `PAID`/`VOID` only. Treating the validation as authoritative.
* [ ] **Status response shape diverges** from other Tango APIs (no `total_records`, flatter `errors[]`) — confirm this is intentional.
* [ ] **Numeric fields sent as strings** in the sample; schema uses `number`.
* [ ] **Lookup codes** are `<TBD>` in Appendix.

## Changelog

| Ver | Date | Description | Author |
| - | - | - | - |
| 0.1–0.9 | 2021-2025 | (see source doc) | Various |
| 1.0 | 04/22/2026 | Updated API Architecture | Jasmin Thasleem |
