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

# Queue Transaction

> A `POST` to the `/transactions/queue` endpoint allows your application to create a Transaction by adding to the process queue.

# What happens when a transaction is queued?

The main difference between this endpoint and [Add Transaction](/api-reference/transaction/add-transaction)
is queuing a transaction adds the transaction request to a batch processing queue.
The response time for this request is much faster than an Add Transaction, as the job is submitted instantly.
The payload required for this endpoint is identical to the [Add Transaction](/api-reference/transaction/add-transaction) endpoint.

In addition to the above, this endpoint includes the same functionality as [Create or Update a Transaction](/api-reference/transaction/create-or-update-a-transaction), where an existing transaction is first searched by `external_id` and then `id` which will update the transaction if found. If no existing transaction is found, the transaction is created instead.

<Warning>
  **Queued transactions may not be created instantly**

  The processing time of transactions submitted to the queue is subject to the other jobs within the queue. The response will contain no data relating to the transaction. A `transaction.created` or `transaction.updated` event will be triggered as each transaction is processed. Developers can use this to retrieve data relating to the submitted transaction.
</Warning>

# When to use Queue Transaction

Queueing is primarily used for batch importing transactions.
The Queue endpoint allows developers to submit high volumes of transactions for processing on a batch queue. This is usually done by the developer by looping through transactions on the external system, and sending them to the Queue Transaction endpoint.

# When not to use Queue Transaction

If response data is required after submitting the request to this endpoint. Queue Transaction will return a 200 response 'OK' with every successful submission. This will not contain any information about the submitted transaction. If response data is required for population on a website or internal system, use the [Add Transaction](/api-reference/transaction/add-transaction) endpoint instead

If transactions need to be created immediately, this endpoint is not suitable. All transactions submitted via this endpoint are subject to the other jobs on the queue. Because of this, Omneo cannot guarantee the time of creation.


## OpenAPI

````yaml post /v3/transactions/queue
openapi: 3.1.0
info:
  title: Omneo
  version: 0.0.1
servers:
  - url: https://api.{tenant}.getomneo.com/api
    variables:
      tenant:
        default: example
security: []
paths:
  /v3/transactions/queue:
    post:
      tags:
        - Transaction
      summary: Queue Transaction
      description: >-
        A `POST` to the `/transactions/queue` endpoint allows your application
        to create a Transaction by adding to the process queue.
      operationId: transaction.queue
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateCreateTransaction'
      responses:
        '202':
          description: ''
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: string
                    const: OK
                required:
                  - data
        '401':
          $ref: '#/components/responses/AuthenticationException'
        '403':
          $ref: '#/components/responses/AuthorizationException'
        '422':
          $ref: '#/components/responses/ValidationException'
components:
  schemas:
    UpdateCreateTransaction:
      type: object
      properties:
        id:
          type:
            - integer
            - 'null'
        profile_id:
          type:
            - string
            - 'null'
        profile_id_handle:
          type:
            - string
            - 'null'
        redemption_id:
          type:
            - integer
            - 'null'
        external_id:
          type:
            - string
            - 'null'
        location_id:
          type:
            - string
            - 'null'
        currency:
          type:
            - string
            - 'null'
        total:
          type: number
        total_original:
          type:
            - number
            - 'null'
        rounding:
          type:
            - number
            - 'null'
        tender:
          type:
            - string
            - 'null'
        is_void:
          type:
            - boolean
            - 'null'
        margin:
          type:
            - number
            - 'null'
        transacted_at:
          type: string
          format: date-time
        timezone:
          type: string
        meta:
          type:
            - array
            - 'null'
          items:
            type: string
        staff_id:
          type:
            - string
            - 'null'
        payments:
          type: array
          items:
            type: string
        receipt_is_email:
          type:
            - boolean
            - 'null'
        receipt_ref:
          type:
            - string
            - 'null'
        linked_receipt_ref:
          type:
            - string
            - 'null'
        receipt_email:
          type:
            - string
            - 'null'
          format: email
        need_action:
          type:
            - boolean
            - 'null'
        tags:
          type: array
          items:
            type: string
        systems:
          type: array
          items:
            type: string
        items:
          type:
            - array
            - 'null'
          items:
            type: object
            properties:
              id:
                type:
                  - string
                  - 'null'
              external_id:
                type:
                  - string
                  - 'null'
              name:
                type: string
              price_current:
                type: number
              price_sell:
                type: number
              quantity:
                type: number
              price_original:
                type:
                  - number
                  - 'null'
              price_margin:
                type:
                  - number
                  - 'null'
              discounts:
                type:
                  - array
                  - 'null'
                items:
                  type: string
              sku:
                type:
                  - string
                  - 'null'
              variant_external_id:
                type:
                  - string
                  - 'null'
              product_variant_sku:
                type:
                  - string
                  - 'null'
              product_variant_id:
                type:
                  - integer
                  - 'null'
              product_variant:
                type:
                  - object
                  - 'null'
                properties:
                  product_id:
                    type: string
                  sku:
                    type: string
                  title:
                    type: string
                  category:
                    type: string
                  subcategory:
                    type:
                      - string
                      - 'null'
                  brand:
                    type: string
                  price:
                    type: number
            required:
              - name
              - price_current
              - price_sell
              - quantity
      required:
        - total
        - transacted_at
        - timezone
      title: UpdateCreateTransaction
  responses:
    AuthenticationException:
      description: Unauthenticated
      content:
        application/json:
          schema:
            type: object
            properties:
              message:
                type: string
                description: Error overview.
            required:
              - message
    AuthorizationException:
      description: Authorization error
      content:
        application/json:
          schema:
            type: object
            properties:
              message:
                type: string
                description: Error overview.
            required:
              - message
    ValidationException:
      description: Validation error
      content:
        application/json:
          schema:
            type: object
            properties:
              message:
                type: string
                description: Errors overview.
              errors:
                type: object
                description: A detailed description of each field that failed validation.
                additionalProperties:
                  type: array
                  items:
                    type: string
            required:
              - message
              - errors

````