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

# Create a new order



## OpenAPI

````yaml openapi.json post /orders
openapi: 3.1.0
info:
  title: Pink Platform
  version: 0.0.1
servers:
  - url: http://localhost/api
security: []
paths:
  /orders:
    post:
      tags:
        - Order
      summary: Create a new order
      operationId: orders.create
      requestBody:
        description: '`Order`'
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/Order'
      responses:
        '201':
          description: ''
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                    example: Order created successfully
                  '':
                    type: string
                  transmission_id:
                    type: string
                required:
                  - message
                  - null
                  - transmission_id
        '400':
          description: ''
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                required:
                  - error
        '401':
          $ref: '#/components/responses/AuthenticationException'
        '422':
          description: ''
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                    example: Invalid request data
                  errors:
                    type: string
                required:
                  - error
                  - errors
components:
  schemas:
    Order:
      type: object
      properties:
        identification:
          $ref: '#/components/schemas/OrderIdentification'
        type:
          $ref: '#/components/schemas/OrderType'
        order_date:
          type: string
          format: date-time
        expected_delivery_date:
          type: string
          format: date-time
        currency:
          $ref: '#/components/schemas/Currency'
        buyer:
          $ref: '#/components/schemas/OrderParty'
          description: Buyer information
        delivery_address:
          $ref: '#/components/schemas/OrderParty'
        seller:
          $ref: '#/components/schemas/OrderParty'
        lines:
          type: array
          items:
            $ref: '#/components/schemas/OrderLine'
        total_amount:
          $ref: '#/components/schemas/PriceRequest'
          description: Total order amount (gross)
        net_amount:
          $ref: '#/components/schemas/PriceRequest'
          description: Net amount (excluding tax)
        tax_details:
          type: array
          description: Tax details
          items:
            $ref: '#/components/schemas/TaxDetail'
      required:
        - identification
        - type
        - order_date
        - currency
        - buyer
        - delivery_address
        - seller
        - lines
        - total_amount
        - net_amount
        - tax_details
      title: Order
    OrderIdentification:
      type: object
      properties:
        pink_id:
          type: string
          description: Internal platform UUID
        buyer_order_id:
          type: string
          description: The order number from the buyer's system
        seller_order_id:
          type: string
          description: The order number from the seller's system
        seller:
          $ref: '#/components/schemas/PartnerIdentification'
          description: Seller identification
        buyer:
          $ref: '#/components/schemas/PartnerIdentification'
          description: Buyer identification
      required:
        - seller
        - buyer
      title: OrderIdentification
    OrderType:
      type: string
      enum:
        - purchase_order
        - sales_order
      title: OrderType
    Currency:
      type: string
      enum:
        - EUR
        - USD
        - GBP
      title: Currency
    OrderParty:
      type: object
      properties:
        name:
          type: string
        address:
          $ref: '#/components/schemas/Address'
        identification:
          $ref: '#/components/schemas/OrderPartyIdentification'
        contact_person:
          type: string
          description: Contact person name
        email:
          type: string
          format: email
          description: Contact email
        phone:
          type: string
          description: Contact phone
      required:
        - name
        - address
      title: OrderParty
    OrderLine:
      type: object
      properties:
        line_number:
          type: string
        product_id:
          type: string
        product_name:
          type: string
        quantity:
          type: number
        unit:
          $ref: '#/components/schemas/Unit'
        unit_price:
          $ref: '#/components/schemas/Price'
        total_amount:
          $ref: '#/components/schemas/Price'
        net_amount:
          $ref: '#/components/schemas/Price'
        tax_details:
          $ref: '#/components/schemas/TaxDetail'
        expected_delivery_date:
          type: string
          format: date-time
      required:
        - line_number
        - product_id
        - product_name
        - quantity
        - unit
      title: OrderLine
    PriceRequest:
      type: object
      properties:
        amount:
          type: integer
          description: Amount in the smallest currency unit (e.g., cents for EUR)
        currency:
          $ref: '#/components/schemas/Currency'
      required:
        - amount
        - currency
      title: PriceRequest
    TaxDetail:
      type: object
      properties:
        type:
          type: string
          description: Tax type (e.g., VAT)
        rate:
          type: number
          description: Tax rate percentage
        amount:
          $ref: '#/components/schemas/Price'
        taxable_amount:
          $ref: '#/components/schemas/Price'
          description: Taxable basis amount
      required:
        - rate
        - amount
      title: TaxDetail
    PartnerIdentification:
      type: object
      properties:
        pink_id:
          type: string
          description: Internal platform UUID
        gln:
          type: string
          description: Global Location Number (GLN)
      title: PartnerIdentification
    Address:
      type: object
      properties:
        line1:
          type: string
          description: Address line 1 (e.g., street name and number)
        line2:
          type: string
          description: Address line 2 (e.g., apartment, suite, unit, building)
        city:
          type: string
          description: City name
        postal_code:
          type: string
        country:
          $ref: '#/components/schemas/Country'
      required:
        - line1
        - city
        - postal_code
        - country
      title: Address
    OrderPartyIdentification:
      type: object
      properties:
        gln:
          type: string
          description: Global Location Number (GLN)
        tax_id:
          type: string
          description: Tax identification number (e.g., VAT number)
      title: OrderPartyIdentification
    Unit:
      type: string
      enum:
        - pc
        - box
        - ctn
        - plt
        - pack
        - bundle
        - kg
        - g
        - mg
        - t
        - l
        - ml
        - m3
      title: Unit
    Price:
      type: object
      properties:
        amount:
          type: integer
          description: Amount in the smallest currency unit (e.g., cents for EUR)
        currency:
          $ref: '#/components/schemas/Currency'
      required:
        - amount
        - currency
      title: Price
    Country:
      type: string
      enum:
        - AT
        - BE
        - BG
        - HR
        - CY
        - CZ
        - DK
        - EE
        - FI
        - FR
        - DE
        - GR
        - HU
        - IE
        - IT
        - LV
        - LT
        - LU
        - MT
        - NL
        - PL
        - PT
        - RO
        - SK
        - SI
        - ES
        - SE
        - AL
        - AD
        - BY
        - BA
        - IS
        - LI
        - MD
        - MC
        - ME
        - MK
        - 'NO'
        - RU
        - SM
        - RS
        - CH
        - TR
        - UA
        - GB
        - VA
      title: Country
  responses:
    AuthenticationException:
      description: Unauthenticated
      content:
        application/json:
          schema:
            type: object
            properties:
              message:
                type: string
                description: Error overview.
            required:
              - message

````