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

# Collect digital content (keys, file, message)

> Same number and key as the status. Only paid lines with digital delivery (`items[].delivery` in the status); for a group — every such line. Paid but not yet issued content is issued on this call. An empty key pool = `state: awaiting_stock` and `pendingUnits` > 0 (the seller is notified, keys follow by e-mail). `text` is plain text — render it without HTML. The download link counts every open.



## OpenAPI

````yaml /openapi.en.json get /api/v2/storefront/v1/orders/by-number/{orderNumber}/delivery
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: Production (API under /api/v2, same origin as the panel)
  - url: http://localhost:3000
    description: Local
security: []
tags: []
paths:
  /api/v2/storefront/v1/orders/by-number/{orderNumber}/delivery:
    get:
      tags:
        - Storefront v1
      summary: Collect digital content (keys, file, message)
      description: >-
        Same number and key as the status. Only paid lines with digital delivery
        (`items[].delivery` in the status); for a group — every such line. Paid
        but not yet issued content is issued on this call. An empty key pool =
        `state: awaiting_stock` and `pendingUnits` > 0 (the seller is notified,
        keys follow by e-mail). `text` is plain text — render it without HTML.
        The download link counts every open.
      operationId: getOrderDelivery
      parameters:
        - name: orderNumber
          required: true
          in: path
          description: Order or group number
          schema:
            example: 8K2M4N6P9QRSTVWX1Y3Z
            type: string
        - name: key
          required: true
          in: query
          description: Status key (`statusKey`)
          schema:
            example: k3m9x2p7qa
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/StorefrontDeliveryResponseDto'
        '403':
          description: Origin outside the shop domains (`ORIGIN_NOT_ALLOWED`)
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/StorefrontErrorDto'
        '404':
          description: '`ORDER_NOT_FOUND` (also a wrong key), `NO_DIGITAL_DELIVERY`'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/StorefrontErrorDto'
        '409':
          description: '`ORDER_NOT_PAID`'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/StorefrontErrorDto'
        '410':
          description: '`DELIVERY_REVOKED` — refund or dispute (chargeback)'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/StorefrontErrorDto'
        '429':
          description: Rate limit exceeded (`RATE_LIMITED`)
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/StorefrontErrorDto'
components:
  schemas:
    StorefrontDeliveryResponseDto:
      type: object
      properties:
        success:
          type: boolean
          example: true
        data:
          $ref: '#/components/schemas/StorefrontDeliveryDto'
      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: Machine-readable error code — translate UI messages by this
          example: SHOP_NOT_FOUND
        message:
          type: string
          description: >-
            Developer message (language not guaranteed; do not show it to
            buyers)
          example: Shop not found
        error:
          type: string
          description: Same as `message` (compatibility with the rest of the API)
          example: Shop not found
          deprecated: true
        details:
          type: object
          description: Validation details
        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
    StorefrontDeliveryDto:
      type: object
      properties:
        orderNumber:
          type: string
          description: Order or group number
          example: A1B2C3D4
        items:
          description: Paid lines with digital content
          type: array
          items:
            $ref: '#/components/schemas/StorefrontDeliveryItemDto'
      required:
        - orderNumber
        - items
    StorefrontDeliveryItemDto:
      type: object
      properties:
        orderId:
          type: string
          example: 664f1a2b3c4d5e6f7a8b9c0d
        orderNumber:
          type: string
          example: A1B2C3D4
        productName:
          type: string
          example: Licencja Pro
        variant:
          type: string
          nullable: true
          example: null
        quantity:
          type: number
          example: 1
        kind:
          type: string
          enum:
            - license_keys
            - download
            - text
          example: license_keys
        state:
          type: string
          enum:
            - pending
            - awaiting_stock
            - delivered
            - revoked
          example: delivered
        keys:
          description: License keys
          example:
            - AAAA-BBBB-CCCC-DDDD
          type: array
          items:
            type: string
        pendingUnits:
          type: number
          description: Units waiting for the pool to be restocked
          example: 0
        text:
          type: string
          nullable: true
          description: Seller message (plain text — render as text, not HTML)
          example: 'Dziękujemy! Zaproszenie: https://discord.gg/…'
        download:
          nullable: true
          type: object
          allOf:
            - $ref: '#/components/schemas/StorefrontDownloadDto'
        deliveredAt:
          type: string
          nullable: true
          format: date-time
          example: '2026-10-27T12:00:00.000Z'
      required:
        - orderId
        - orderNumber
        - productName
        - variant
        - quantity
        - kind
        - state
        - keys
        - pendingUnits
        - text
        - download
        - deliveredAt
    StorefrontDownloadDto:
      type: object
      properties:
        url:
          type: string
          nullable: true
          description: >-
            Counted link (every open uses one download). null once
            expired/exhausted
          example: >-
            https://api.itemshop.pl/api/v2/storefront/v1/downloads/664f1a2b3c4d5e6f7a8b9c0d.Xy…
        fileName:
          type: string
          example: plugin-1.4.2.zip
        size:
          type: number
          nullable: true
          example: null
        expiresAt:
          type: string
          nullable: true
          format: date-time
          example: '2026-10-30T12:00:00.000Z'
        maxDownloads:
          type: number
          example: 5
        remaining:
          type: number
          example: 4
        expired:
          type: boolean
          example: false
      required:
        - url
        - fileName
        - size
        - expiresAt
        - maxDownloads
        - remaining
        - expired

````

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