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

# Create a POS order

> Create an in-person point-of-sale order, marked paid with a payment record created automatically. Requires the WRITE_ORDERS scope.

Creates an in-person POS order with source `pos`, marked paid, computing totals as subtotal − discount + tax. The store is bound to your app token server-side — never send a shop id.


## OpenAPI

````yaml POST /orders/pos
openapi: 3.1.0
info:
  title: Salesive Apps API — Orders
  version: 1.0.0
  description: >-
    Read and manage the store's orders from an installed third-party app. Every
    endpoint authenticates with an installed-app access token (prefix `app_`)
    and requires a specific OAuth scope. The target store is bound to the token
    server-side from the installation — never send a shop id.
servers:
  - url: https://api.salesive.com/api/v1
    description: Production
security:
  - AppToken: []
paths:
  /orders/pos:
    post:
      tags:
        - Orders
      summary: Create a POS (in-person) order
      description: >-
        Creates an in-person point-of-sale order. A completed payment record is
        created automatically (channel derived from paymentMethod), the order is
        marked paid with source `pos`, and totals are computed as subtotal -
        discount + tax (floored at 0). Item prices use promoPrice when supplied,
        otherwise price. Requires the `WRITE_ORDERS` scope. The store is bound
        to the app token server-side from the installation — never send a shop
        id.
      operationId: createPosOrder
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - items
              properties:
                items:
                  type: array
                  description: Line items (at least one).
                  minItems: 1
                  items:
                    type: object
                    required:
                      - _id
                      - name
                      - price
                      - qty
                    additionalProperties: true
                    properties:
                      _id:
                        type: string
                        description: The product id.
                      name:
                        type: string
                      price:
                        type: number
                        minimum: 0
                        description: Unit list price.
                      qty:
                        type: integer
                        minimum: 1
                        description: Quantity ordered.
                      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
                  description: Order-level discount amount.
                tax:
                  type: number
                  minimum: 0
                  default: 0
                  description: Order-level tax amount.
                paymentMethod:
                  type: string
                  enum:
                    - cash
                    - card
                    - transfer
                    - other
                  default: cash
                  description: Payment method used at the point of sale.
                customerName:
                  type: string
                  description: Walk-in customer name (optional).
                customerEmail:
                  type: string
                  format: email
                  description: >-
                    Walk-in customer email (optional, validated as an email when
                    provided).
                customerPhone:
                  type: string
                  description: Walk-in customer phone (optional).
            example:
              items:
                - _id: 6699aabbccddeeff00112233
                  name: Wireless Earbuds
                  price: 24990
                  promoPrice: 19990
                  qty: 2
                  sku: WE-BLK-01
                  images:
                    - https://cdn.salesive.com/p/earbuds.jpg
              discount: 1000
              tax: 500
              paymentMethod: cash
              customerName: Walk-in Customer
              customerEmail: walkin@example.com
              customerPhone: '+2348012345678'
      responses:
        '201':
          description: The created POS order.
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/EnvelopeBase'
                  - type: object
                    properties:
                      data:
                        $ref: '#/components/schemas/PosOrder'
              example:
                status: 201
                success: true
                message: POS order created successfully
                data:
                  _id: 66b2010a1b2c3d4e5f60718a
                  orderId: 1043
                  user: 66a0c1d2e3f4a5b6c7d8e9f0
                  shop: 6680aabbccddeeff00112200
                  items:
                    - _id: 66b2010a1b2c3d4e5f60718b
                      product: 6699aabbccddeeff00112233
                      variant: null
                      name: Wireless Earbuds
                      sku: WE-BLK-01
                      price: 19990
                      quantity: 2
                      variantAttributes: {}
                      imageUrl: https://cdn.salesive.com/p/earbuds.jpg
                  subtotal: 39980
                  discount: 1000
                  tax: 500
                  shippingCost: 0
                  status: paid
                  source: pos
                  paymentMethod: cash
                  posCustomerName: Walk-in Customer
                  posCustomerEmail: walkin@example.com
                  posCustomerPhone: '+2348012345678'
                  payment: 66b2010a1b2c3d4e5f607180
                  total: 39480
                  createdAt: '2026-06-21T11:00:00.000Z'
                  updatedAt: '2026-06-21T11:00:00.000Z'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
components:
  schemas:
    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.
    PosOrder:
      type: object
      description: >-
        An order created through the POS endpoint. Item products and the payment
        are referenced by id.
      properties:
        _id:
          type: string
        orderId:
          type: integer
        user:
          type: string
          description: Acting user (staff/app) id.
        shop:
          type: string
          description: The store id (bound server-side).
        items:
          type: array
          items:
            $ref: '#/components/schemas/OrderItemSummary'
        subtotal:
          type: number
        discount:
          type: number
        tax:
          type: number
        shippingCost:
          type: number
        status:
          type: string
        source:
          type: string
        paymentMethod:
          type: string
        posCustomerName:
          type:
            - string
            - 'null'
        posCustomerEmail:
          type:
            - string
            - 'null'
        posCustomerPhone:
          type:
            - string
            - 'null'
        payment:
          type: string
          description: The created payment record id.
        total:
          type: number
        createdAt:
          type: string
          format: date-time
        updatedAt:
          type: string
          format: date-time
    OrderItemSummary:
      type: object
      description: A line item where the product is referenced by id.
      properties:
        _id:
          type: string
        product:
          type:
            - string
            - 'null'
          description: Product id.
        variant:
          type:
            - string
            - 'null'
          description: Variant id, if any.
        name:
          type: string
        sku:
          type: string
        price:
          type: number
          description: Charged unit price.
        quantity:
          type: integer
        variantAttributes:
          type: object
          additionalProperties: true
        imageUrl:
          type:
            - string
            - 'null'
    Envelope:
      allOf:
        - $ref: '#/components/schemas/EnvelopeBase'
        - type: object
          properties:
            data:
              description: Operation-specific payload (object, array, or null).
  responses:
    Unauthorized:
      description: Missing or invalid app access token.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Envelope'
          example:
            status: 401
            success: false
            message: Authentication required
            data: null
    Forbidden:
      description: The app token is missing the OAuth scope required for this operation.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Envelope'
          example:
            status: 403
            success: false
            message: Insufficient scope
            data: null
  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 — never send a shop
        id.

````