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

# Upsert Daily Sales

> Upserts daily sales data by location and date.



## OpenAPI

````yaml https://console.lomaplatform.com/api/org/v1/openapi put /api/org/v1/sales/daily
openapi: 3.1.0
info:
  title: LOMA Organization API
  version: 2.78.1
  description: >-
    API for managing organizational data on LOMA.

    ### Authentication


    Your API Key should be passed in the `API-Key` header formatted as
    `KEY_ID:KEY_SECRET`.


    Organization admins can create API keys in the LOMA console.
  contact:
    email: support@lomaplatform.com
servers:
  - url: https://console.lomaplatform.com
security: []
paths:
  /api/org/v1/sales/daily:
    put:
      tags:
        - Sales
      summary: Upsert Daily Sales
      description: Upserts daily sales data by location and date.
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                date:
                  type: string
                locations:
                  type: object
                  propertyNames:
                    type: string
                    description: location_id
                  additionalProperties:
                    type: object
                    properties:
                      net_sales:
                        type: number
                        minimum: 0
                      transaction_count:
                        type: number
                        minimum: 0
                    required:
                      - net_sales
                      - transaction_count
              required:
                - date
                - locations
              example:
                date: '2024-06-14'
                locations:
                  loc_jsnFcOej5oD:
                    net_sales: 1201
                    transaction_count: 12
                  loc_PP4ZcUxYG2g:
                    net_sales: 3291
                    transaction_count: 32
      responses:
        '204':
          description: Data upserted successfully.
        '400':
          description: 400 Bad Request
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: object
                    properties:
                      status:
                        type: number
                      message:
                        type: string
                      hint:
                        type: string
                    required:
                      - status
                      - message
                required:
                  - error
                example:
                  error:
                    status: 400
                    message: Invalid date.
                    hint: Date cannot be in the future.
        '401':
          description: 401 Unauthorized
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: object
                    properties:
                      status:
                        type: number
                      message:
                        type: string
                    required:
                      - status
                      - message
                required:
                  - error
                example:
                  error:
                    status: 401
                    message: Invalid API Key
      security:
        - apiKeyHeader: []
components:
  securitySchemes:
    apiKeyHeader:
      type: apiKey
      in: header
      name: API-Key
      description: API Key for the organization

````