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

# Pobierz zakupiony plik (podpisany link)

> Link z `GET …/delivery` albo z e-maila. Każde wywołanie zużywa jedno pobranie; po terminie lub limicie — 410. Zawsze `Content-Disposition: attachment`.



## OpenAPI

````yaml /openapi.pl.json get /api/v2/storefront/v1/downloads/{token}
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/downloads/{token}:
    get:
      tags:
        - Storefront v1
      summary: Pobierz zakupiony plik (podpisany link)
      description: >-
        Link z `GET …/delivery` albo z e-maila. Każde wywołanie zużywa jedno
        pobranie; po terminie lub limicie — 410. Zawsze `Content-Disposition:
        attachment`.
      operationId: downloadFile
      parameters:
        - name: token
          required: true
          in: path
          description: Podpisany token z linku
          schema:
            type: string
      responses:
        '200':
          description: Plik
          content:
            application/octet-stream:
              schema:
                type: string
                format: binary
        '403':
          description: Pochodzenie (Origin) spoza domen sklepu (`ORIGIN_NOT_ALLOWED`)
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/StorefrontErrorDto'
        '404':
          description: '`DOWNLOAD_NOT_FOUND`'
          content:
            application/octet-stream:
              schema:
                $ref: '#/components/schemas/StorefrontErrorDto'
        '410':
          description: >-
            `DOWNLOAD_EXPIRED`, `DOWNLOAD_LIMIT_REACHED`,
            `DOWNLOAD_UNAVAILABLE`, `DELIVERY_REVOKED`
          content:
            application/octet-stream:
              schema:
                $ref: '#/components/schemas/StorefrontErrorDto'
        '429':
          description: Przekroczony limit żądań (`RATE_LIMITED`)
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/StorefrontErrorDto'
components:
  schemas:
    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

````

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