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

# Create a new Attachment

> Create a new Attachment

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

  const sdk = new SDK(...)

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


## OpenAPI

````yaml post /attachments
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:
  /attachments:
    post:
      tags:
        - attachments
      summary: Create a new Attachment
      description: Create a new Attachment
      parameters:
        - 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/attachmentsRequest'
      responses:
        '200':
          $ref: '#/components/responses/attachmentsUpsertConfirmationResponse'
      security:
        - apiKeyAuth: []
components:
  requestBodies:
    attachmentsRequest:
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/attachments'
  responses:
    attachmentsUpsertConfirmationResponse:
      description: ok
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/attachmentsUpsertConfirmation'
  schemas:
    attachments:
      additionalProperties: false
      title: Attachment
      type: object
      properties:
        name:
          type: string
          nullable: true
        status:
          enum:
            - Error
            - Sending
            - Sent
          type: string
          nullable: true
        type:
          type: string
          nullable: true
        file:
          type: string
          nullable: true
        serviceOrders:
          type: string
          nullable: true
        orderId:
          type: string
          nullable: true
        transportServiceOrders:
          items:
            oneOf:
              - type: number
              - 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
          type: array
          nullable: true
        updatedAt:
          type: string
        createdAt:
          type: string
      required:
        - id
        - updatedAt
        - createdAt
    attachmentsUpsertConfirmation:
      type: object
      title: Attachment upsert confirmation
      properties:
        doc:
          additionalProperties: false
          title: Attachment
          type: object
          properties:
            name:
              type: string
              nullable: true
            status:
              enum:
                - Error
                - Sending
                - Sent
              type: string
              nullable: true
            type:
              type: string
              nullable: true
            file:
              type: string
              nullable: true
            serviceOrders:
              type: string
              nullable: true
            orderId:
              type: string
              nullable: true
            transportServiceOrders:
              items:
                type: number
              type: array
              nullable: true
            updatedAt:
              type: string
            createdAt:
              type: string
          required:
            - id
            - updatedAt
            - createdAt
        message:
          type: string
      required:
        - doc
        - message
  securitySchemes:
    apiKeyAuth:
      in: header
      type: apiKey
      name: Authorization

````