openapi: 3.0.1
info:
  title: Application API
  description: Lili Server API Swagger documentation
  version: v2.0.0
  contact:
    name: Lili Dev Resources
    email: dev-resources@lili.co
    url: https://lili.co
servers:
  - description: Lili Server
    url: https://sandbox.lili.co
paths:
  /lili/api/v1/lead:
    put:
      operationId: registerAccount
      responses:
        '201':
          description: Created with a URL of the onboarding link
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/LeadResponse'
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                type: object
                properties: {}
            application/xml:
              schema:
                $ref: '#/components/schemas/JsonErrorResponse'
      x-stoplight:
        id: g557e7m6h5mmc
      summary: Create Application
      description: >-
        The Create Application API is used to create a new Application in the
        Lili platform.


        The respon contains a UUID representing the applicant that was created
        in the Lili platform, and a URL that allows initializing the application
        process with the pre-filled information.
      security:
        - accessKey: []
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/LeadRequest'
  /lili/api/v1/{customerId}/bankLetter:
    get:
      summary: Download Bank Letter
      tags: []
      responses: {}
      operationId: createPaymentNotification
      parameters:
        - name: customerId
          description: The customer ID, as provided in the create lead response
          in: path
          required: true
          schema:
            type: string
      description: Gets a PDF containing a bank letter for a customer
      security:
        - accessKey: []
  /lili/api/v1/payments:
    put:
      summary: Register a payment transaction
      tags: []
      responses: {}
      operationId: createPaymentNotification
      description: Creates a payment notification in the Lili system
      security:
        - accessKey: []
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PaymentRequest'
components:
  schemas:
    LeadRequest:
      type: object
      x-stoplight:
        id: c2d7e6a8d57d1
      description: Contains the information about an account partner wants to register
      required:
        - email
      properties:
        email:
          type: string
          description: The unique ID of the webhook
          format: email
        phoneNumber:
          type: string
          description: 'Customer phone number. E.164 format. '
        ssn:
          type: string
          pattern: >-
            ^(?!666|000|9\d{2})\d{3}-\d{2}-(?!0{4})\d{4}$|^(?!666|000|9\d{2})\d{3}\d{2}(?!0{4})\d{4}$
          example: XXX-XX-XXXX
          format: regex
          description: Customer SSN
        birthDate:
          type: string
          format: date
          description: Customer birth date
        firstName:
          type: string
          description: Customer first name
        lastName:
          type: string
          description: Customer last name
        line1:
          type: string
          description: Customer address line1
        line2:
          type: string
          x-stoplight:
            id: s4ueie5kmng7h
          description: Customer address line2
        city:
          type: string
          x-stoplight:
            id: glw5cw81eccwf
          minLength: 1
          maxLength: 30
          description: Customer address city
        state:
          type: string
          x-stoplight:
            id: fnnbe5v9wwqpd
          example: NY
          description: Customer address 2 letter state code
        country:
          type: string
          x-stoplight:
            id: fy63l53p59hv2
          example: NY
          description: Customer country of residence (Alpha 2, ISO 3166 format)
        postalCode:
          type: string
          x-stoplight:
            id: nludzl5bdmrhi
          pattern: ^\d{5}(-\d{4})?$
          example: XXXXX
          format: regex
          description: Customer address postal code
        ein:
          type: string
          x-stoplight:
            id: fykqvsjr5irgz
          pattern: >-
            ^(0[1-6]|1[0-6]|2[0-7]|3[0-9]|4[0-8]|5[0-9]|6[0-8]|7[1-7]|8[0-8]|9[0-5]|9[8-9])[0-9]{7}$
          format: regex
          description: Business EIN
        businessName:
          type: string
          x-stoplight:
            id: atsiy8oe3n8no
          description: Business name
        businessLine1:
          type: string
          x-stoplight:
            id: ccxnpz2h5glg6
          description: Business address line 1
        businessLine2:
          type: string
          x-stoplight:
            id: 5jhwmu7zot1qj
          description: Business address line 2
        businessCity:
          type: string
          x-stoplight:
            id: qwjpiuxu5apud
          maxLength: 30
          minLength: 1
          description: Business address city
        businessState:
          type: string
          x-stoplight:
            id: vww2irxpn0o7y
          example: NY
          description: Business address 2 letter state code
        businessPostalCode:
          type: string
          x-stoplight:
            id: 7hc8m9rj0mvyd
          example: XXXXX
          pattern: ^\d{5}(-\d{4})?$
          format: regex
          description: Business address postal code
        businessType:
          x-stoplight:
            id: 8528dyj6t5tmr
          enum:
            - DBA
            - LLC
            - MMLLC
            - GENERAL_PARTNERSHIP
            - LLP
            - S_CORP
            - SSN
            - C_CORP
          description: Incorporation type of the business
        incorporationState:
          type: string
          x-stoplight:
            id: hanqi2qs81oxo
          description: State the business was incorporated in
        uniqueId:
          type: string
          x-stoplight:
            id: hvvut92twj8zl
          description: Unique ID to be used by the partner to identify the customer
        duns:
          type: string
          x-stoplight:
            id: mdx7xwx9qg7oo
          description: Business DUNS number
        passportNumber:
          type: string
          x-stoplight:
            id: u96zghwqqilzk
          description: Passport number
        idGovNumber:
          type: string
          x-stoplight:
            id: khn60rkioznok
          description: Non US customer National ID number
        idCountry:
          type: string
          x-stoplight:
            id: vvmfjr6c7k8hj
          description: >-
            National ID country (Alpha 2, ISO 3166 format). 

            Note that if a passport number is supplied, this is the passport
            issuance country
        idExpirationDate:
          type: string
          x-stoplight:
            id: wzrynrlmd8n8p
          description: >-
            National ID expiration date. Note that if passport number is
            supplied, this is the passport expiration date
        documentUrls:
          type: array
          x-stoplight:
            id: ymfo4cy2ie5m1
          description: A list of URLs containing the business documents of the customer
          items:
            x-stoplight:
              id: 7r4d1jrjajatt
            type: string
            nullable: true
        documentDataList:
          type: array
          x-stoplight:
            id: cdqquqqimpi06
          description: A list of URLs containing the business documents of the customer
          items:
            $ref: '#/components/schemas/DocumentData'
    LeadResponse:
      type: object
      description: Contains the information on an account registration.
      required:
        - customerId
        - location
        - token
        - personId
      properties:
        customerId:
          type: string
          x-stoplight:
            id: 2t32yr90qzikr
          format: uuid
          description: A unique ID for the customer (same as person ID)
        location:
          type: string
          x-stoplight:
            id: e5dl038wx7qm1
          format: uri
          description: >-
            A unique URL to be used by the customer for a personalized
            application flow
        token:
          type: string
          x-stoplight:
            id: 4ye33btepk7al
          description: The token that should be sent to Lili Connect UI
        partnerSuppliedId:
          type: string
          x-stoplight:
            id: zemy587iwy2il
          description: >-
            The uniqueID provided by the partner in the Create Application call.
            Empty if none was supplied
        personId:
          type: string
          description: The unique ID of the registered person
          format: uuid
          deprecated: true
    DocumentData:
      title: DocumentData
      x-stoplight:
        id: kr3i4g62ojz2v
      type: object
      required:
        - content
        - contentType
        - fileName
      properties:
        content:
          type: string
          x-stoplight:
            id: igaiyylh7egx3
          description: File content, Base64 decoded
        contentType:
          type: string
          x-stoplight:
            id: hw2oss0an7s2c
          description: The file content type. All standard mime types are supported
        fileName:
          type: string
          x-stoplight:
            id: spxyb1avccnlk
          description: The name of the file
    JsonErrorResponse:
      type: object
      description: An object representing a server error
      properties:
        httpStatus:
          type: integer
          description: The http status of the error
        reasonPhrase:
          type: string
          description: Human readable description of the error
        errors:
          description: A list of all the errors that the server reported
          type: array
          items:
            $ref: '#/components/schemas/JsonSingleError'
    JsonSingleError:
      type: object
      x-stoplight:
        id: 0kg0wrad8xmxx
      properties:
        code:
          type: integer
          description: A unique numeric code representing the error
        codeName:
          type: string
          description: A unique string code representing the error
        message:
          type: string
          description: Human readable description of the error
        localizedMessage:
          type: string
          description: Human readable description of the error, localized
      description: A specific server error
      x-internal: false
    PaymentRequest:
      title: PaymentRequest
      x-stoplight:
        id: mzgj1wvnev9ng
      type: object
      properties:
        customerId:
          type: string
          x-stoplight:
            id: fgrcj8u8o4iz8
        amount:
          type: number
          x-stoplight:
            id: ouzp8dvf172r6
        effectiveDate:
          type: string
          x-stoplight:
            id: 85iumy8bjfihy
          format: date-time
        payeeName:
          type: string
          x-stoplight:
            id: uhhzstz303iht
        receiverAccountNumber:
          type: string
          x-stoplight:
            id: frk7yk1vun76x
        traceNumber:
          type: string
          x-stoplight:
            id: 20t3cl9u2exsk
        originatorRoutingNumber:
          type: string
          x-stoplight:
            id: glslddqkg684s
        originatorAccountNumber:
          type: string
          x-stoplight:
            id: 02bwatpsyufwv
  securitySchemes:
    accessKey:
      name: Authorization
      type: apiKey
      in: header
      description: |-
        The authorization in the format:<br/>
        Authorization: Lili accessKey:secretKey
security:
  - accessKey: []
