> ## 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 file

# Tango AR Inbound (Cash Receipts) — File

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

## Overview

SFTP file-based inbound. Client drops a pipe-delimited file of cash receipts on Tango's SFTP server. Tango updates billing status (visible in Lease Financials → Receivables) and moves the file to `Processed/`.

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

## Transport

| Attribute | Value | |
| - | - | - |
| Direction | Inbound (Client → Tango) | |
| Mechanism | SFTP file drop | |
| File format | Pipe-delimited (\` | `) text, `.txt\` |
| File naming | `{ClientName}_arin_MMDDYYYYHHMMSS.txt` | |
| Path | `inbound/ar/` | |
| Auth | SFTP user/password (TBD) | |
| Frequency | TBD | |

## Integration logic

* `LEASE_BILLING_ID` must already exist in Tango (round-tripped from AR Outbound).
* Invalid `LEASE_BILLING_ID` → service-log error `Invalid Lease Billing ID`.
* If `CHECK_AMOUNT >= GROSS_AMOUNT`, exported records' status changes to `PAID` (but the client must explicitly send this in the file).
* Empty file or header-only → `No records in input file` warning.
* Multiple concurrent files processed FIFO; all moved to Processed.

## Data fields

| Field | Type | Required | Sample | Description |
| - | - | - | - | - |
| `CLIENT_ID` | NUMBER | ✅ | `74` | Provided by Tango |
| `INVOICE_ID` | VARCHAR | – | `770501` | |
| `LEASE_BILLING_ID` | NUMBER | ✅ | `770567` | Unique billing identifier |
| `INVOICE_NUMBER` | VARCHAR | – | `A1234` | |
| `CHECK_DATE` | DATE | ✅ | `11/10/2017` | `MM/DD/YYYY` |
| `CHECK_NUMBER` | VARCHAR | ✅ | `889559` | |
| `CHECK_AMOUNT` | NUMBER | ✅ | `76542.33` | |
| `APPLIED_AMOUNT` | NUMBER | ✅ | `76542.33` | |
| `CHARGE_STATUS` | VARCHAR ⚠ | ✅ | `PAID` | Doc types as NUMBER; values `PAID` / `VOID` |

## Validations

| Condition | Error message |
| - | - |
| Client ID invalid/null | `Client id is not present or invalid` |
| No file in folder | `There is no file to process right now` |
| Empty file | `Empty file, no records to process` |
| No header | `No header present, file can not be processed` |
| `LEASE_BILLING_ID` invalid/NULL | `Lease Receivable ID is not present or invalid` |
| `CHECK_DATE` not `MM/DD/YYYY` | `Check date <> is not in valid format` |
| `CHECK_DATE` NULL | `Check date is not present` |
| `CHECK_NUMBER` NULL | `Check number is not present` |
| `CHECK_AMOUNT` NULL | `Check amount is not present` |
| `APPLIED_AMOUNT` NULL | `Applied amount is not present` |
| `CHARGE_STATUS` not in (`PAID`, `VOID`) | `Invalid receivable_status :<> for billing id:<>` |

## Open Questions / Assumptions

* [ ] **`CHARGE_STATUS` typed as NUMBER** in mapping but sample is `PAID`. Schema uses string with enum `PAID`/`VOID`.
* [ ] **SFTP credentials** are `<TBD>`.
* [ ] **Timing/frequency** is `<TBD>`.
* [ ] **Error message inconsistency**: validation uses `Lease Receivable ID` but field name is `LEASE_BILLING_ID`.

## Changelog

| Ver | Date | Description | Author |
| - | - | - | - |
| 0.1–0.6 | 2020-2023 | (see source doc) | Various |
| 0.7 | 09/20/2023 | Reformatted | Jasmin Thasleem |
