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

# Ring up an in-person sale

> Create a POS sale, marked paid, with a completed payment record. Requires the WRITE_POS scope.

Creates the same record the dashboard's POS produces: source `pos`, status `paid`, stock reduced for tracked items, and a completed payment attached. An app that already holds `WRITE_ORDERS` may use `POST /orders/pos` instead.


## OpenAPI

````yaml apps-api/specs/pos.json POST /pos/sales
openapi: 3.1.0
info:
  title: 'Salesive Apps API: Point of Sale'
  version: 1.0.0
  description: >-
    Ring up in-person sales and reconcile them from an installed third-party
    app. Every endpoint authenticates with an installed-app access token (prefix
    `app_`) and requires `READ_POS` or `WRITE_POS`. The target store is bound to
    the token server-side from the installation, so never send a shop id.
servers:
  - url: https://api.salesive.com/api/v1
    description: Production
security:
  - AppToken: []
tags:
  - name: Point of sale
    description: In-person sales, their receipts and daily totals.
paths:
  /pos/sales:
    post:
      tags:
        - Point of sale
      summary: Ring up an in-person sale
      description: >-
        Creates a POS sale. A completed payment record is created automatically
        (channel derived from paymentMethod), the sale is marked paid with
        source `pos`, and totals are subtotal - discount + tax (floored at 0).
        Item prices use promoPrice when supplied, otherwise price. Stock is
        reduced for tracked products. Requires `WRITE_POS`. An app that already
        holds `WRITE_ORDERS` can use POST /orders/pos instead; this route is the
        POS-only path.
      operationId: createPosSale
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - items
              properties:
                items:
                  type: array
                  description: >-
                    Line items (at least one). Each id must resolve to a
                    product, food or service in this store.
                  minItems: 1
                  items:
                    type: object
                    required:
                      - _id
                      - name
                      - price
                      - qty
                    additionalProperties: true
                    properties:
                      _id:
                        type: string
                        description: The catalog item id.
                      name:
                        type: string
                      price:
                        type: number
                        minimum: 0
                        description: Unit list price.
                      qty:
                        type: integer
                        minimum: 1
                      promoPrice:
                        type: number
                        minimum: 0
                        description: Used as the charged price when present.
                      sku:
                        type: string
                      images:
                        type: array
                        items:
                          type: string
                discount:
                  type: number
                  minimum: 0
                  default: 0
                tax:
                  type: number
                  minimum: 0
                  default: 0
                paymentMethod:
                  type: string
                  enum:
                    - cash
                    - card
                    - transfer
                    - other
                  default: cash
                customerName:
                  type: string
                customerEmail:
                  type: string
                  format: email
                customerPhone:
                  type: string
                additionalInfo:
                  type: array
                  maxItems: 50
                  items:
                    $ref: '#/components/schemas/AdditionalInfoItem'
            example:
              items:
                - _id: 6699aabbccddeeff00112233
                  name: Jollof rice
                  price: 2500
                  qty: 2
              discount: 0
              tax: 375
              paymentMethod: cash
              customerName: Walk-in
      responses:
        '201':
          description: The created sale.
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/EnvelopeBase'
                  - type: object
                    properties:
                      data:
                        $ref: '#/components/schemas/PosSale'
        '403':
          description: The app is missing `WRITE_POS`.
components:
  schemas:
    AdditionalInfoItem:
      type: object
      required:
        - label
        - value
      properties:
        label:
          type: string
        value:
          type: string
    EnvelopeBase:
      type: object
      description: >-
        Standard Salesive response envelope. The operation-specific payload is
        carried in `data`.
      required:
        - status
        - success
        - message
      properties:
        status:
          type: integer
          description: HTTP status code, echoed in the body.
        success:
          type: boolean
          description: Whether the request succeeded.
        message:
          type: string
          description: Human-readable result message.
    PosSale:
      type: object
      description: >-
        An in-person sale. It is the same order record the dashboard's POS
        creates: source `pos`, status `paid`, stock reduced and a completed
        payment attached.
      properties:
        _id:
          type: string
        orderId:
          type: integer
          description: The store-facing order number.
        shop:
          type: string
        user:
          type: string
        items:
          type: array
          items:
            type: object
            properties:
              _id:
                type: string
              name:
                type: string
              price:
                type: number
              quantity:
                type: integer
              sku:
                type:
                  - string
                  - 'null'
              imageUrl:
                type:
                  - string
                  - 'null'
              itemType:
                type: string
                enum:
                  - product
                  - food
                  - service
        subtotal:
          type: number
        discount:
          type: number
        tax:
          type: number
        shippingCost:
          type: number
        status:
          type: string
          enum:
            - pending
            - processing
            - paid
            - cancelled
            - refunded
        source:
          type: string
          enum:
            - online
            - pos
        paymentMethod:
          type: string
          enum:
            - cash
            - card
            - transfer
            - other
        posCustomerName:
          type:
            - string
            - 'null'
        posCustomerEmail:
          type:
            - string
            - 'null'
        posCustomerPhone:
          type:
            - string
            - 'null'
        additionalInfo:
          type: array
          items:
            $ref: '#/components/schemas/AdditionalInfoItem'
        payment:
          $ref: '#/components/schemas/PaymentSummary'
        createdAt:
          type: string
          format: date-time
        updatedAt:
          type: string
          format: date-time
    PaymentSummary:
      type: object
      description: The completed payment created with the sale.
      properties:
        _id:
          type: string
        status:
          type: string
        amount:
          type: number
        total:
          type: number
        channel:
          type: string
        provider:
          type: string
  securitySchemes:
    AppToken:
      type: http
      scheme: bearer
      description: >-
        Installed-app access token (prefix app_), issued by the OAuth install
        flow. The store is bound to the token server-side, so never send a shop
        id.

````

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