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

# Shop-key variant: the path binding is enforced by ShopAccessGuard.



## OpenAPI

````yaml /openapi.en.json post /api/v2/payment-methods/{shopId}
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: Production
  - url: http://localhost:3000
    description: Local
security: []
tags: []
paths:
  /api/v2/payment-methods/{shopId}:
    post:
      tags:
        - Payment Methods
      summary: 'Shop-key variant: the path binding is enforced by ShopAccessGuard.'
      operationId: PaymentMethodController_createPaymentMethodForShop
      parameters:
        - name: shopId
          required: true
          in: path
          schema:
            type: string
          description: Shop ID (ObjectId)
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreatePaymentMethodDto'
      responses:
        '201':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    example: true
                  data:
                    $ref: '#/components/schemas/PaymentMethod'
                  message:
                    type: string
        '400':
          description: Bad request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '404':
          description: Not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '429':
          description: Too many requests
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      security:
        - apiKeyAuth: []
        - bearerAuth: []
components:
  schemas:
    CreatePaymentMethodDto:
      type: object
      properties:
        name:
          type: string
          description: Provider name (e.g. imojeTransfer, zen)
          example: imojeTransfer
        displayName:
          type: string
          minLength: 1
          maxLength: 100
          description: Display name
          example: imoje
        shopId:
          type: string
          pattern: ^[0-9a-fA-F]{24}$
          description: Shop ID (ObjectId)
          example: 664f1a2b3c4d5e6f7a8b9c0d
        config:
          type: object
          description: Provider config (API keys, etc.)
          example:
            MERCHANT_ID: ...
            SERVICE_KEY: ...
            SANDBOXMODE: true
        fees:
          description: Fees
          allOf:
            - $ref: '#/components/schemas/FeesDto'
        channelFees:
          description: Per-channel fees
          type: array
          items:
            $ref: '#/components/schemas/ChannelFeeDto'
        channels:
          description: Payment channels
          type: array
          items:
            $ref: '#/components/schemas/ChannelDto'
        currencies:
          description: Supported currencies
          example:
            - PLN
          type: array
          items:
            type: string
        defaultCurrency:
          type: string
          pattern: ^[A-Za-z]{3}$
          description: Default currency
          example: PLN
        limits:
          description: Amount limits
          allOf:
            - $ref: '#/components/schemas/LimitsDto'
        commission:
          description: Operator commission
          allOf:
            - $ref: '#/components/schemas/CommissionDto'
        flags:
          description: Gateway flags
          allOf:
            - $ref: '#/components/schemas/FlagsDto'
        testMode:
          type: boolean
          description: Test mode
        assignToAllProducts:
          type: boolean
          description: Assign this method to all existing products at the standard price
          default: true
      required:
        - name
        - displayName
        - shopId
        - config
    PaymentMethod:
      type: object
      properties:
        _id:
          type: string
          example: 664f1a2b3c4d5e6f7a8b9c0d
        name:
          type: string
          example: imojeTransfer
        displayName:
          type: string
          example: imoje
        shopId:
          type: string
          example: 664f1a2b3c4d5e6f7a8b9c0d
        isActive:
          type: boolean
          example: true
        fees:
          type: object
          properties:
            percentage:
              type: number
              example: 1.9
            minimumFee:
              type: number
    ErrorResponse:
      type: object
      properties:
        success:
          type: boolean
          example: false
        statusCode:
          type: integer
          example: 400
        error:
          type: string
          example: Error message
        timestamp:
          type: string
          format: date-time
        path:
          type: string
          example: /api/v2/...
    FeesDto:
      type: object
      properties:
        percentage:
          type: number
          minimum: 0
          maximum: 100
          description: Percentage fee
          example: 1.9
        fixedAmount:
          type: number
          minimum: 0
          description: Fixed fee
          example: 0.3
        minimumFee:
          type: number
          minimum: 0
          description: Minimum fee
          example: 0.3
    ChannelFeeDto:
      type: object
      properties:
        channel:
          type: string
          description: Channel
          example: blik
        percentage:
          type: number
          minimum: 0
          maximum: 100
          description: Percentage fee
          example: 1.5
        minimumFee:
          type: number
          minimum: 0
          description: Minimum fee
          example: 0.2
      required:
        - channel
        - percentage
        - minimumFee
    ChannelDto:
      type: object
      properties:
        channel:
          type: string
          description: Channel
          example: blik
        displayName:
          type: string
          description: Display name
          example: BLIK
        icon:
          type: string
          description: Icon URL
        active:
          type: boolean
          description: Active
      required:
        - channel
        - displayName
    LimitsDto:
      type: object
      properties:
        minAmount:
          type: number
          minimum: 0
          description: Minimum amount
          example: 1
        maxAmount:
          type: number
          minimum: 0
          description: Maximum amount
          example: 9999
    CommissionDto:
      type: object
      properties:
        enabled:
          type: boolean
          description: Enable operator commission
        source:
          enum:
            - manual
            - auto
          type: string
          description: Commission source
        percentage:
          type: number
          minimum: 0
          maximum: 100
          description: Operator commission (%)
          example: 1.5
        amount:
          type: number
          minimum: 0
          description: Operator commission (amount)
          example: 0.5
        calculationType:
          enum:
            - first_percentage
            - first_amount
          type: string
          description: Commission calc order
        finalPriceCalculation:
          enum:
            - add
            - exclude_commission
          type: string
          description: Final price calc
    FlagsDto:
      type: object
      properties:
        logErrors:
          type: boolean
          description: Log payment errors
        disabled:
          type: boolean
          description: Disable gateway
        allowCurrencyConversion:
          type: boolean
          description: Allow currency conversion
        blockPromotions:
          type: boolean
          description: Block promotions
        blockPromoCodes:
          type: boolean
          description: Block promo codes
  securitySchemes:
    apiKeyAuth:
      type: apiKey
      in: header
      name: X-API-Key
    bearerAuth:
      scheme: bearer
      bearerFormat: JWT
      type: http

````