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

# Bulk upsert transactions

> Create or update many sales transactions in a single Retailgrid request, ideal for syncing large batches of POS or order history data.



## OpenAPI

````yaml POST /v1/transactions/bulk
openapi: 3.1.0
info:
  title: Retailgrid Public API
  version: v1
servers: []
security: []
paths:
  /v1/transactions/bulk:
    post:
      tags:
        - transactions
      summary: Bulk Upsert Transactions
      operationId: bulk_upsert_transactions_v1_transactions_bulk_post
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/TransactionBulkRequest'
        required: true
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BulkResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
components:
  schemas:
    TransactionBulkRequest:
      properties:
        items:
          items:
            $ref: '#/components/schemas/TransactionBulkItem'
          type: array
          title: Items
      additionalProperties: false
      type: object
      title: TransactionBulkRequest
    BulkResponse:
      properties:
        results:
          items:
            oneOf:
              - $ref: '#/components/schemas/BulkItemSuccess'
              - $ref: '#/components/schemas/BulkItemError'
            discriminator:
              propertyName: ok
              mapping:
                'False':
                  $ref: '#/components/schemas/BulkItemError'
                'True':
                  $ref: '#/components/schemas/BulkItemSuccess'
          type: array
          title: Results
      additionalProperties: false
      type: object
      title: BulkResponse
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    TransactionBulkItem:
      properties:
        sku:
          anyOf:
            - type: string
            - type: 'null'
          title: Sku
        region:
          anyOf:
            - type: string
            - type: 'null'
          title: Region
        sales_value:
          anyOf:
            - type: number
            - type: string
              pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$
            - type: 'null'
          title: Sales Value
        gross_profit:
          anyOf:
            - type: number
            - type: string
              pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$
            - type: 'null'
          title: Gross Profit
        stock_after_sale:
          anyOf:
            - type: number
            - type: string
              pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$
            - type: 'null'
          title: Stock After Sale
        regular_price:
          anyOf:
            - type: number
            - type: string
              pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$
            - type: 'null'
          title: Regular Price
        promo_type:
          anyOf:
            - type: string
            - type: 'null'
          title: Promo Type
        zone_price:
          anyOf:
            - type: number
            - type: string
              pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$
            - type: 'null'
          title: Zone Price
        external_transaction_id:
          anyOf:
            - type: string
            - type: 'null'
          title: External Transaction Id
        unit_cost:
          anyOf:
            - type: number
            - type: string
              pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$
            - type: 'null'
          title: Unit Cost
        discount_rate:
          anyOf:
            - type: number
            - type: string
              pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$
            - type: 'null'
          title: Discount Rate
        currency:
          anyOf:
            - type: string
            - type: 'null'
          title: Currency
        tax_rate:
          anyOf:
            - type: number
            - type: string
              pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$
            - type: 'null'
          title: Tax Rate
        transaction_type:
          anyOf:
            - type: string
            - type: 'null'
          title: Transaction Type
        item_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Item Id
        store_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Store Id
        transaction_timestamp:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Transaction Timestamp
        quantity:
          anyOf:
            - type: number
            - type: string
              pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$
            - type: 'null'
          title: Quantity
        selling_price:
          anyOf:
            - type: number
            - type: string
              pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$
            - type: 'null'
          title: Selling Price
      additionalProperties: false
      type: object
      title: TransactionBulkItem
    BulkItemSuccess:
      properties:
        index:
          type: integer
          title: Index
        ok:
          type: boolean
          const: true
          title: Ok
        id:
          anyOf:
            - type: string
              format: uuid
            - type: integer
          title: Id
      additionalProperties: false
      type: object
      required:
        - index
        - ok
        - id
      title: BulkItemSuccess
    BulkItemError:
      properties:
        index:
          type: integer
          title: Index
        ok:
          type: boolean
          const: false
          title: Ok
        code:
          type: string
          enum:
            - validation_error
            - conflict
          title: Code
        message:
          type: string
          title: Message
      additionalProperties: false
      type: object
      required:
        - index
        - ok
        - code
        - message
      title: BulkItemError
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError

````