LendKey applications API

The applications API from LendKey — 1 operation(s) for applications.

OpenAPI Specification

lendkey-applications-api-openapi.yml Raw ↑
openapi: 3.0.3
info:
  title: LendKey E-Sign API (via Kong Gateway) Application Contracts applications API
  version: 0.1
  description: "# LendKey E-Sign API - Kong Gateway Documentation\n\n## Overview\n\nThe LendKey E-Sign API provides endpoints for creating and managing electronic signature contracts using DocuSign.\nThis API is accessed through Kong Gateway, which handles authentication via OAuth2.\n\n## Authentication\n\nAll requests to this API require OAuth2 authentication through Kong Gateway.\n\n### Step 1: Get OAuth2 Token\n\nBefore calling any endpoint, you must obtain an access token:\n\n**Production Environment:**\n```bash\ncurl -X POST https://api.lendkey.com/esign/oauth2/token \\\n  -d \"grant_type=client_credentials\" \\\n  -d \"client_id=YOUR_CLIENT_ID\" \\\n  -d \"client_secret=YOUR_CLIENT_SECRET\"\n```\n\n**Response:**\n```json\n{\n  \"access_token\": \"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...\",\n  \"token_type\": \"bearer\",\n  \"expires_in\": 7200\n}\n```\n\n### Step 2: Use Token in API Calls\n\nInclude the access token in the `Authorization` header:\n```\nAuthorization: Bearer YOUR_ACCESS_TOKEN\n```\n\n**Token Lifetime:** 2 hours (7200 seconds)\n\n## Base URLs (Kong Gateway)\n\n| Environment | Kong Base URL | Backend Kubernetes Service |\n|------------|---------------|---------------------------|\n| **Production** | `https://api.lendkey.com/esign` | `main-esign-kotlin.ci.lkeyprod.com` |\n\n## How Kong Routes Requests\n\nWhen you call Kong:\n```\nhttps://api.lendkey.com/esign/applications\n```\n\nKong:\n1. Validates your OAuth2 token\n2. Strips the `/esign` prefix\n3. Forwards to: `http://main-esign-kotlin.ci.lkeyprod.com/applications`\n\nYou don't need to manage any backend authentication - Kong handles everything!\n\n## Getting Started\n\n1. **Get Credentials:** Contact your Kong admin or use the Kong Developer Portal\n2. **Get Token:** Use the OAuth2 token endpoint for your environment\n3. **Call API:** Use the token in the Authorization header\n4. **Refresh:** Get a new token every 2 hours\n"
  contact:
    name: LendKey Platform Team
    url: https://lendkey.com
servers:
- url: https://api.lendkey.com/esign
  description: Production Environment
security:
- oauth2: []
tags:
- name: applications
paths:
  /v1/application/status:
    post:
      tags:
      - applications
      summary: Retrieve the current status of one or more applications
      description: Provide your requester identification UUID and a set of application/loan reference keys to get an up-to-date status on them.
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/applicationStatusRequest'
      responses:
        200:
          description: OK
          content:
            application/hal+json:
              schema:
                $ref: '#/components/schemas/applicationStatusResponse'
        400:
          $ref: '#/components/responses/BadRequest'
        500:
          $ref: '#/components/responses/UnexpectedError'
components:
  schemas:
    applicationStatusRequest:
      type: object
      required:
      - referenceKeys
      - requester
      properties:
        referenceKeys:
          type: array
          items:
            allOf:
            - type: string
          example:
          - HIL-12345
          - HIL-98765
        requester:
          type: object
          allOf:
          - $ref: '#/components/schemas/requester'
    error:
      type: object
      properties:
        id:
          type: string
          format: uuid
        status:
          type: string
        timestamp:
          type: string
        message:
          type: string
        debugMessage:
          type: string
        subErrors:
          type: array
          items:
            $ref: '#/components/schemas/suberror'
      example:
        id: null
        status: BAD_REQUEST
        timestamp: '2019-10-21 14:07:59'
        message: Validation error
        debugMessage: null
        subErrors:
        - object: Resource
          field: name
          rejectedValue: null
          message: must not be null
    requester:
      type: object
      properties:
        uuid:
          type: string
          format: uuid
          example: 40121260-4082-4c22-b70c-b5be137bf2a0
    applicationStatus:
      type: object
      properties:
        loanStatus:
          type: string
          description: What stage the application/loan is on within the LendKey system.
        loanKey:
          type: string
          description: Unique identifier for application/loan
          example: HIL-12345
        loanAmount:
          type: number
          description: The loan amount for the application/loan - this is not the current balance for the account.
          example: 50000.0
        blockages:
          type: array
          items:
            allOf:
            - type: string
          description: A set of text describing what may be preventing the application/loan from advancing.
          example:
          - Waiting for contractor to submit a disbursement request.
    applicationStatusResponse:
      type: object
      properties:
        applications:
          type: array
          items:
            allOf:
            - $ref: '#/components/schemas/applicationStatus'
        errors:
          type: array
          items:
            allOf:
            - type: string
              example: String reference key of unretrievable application.
    suberror:
      type: object
      properties:
        object:
          type: string
        field:
          type: string
        rejectedValue:
          type: string
        message:
          type: string
      example:
        object: Resource
        field: name
        rejectedValue: null
        message: must not be null
  responses:
    UnexpectedError:
      description: An unexpected server error occurred.
      content:
        application/hal+json:
          schema:
            $ref: '#/components/schemas/error'
          example:
            id: b6c52a48-551a-42ef-b361-f642d25cfeb7
            status: INTERNAL_SERVER_ERROR
            timestamp: '2019-10-21 14:07:59'
            message: An internal issue occurred.  Please try again shortly.  If the issue persists, contact us with all of the data in this error message.
            debugMessage: null
    BadRequest:
      description: Invalid request, unable to process the request with the information provided.
      content:
        application/hal+json:
          schema:
            $ref: '#/components/schemas/error'
          example:
            id: b6c52a48-551a-42ef-b361-f642d25cfeb7
            status: BAD_REQUEST
            timestamp: '2019-10-21 14:07:59'
            message: Describes what was invalid about the request, if possible.
            debugMessage: null
  securitySchemes:
    oauth2:
      type: oauth2
      description: OAuth2 client credentials flow via Kong Gateway
      flows:
        clientCredentials:
          tokenUrl: /oauth2/token
          scopes: {}