> ## 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.

# Latest Transaction

> Return the greatest non-null transaction_timestamp in the organization's namespace.

Ties select the greatest canonical UUID string id (both keys descending), independent
of updated_at. Empty/all-null data and unknown, foreign or unmatched stores return
{"item": null}. Works with either TRANSACTION_READS_ENABLED setting, without an export.

Stored DATETIME has no timezone: aware API inputs normalize to UTC before storage;
naive inputs retain their wall-clock values. Responses preserve stored values without
inventing an offset. Each call can scan historical partitions despite returning one row.

This maximum is not a lossless sync checkpoint. Late/backdated records, corrections
and equal timestamps require reconciliation or overlap with idempotent retries.



## OpenAPI

````yaml https://clientapi.retailgrid.io/openapi.json get /v1/transactions/latest
openapi: 3.1.0
info:
  title: Retailgrid Public API
  version: v1
servers: []
security: []
paths:
  /v1/transactions/latest:
    get:
      tags:
        - transactions
      summary: Latest Transaction
      description: >-
        Return the greatest non-null transaction_timestamp in the organization's
        namespace.


        Ties select the greatest canonical UUID string id (both keys
        descending), independent

        of updated_at. Empty/all-null data and unknown, foreign or unmatched
        stores return

        {"item": null}. Works with either TRANSACTION_READS_ENABLED setting,
        without an export.


        Stored DATETIME has no timezone: aware API inputs normalize to UTC
        before storage;

        naive inputs retain their wall-clock values. Responses preserve stored
        values without

        inventing an offset. Each call can scan historical partitions despite
        returning one row.


        This maximum is not a lossless sync checkpoint. Late/backdated records,
        corrections

        and equal timestamps require reconciliation or overlap with idempotent
        retries.
      operationId: latest_transaction_v1_transactions_latest_get
      parameters:
        - name: store_id
          in: query
          required: false
          schema:
            anyOf:
              - type: string
                format: uuid
              - type: 'null'
            description: Canonical organization store UUID; no aliases or names.
            title: Store Id
          description: Canonical organization store UUID; no aliases or names.
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/LatestTransactionResponse'
        '401':
          description: Missing, invalid or revoked API key.
        '403':
          description: Organization namespace unavailable or access denied.
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
        '429':
          description: Usage budget exceeded.
        '503':
          description: Usage enforcement unavailable.
      security:
        - APIKeyBearer: []
components:
  schemas:
    LatestTransactionResponse:
      properties:
        item:
          anyOf:
            - $ref: '#/components/schemas/TransactionResponse'
            - type: 'null'
          description: >-
            Latest transaction by stored business timestamp, or null when no
            dated transaction matches.
      additionalProperties: false
      type: object
      required:
        - item
      title: LatestTransactionResponse
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    TransactionResponse:
      properties:
        sku:
          anyOf:
            - type: string
            - type: 'null'
          title: Sku
        region:
          anyOf:
            - type: string
            - type: 'null'
          title: Region
        sales_value:
          anyOf:
            - type: string
              pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$
            - type: 'null'
          title: Sales Value
        gross_profit:
          anyOf:
            - type: string
              pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$
            - type: 'null'
          title: Gross Profit
        stock_after_sale:
          anyOf:
            - type: string
              pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$
            - type: 'null'
          title: Stock After Sale
        regular_price:
          anyOf:
            - 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: 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: string
              pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$
            - type: 'null'
          title: Unit Cost
        discount_rate:
          anyOf:
            - type: string
              pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$
            - type: 'null'
          title: Discount Rate
        currency:
          anyOf:
            - type: string
            - type: 'null'
          title: Currency
        tax_rate:
          anyOf:
            - type: string
              pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$
            - type: 'null'
          title: Tax Rate
        transaction_type:
          anyOf:
            - type: string
            - type: 'null'
          title: Transaction Type
        id:
          type: string
          format: uuid
          title: Id
        item_id:
          type: string
          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: string
              pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$
            - type: 'null'
          title: Quantity
        selling_price:
          anyOf:
            - type: string
              pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$
            - type: 'null'
          title: Selling Price
      additionalProperties: false
      type: object
      required:
        - id
        - item_id
      title: TransactionResponse
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
        input:
          title: Input
        ctx:
          type: object
          title: Context
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
  securitySchemes:
    APIKeyBearer:
      type: http
      scheme: bearer

````

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