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

# Create order

> Create a certificate order.

<Card>
  <div className="flex items-center gap-3">
    <Icon icon="arrow-progress" size="27" />

    <p className="text-base text-lg font-semibold m-0"> Order Creation Steps</p>
  </div>

  <div className="ml-1">
    <Steps>
      <Step title="Start Order Creation">
        * Call the endpoint with the required fields and the `state` set to `Start`
        * The response will contain:
          * A `pre_signed_url` for uploading the asset
          * An `order_id` for committing the order
      </Step>

      <Step title="Upload Asset">
        * Upload the asset with `PUT` request using the `pre_signed_url`
        * Example S3 upload request:
          ```nushell cURL icon="terminal" lines theme={"system"}
          curl --location 'S3_PRE_SIGNED_URL' \
          --request PUT
          --upload-file 'PATH_TO_FILE'
          ```
        * Notice the lack of `Content-Type` header
      </Step>

      <Step title="Commit the Order">
        * Finalize the order creation by calling the endpoint again with:
          * The `state` set to `Commit`
          * The rest of the optional fields
          * The `order_id` from step <div className="size-7 ml-1 shrink-0 rounded-full bg-gray-50 dark:bg-white/10 text-xs text-gray-900 dark:text-gray-50 font-semibold inline-flex items-center justify-center">1</div>
      </Step>
    </Steps>
  </div>
</Card>


## OpenAPI

````yaml post /v1/orders
openapi: 3.1.0
info:
  title: Voight Orders API docs
  version: 1.0.0
servers:
  - url: https://api.human.prod.artistree.io
security:
  - oauth:
      - enterprise-api-access/read
      - enterprise-api-access/write
paths:
  /v1/orders:
    post:
      summary: Create order
      description: Create a certificate order.
      operationId: create_orders_v1_orders_post
      requestBody:
        description: The order creation request
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/OrderCreateRequest'
              description: The order creation request
        required: true
      responses:
        '200':
          description: The Start order response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/OrderCreateResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - {}
components:
  schemas:
    OrderCreateRequest:
      properties:
        asset_id:
          type: string
          format: uuid
          title: Asset Id
          description: A unique UUID identifier for the asset.
        asset_name:
          type: string
          title: Asset Name
          description: >-
            The filename of the asset, make sure it matches the actual file name
            you intend to upload, especially whether it has an extension or not.
        asset_last_modified_timestamp:
          type: integer
          title: Asset Last Modified Timestamp
          description: A Unix timestamp of the last time the asset was modified.
        organization_id:
          type: string
          title: Organization Id
        state:
          $ref: '#/components/schemas/CreateOrderState'
        project_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Project Id
          description: >-
            The project id the order is associated with. If not provided, it
            will be set to 'Personal Certificates', meaning the order is not
            associated with any project but uploaded to App Client's Personal
            Certificates.
          default: Personal Certificates
        ordered_by:
          anyOf:
            - type: string
            - type: 'null'
          title: Ordered By
          description: >-
            The entity that is ordering the certificate, can be the same as the
            username or a anything else, ex. the artist name.
          default: ''
        ordered_by_email:
          anyOf:
            - type: string
            - type: 'null'
          title: Ordered By Email
          description: >-
            The email of the entity that is ordering the certificate, can be the
            same as the username or a anything else, ex. the artist email.
          default: ''
        order_id:
          anyOf:
            - type: string
              format: uuid
            - type: 'null'
          title: Order Id
        order_title:
          anyOf:
            - type: string
            - type: 'null'
          title: Order Title
          default: ''
        tags:
          items:
            type: string
          type: array
          title: Tags
          description: >-
            Tags to be added to the order, can be used for filtering and
            searching.
      type: object
      required:
        - asset_id
        - asset_name
        - asset_last_modified_timestamp
        - organization_id
        - state
      title: OrderCreateRequest
    OrderCreateResponse:
      properties:
        pre_signed_url:
          type: string
          title: Pre Signed Url
        order_id:
          type: string
          format: uuid
          title: Order Id
      type: object
      required:
        - pre_signed_url
        - order_id
      title: OrderCreateResponse
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    CreateOrderState:
      type: string
      enum:
        - Start
        - Commit
      title: CreateOrderState
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        type:
          type: string
          title: Error Type
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
  securitySchemes:
    oauth:
      type: oauth2
      flows:
        clientCredentials:
          scopes: {}
          tokenUrl: >-
            https://human-artistree-prod.auth.us-east-1.amazoncognito.com/oauth2/token

````