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

# Status zamówienia po numerze i kluczu

> Numer zamówienia (albo grupy płatności) i jego klucz statusu — oba z odpowiedzi kasy albo z adresu powrotu z bramki (`itemshop_order`, `itemshop_key`). Zły klucz = 404 jak nieistniejące zamówienie. Dla grupy `status` jest zbiorczy, a `items[]` niesie stan każdej pozycji.



## OpenAPI

````yaml /openapi.pl.json get /api/v2/storefront/v1/orders/by-number/{orderNumber}/status
openapi: 3.0.0
info:
  title: ItemShop v2 API
  description: >-
    REST API platformy ItemShop v2 (NestJS + Fastify). Wszystkie ścieżki mają
    prefiks /api/v2.
  version: 2.0.0
  contact: {}
servers:
  - url: https://itemshop.dev
    description: Produkcja (API pod /api/v2, ten sam origin co panel)
  - url: http://localhost:3000
    description: Lokalnie
security: []
tags: []
paths:
  /api/v2/storefront/v1/orders/by-number/{orderNumber}/status:
    get:
      tags:
        - Storefront v1
      summary: Status zamówienia po numerze i kluczu
      description: >-
        Numer zamówienia (albo grupy płatności) i jego klucz statusu — oba z
        odpowiedzi kasy albo z adresu powrotu z bramki (`itemshop_order`,
        `itemshop_key`). Zły klucz = 404 jak nieistniejące zamówienie. Dla grupy
        `status` jest zbiorczy, a `items[]` niesie stan każdej pozycji.
      operationId: getOrderStatusByNumber
      parameters:
        - name: orderNumber
          required: true
          in: path
          description: Numer zamówienia albo grupy
          schema:
            example: 8K2M4N6P9QRSTVWX1Y3Z
            type: string
        - name: key
          required: true
          in: query
          description: Klucz statusu (`statusKey`)
          schema:
            example: k3m9x2p7qa
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/StorefrontOrderStatusResponseDto'
        '403':
          description: Pochodzenie (Origin) spoza domen sklepu (`ORIGIN_NOT_ALLOWED`)
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/StorefrontErrorDto'
        '404':
          description: >-
            Sklep/zasób nie istnieje albo sklep jest zablokowany
            (`SHOP_NOT_FOUND`, `PRODUCT_NOT_FOUND`, `ORDER_NOT_FOUND`)
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/StorefrontErrorDto'
        '429':
          description: Przekroczony limit żądań (`RATE_LIMITED`)
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/StorefrontErrorDto'
components:
  schemas:
    StorefrontOrderStatusResponseDto:
      type: object
      properties:
        success:
          type: boolean
          example: true
        data:
          $ref: '#/components/schemas/StorefrontOrderStatusDto'
      required:
        - success
        - data
    StorefrontErrorDto:
      type: object
      properties:
        success:
          type: boolean
          example: false
        statusCode:
          type: number
          example: 404
        code:
          enum:
            - VALIDATION_FAILED
            - BAD_REQUEST
            - NOT_FOUND
            - SHOP_NOT_FOUND
            - PRODUCT_NOT_FOUND
            - ORDER_NOT_FOUND
            - PRODUCT_UNAVAILABLE
            - PRODUCT_VARIANT_REQUIRED
            - INVALID_PRODUCT_VARIANT
            - INVALID_QUANTITY
            - OUT_OF_STOCK
            - CART_EMPTY
            - NICK_REQUIRED
            - EMAIL_REQUIRED
            - CART_TOO_LARGE
            - DISCOUNT_INVALID
            - LEGAL_CONSENT_REQUIRED
            - LEGAL_DOCUMENTS_CHANGED
            - SHOP_PAYMENT_NOT_READY
            - PAYMENT_INIT_FAILED
            - ORDER_BLOCKED
            - RETURN_URL_NOT_ALLOWED
            - VOUCHER_NOT_FOUND
            - VOUCHER_USED
            - VOUCHER_EXPIRED
            - IDEMPOTENCY_KEY_REQUIRED
            - IDEMPOTENCY_KEY_REUSED
            - CHECKOUT_ATTEMPT_CLOSED
            - CHECKOUT_IN_PROGRESS
            - CAPTCHA_REQUIRED
            - ORIGIN_NOT_ALLOWED
            - FORBIDDEN
            - UNAUTHORIZED
            - PAYLOAD_TOO_LARGE
            - CONFLICT
            - RATE_LIMITED
            - SERVICE_UNAVAILABLE
            - INTERNAL_ERROR
          type: string
          description: Maszynowy kod błędu — tłumacz po nim komunikat w UI
          example: SHOP_NOT_FOUND
        message:
          type: string
          description: >-
            Komunikat dla dewelopera (język nieustalony, nie pokazuj go
            kupującemu)
          example: Shop not found
        error:
          type: string
          description: To samo co `message` (zgodność z resztą API)
          example: Shop not found
          deprecated: true
        details:
          type: object
          description: Szczegóły walidacji
        timestamp:
          type: string
          format: date-time
          example: '2026-10-27T12:00:00.000Z'
        path:
          type: string
          example: /api/v2/storefront/v1/shops/moj-sklep
      required:
        - success
        - statusCode
        - code
        - message
        - error
        - timestamp
        - path
    StorefrontOrderStatusDto:
      type: object
      properties:
        orderId:
          type: string
          description: ID zamówienia albo grupy płatności
          example: 664f1a2b3c4d5e6f7a8b9c0d
        orderNumber:
          type: string
          example: A1B2C3D4
        shopId:
          type: string
          example: 664f1a2b3c4d5e6f7a8b9c0d
        status:
          type: string
          enum:
            - pending
            - paid
            - processing
            - completed
            - cancelled
            - failed
            - dispute
            - refunded
            - partially_refunded
          description: Dla grupy — stan zbiorczy pozycji (szczegóły w `items[]`)
          example: paid
        productName:
          type: string
          nullable: true
          description: 'Dla grupy: pozycje po przecinku'
          example: Ranga VIP
        serverName:
          type: string
          nullable: true
          example: Survival
        nick:
          type: string
          nullable: true
          description: Nick gracza, a w sklepie `general` zamaskowany e-mail
          example: Steve
        amount:
          type: number
          nullable: true
          example: 19.99
        currency:
          type: string
          example: PLN
        createdAt:
          type: string
          format: date-time
          example: '2026-10-27T12:00:00.000Z'
        groupId:
          type: string
          nullable: true
          description: Grupa płatności, do której należy zamówienie
          example: null
        items:
          description: Pozycje (jedna dla zwykłego zamówienia)
          type: array
          items:
            $ref: '#/components/schemas/StorefrontOrderItemStatusDto'
        delivery:
          nullable: true
          description: >-
            Zbiorcza flaga dostawy cyfrowej (null = brak treści cyfrowej).
            `ready` = któraś pozycja jest do odebrania
          type: object
          allOf:
            - $ref: '#/components/schemas/StorefrontDeliveryFlagDto'
      required:
        - orderId
        - orderNumber
        - shopId
        - status
        - productName
        - serverName
        - nick
        - amount
        - currency
        - createdAt
        - groupId
        - items
        - delivery
    StorefrontOrderItemStatusDto:
      type: object
      properties:
        orderId:
          type: string
          example: 664f1a2b3c4d5e6f7a8b9c0d
        orderNumber:
          type: string
          example: A1B2C3D4
        status:
          type: string
          enum:
            - pending
            - paid
            - processing
            - completed
            - cancelled
            - failed
            - dispute
            - refunded
          example: paid
        productName:
          type: string
          nullable: true
          example: Ranga VIP
        variant:
          type: string
          nullable: true
          example: 30 dni
        quantity:
          type: number
          example: 1
        serverName:
          type: string
          nullable: true
          example: Survival
        amount:
          type: number
          nullable: true
          example: 19.99
        delivery:
          nullable: true
          description: Dostawa cyfrowa pozycji; null = w grze
          type: object
          allOf:
            - $ref: '#/components/schemas/StorefrontDeliveryFlagDto'
      required:
        - orderId
        - orderNumber
        - status
        - productName
        - variant
        - quantity
        - serverName
        - amount
        - delivery
    StorefrontDeliveryFlagDto:
      type: object
      properties:
        kind:
          type: string
          enum:
            - license_keys
            - download
            - text
            - mixed
          description: '`mixed` tylko w fladze zbiorczej grupy'
          example: license_keys
        state:
          type: string
          enum:
            - pending
            - awaiting_stock
            - delivered
            - revoked
          description: >-
            `pending` — czeka na płatność/wydanie; `awaiting_stock` — opłacone,
            sprzedawca uzupełnia treść („oczekuje na dostawę”); `delivered`;
            `revoked` — zwrot/spór
          example: delivered
        ready:
          type: boolean
          description: Treść można odebrać (`GET …/delivery`)
          example: true
      required:
        - kind
        - state
        - ready

````

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