> ## 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.

# Retrieve a Document



## OpenAPI

````yaml Commerce get /documents/{id}
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:
  /documents/{id}:
    parameters:
      - schema:
          type: string
        name: id
        in: path
        required: true
        description: Document is uniquely identified by id
      - schema:
          type: integer
        name: depth
        in: query
        required: false
        description: The number of levels of related objects to include in the response
    get:
      summary: Retrieve a Document
      operationId: get-document
      responses:
        '200':
          description: Document Found
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    $ref: '#/components/schemas/Document'
                  success:
                    type: boolean
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorModel'
                examples:
                  - error:
                      code: 401
                      message: Unauthorized
                    success: false
        '404':
          description: Document Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorModel'
                examples:
                  - error:
                      code: 404
                      message: Document Not Found
                    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:
    Document:
      $id: Document
      examples:
        - id: doc_5dk39d3j93jd
          deal: Deal ID
          data:
            key: value
          isSigned: true
      required:
        - id
        - data
      title: Document
      type: object
      properties:
        id:
          type: string
          description: Document is uniquely identified by id
        deal:
          oneOf:
            - type: string
            - $ref: '#/components/schemas/Deal'
          description: Deal has Document
        data:
          type: object
          description: Document has Data
        isSigned:
          type: boolean
          description: Document is signed
    ErrorModel:
      type: object
      properties:
        error:
          type: object
          properties:
            code:
              type: number
            message:
              type: string
        success:
          type: boolean
    Deal:
      $id: Deal
      examples:
        - id: deal_5ksj49dkvdl2
          dealer:
            location:
              id: loc_8dj39dksm2d9
              zip: '90210'
              city:
                name: Anytown
                state:
                  code: CA
              line2: Suite 100
              line1: 456 Dealership Blvd
              latitude: 34.0522
              longitude: -118.2437
          vehicle:
            id: veh_3k12j9qksdf0
            vin: 1C4HJXEN5MW592818
            year: 2021
            make: Jeep
            trim: Sport
            spec: Off-Road Package
            model: Wrangler
            engine: 3.6L V6
            seatCount: 5
            doorCount: 4
            bodyStyle: SUV
            drivetrain: 4WD
            transmission: Automatic
            interiorColor: Black
            exteriorColor: Red
          customer:
            id: cus_9kd39fkj4l5d
            addresses:
              - id: adr_9fdk39dkc9d3
                city:
                  name: New City
                  state:
                    code: CA
                zip: '90212'
                line2: Apt 202
                line1: 987 New Address Blvd
            phoneNumbers:
              - 555-456-7890
          facilitator:
            id: fac_6dj39dk3kdl3
            name: AutoFacilitators Inc.
            location:
              id: loc_2kj49d1msod2
              zip: '90310'
              city:
                name: Uptown
                state:
                  code: CA
              line2: Floor 3
              line1: 789 Facilitator Road
          maximumBidPrice: 50000
          currentBidPrice: 45000
          minimumBidPrice: 30000
          coBuyerOrCoSellerCustomer:
            id: cus_k3j5s9qj3w0d
            addresses:
              - id: adr_4kj6s9qj3w0d
                city:
                  name: Anytown
                  state:
                    code: NY
                zip: '10001'
                line2: ''
                line1: 123 Customer St
            phoneNumbers:
              - 555-987-6543
      required:
        - id
        - vehicle
        - customer
      title: Deal
      type: object
      properties:
        id:
          type: string
          description: Deal is uniquely identified by id
        maximumBidPrice:
          type: integer
          description: Deal has Maximum Bid Price
        dealer:
          oneOf:
            - type: string
            - $ref: '#/components/schemas/Dealer'
          description: Deal sells from Dealer
        currentBidPrice:
          type: integer
          description: Deal has Current Bid Price
        minimumBidPrice:
          type: integer
          description: Deal has Minimum Bid Price
        facilitator:
          oneOf:
            - type: string
            - $ref: '#/components/schemas/Facilitator'
          description: Deal is facilitated by Facilitator
        coBuyerOrCoSellerCustomer:
          oneOf:
            - type: string
            - $ref: '#/components/schemas/Customer'
          description: Deal has CoBuyer Or CoSeller Customer
        vehicle:
          oneOf:
            - type: string
            - $ref: '#/components/schemas/Vehicle'
          description: Deal buys/sells Vehicle
        customer:
          oneOf:
            - type: string
            - $ref: '#/components/schemas/Customer'
          description: Deal is made with Customer
    Dealer:
      $id: Dealer
      title: Dealer
      examples:
        - location:
            latitude: 39.7487
            longitude: -104.999
          addresses:
            - city:
                name: Denver
                state:
                  code: CO
              zip: '80202'
              line2: Suite 400
              line1: 100 Business Park Ave
      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
        location:
          oneOf:
            - type: object
              properties:
                longitude:
                  type: number
                  minimum: -180
                  maximum: 180
                latitude:
                  type: number
                  minimum: -90
                  maximum: 90
              required:
                - longitude
                - latitude
            - $ref: '#/components/schemas/Location'
          description: Dealer is located at Location
      type: object
      required:
        - name
        - id
    Facilitator:
      $id: Facilitator
      title: Facilitator
      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
    Customer:
      $id: Customer
      required:
        - id
      title: Customer
      type: object
      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
    Vehicle:
      $id: Vehicle
      examples:
        - vin: 1C4HJXEN5MW592818
          year: 2021
          make: Jeep
          trim: Sport
          spec: vs_4jf8x9jv5c0b
          model: Wrangler
          engine: 3.6L V6
          seatCount: 5
          doorCount: 4
          bodyStyle: SUV
          drivetrain: 4WD
          transmission: Automatic
          interiorColor: Black
          exteriorColor: Red
      required:
        - vin
        - year
        - make
        - transmission
        - engine
        - drivetrain
        - model
        - bodyStyle
      title: Vehicle
      type: object
      properties:
        vin:
          type: string
          description: Vehicle is uniquely identified by vin
        seatCount:
          type: integer
          minimum: 0
          description: Vehicle has Seat Count
        doorCount:
          type: integer
          minimum: 0
          description: Vehicle has Door Count
        interiorColor:
          type: string
          description: Vehicle was manufactured with Interior Color
        exteriorColor:
          type: string
          description: Vehicle was manufactured with Exterior Color
        year:
          type: integer
          description: Vehicle was manufactured in Year
        make:
          type: string
          description: Vehicle is of Make
        trim:
          type: string
          description: Vehicle has Trim level
        transmission:
          type: string
          description: Vehicle has Transmission
        engine:
          type: string
          description: Vehicle has Engine specification
        spec:
          oneOf:
            - type: string
            - $ref: '#/components/schemas/VehicleSpec'
          description: Vehicle has Vehicle Spec
        drivetrain:
          type: string
          description: Vehicle has Drivetrain
        model:
          type: string
          description: Vehicle has Model
        bodyStyle:
          type: string
          description: Vehicle has Body Style
    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
    Location:
      $id: Location
      title: Location
      examples:
        - latitude: 37.7749295
          longitude: -122.4194155
      properties:
        longitude:
          type: number
          minimum: -180
          maximum: 180
          description: Location is uniquely identified by Longitude
        latitude:
          type: number
          minimum: -90
          maximum: 90
          description: Location is uniquely identified by Latitude
      type: object
      required:
        - longitude
        - latitude
    VehicleSpec:
      $id: VehicleSpec
      title: Vehicle Spec
      examples:
        - id: vs_4jf8x9jv5c0b
          make: Toyota
          year: 2022
          trim: SE
          model: Camry
          engine: 2.5L 4-cylinder
          squishVin: 4T1BF1FK5H
          bodyStyle: Sedan
          drivetrain: FWD
          transmission: Automatic
          exteriorColors:
            - Black
            - Silver
          interiorColors:
            - Black
            - Gray
      properties:
        id:
          type: string
          description: Vehicle Spec is uniquely identified by id
        model:
          type: string
          description: Vehicle Spec has Model
        make:
          type: string
          description: Vehicle Spec has Make
        squishVin:
          type: string
          minLength: 10
          maxLength: 10
          description: Vehicle Spec has Squish VIN
        year:
          type: integer
          description: Vehicle Spec has Year
        engine:
          type: string
          description: Vehicle Spec has Engine specifications
        drivetrain:
          type: string
          description: Vehicle Spec has Drivetrain
        bodyStyle:
          type: string
          description: Vehicle Spec has Body Style
        transmission:
          type: string
          description: Vehicle Spec has Transmission
        trim:
          type: string
          description: Vehicle Spec has Trim
        exteriorColors:
          type: array
          items:
            type: string
          description: Vehicle Spec has Exterior Color
        interiorColors:
          type: array
          items:
            type: string
          description: Vehicle Spec has Interior Color
      type: object
      required:
        - id
        - model
        - make
        - year
        - engine
        - drivetrain
        - bodyStyle
        - transmission
    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

````