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

# Gl outbound api

# Tango GL Outbound API

> Generated from `Tango GL Outbound API Integration Technical Specification V1.4.docx` in SharePoint folder `02 Lease Integrations`.
> OAS spec: [`gl-outbound-api.yaml`](./gl-outbound-api.yaml)

## Overview

Async REST API: client fetches approved Journal Entries (batch accruals) from Tango for booking to its general ledger. Tango's internal 3-step process — generate accruals → approve JEs → transmit on request — feeds this API.

**Owner:** Tango Analytics
**Spec version:** 1.4
**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 |
| - | - | - |
| GET | `/v1/leasemgmt/accurals` ⚠ | Initiate GL export — returns `gu_id`. (Typo in source: `accurals` should likely be `accruals`.) |
| GET | `/v1/batch/status?gu_id=...&page_no=...` | Retrieve paginated JE records. |

### `GET /v1/leasemgmt/accurals`

Optional query params: `fiscal_year`, `fiscal_period`, `country`, `financial_group`.

**Response — 200 OK**

```json theme={null}
{ "status": "OK/Error", "status_message": "", "gu_id": "721c54c4-c7aa-4fa1-8fdfd6-c0cee161694d" }
```

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

Default `page_no = 1`, page size 5000. Null fields **omitted** from JSON.

## Integration logic

* Only accruals on `Active` leases are returned.
* Only batches in `APPROVED` status are picked up.
* All line items from approved batches are returned.
* After successful processing, `posting status` on the accounting schedule transitions to `PROCESSED` for the current period (and any error-correcting prior periods).

## Data model (required ✅)

| Field | Type | Req | Notes |
| - | - | - | - |
| `accrual_id` | NUMBER | ✅ | Tango unique ID |
| `batch_id` | NUMBER | ✅ | Tango unique batch ID |
| `location_num` | VARCHAR | ✅ | |
| `lease_num` | VARCHAR | ✅ | |
| `legal_entity` | VARCHAR | – | |
| `gl_type` | VARCHAR | ✅ | Accrual type, e.g., `842-BSE` |
| `accrual_description` / `line_desc` | VARCHAR | – | |
| `posting_date` | DATE | – | Last day of fiscal period |
| `fiscal_period` | VARCHAR | ✅ | |
| `fiscal_year` | VARCHAR | ✅ | |
| `period_amount` | VARCHAR ⚠ | – | Numeric per period |
| `lease_finacials_group` ⚠ | VARCHAR | – | Typo in source (preserved) |
| `je_number` | VARCHAR | – | |
| `accounting_schedule_treatment` | VARCHAR | – | FASB 840/842, IFRS16 |
| `currency` / `brand` / `department` / `region` | VARCHAR | – | |
| `account_classification` | VARCHAR | – | Operating / Finance |
| `asset_type` | VARCHAR | – | RE / Non-RE |
| `expense_type` | VARCHAR | – | Rent etc. |
| `seg1`–`seg6` | VARCHAR | – | See source for segment semantics |
| `seg1_gl`–`seg6_gl` | VARCHAR | – | GL extensions |
| `comments` / `country` | VARCHAR | – | |
| `credit_account` / `debit_Account` ⚠ | VARCHAR | – | `debit_Account` mixed case preserved |
| `lease_name` | VARCHAR | – | |

## Open Questions / Assumptions

* [ ] **`/accurals` typo**: the documented endpoint is `/v1/leasemgmt/accurals`. Likely should be `/accruals`. Schema preserved verbatim — confirm.
* [ ] **`lease_finacials_group` typo** in source ("finacials" not "financials"). Preserved verbatim.
* [ ] **`debit_Account` mixed case**: the doc uses capital A in `debit_Account` while `credit_account` is lowercase. Preserved verbatim; confirm wire format.
* [ ] **`period_amount` typed VARCHAR** — likely numeric. Preserved per source.
* [ ] **Required-fields**: per data mapping, most fields are optional, but business validations (e.g., `Lease Number not available`, `Posting Date not available`, `GL Account not available`) effectively require additional fields.
* [ ] **Pagination** page size 5000 (non-configurable per the doc).
* [ ] Reference documents (Journal Entry Descriptions, Journal Entry Model, JE accrual design xlsx, Plain Language JEs) live alongside this spec in SharePoint — not consumed by this generation per your direction.

## Changelog

| Ver | Date | Description | Author |
| - | - | - | - |
| 0.1–1.3 | 2020-2026 | (see source doc) | Various |
| 1.4 | 04/22/2026 | Updated API Architecture | Jasmin Thasleem |
