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

# Create a new Lender



## OpenAPI

````yaml Commerce post /lenders
openapi: 3.1.0
info:
  title: Commerce
  version: '3.0'
  contact:
    email: samuel@driv.ly
    name: Samuel Lippert
    url: https://driv.ly/
  description: Drivly Commerce API
servers:
  - url: https://commerce.driv.ly/api
security: []
paths:
  /lenders:
    parameters:
      - schema:
          type: integer
        name: depth
        in: query
        required: false
        description: The number of levels of related objects to include in the response
    post:
      summary: Create a new Lender
      operationId: post-lender
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/NewLender'
      responses:
        '200':
          description: Lender Created
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    $ref: '#/components/schemas/Lender'
                  success:
                    type: boolean
        '400':
          description: Missing Required Information
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorModel'
                examples:
                  - error:
                      code: 400
                      message: Missing Required Information
                    success: false
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorModel'
                examples:
                  - error:
                      code: 401
                      message: Unauthorized
                    success: false
        '429':
          description: Too Many Requests
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorModel'
                examples:
                  - error:
                      code: 429
                      message: Too Many Requests
                    success: false
components:
  schemas:
    NewLender:
      $id: NewLender
      title: Lender
      type: object
      examples:
        - id: com_9j3k2dls0j29
          name: Auto Sales Co.
          address: 123 Main St, Anytown, USA
          locations:
            - id: loc_k2j3l9s9d4j0
              companyId: com_9j3k2dls0j29
              address: 123 Main St, Anytown, USA
              phone: '+1234567890'
      properties:
        id:
          type: string
          description: Customer is uniquely identified by id
        addresses:
          type: array
          items:
            oneOf:
              - type: string
              - $ref: '#/components/schemas/Address'
          description: Customer is located at Addresses
        phoneNumbers:
          type: array
          items:
            type: string
            pattern: ^\+?1?[- ]?\(?([0-9]{3})\)?[- ]?([0-9]{3})-?([0-9]{4})$
          description: Customer has Phone Number
        name:
          type: string
          description: Company has Name
        contacts:
          type: array
          items:
            oneOf:
              - type: string
              - $ref: '#/components/schemas/Contact'
          description: Company has Contact
      required:
        - name
    Lender:
      $id: Lender
      title: Lender
      type: object
      examples:
        - id: com_9j3k2dls0j29
          name: Auto Sales Co.
          address: 123 Main St, Anytown, USA
          locations:
            - id: loc_k2j3l9s9d4j0
              companyId: com_9j3k2dls0j29
              address: 123 Main St, Anytown, USA
              phone: '+1234567890'
      properties:
        id:
          type: string
          description: Customer is uniquely identified by id
        addresses:
          type: array
          items:
            oneOf:
              - type: string
              - $ref: '#/components/schemas/Address'
          description: Customer is located at Addresses
        phoneNumbers:
          type: array
          items:
            type: string
            pattern: ^\+?1?[- ]?\(?([0-9]{3})\)?[- ]?([0-9]{3})-?([0-9]{4})$
          description: Customer has Phone Number
        name:
          type: string
          description: Company has Name
        contacts:
          type: array
          items:
            oneOf:
              - type: string
              - $ref: '#/components/schemas/Contact'
          description: Company has Contact
      required:
        - name
        - id
    ErrorModel:
      type: object
      properties:
        error:
          type: object
          properties:
            code:
              type: number
            message:
              type: string
        success:
          type: boolean
    Address:
      $id: Address
      examples:
        - id: adr_2kj49d1msod2
          zip: '62704'
          city:
            name: Springfield
            state:
              code: IL
          line2: Apt 201
          line1: 456 Elm Street
      required:
        - id
        - city
        - zip
        - line1
      title: Address
      type: object
      properties:
        id:
          type: string
          description: Address is uniquely identified by id
        city:
          oneOf:
            - type: object
              properties:
                state:
                  oneOf:
                    - type: string
                    - $ref: '#/components/schemas/State'
                name:
                  type: string
              required:
                - state
                - name
            - $ref: '#/components/schemas/City'
          description: Address is located in City
        zip:
          type: string
          description: Address has ZIP
        line2:
          type: string
          description: Address has Address Line 2
        line1:
          type: string
          description: Address has Address Line 1
    Contact:
      $id: Contact
      examples:
        - id: cnt_8dk3j2ksl9d2
          roles:
            - Manager
            - Sales
          lastName: Smith
          firstName: Alice
      required:
        - id
        - lastName
        - firstName
      title: Contact
      type: object
      properties:
        id:
          type: string
          description: Contact is uniquely identified by id
        agent:
          oneOf:
            - type: string
            - $ref: '#/components/schemas/Agent'
          description: Contact is automated Agent
        address:
          oneOf:
            - type: string
            - $ref: '#/components/schemas/Address'
          description: Contact has Address
        primaryPhoneNumber:
          type: string
          pattern: ^\+?1?[- ]?\(?([0-9]{3})\)?[- ]?([0-9]{3})-?([0-9]{4})$
          description: Contact has Primary Phone Number
        primaryEmail:
          type: string
          format: idn-email
          description: Contact has Primary Email
        lastName:
          type: string
          description: Contact has Last Name
        firstName:
          type: string
          description: Contact has First Name
        emails:
          type: array
          items:
            type: string
            format: idn-email
          description: Contact has Email
        phoneNumbers:
          type: array
          items:
            type: string
            pattern: ^\+?1?[- ]?\(?([0-9]{3})\)?[- ]?([0-9]{3})-?([0-9]{4})$
          description: Contact has Phone Number
        roles:
          type: array
          items:
            type: string
          description: Contact has Role
    State:
      $id: State
      title: State
      properties:
        code:
          type: string
          description: State is uniquely identified by State Code
      type: object
      required:
        - code
    City:
      $id: City
      examples:
        - name: Springfield
          state:
            code: IL
      required:
        - state
        - name
      title: City
      type: object
      properties:
        state:
          oneOf:
            - type: string
            - $ref: '#/components/schemas/State'
          description: City is uniquely identified by State
        name:
          type: string
          description: City is uniquely identified by Name
    Agent:
      $id: Agent
      examples:
        - id: ai_3jks93ndk3s9
          model: gpt-4o
          prompt: Respond to the customer service request
          functions:
            - fnc_ed904md03684
      required:
        - id
        - model
      title: Agent
      type: object
      properties:
        id:
          type: string
          description: Agent is uniquely identified by id
        prompt:
          type: string
          description: Agent has Prompt
        model:
          type: string
          description: Agent has Agent Model
        functions:
          type: array
          items:
            type: string
          description: Agent has Function

````