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

# Create Orders

> Creates a new order. You can specify products by `sku` code (recommended) or by `spu` + `size` + `color`.

Import orders into the system. You can specify products in two ways:

* **By SKU code (recommended):** Pass the `sku` field with a code from [List Products](/api-reference/endpoint/list-products). The system resolves size, color, and SPU automatically.
* **By SPU + size + color:** Pass `spu`, `size`, and `color` individually (legacy method, still supported).


## OpenAPI

````yaml POST /api/openapi/order
openapi: 3.1.0
info:
  title: Pod ERP OpenAPI
  description: Pod ERP Open API for order management
  license:
    name: MIT
  version: 2.0.0
servers:
  - url: https://api.platform.poderp.com
security:
  - bearerAuth: []
paths:
  /api/openapi/order:
    post:
      summary: Create Orders
      description: >-
        Creates a new order. You can specify products by `sku` code
        (recommended) or by `spu` + `size` + `color`.
      requestBody:
        description: Order details
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateOpenAPIOrderRequest'
      responses:
        '200':
          description: Order created successfully. No content returned.
          content: {}
        '400':
          description: Invalid input or unexpected error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
components:
  schemas:
    CreateOpenAPIOrderRequest:
      type: object
      required:
        - uniqueRequestId
        - orderItems
      properties:
        uniqueRequestId:
          type: string
          description: >-
            Unique identifier for this order batch, used for deduplication and
            later querying waybills
        orderItems:
          type: array
          items:
            $ref: '#/components/schemas/CreateOpenAPIOrderItemRequest'
    Error:
      required:
        - code
        - message
      type: object
      properties:
        code:
          type: string
        message:
          type: string
    CreateOpenAPIOrderItemRequest:
      type: object
      required:
        - orderNo
        - recipient
        - product
      properties:
        orderNo:
          type: string
          description: Customer order number, used later to query waybills
          minLength: 6
          maxLength: 50
        imageUrls:
          type: array
          items:
            type: string
            format: url
          default: []
        recipient:
          $ref: '#/components/schemas/CreateOpenAPIOrderItemRecipientInfoRequest'
        product:
          $ref: '#/components/schemas/CreateOpenAPIOrderItemProductRequest'
    CreateOpenAPIOrderItemRecipientInfoRequest:
      type: object
      required:
        - receiverName
        - country
        - state
        - city
        - postcode
        - address1
        - phone
      properties:
        receiverName:
          type: string
          minLength: 1
          maxLength: 150
        country:
          type: string
          description: ISO 3166-1 alpha-2
          minLength: 1
          maxLength: 150
        state:
          type: string
          minLength: 1
          maxLength: 150
        city:
          type: string
          minLength: 1
          maxLength: 150
        postcode:
          type: string
          minLength: 1
          maxLength: 150
        address1:
          type: string
          minLength: 1
          maxLength: 150
        phone:
          type: string
          minLength: 1
          maxLength: 150
        remark:
          type: string
          maxLength: 300
          nullable: true
        email:
          type: string
          format: email
          nullable: true
    CreateOpenAPIOrderItemProductRequest:
      type: object
      required:
        - quantity
      properties:
        sku:
          type: string
          maxLength: 100
          description: >-
            SKU code from the product catalog. When provided, `spu`, `size`, and
            `color` are not needed.
        spu:
          type: string
          maxLength: 100
          description: Product (SPU) code. Required if `sku` is not provided.
        size:
          type: string
          maxLength: 100
          description: Size. Optional when `sku` is provided.
        color:
          type: string
          maxLength: 100
          description: Color. Optional when `sku` is provided.
        quantity:
          type: integer
          description: Order quantity
        attributes:
          type: object
          additionalProperties:
            type: string
          description: Additional product attributes (e.g. `material`, `packaging`)
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer

````