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

# Report Advance Usage

> Employee reports how much of a cash advance they actually used. Records the
spend (optionally with line items) and computes the leftover to return.

- used == advance -> status 'settled' (nothing to return)
- used <  advance -> status 'pending_settlement' (leftover returned via /return-advance)

Allowed for the original requester or a finance role
(Accountant / Manager / Admin / Director / Finance).



## OpenAPI

````yaml /api/openapi-cutmake.json post /api/v1/expense-requests/{expense_request_id}/report-usage
openapi: 3.1.0
info:
  title: VM App API
  version: 0.1.0
servers:
  - url: https://vinmake-erp.onrender.com
security: []
paths:
  /api/v1/expense-requests/{expense_request_id}/report-usage:
    post:
      tags:
        - 'Admin Sector: Expense Requests'
      summary: Report Advance Usage
      description: >-
        Employee reports how much of a cash advance they actually used. Records
        the

        spend (optionally with line items) and computes the leftover to return.


        - used == advance -> status 'settled' (nothing to return)

        - used <  advance -> status 'pending_settlement' (leftover returned via
        /return-advance)


        Allowed for the original requester or a finance role

        (Accountant / Manager / Admin / Director / Finance).
      operationId: >-
        report_advance_usage_api_v1_expense_requests__expense_request_id__report_usage_post
      parameters:
        - name: expense_request_id
          in: path
          required: true
          schema:
            type: string
            title: Expense Request Id
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ReportUsageRequest'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ExpenseRequestResponse'
        '401':
          description: Unauthorized
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - OAuth2PasswordBearer: []
components:
  schemas:
    ReportUsageRequest:
      properties:
        usedAmount:
          anyOf:
            - type: number
              exclusiveMinimum: 0
            - type: string
              pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$
          title: Usedamount
          description: How much of the advance was actually spent
        notes:
          anyOf:
            - type: string
            - type: 'null'
          title: Notes
        lineItems:
          items:
            $ref: >-
              #/components/schemas/routers__admin_sector__expense_requests__LineItemCreate
          type: array
          title: Lineitems
      type: object
      required:
        - usedAmount
      title: ReportUsageRequest
    ExpenseRequestResponse:
      properties:
        id:
          type: string
          title: Id
        orgId:
          type: string
          title: Orgid
        requesterId:
          type: string
          title: Requesterid
        requestType:
          type: string
          title: Requesttype
        paymentMethod:
          type: string
          title: Paymentmethod
        totalAmount:
          type: string
          pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$
          title: Totalamount
        paidAmount:
          type: string
          pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$
          title: Paidamount
          default: 0
        usedAmount:
          type: string
          pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$
          title: Usedamount
          default: 0
        currency:
          type: string
          title: Currency
        status:
          type: string
          title: Status
        supplierId:
          anyOf:
            - type: string
            - type: 'null'
          title: Supplierid
        notes:
          anyOf:
            - type: string
            - type: 'null'
          title: Notes
        linkedAdvanceRequestId:
          anyOf:
            - type: string
            - type: 'null'
          title: Linkedadvancerequestid
        sourceTemplateId:
          anyOf:
            - type: string
            - type: 'null'
          title: Sourcetemplateid
        createdAt:
          anyOf:
            - type: string
            - type: 'null'
          title: Createdat
        lineItems:
          items:
            $ref: >-
              #/components/schemas/routers__admin_sector__expense_requests__LineItemResponse
          type: array
          title: Lineitems
      type: object
      required:
        - id
        - orgId
        - requesterId
        - requestType
        - paymentMethod
        - totalAmount
        - currency
        - status
      title: ExpenseRequestResponse
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    routers__admin_sector__expense_requests__LineItemCreate:
      properties:
        description:
          type: string
          title: Description
        quantity:
          anyOf:
            - type: number
              exclusiveMinimum: 0
            - type: string
              pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$
          title: Quantity
          default: '1'
        unitPrice:
          anyOf:
            - type: number
            - type: string
              pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$
            - type: 'null'
          title: Unitprice
        amount:
          anyOf:
            - type: number
              exclusiveMinimum: 0
            - type: string
              pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$
          title: Amount
        supplierId:
          anyOf:
            - type: string
            - type: 'null'
          title: Supplierid
        managementAccountId:
          anyOf:
            - type: string
            - type: 'null'
          title: Managementaccountid
        receiptUrl:
          anyOf:
            - type: string
            - type: 'null'
          title: Receipturl
      type: object
      required:
        - description
        - amount
      title: LineItemCreate
    routers__admin_sector__expense_requests__LineItemResponse:
      properties:
        id:
          type: string
          title: Id
        expenseRequestId:
          type: string
          title: Expenserequestid
        description:
          type: string
          title: Description
        quantity:
          anyOf:
            - type: string
              pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$
            - type: 'null'
          title: Quantity
        unitPrice:
          anyOf:
            - type: string
              pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$
            - type: 'null'
          title: Unitprice
        amount:
          type: string
          pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$
          title: Amount
        supplierId:
          anyOf:
            - type: string
            - type: 'null'
          title: Supplierid
        managementAccountId:
          anyOf:
            - type: string
            - type: 'null'
          title: Managementaccountid
        receiptUrl:
          anyOf:
            - type: string
            - type: 'null'
          title: Receipturl
        createdAt:
          anyOf:
            - type: string
            - type: 'null'
          title: Createdat
      type: object
      required:
        - id
        - expenseRequestId
        - description
        - amount
      title: LineItemResponse
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
        input:
          title: Input
        ctx:
          type: object
          title: Context
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
  securitySchemes:
    OAuth2PasswordBearer:
      type: oauth2
      flows:
        password:
          scopes: {}
          tokenUrl: /auth/login

````