> ## 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 Credit Application version by its id

> Restore a Credit Application 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 { creditApplications } from '@drivly/commerce'

  const sdk = new SDK(...)

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


## OpenAPI

````yaml post /creditApplications/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:
  /creditApplications/versions/{id}:
    post:
      tags:
        - creditApplications
      summary: Restore a Credit Application version by its id
      description: Restore a Credit Application version by its id
      parameters:
        - name: id
          in: path
          description: id of the Credit Application 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/creditApplicationsUpsertConfirmationResponse'
        '404':
          $ref: '#/components/responses/NotFoundErrorResponse'
      security:
        - apiKeyAuth: []
components:
  responses:
    creditApplicationsUpsertConfirmationResponse:
      description: ok
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/creditApplicationsUpsertConfirmation'
    NotFoundErrorResponse:
      description: not found
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/error'
  schemas:
    creditApplicationsUpsertConfirmation:
      type: object
      title: Credit Application upsert confirmation
      properties:
        doc:
          additionalProperties: false
          title: CreditApplication
          type: object
          properties:
            title:
              type: string
              nullable: true
            sendToTSG:
              type: boolean
              nullable: true
            state:
              enum:
                - DRAFT
                - SUBMITTED
                - APPROVED
                - DENIED
                - CANCELLED
              type: string
              nullable: true
            environment:
              enum:
                - Production
                - Development
              type: string
            meta:
              nullable: true
              anyOf:
                - type: object
                - type: array
                - type: string
                - type: number
                - type: boolean
            sentToCustomer:
              type: boolean
              nullable: true
            rates:
              items:
                additionalProperties: false
                type: object
                properties:
                  term:
                    type: string
                    nullable: true
                  apr:
                    type: string
                    nullable: true
                  monthlyPayment:
                    type: number
                    nullable: true
                  requiredDownPayment:
                    type: number
                    nullable: true
                  activationLink:
                    type: string
                    nullable: true
                  id:
                    type: string
                    nullable: true
              type: array
              nullable: true
            passesChecklist:
              type: boolean
              nullable: true
            requiredFields:
              items:
                enum:
                  - primaryApplicant
                  - primaryApplicant.currentResidence
                  - primaryApplicant.currentEmployment
                  - primaryApplicant.additionalIncome
                  - primaryApplicant.previousResidence
                  - primaryApplicant.previousEmployment
                  - coApplicant
                  - coApplicant.currentResidence
                  - coApplicant.currentEmployment
                  - coApplicant.additionalIncome
                  - coApplicant.previousResidence
                  - coApplicant.previousEmployment
                  - vehicle
                  - vehicle.lien
                  - financeAmount
                  - applicationType
                  - primaryApplicant.agreeTerms
                  - coApplicant.agreeTerms
                type: string
              type: array
              nullable: true
            missingFields:
              nullable: true
              anyOf:
                - type: object
                - type: array
                - type: string
                - type: number
                - type: boolean
            requestId:
              type: string
              nullable: true
            logs:
              items:
                additionalProperties: false
                type: object
                properties:
                  timestamp:
                    type: string
                    nullable: true
                  message:
                    type: string
                    nullable: true
                  debug:
                    nullable: true
                    anyOf:
                      - type: object
                      - type: array
                      - type: string
                      - type: number
                      - type: boolean
                  id:
                    type: string
                    nullable: true
              type: array
              nullable: true
            autopayNumber:
              type: string
              nullable: true
            applicationLink:
              type: string
              nullable: true
            preApproval:
              type: number
              nullable: true
            applicationType:
              enum:
                - REFINANCE
                - PURCHASE
                - LEASE_BUYOUT
              type: string
              nullable: true
            financeAmount:
              type: number
              nullable: true
            downPayment:
              type: number
              nullable: true
            primaryApplicant:
              additionalProperties: false
              type: object
              properties:
                consumer:
                  type: number
                  nullable: true
                firstName:
                  type: string
                  nullable: true
                lastName:
                  type: string
                  nullable: true
                birthDate:
                  type: string
                  nullable: true
                emailAddress:
                  type: string
                  nullable: true
                cellPhone:
                  type: string
                  nullable: true
                ssn:
                  type: string
                  nullable: true
                relationshipType:
                  enum:
                    - SPOUSE
                    - RELATIVE
                    - FRIEND
                  type: string
                  nullable: true
                currentResidence:
                  additionalProperties: false
                  type: object
                  properties:
                    monthlyPaymentAmount:
                      type: number
                      nullable: true
                    monthsAtResidence:
                      type: number
                      nullable: true
                    ownershipStatus:
                      enum:
                        - OWN
                        - RENT
                        - RELATIVE_OWNED
                      type: string
                      nullable: true
                    address:
                      additionalProperties: false
                      type: object
                      properties:
                        lineOne:
                          type: string
                          nullable: true
                        lineTwo:
                          type: string
                          nullable: true
                        city:
                          type: string
                          nullable: true
                        state:
                          enum:
                            - AL
                            - AK
                            - AZ
                            - AR
                            - CA
                            - CO
                            - CT
                            - DE
                            - FL
                            - GA
                            - HI
                            - ID
                            - IL
                            - IN
                            - IA
                            - KS
                            - KY
                            - LA
                            - ME
                            - MD
                            - MA
                            - MI
                            - MN
                            - MS
                            - MO
                            - MT
                            - NE
                            - NV
                            - NH
                            - NJ
                            - NM
                            - NY
                            - NC
                            - ND
                            - OH
                            - OK
                            - OR
                            - PA
                            - RI
                            - SC
                            - SD
                            - TN
                            - TX
                            - UT
                            - VT
                            - VA
                            - WA
                            - WV
                            - WI
                            - WY
                          type: string
                          nullable: true
                        postalCode:
                          type: string
                          nullable: true
                currentEmployment:
                  additionalProperties: false
                  type: object
                  properties:
                    yearlyIncomeAmount:
                      type: number
                      nullable: true
                    monthsAtEmployer:
                      type: number
                      nullable: true
                    employmentType:
                      enum:
                        - FULL_TIME
                        - CONTRACTOR
                        - SELF_EMPLOYED
                        - ACTIVE_MILITARY
                        - RETIRED
                        - UN_EMPLOYED
                      type: string
                      nullable: true
                    employerName:
                      type: string
                      nullable: true
                    employmentPosition:
                      type: string
                      nullable: true
                    employmentAddress:
                      additionalProperties: false
                      type: object
                      properties:
                        lineOne:
                          type: string
                          nullable: true
                        lineTwo:
                          type: string
                          nullable: true
                        city:
                          type: string
                          nullable: true
                        state:
                          enum:
                            - AL
                            - AK
                            - AZ
                            - AR
                            - CA
                            - CO
                            - CT
                            - DE
                            - FL
                            - GA
                            - HI
                            - ID
                            - IL
                            - IN
                            - IA
                            - KS
                            - KY
                            - LA
                            - ME
                            - MD
                            - MA
                            - MI
                            - MN
                            - MS
                            - MO
                            - MT
                            - NE
                            - NV
                            - NH
                            - NJ
                            - NM
                            - NY
                            - NC
                            - ND
                            - OH
                            - OK
                            - OR
                            - PA
                            - RI
                            - SC
                            - SD
                            - TN
                            - TX
                            - UT
                            - VT
                            - VA
                            - WA
                            - WV
                            - WI
                            - WY
                          type: string
                          nullable: true
                        postalCode:
                          type: string
                          nullable: true
                previousResidence:
                  additionalProperties: false
                  type: object
                  properties:
                    monthlyPaymentAmount:
                      type: number
                      nullable: true
                    monthsAtResidence:
                      type: number
                      nullable: true
                    ownershipStatus:
                      enum:
                        - OWN
                        - RENT
                        - RELATIVE_OWNED
                      type: string
                      nullable: true
                    address:
                      additionalProperties: false
                      type: object
                      properties:
                        lineOne:
                          type: string
                          nullable: true
                        lineTwo:
                          type: string
                          nullable: true
                        city:
                          type: string
                          nullable: true
                        state:
                          enum:
                            - AL
                            - AK
                            - AZ
                            - AR
                            - CA
                            - CO
                            - CT
                            - DE
                            - FL
                            - GA
                            - HI
                            - ID
                            - IL
                            - IN
                            - IA
                            - KS
                            - KY
                            - LA
                            - ME
                            - MD
                            - MA
                            - MI
                            - MN
                            - MS
                            - MO
                            - MT
                            - NE
                            - NV
                            - NH
                            - NJ
                            - NM
                            - NY
                            - NC
                            - ND
                            - OH
                            - OK
                            - OR
                            - PA
                            - RI
                            - SC
                            - SD
                            - TN
                            - TX
                            - UT
                            - VT
                            - VA
                            - WA
                            - WV
                            - WI
                            - WY
                          type: string
                          nullable: true
                        postalCode:
                          type: string
                          nullable: true
                previousEmployment:
                  additionalProperties: false
                  type: object
                  properties:
                    yearlyIncomeAmount:
                      type: number
                      nullable: true
                    monthsAtEmployer:
                      type: number
                      nullable: true
                    employmentType:
                      enum:
                        - FULL_TIME
                        - CONTRACTOR
                        - SELF_EMPLOYED
                        - ACTIVE_MILITARY
                        - RETIRED
                        - UN_EMPLOYED
                      type: string
                      nullable: true
                    employerName:
                      type: string
                      nullable: true
                    employmentPosition:
                      type: string
                      nullable: true
                    employmentAddress:
                      additionalProperties: false
                      type: object
                      properties:
                        lineOne:
                          type: string
                          nullable: true
                        lineTwo:
                          type: string
                          nullable: true
                        city:
                          type: string
                          nullable: true
                        state:
                          enum:
                            - AL
                            - AK
                            - AZ
                            - AR
                            - CA
                            - CO
                            - CT
                            - DE
                            - FL
                            - GA
                            - HI
                            - ID
                            - IL
                            - IN
                            - IA
                            - KS
                            - KY
                            - LA
                            - ME
                            - MD
                            - MA
                            - MI
                            - MN
                            - MS
                            - MO
                            - MT
                            - NE
                            - NV
                            - NH
                            - NJ
                            - NM
                            - NY
                            - NC
                            - ND
                            - OH
                            - OK
                            - OR
                            - PA
                            - RI
                            - SC
                            - SD
                            - TN
                            - TX
                            - UT
                            - VT
                            - VA
                            - WA
                            - WV
                            - WI
                            - WY
                          type: string
                          nullable: true
                        postalCode:
                          type: string
                          nullable: true
                additionalIncomeAmount:
                  type: number
                  nullable: true
                additionalIncomeFrequency:
                  enum:
                    - WEEKLY
                    - BI_WEEKLY
                    - TWICE_MONTHLY
                    - MONTHLY
                    - YEARLY
                  type: string
                  nullable: true
                additionalIncomeSource:
                  type: string
                  nullable: true
                terms:
                  additionalProperties: false
                  type: object
                  properties:
                    agreeToTerms:
                      type: boolean
                      nullable: true
                    agreeIP:
                      type: string
                      nullable: true
                    agreeUserAgent:
                      type: string
                      nullable: true
            hasCoApplicant:
              type: boolean
              nullable: true
            coApplicant:
              additionalProperties: false
              type: object
              properties:
                consumer:
                  type: number
                  nullable: true
                firstName:
                  type: string
                  nullable: true
                lastName:
                  type: string
                  nullable: true
                birthDate:
                  type: string
                  nullable: true
                emailAddress:
                  type: string
                  nullable: true
                cellPhone:
                  type: string
                  nullable: true
                ssn:
                  type: string
                  nullable: true
                relationshipType:
                  enum:
                    - SPOUSE
                    - RELATIVE
                    - FRIEND
                  type: string
                  nullable: true
                currentResidence:
                  additionalProperties: false
                  type: object
                  properties:
                    monthlyPaymentAmount:
                      type: number
                      nullable: true
                    monthsAtResidence:
                      type: number
                      nullable: true
                    ownershipStatus:
                      enum:
                        - OWN
                        - RENT
                        - RELATIVE_OWNED
                      type: string
                      nullable: true
                    address:
                      additionalProperties: false
                      type: object
                      properties:
                        lineOne:
                          type: string
                          nullable: true
                        lineTwo:
                          type: string
                          nullable: true
                        city:
                          type: string
                          nullable: true
                        state:
                          enum:
                            - AL
                            - AK
                            - AZ
                            - AR
                            - CA
                            - CO
                            - CT
                            - DE
                            - FL
                            - GA
                            - HI
                            - ID
                            - IL
                            - IN
                            - IA
                            - KS
                            - KY
                            - LA
                            - ME
                            - MD
                            - MA
                            - MI
                            - MN
                            - MS
                            - MO
                            - MT
                            - NE
                            - NV
                            - NH
                            - NJ
                            - NM
                            - NY
                            - NC
                            - ND
                            - OH
                            - OK
                            - OR
                            - PA
                            - RI
                            - SC
                            - SD
                            - TN
                            - TX
                            - UT
                            - VT
                            - VA
                            - WA
                            - WV
                            - WI
                            - WY
                          type: string
                          nullable: true
                        postalCode:
                          type: string
                          nullable: true
                currentEmployment:
                  additionalProperties: false
                  type: object
                  properties:
                    yearlyIncomeAmount:
                      type: number
                      nullable: true
                    monthsAtEmployer:
                      type: number
                      nullable: true
                    employmentType:
                      enum:
                        - FULL_TIME
                        - CONTRACTOR
                        - SELF_EMPLOYED
                        - ACTIVE_MILITARY
                        - RETIRED
                        - UN_EMPLOYED
                      type: string
                      nullable: true
                    employerName:
                      type: string
                      nullable: true
                    employmentPosition:
                      type: string
                      nullable: true
                    employmentAddress:
                      additionalProperties: false
                      type: object
                      properties:
                        lineOne:
                          type: string
                          nullable: true
                        lineTwo:
                          type: string
                          nullable: true
                        city:
                          type: string
                          nullable: true
                        state:
                          enum:
                            - AL
                            - AK
                            - AZ
                            - AR
                            - CA
                            - CO
                            - CT
                            - DE
                            - FL
                            - GA
                            - HI
                            - ID
                            - IL
                            - IN
                            - IA
                            - KS
                            - KY
                            - LA
                            - ME
                            - MD
                            - MA
                            - MI
                            - MN
                            - MS
                            - MO
                            - MT
                            - NE
                            - NV
                            - NH
                            - NJ
                            - NM
                            - NY
                            - NC
                            - ND
                            - OH
                            - OK
                            - OR
                            - PA
                            - RI
                            - SC
                            - SD
                            - TN
                            - TX
                            - UT
                            - VT
                            - VA
                            - WA
                            - WV
                            - WI
                            - WY
                          type: string
                          nullable: true
                        postalCode:
                          type: string
                          nullable: true
                previousResidence:
                  additionalProperties: false
                  type: object
                  properties:
                    monthlyPaymentAmount:
                      type: number
                      nullable: true
                    monthsAtResidence:
                      type: number
                      nullable: true
                    ownershipStatus:
                      enum:
                        - OWN
                        - RENT
                        - RELATIVE_OWNED
                      type: string
                      nullable: true
                    address:
                      additionalProperties: false
                      type: object
                      properties:
                        lineOne:
                          type: string
                          nullable: true
                        lineTwo:
                          type: string
                          nullable: true
                        city:
                          type: string
                          nullable: true
                        state:
                          enum:
                            - AL
                            - AK
                            - AZ
                            - AR
                            - CA
                            - CO
                            - CT
                            - DE
                            - FL
                            - GA
                            - HI
                            - ID
                            - IL
                            - IN
                            - IA
                            - KS
                            - KY
                            - LA
                            - ME
                            - MD
                            - MA
                            - MI
                            - MN
                            - MS
                            - MO
                            - MT
                            - NE
                            - NV
                            - NH
                            - NJ
                            - NM
                            - NY
                            - NC
                            - ND
                            - OH
                            - OK
                            - OR
                            - PA
                            - RI
                            - SC
                            - SD
                            - TN
                            - TX
                            - UT
                            - VT
                            - VA
                            - WA
                            - WV
                            - WI
                            - WY
                          type: string
                          nullable: true
                        postalCode:
                          type: string
                          nullable: true
                previousEmployment:
                  additionalProperties: false
                  type: object
                  properties:
                    yearlyIncomeAmount:
                      type: number
                      nullable: true
                    monthsAtEmployer:
                      type: number
                      nullable: true
                    employmentType:
                      enum:
                        - FULL_TIME
                        - CONTRACTOR
                        - SELF_EMPLOYED
                        - ACTIVE_MILITARY
                        - RETIRED
                        - UN_EMPLOYED
                      type: string
                      nullable: true
                    employerName:
                      type: string
                      nullable: true
                    employmentPosition:
                      type: string
                      nullable: true
                    employmentAddress:
                      additionalProperties: false
                      type: object
                      properties:
                        lineOne:
                          type: string
                          nullable: true
                        lineTwo:
                          type: string
                          nullable: true
                        city:
                          type: string
                          nullable: true
                        state:
                          enum:
                            - AL
                            - AK
                            - AZ
                            - AR
                            - CA
                            - CO
                            - CT
                            - DE
                            - FL
                            - GA
                            - HI
                            - ID
                            - IL
                            - IN
                            - IA
                            - KS
                            - KY
                            - LA
                            - ME
                            - MD
                            - MA
                            - MI
                            - MN
                            - MS
                            - MO
                            - MT
                            - NE
                            - NV
                            - NH
                            - NJ
                            - NM
                            - NY
                            - NC
                            - ND
                            - OH
                            - OK
                            - OR
                            - PA
                            - RI
                            - SC
                            - SD
                            - TN
                            - TX
                            - UT
                            - VT
                            - VA
                            - WA
                            - WV
                            - WI
                            - WY
                          type: string
                          nullable: true
                        postalCode:
                          type: string
                          nullable: true
                additionalIncomeAmount:
                  type: number
                  nullable: true
                additionalIncomeFrequency:
                  enum:
                    - WEEKLY
                    - BI_WEEKLY
                    - TWICE_MONTHLY
                    - MONTHLY
                    - YEARLY
                  type: string
                  nullable: true
                additionalIncomeSource:
                  type: string
                  nullable: true
                terms:
                  additionalProperties: false
                  type: object
                  properties:
                    agreeToTerms:
                      type: boolean
                      nullable: true
                    agreeIP:
                      type: string
                      nullable: true
                    agreeUserAgent:
                      type: string
                      nullable: true
            vehicle:
              additionalProperties: false
              type: object
              properties:
                vin:
                  type: string
                  nullable: true
                year:
                  type: number
                  nullable: true
                make:
                  type: string
                  nullable: true
                model:
                  type: string
                  nullable: true
                trim:
                  type: string
                  nullable: true
                mileage:
                  type: number
                  nullable: true
                lien:
                  additionalProperties: false
                  type: object
                  properties:
                    lienHolder:
                      type: string
                      nullable: true
                    monthlyPaymentAmount:
                      type: number
                      nullable: true
                    payoffAmount:
                      type: number
                      nullable: true
                    initialTerm:
                      type: number
                      nullable: true
                    remainingTerm:
                      type: number
                      nullable: true
                    originalAmount:
                      type: number
                      nullable: true
                    apr:
                      type: number
                      nullable: true
            trades:
              items:
                type: number
              type: array
              nullable: true
            updatedAt:
              type: string
            createdAt:
              type: string
          required:
            - id
            - environment
            - 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

````