openapi: 3.1.0
info:
  title: Tango Vendor Inbound — File
  version: "0.6"
  description: |
    SFTP file-based inbound. Client drops a pipe-delimited file of vendor /
    supplier records to Tango's SFTP server. Tango picks up the file and
    creates / updates vendor records. Inactivation via `status = I`. Tango
    never deletes vendors.

    Out-of-scope for this integration (must be done manually in UI):
      - Linking a vendor to a lease.
      - Adding / updating vendor contacts.

    Field names differ from the API variant — file uses `vendor_number` /
    `phone_number` / `address_1` while API uses `Supplier_number` /
    `business_phone` / `address1`.
  x-direction: inbound
  x-source: Client System
  x-destination: Tango
  x-transport: sftp
  x-file-format: pipe-delimited text (.txt)
  x-file-naming-convention: "{ClientName}_Vendor_MMDDYYYYHHMMSS.txt"
servers:
  - url: sftp://sftp.tangoanalytics.com
    description: Production SFTP
    x-environment: production
    x-path: /inbound/vendor
  - url: sftp://sftpdev.tangoanalytics.com
    description: Test SFTP (SIT/UAT)
    x-environment: test
    x-path: /inbound/vendor
tags:
  - name: Vendor Inbound File
paths:
  /inbound/vendor:
    post:
      summary: Drop vendor file at SFTP path
      operationId: deliverVendorFile
      tags: [Vendor Inbound File]
      requestBody:
        required: true
        content:
          text/plain:
            schema:
              type: string
              format: binary
              x-record-schema:
                $ref: "#/components/schemas/VendorRow"
      responses:
        "200":
          description: File received and queued for processing.
components:
  securitySchemes:
    sftpUserPassword:
      type: http
      scheme: basic
  schemas:
    VendorRow:
      type: object
      required:
        - client_id
        - vendor_number
        - supplier_site_name
        - supplier_type
        - supplier_site_type
        - is_payee
        - country
        - status
      properties:
        client_id:
          type: number
          description: Tango client identifier.
          example: 76
        vendor_number:
          type: string
          description: Unique vendor number.
          example: "0000041674/01"
        supplier_site_name:
          type: string
          description: Client label "Vendor Name".
          example: "Aqualogical - East Side"
        supplier_type:
          type: string
          enum: [LEASE, PROJECT, ALL]
          description: Tango standard LOVs.
        supplier_site_type:
          type: string
          description: Client-defined vendor type (Lessee, Payee, Tenant, etc.).
        description: { type: string }
        address_1: { type: string }
        address_2: { type: string }
        address_3: { type: string }
        is_payee:
          type: string
          enum: [Y, N]
        city: { type: string }
        state: { type: string }
        zip: { type: string }
        country:
          type: string
          description: 3-letter country code.
        phone_number: { type: string }
        email: { type: string, format: email }
        status:
          type: string
          enum: [A, I]
          description: "`A` = Active, `I` = Inactive."
security:
  - sftpUserPassword: []
