> ## Documentation Index
> Fetch the complete documentation index at: https://docs.swippee.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Record a lending decision

> Closed-loop feedback: record the decision you made on an applicant, keyed by your own client_reference_id. Re-POSTing the same reference updates it (upsert).



## OpenAPI

````yaml /openapi.json post /v1/decisions
openapi: 3.1.0
info:
  title: Swippee API
  version: 1.0.0
  description: >-
    Convert Nepali bank statement PDFs into structured financial data, derive
    lending products from a parse, and read Nepal's public-sector financial
    datasets — over one REST API.
servers:
  - url: https://api.swippee.com
    description: Production
security:
  - bearerAuth: []
paths:
  /v1/decisions:
    post:
      tags:
        - Decisions
      summary: Record a lending decision
      description: >-
        Closed-loop feedback: record the decision you made on an applicant,
        keyed by your own client_reference_id. Re-POSTing the same reference
        updates it (upsert).
      operationId: recordDecision
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - client_reference_id
                - decision
              properties:
                client_reference_id:
                  type: string
                  example: loan-1001
                decision:
                  type: string
                  enum:
                    - approved
                    - review
                    - declined
                report_id:
                  type: string
                decision_rationale:
                  type: string
                  example: FOIR 32%, stable salary
                amount:
                  type: number
                  example: 250000
      responses:
        '201':
          description: Decision recorded
        '400':
          $ref: '#/components/responses/Unprocessable'
        '401':
          $ref: '#/components/responses/Unauthorized'
components:
  responses:
    Unprocessable:
      description: The document could not be parsed
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    Unauthorized:
      description: Authentication failed
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
  schemas:
    Error:
      type: object
      description: >-
        Flat, industry-standard error envelope. Branch on error_code, not the
        HTTP status.
      properties:
        error_type:
          type: string
          example: AUTHENTICATION_ERROR
        error_code:
          type: string
          example: INVALID_API_KEY
        error_message:
          type: string
          example: Unknown API key.
        display_message:
          type: string
          nullable: true
          example: null
        request_id:
          type: string
          example: req_8f3c9b2e4a1d4f7c9e0b1a2c3d4e5f60
        documentation_url:
          type: string
          example: https://docs.swippee.com/concepts/errors#invalid_api_key
        suggested_action:
          type: string
          example: Check your API key in the Authorization header.
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: >-
        Your API key from the dashboard, sent as `Authorization: Bearer
        swippee_sk_live_...`.

````