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

# Zrealizuj voucher



## OpenAPI

````yaml /openapi.pl.json post /api/v2/vouchers/redeem
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://api.itemshop.dev
    description: Produkcja
  - url: http://localhost:3000
    description: Lokalnie
security: []
tags: []
paths:
  /api/v2/vouchers/redeem:
    post:
      tags:
        - Vouchers
      summary: Zrealizuj voucher
      operationId: VoucherController_redeemVoucher
      parameters:
        - name: cf-turnstile-response
          in: header
          description: >-
            Cloudflare Turnstile token from the storefront widget (required in
            production)
          required: true
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/RedeemVoucherDto'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    example: true
                  data:
                    type: object
                  message:
                    type: string
        '400':
          description: Błędne dane wejściowe
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '404':
          description: Nie znaleziono
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '429':
          description: Przekroczony limit żądań
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
components:
  schemas:
    RedeemVoucherDto:
      type: object
      properties:
        code:
          type: string
          description: Kod vouchera
          example: ABC123
        shopId:
          type: string
          description: ID sklepu (ObjectId)
          example: 664f1a2b3c4d5e6f7a8b9c0d
        nickname:
          type: string
          description: Nick gracza
          example: Steve
      required:
        - code
        - shopId
        - nickname
    ErrorResponse:
      type: object
      properties:
        success:
          type: boolean
          example: false
        statusCode:
          type: integer
          example: 400
        error:
          type: string
          example: Komunikat błędu
        timestamp:
          type: string
          format: date-time
        path:
          type: string
          example: /api/v2/...

````