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

# Create an order for a customer

> Create a buy-it-now order on behalf of a customer. Works for both auction products and standalone products.



## OpenAPI

````yaml https://api.auctionnow.io/api/alpha/doc post /alpha/merchant/customers/{customerId}/orders
openapi: 3.0.0
info:
  version: alpha
  title: Auction Now API
servers:
  - url: https://api.auctionnow.io/api
    description: Production API
security: []
paths:
  /alpha/merchant/customers/{customerId}/orders:
    post:
      tags:
        - Customer Actions
      summary: Create an order for a customer
      description: >-
        Create a buy-it-now order on behalf of a customer. Works for both
        auction products and standalone products.
      parameters:
        - schema:
            type: string
            description: The unique ID of the customer
          required: true
          description: The unique ID of the customer
          name: customerId
          in: path
        - schema:
            type: string
            description: Your Auction Now API key as a Bearer token
            example: Bearer ak_XXXXXXX
          required: true
          description: Your Auction Now API key as a Bearer token
          name: Authorization
          in: header
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                data:
                  type: object
                  properties:
                    productId:
                      type: string
                      description: The product to purchase
                    quantity:
                      type: integer
                      minimum: 1
                      description: Number of items to purchase
                  required:
                    - productId
                    - quantity
                  description: Input data for creating an order
              required:
                - data
      responses:
        '201':
          description: Order created successfully
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: object
                    properties:
                      ok:
                        type: boolean
                        description: Whether the order was successful
                      orderId:
                        type: string
                        description: The created order ID, if any
                      state:
                        type: string
                        description: Order state (e.g. SOLD, UNSOLD)
                      reason:
                        type: string
                        description: Reason if order could not be created
                      idempotent:
                        type: boolean
                        description: Whether this was an idempotent duplicate
                    required:
                      - ok
                    description: The order result
                  message:
                    type: string
                  timestamp:
                    type: number
                required:
                  - data
                  - timestamp
        '400':
          description: Bad Request - Validation error or invalid input
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                  error:
                    anyOf:
                      - type: string
                      - type: object
                        properties:
                          errors:
                            type: array
                            items:
                              type: string
                          properties:
                            type: object
                            properties:
                              data:
                                type: object
                                properties:
                                  errors:
                                    type: array
                                    items:
                                      type: string
                                  properties:
                                    type: object
                                    additionalProperties:
                                      type: object
                                      properties:
                                        errors:
                                          type: array
                                          items:
                                            type: string
                                      required:
                                        - errors
                                required:
                                  - errors
                                  - properties
                            required:
                              - data
                        required:
                          - errors
                          - properties
                required:
                  - message
                  - error
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                  reason:
                    type: string
                required:
                  - error
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                  reason:
                    type: string
                required:
                  - error
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                  reason:
                    type: string
                required:
                  - error
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                required:
                  - error

````