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

# Updates a Listing

> Updates a Listing

<Accordion title="Usage with the Drivly SDK" icon="code-simple">
  <Note>
    <span class="font-medium">Make sure you install our SDK first. You can find out how, and more [here](/commerce/sdk).</span>
  </Note>

  ```typescript theme={null}
  import { SDK } from '@drivly/commerce'
  import type { listings } from '@drivly/commerce'

  const sdk = new SDK(...)

  const listings = await sdk.listings.update(listingsId: string, data: listings): Promise<listings>
  ```
</Accordion>


## OpenAPI

````yaml patch /listings/{id}
openapi: 3.0.3
info:
  title: Drivly Commerce API
  version: 1.0.0
  description: API for the Driv.ly experience
  contact:
    name: Drivly
    url: https://driv.ly
    email: support@driv.ly
  license:
    name: MIT
    url: https://opensource.org/licenses/MIT
servers:
  - url: https://commerce.driv.ly/api
security: []
paths:
  /listings/{id}:
    patch:
      tags:
        - listings
      summary: Updates a Listing
      description: Updates a Listing
      parameters:
        - name: id
          in: path
          description: id of the Listing
          required: true
          schema:
            type: string
        - name: depth
          in: query
          description: number of levels to automatically populate relationships and uploads
          schema:
            type: number
        - name: locale
          in: query
          description: retrieves document(s) in a specific locale
          schema:
            type: string
        - name: fallback-locale
          in: query
          description: specifies a fallback locale if no locale value exists
          schema:
            type: string
      requestBody:
        $ref: '#/components/requestBodies/listingsRequest'
      responses:
        '200':
          $ref: '#/components/responses/listingsUpsertConfirmationResponse'
        '404':
          $ref: '#/components/responses/NotFoundErrorResponse'
      security:
        - apiKeyAuth: []
components:
  requestBodies:
    listingsRequest:
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/listings'
  responses:
    listingsUpsertConfirmationResponse:
      description: ok
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/listingsUpsertConfirmation'
    NotFoundErrorResponse:
      description: not found
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/error'
  schemas:
    listings:
      additionalProperties: false
      title: Listing
      type: object
      properties:
        vehicles:
          oneOf:
            - type: number
              nullable: true
            - additionalProperties: false
              title: Vehicle
              type: object
              properties:
                name:
                  type: string
                  nullable: true
                vin:
                  type: string
                  nullable: true
                customer:
                  type: number
                  nullable: true
                status:
                  items:
                    enum:
                      - Bought at Auction
                      - Inspected
                      - Transport to Inspection
                      - Transport to Customer
                      - Arbitration
                      - Bid Placed
                      - SOLD TO CUSTOMER
                      - Identified as potential option for customer
                      - Taken in on Trade
                      - Trade sold at Auction
                      - Trade sold Retail
                    type: string
                  type: array
                  nullable: true
                deals:
                  items:
                    type: number
                  type: array
                  nullable: true
                year:
                  type: string
                  nullable: true
                make:
                  type: string
                  nullable: true
                model:
                  type: string
                  nullable: true
                trim:
                  type: string
                  nullable: true
                style:
                  type: string
                  nullable: true
                body:
                  type: string
                  nullable: true
                drivetrain:
                  type: string
                  nullable: true
                engine:
                  type: string
                  nullable: true
                transmission:
                  type: string
                  nullable: true
                interior:
                  type: string
                  nullable: true
                exterior:
                  type: string
                  nullable: true
                listings:
                  items:
                    type: number
                  type: array
                  nullable: true
                serviceQuotes:
                  items:
                    type: number
                  type: array
                  nullable: true
                tenant:
                  type: number
                  nullable: true
                trades:
                  items:
                    type: number
                  type: array
                  nullable: true
                createdBy:
                  type: number
                  nullable: true
                transportServiceOrders:
                  type: string
                  nullable: true
                transportServiceOrders2:
                  items:
                    type: number
                  type: array
                  nullable: true
                updatedAt:
                  type: string
                createdAt:
                  type: string
              required:
                - id
                - updatedAt
                - createdAt
        mileage:
          type: number
          nullable: true
        seller:
          type: string
          nullable: true
        wholesaleValue:
          type: string
          nullable: true
        wholesaleBuyNowPrice:
          type: string
          nullable: true
        wholesaleMinimumBid:
          type: string
          nullable: true
        wholesaleCurrentBid:
          type: string
          nullable: true
        wholesaleDetailPage:
          type: string
          nullable: true
        condition:
          type: number
          nullable: true
        wholesaleConditionReport:
          type: string
          nullable: true
        retailValue:
          type: string
          nullable: true
        retailAskingPrice:
          type: string
          nullable: true
        retailBuyNowPrice:
          type: string
          nullable: true
        vehicleHistoryReport:
          type: string
          nullable: true
        vehicleHistoryScore:
          type: string
          nullable: true
        cleanTitle:
          type: boolean
          nullable: true
        owners:
          type: number
          nullable: true
        accidents:
          type: number
          nullable: true
        attachments:
          type: string
          nullable: true
        pickupLocation:
          oneOf:
            - type: number
              nullable: true
            - additionalProperties: false
              title: Location
              type: object
              properties:
                name:
                  type: string
                  nullable: true
                address:
                  type: string
                  nullable: true
                city:
                  type: string
                  nullable: true
                state:
                  type: string
                  nullable: true
                zip:
                  type: string
                  nullable: true
                country:
                  type: string
                  nullable: true
                listings:
                  items:
                    type: number
                  type: array
                  nullable: true
                tenant:
                  type: number
                  nullable: true
                createdBy:
                  type: number
                  nullable: true
                updatedAt:
                  type: string
                createdAt:
                  type: string
              required:
                - id
                - updatedAt
                - createdAt
        tenant:
          oneOf:
            - type: number
              nullable: true
            - additionalProperties: false
              title: Tenant
              type: object
              properties:
                name:
                  type: string
                  nullable: true
                customer:
                  items:
                    type: number
                  type: array
                  nullable: true
                defaultDealer:
                  items:
                    type: number
                  type: array
                  nullable: true
                defaultFacilitator:
                  type: number
                  nullable: true
                email:
                  type: string
                  nullable: true
                apiKey:
                  type: string
                  nullable: true
                environment:
                  type: string
                  nullable: true
                creditApplicationLabel:
                  type: string
                  nullable: true
                deals:
                  items:
                    type: number
                  type: array
                  nullable: true
                locations:
                  items:
                    type: number
                  type: array
                  nullable: true
                insuranceQuotes:
                  items:
                    type: number
                  type: array
                  nullable: true
                serviceQuotes:
                  items:
                    type: number
                  type: array
                  nullable: true
                serviceOrders:
                  type: string
                  nullable: true
                insurancePolicies:
                  items:
                    type: number
                  type: array
                  nullable: true
                addresses:
                  items:
                    type: number
                  type: array
                  nullable: true
                listings:
                  items:
                    type: number
                  type: array
                  nullable: true
                vehicles:
                  items:
                    type: number
                  type: array
                  nullable: true
                webhooks:
                  items:
                    type: number
                  type: array
                  nullable: true
                taxesAndFees:
                  items:
                    type: number
                  type: array
                  nullable: true
                dmvFees:
                  items:
                    type: number
                  type: array
                  nullable: true
                transportServiceOrders:
                  items:
                    type: number
                  type: array
                  nullable: true
                updatedAt:
                  type: string
                createdAt:
                  type: string
              required:
                - id
                - updatedAt
                - createdAt
        updatedAt:
          type: string
        createdAt:
          type: string
      required:
        - id
        - updatedAt
        - createdAt
    listingsUpsertConfirmation:
      type: object
      title: Listing upsert confirmation
      properties:
        doc:
          additionalProperties: false
          title: Listing
          type: object
          properties:
            vehicles:
              type: number
              nullable: true
            mileage:
              type: number
              nullable: true
            seller:
              type: string
              nullable: true
            wholesaleValue:
              type: string
              nullable: true
            wholesaleBuyNowPrice:
              type: string
              nullable: true
            wholesaleMinimumBid:
              type: string
              nullable: true
            wholesaleCurrentBid:
              type: string
              nullable: true
            wholesaleDetailPage:
              type: string
              nullable: true
            condition:
              type: number
              nullable: true
            wholesaleConditionReport:
              type: string
              nullable: true
            retailValue:
              type: string
              nullable: true
            retailAskingPrice:
              type: string
              nullable: true
            retailBuyNowPrice:
              type: string
              nullable: true
            vehicleHistoryReport:
              type: string
              nullable: true
            vehicleHistoryScore:
              type: string
              nullable: true
            cleanTitle:
              type: boolean
              nullable: true
            owners:
              type: number
              nullable: true
            accidents:
              type: number
              nullable: true
            attachments:
              type: string
              nullable: true
            pickupLocation:
              type: number
              nullable: true
            tenant:
              type: number
              nullable: true
            updatedAt:
              type: string
            createdAt:
              type: string
          required:
            - id
            - updatedAt
            - createdAt
        message:
          type: string
      required:
        - doc
        - message
    error:
      title: Error response message
      type: object
      additionalProperties: false
      properties:
        errors:
          type: array
          items:
            type: object
            additionalProperties: false
            properties:
              message:
                type: string
            required:
              - message
      required:
        - errors
  securitySchemes:
    apiKeyAuth:
      in: header
      type: apiKey
      name: Authorization

````