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

# Vendor inbound onetomany

# Tango Vendor One-to-Many Inbound — File

> Generated from `Tango Vendor_OnetoMany Integration Design Specification V0.4.docx` in SharePoint folder `01 Common Integrations`.
> OAS spec: [`vendor-inbound-onetomany.yaml`](./vendor-inbound-onetomany.yaml)

## Overview

SFTP file-based inbound for clients where a single supplier maintains many sites. Each pipe-delimited row carries BOTH supplier-level data (the same on every row for a given supplier) AND site-level data. Multiple rows with the same `Supplier_number` represent multiple sites under that supplier.

Same SFTP path and naming as the standard [`vendor-inbound-file`](./vendor-inbound-file.yaml) — Tango disambiguates by row shape (presence of supplier-level columns alongside site-level ones).

**Owner:** Tango Analytics
**Spec version:** 0.4
**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}_Vendor_MMDDYYYYHHMMSS.txt` (same as standard) | |
| Path | `/inbound/vendor` (same as standard) | |
| Auth | SFTP user/password (TBD) | |

## Differences from standard Vendor file

| Aspect | Standard Vendor file | One-to-Many variant |
| - | - | - |
| Supplier-level fields | One vendor = one site | Separate `Supplier_*` columns AND `supplier_site_*` columns |
| Per-supplier sites | One per row | Multiple rows allowed under one `Supplier_number` |
| `Primary_site` field | Absent | **Required** (Y/N) |
| Field casing | mostly lowercase | Mixed: `Supplier_Address1`/`Supplier_City` PascalCase, `address_1`/`city` snake\_case |

## Out-of-scope

* Linking the vendor to a lease or project (UI only).
* Adding / updating contacts attached to the vendor (UI only).

## Integration logic

* `Supplier_number` is the supplier upsert key; `Supplier_Site_Number` is the site upsert key (under that supplier).
* Tango never deletes vendors. Inactivate via `Supplier_Status = I`.
* Empty / header-only → `no data sent in the file` warning.

## Data fields (required ✅)

### Supplier-level (PascalCase)

| Field | Type | Req | Sample | Notes |
| - | - | - | - | - |
| `client_id` | NUMBER | ✅ | `76` | Tango client identifier |
| `Supplier_number` | VARCHAR | ✅ | `0000041674/01` | Unique vendor number |
| `Supplier_name` | VARCHAR | ✅ | `ABC Corp.` | |
| `Supplier_Status` | VARCHAR | ✅ | `A` | `A` Active / `I` Inactive |
| `Supplier_Address1` / `Supplier_Address2` | VARCHAR | – | | |
| `Supplier_City` / `Supplier_State` / `Supplier_Zip` | VARCHAR | – | | |
| `Supplier_Country` | VARCHAR | ✅ | `USA` | 3-letter ISO |
| `supplier_type` | VARCHAR | ✅ | `LEASE` | `LEASE` / `PROJECT` / `ALL` |

### Site-level (snake\_case)

| Field | Type | Req | Sample | Notes |
| - | - | - | - | - |
| `Supplier_Site_Number` ⚠ | VARCHAR | ✅ | `00004167` | Per-site identifier; PascalCase in source |
| `supplier_site_name` | VARCHAR | ✅ | `Aqualogical - East Side` | Client label "Vendor Name" |
| `supplier_site_type` | VARCHAR | ✅ | `Lessee` | Client-defined |
| `Primary_site` ⚠ | VARCHAR | ✅ | `Y` | Y/N; PascalCase in source |
| `address_1` / `address_2` / `address_3` | VARCHAR | – | | |
| `city` / `state` / `zip` | VARCHAR | – | | |
| `country` | VARCHAR | ✅ | `USA` | 3-letter ISO |
| `is_payee` | VARCHAR | ✅ | `Y` | Y/N |

## Open Questions / Assumptions

* [ ] **Same SFTP path as standard Vendor file** — both `vendor-inbound-file` and this variant land at `/inbound/vendor`. Tango distinguishes by file content shape. Confirm whether separate paths are expected in production.
* [ ] **Mixed-case field names** — supplier-level fields use PascalCase, site-level fields use snake\_case. Confirm intentional (or a doc inconsistency).
* [ ] **`Supplier_Site_Number` PascalCase** with underscore is unusual for snake-case'd "site" fields.
* [ ] **SFTP credentials** are `<TBD>`.
* [ ] **Timing/frequency** is `<TBD>`.
* [ ] **No `Supplier_Address3` field** in source (just `Address1`/`Address2`), but site has `address_3`. Confirm asymmetry.

## Changelog

| Ver | Date | Description | Author |
| - | - | - | - |
| 0.1 | — | Initial Draft | Alpna Bansal |
| 0.2 | 06/15/2022 | Error Handling & Appendix updates | Olivia Aneye |
| 0.3 | 11/03/2022 | Reformatted | Jasmin Thasleem |
| 0.4 | 09/18/2023 | Reformatted | Jasmin Thasleem |
