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

# Store financials inbound

# Tango Store Financials Inbound — File

> Generated from `Tango Store Financials Inbound Integration Design Specification V0.3.docx` in SharePoint folder `01 Common Integrations`.
> OAS spec: [`store-financials-inbound.yaml`](./store-financials-inbound.yaml)

## Overview

SFTP file-based inbound. Client drops a pipe-delimited file of per-period store-sales rows; Tango updates the Store Financials view under Locations / Stores.

**Owner:** Tango Analytics
**Spec version:** 0.3
**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 | `{ClientCode}_sales_MMDDYYYYHHMMSS.txt` | |
| Production host | `sftp.tangoanalytics.com` | |
| Test host | `sftpdev.tangoanalytics.com` | |
| Path | `/inbound/store_sales` | |
| Auth | SFTP user/password (TBD) | |
| Frequency | TBD | |

## Integration logic

* One row per period per store.
* `STORE_NUMBER` must exist in Tango; otherwise the row fails with a service-log error.
* Multiple files at the same time are processed FIFO.
* Tango does not derive any values — every figure must be supplied.

## Data fields (required ✅)

| Field | Type | Req | Notes |
| - | - | - | - |
| `CLIENT_ID` | NUMBER | ✅ | Tango client identifier |
| `STORE_NUMBER` | VARCHAR | ✅ | Must exist in Tango |
| `CURRENCY_TYPE` | VARCHAR | ✅ | |
| `CURRENCY` | VARCHAR | – | ISO 4217 3-letter |
| `PERIOD_ENDING` | NUMBER | – | Period-ending indicator |
| `CY_ANNUAL_SALES` | NUMBER | ✅ | Current-year annual sales |
| `CY_TRL_12_MO_SALES` | NUMBER | – | Client Label "CY WPSA" |
| `PY_TRL_12_MO_SALES` | NUMBER | – | Client Label "PY WPSA" |
| `PCT_DIFF_SALES` / `CY_EBITDA` / `PY_EBITDA` / `PCT_DIFF_EBITDA` | NUMBER | – | |
| `N_SALES_EXT_ATTR01..50` | NUMBER | – | Numeric custom attributes |
| `C_SALES_EXT_ATTR1..5` | VARCHAR | – | String custom attributes |

## Validations

| Condition | Error message |
| - | - |
| `CLIENT_ID` missing/invalid | `Fatal Error: Client ID Missing or Invalid for record: <number>` |
| `STORE_NUMBER` missing/invalid | `Store_number missing or Invalid for record: <number>` |
| `CURRENCY_TYPE` missing/invalid | `Fatal Error: currency_type is missing or invalid for record: <number>` |
| `CY_ANNUAL_SALES` missing | `Fatal Error: cy_annual_sales missing for record: <number>` |
| No header | `Fatal Error: No header present, file cannot be processed` |
| No records | `Warning: No records in <filename> to process` |
| No file present | `There is no file to process right now` |
| File format wrong | `Format of the file <filename> is wrong.` |

## Open Questions / Assumptions

* [ ] **SFTP credentials** are `<TBD>`.
* [ ] **Timing/frequency** is `<TBD>`.
* [ ] **`PERIOD_ENDING` format** is typed NUMBER but the semantic is "period ending" — likely YYYYMM or YYYYMMDD. Confirm.
* [ ] **`CURRENCY_TYPE` values** are not enumerated.
* [ ] **`CURRENCY` vs `CURRENCY_TYPE`** — both fields exist; their respective uses aren't explicit in the source.

## Changelog

| Ver | Date | Description | Author |
| - | - | - | - |
| 0.1 | 08/10/2022 | Initial Draft | Jasmin Thasleem |
| 0.2 | 08/09/2023 | Reformatted | Jasmin Thasleem |
| 0.3 | 09/13/2023 | Updated sample filename | Jasmin Thasleem |
