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

# Create order events

> Create new order events.

**Required scope:** `ORDER_WRITE`




## OpenAPI

````yaml /api-reference/2025-05-05/openapi.yaml post /v2/order_events
openapi: 3.1.0
info:
  title: Public Imprint API
  version: '2.0'
servers:
  - url: https://dev.sbx.imprint.co
    description: Imprint public api sandbox
security:
  - basicAuth: []
  - bearerAuth: []
paths:
  /v2/order_events:
    post:
      tags:
        - Order Events
      summary: Create order events
      description: |
        Create new order events.

        **Required scope:** `ORDER_WRITE`
      operationId: postOrderEvent
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/OrderEventBase'
      responses:
        '200':
          description: Order event created successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/OrderEvent'
        '403':
          description: API key is missing the required `ORDER_WRITE` scope
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiError'
components:
  schemas:
    OrderEventBase:
      type: object
      required:
        - order_id
        - type
        - amount
        - network_transaction_id
      properties:
        order_event_id:
          type: string
          description: The ID of the order event
          example: 77f60af4-185e-4867-b113-34e3cf7c6acd
        order_id:
          type: string
          description: The ID of the order to which the event is related
          example: 77f60af4-185e-4867-b113-34e3cf7c6acd
        partner_event_id:
          type: string
          description: Partner's event identifier
          example: 7622c07d-eb2b-4345-a9a9-345d61d32bc2
        type:
          type: string
          enum:
            - CAPTURED
            - REFUNDED
          description: Type of order event
          example: CAPTURED
        amount:
          allOf:
            - $ref: '#/components/schemas/CurrencyAmount'
            - example: 274999
              description: Total event amount ($2,699.99 + $50.00)
        rewards_amount:
          allOf:
            - $ref: '#/components/schemas/CurrencyAmount'
            - example: 2500
              description: Total rewards amount for the event ($25 + $0)
        currency:
          type: string
          description: >-
            The 3-character currency code of the amount in ISO 4217 format
            (e.g., "USD")
          example: USD
        network_transaction_id:
          type: string
          description: Card network transaction identifier
          example: 615e3ba0-6b99-495b-ade4-1f584c40f376
        order_lines:
          type: array
          items:
            $ref: '#/components/schemas/OrderLine'
          description: >-
            When provided, the API will require that the calculated sum of all
            the rates and rewards rates within (taking quantities into account)
            are equal to the `amount` and `rewards_amount`, respectively.

            It is important to note that the sums of all *event* amounts and
            *event* rewards amounts belonging to an order do not need to be
            equal to `total_order_amount` and `total_rewards_amount` in the
            order, as the data contained in events will serve as the final
            source of truth for the lifecycle of the order, as it actually
            transpired.
          example:
            - name: Couch Supreme
              product_url: www.restassured.com/couch-supreme
              image_url: https://cdn.restassured.com/couch-supreme.jpg
              quantity: 1
              rate: 274999
              rewards_rate: 2500
    OrderEvent:
      allOf:
        - $ref: '#/components/schemas/OrderEventBase'
    ApiError:
      type: object
      required:
        - error
      properties:
        error:
          type: object
          required:
            - type
            - message
          properties:
            type:
              type: string
              description: The category of error being returned
              example: BAD_REQUEST_ERROR
            message:
              type: string
              description: A message describing the cause of the error
              example: 'unsupported reward_type: INVALID, must be STATEMENT or DELAYED'
    CurrencyAmount:
      type: integer
      description: Amount in the smallest currency unit (e.g., cents for USD)
    OrderLine:
      type: object
      required:
        - name
        - quantity
        - rate
        - rewards_rate
      properties:
        name:
          type: string
          description: Name of the order line item
          example: Couch Supreme
        product_url:
          type: string
          nullable: true
          description: URL to the product
          example: www.restassured.com/couch-supreme
        image_url:
          type: string
          nullable: true
          description: URL to an image of the product
          example: https://cdn.restassured.com/couch-supreme.jpg
        quantity:
          type: integer
          description: Quantity of the item
          example: 1
        rate:
          allOf:
            - $ref: '#/components/schemas/CurrencyAmount'
            - example: 274999
        rewards_rate:
          allOf:
            - $ref: '#/components/schemas/CurrencyAmount'
            - example: 2500
  securitySchemes:
    basicAuth:
      type: http
      scheme: basic
      description: >-
        Basic HTTP authentication. Allowed headers-- Authorization: Basic
        <base64(api_key_id:api_key_secret)>
    bearerAuth:
      bearerFormat: auth-scheme
      description: >-
        Bearer HTTP authentication. Allowed headers-- Authorization: Bearer
        <api_key>
      scheme: bearer
      type: http

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.