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

# Restore a Service Order version by its id

> Restore a Service Order version by its id

<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 { serviceOrders } from '@drivly/commerce'

  const sdk = new SDK(...)

  const serviceOrders = await sdk.serviceOrders.create(data: serviceOrders): Promise<serviceOrders>
  ```
</Accordion>


## OpenAPI

````yaml post /serviceOrders/versions/{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:
  /serviceOrders/versions/{id}:
    post:
      tags:
        - serviceOrders
      summary: Restore a Service Order version by its id
      description: Restore a Service Order version by its id
      parameters:
        - name: id
          in: path
          description: id of the Service Order version
          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
      responses:
        '200':
          $ref: '#/components/responses/serviceOrdersUpsertConfirmationResponse'
        '404':
          $ref: '#/components/responses/NotFoundErrorResponse'
      security:
        - apiKeyAuth: []
components:
  responses:
    serviceOrdersUpsertConfirmationResponse:
      description: ok
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/serviceOrdersUpsertConfirmation'
    NotFoundErrorResponse:
      description: not found
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/error'
  schemas:
    serviceOrdersUpsertConfirmation:
      type: object
      title: Service Order upsert confirmation
      properties:
        doc:
          additionalProperties: false
          title: ServiceOrder
          type: object
          properties:
            name:
              type: string
              nullable: true
            type:
              items:
                enum:
                  - Condition Inspection
                  - Last Mile Delivery
                  - Long Haul Transport
                  - Mechanical Inspection
                  - Post Sale Inspection
                  - Pre-Paid Maintenance
                  - Pre-Purchase Inspection
                  - Safety Inspection
                  - Vehicle Service Contract
                  - Wash And Detail
                type: string
              type: array
              nullable: true
            customer:
              items:
                type: number
              type: array
              nullable: true
            serviceQuotes:
              type: number
              nullable: true
            paymentLink:
              type: string
              nullable: true
            vin:
              type: number
              nullable: true
            status:
              enum:
                - Quoted
                - Pending
                - In Review
                - Active
                - Dispatched
                - En Route
                - Complete
                - Hold
                - Cancel
                - Error
              type: string
              nullable: true
            error:
              type: string
              nullable: true
            orderId:
              type: string
              nullable: true
            price:
              type: string
              nullable: true
            rush:
              type: boolean
              nullable: true
            attachments:
              items:
                type: number
              type: array
              nullable: true
            quoteExpiration:
              type: string
              nullable: true
            ordered:
              type: string
              nullable: true
            start:
              type: string
              nullable: true
            due:
              type: string
              nullable: true
            consignor:
              type: number
              nullable: true
            billTo:
              type: number
              nullable: true
            origin:
              type: number
              nullable: true
            destination:
              type: number
              nullable: true
            deals:
              items:
                type: number
              type: array
              nullable: true
            orderLink:
              type: string
              nullable: true
            tenant:
              items:
                type: number
              type: array
              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

````