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

# Po outbound

# Tango PO Outbound

> Generated from `Tango PO Outbound Integration Design Specification V0.5.docx` in SharePoint folder `04 Projects Integrations`.
> OAS spec: [`po-outbound.yaml`](./po-outbound.yaml)

## Overview

SFTP file-based outbound integration. Tango writes approved Purchase Orders (header + detail rows) as a pipe-delimited text file to its SFTP server. The client reads the file and processes the data in its target system.

**Owner:** Tango Analytics
**Spec version:** 0.5
**Status:** Draft (auto-generated from design doc — needs review)

## Transport

| Attribute | Value | |
| - | - | - |
| Direction | Outbound (Tango → Client) | |
| Mechanism | SFTP file drop | |
| File format | Pipe-delimited (\` | `) text, `.txt\` extension |
| File naming | `{ClientName}_poout_MMDDYYYYHHMMSS.txt` | |
| Production host | `sftp.tangoanalytics.com` | |
| Test host | `sftpdev.tangoanalytics.com` (SIT/UAT) | |
| Path | `/outbound/PO` | |
| Auth | SFTP user/password (blank in source) | |
| Frequency | TBD | |

Existing files are moved to `Processed/` with a timestamp before each new write.

## Integration logic

* All POs with status `Approved` are exported.
* Zero-dollar lines are excluded.
* After successful export, POs are flagged `Exported`.
* `PO_ID` is the reconciliation key.
* The file always contains Header + Detail.
* If there are no approved POs, no file is generated.

## Data fields

| Field | Type | Description |
| - | - | - |
| `PO_ID` | NUMBER | Tango unique ID |
| `PO_NUMBER` | VARCHAR | |
| `PROJECT_NUMBER` | VARCHAR | |
| `PO_TYPE` | VARCHAR (lookup) | |
| `SUPPLIER_NUMBER` | VARCHAR | |
| `SUPPLIER_SITE` | VARCHAR | |
| `PAYMENT_TERMS` | VARCHAR (lookup) | |
| `PO_AMOUNT` | VARCHAR ⚠ | Source types as VARCHAR though numeric in nature |
| `RETAINAGE_PCT` | VARCHAR ⚠ | Same |
| `CURRENCY` | VARCHAR (lookup) | |
| `COMMENTS` | VARCHAR | |
| `DUE_DATE` | DATE (MM/DD/YYYY) | |
| `ISSUE_DATE` | DATE (MM/DD/YYYY) | |
| `ISSUED_BY` | VARCHAR | |
| `LEGAL_COMPANY` | VARCHAR | |
| `BUYER_CODE` | VARCHAR | |
| `BUYER_NAME` | VARCHAR | |
| `C_EXT_LOV1` | VARCHAR (lookup) | |
| `ITEM_NO` | VARCHAR | |
| `QTY` | VARCHAR ⚠ | |
| `RATE` | VARCHAR ⚠ | |
| `UOM` | VARCHAR (lookup) | |
| `LINE_AMOUNT` | VARCHAR ⚠ | |
| `DELIVERY_DATE` | DATE (MM/DD/YYYY) | |
| `ACCOUNT_CODE` | VARCHAR | Sample: `0938921` |
| `SEGMENT1` – `SEGMENT6` | VARCHAR | Budget segments |
| `LINE_COMMENTS` | VARCHAR | |

## Validations

| Condition | Error message | Comments |
| - | - | - |
| No approved PO records | `Fatal Error : No data found` | File is not generated on the FTP server; an error log is generated. |

## Open Questions / Assumptions

* [ ] **No "Required?" column** in the source — every field is left optional in the schema.
* [ ] **Numeric fields typed as VARCHAR** (`PO_AMOUNT`, `RETAINAGE_PCT`, `QTY`, `RATE`, `LINE_AMOUNT`): mapping table says VARCHAR; the spec mirrors that. Confirm whether numeric typing is intended.
* [ ] **SFTP credentials** are blank in source.
* [ ] **Timing/frequency** is `<TBD>`.
* [ ] **Lookup values** for `PO_TYPE`, `PAYMENT_TERMS`, `CURRENCY`, `UOM`, `C_EXT_LOV1` are `<TBD>` in Appendix.
* [ ] **Header / Trailer formats** not separately defined.
* [ ] **Test Scenario #2 is missing** from the source (numbering jumps from 1 to 3 in the doc).

## Changelog

| Ver | Date | Description | Author |
| - | - | - | - |
| 0.1 | 05/26/2021 | Initial Draft | Alpna Bansal |
| 0.2 | 07/06/2021 | Added segment fields, account code | Alpna Bansal |
| 0.3 | 06/30/2022 | Updated Data Mapping | Olivia Aneye |
| 0.4 | 09/15/2022 | Updated integration name in data mapping + formatting | Jasmin Thasleem |
| 0.5 | 10/31/2023 | Reformatting | Jasmin Thasleem |
