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

# Create a new voucher group

> This endpoint allows you to create a voucher group

A Voucher Group unites several Vouchers



## OpenAPI

````yaml /openapi/integration-api-v2/openapi.yaml post /v2/voucher-groups
openapi: 3.0.0
info:
  title: Spirii API
  description: Spirii API
  version: 2.10.0
  contact: {}
servers:
  - url: https://api.spirii.com
security: []
tags: []
paths:
  /v2/voucher-groups:
    post:
      tags:
        - VoucherGroups
      summary: Create a new voucher group
      description: |-
        This endpoint allows you to create a voucher group

        A Voucher Group unites several Vouchers
      operationId: createVoucherGroup
      parameters: []
      requestBody:
        required: true
        description: The voucher group to be created.
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateVoucherGroupDto'
      responses:
        '201':
          description: The voucher group has been successfully created.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/VoucherGroupResponseDto'
components:
  schemas:
    CreateVoucherGroupDto:
      type: object
      properties:
        name:
          type: string
          maxLength: 30
          description: The voucher group name.
          example: Premium Voucher Group
        notes:
          type: string
          maxLength: 30
          description: Optional comment about the voucher.
          example: This is a comment.
        pricing:
          oneOf:
            - $ref: '#/components/schemas/VoucherTariffPricing'
            - $ref: '#/components/schemas/VoucherFixedPricing'
            - $ref: '#/components/schemas/VoucherDynamicPricing'
            - $ref: '#/components/schemas/VoucherFleetPricing'
          description: >-
            With a voucher applied, the drivers charges at a lowered price
            overwriting the standard tariff on the location.
          example:
            type: tariff
            tariffId: 2606f342-2c3e-4f7b-9034-dbaac5e62c82
          allOf:
            - $ref: '#/components/schemas/VoucherGroupPricing'
        customerId:
          type: number
          description: Customer the voucher group will be created for.
          example: 2001
      required:
        - name
        - pricing
        - customerId
    VoucherGroupResponseDto:
      type: object
      properties:
        id:
          type: number
          description: Unique identifier for the voucher group.
          example: 1
        name:
          type: string
          maxLength: 30
          description: The voucher group name.
          example: Premium Voucher Group
        customerId:
          type: number
          nullable: true
          description: The CRM customer ID the voucher group belongs to.
        notes:
          type: string
          maxLength: 30
          description: Optional comment about the voucher.
          example: This is a comment.
        pricing:
          oneOf:
            - $ref: '#/components/schemas/VoucherTariffPricing'
            - $ref: '#/components/schemas/VoucherFixedPricing'
            - $ref: '#/components/schemas/VoucherDynamicPricing'
            - $ref: '#/components/schemas/VoucherFleetPricing'
          description: >-
            With a voucher applied, the drivers charges at a lowered price
            overwriting the standard tariff on the location.
          example:
            type: tariff
            tariffId: 2606f342-2c3e-4f7b-9034-dbaac5e62c82
          allOf:
            - $ref: '#/components/schemas/VoucherGroupPricing'
        createdAt:
          format: date-time
          type: string
          description: The date and time when the voucher group was created.
          example: '2025-06-03T12:00:00.000Z'
        updatedAt:
          format: date-time
          type: string
          description: The date and time when the voucher group was last updated.
          example: '2025-06-03T12:00:00.000Z'
        deletedAt:
          format: date-time
          type: string
          nullable: true
      required:
        - id
        - name
        - pricing
        - createdAt
        - updatedAt
    VoucherTariffPricing:
      type: object
      properties:
        type:
          enum:
            - fixed
            - fleet
            - tariff
            - dynamic
          type: string
          description: The identifier type of the voucher group.
        tariffId:
          type: string
          format: uuid
          description: >-
            Unique identifier of the tariff. It does not apply to Spirii Legacy
            Tariffs.
          example: 2606f342-2c3e-4f7b-9034-dbaac5e62c82
          nullable: true
      description: >-
        Unique identifier of the tariff. It does not apply to Spirii Legacy
        Tariffs.
      required:
        - type
    VoucherFixedPricing:
      type: object
      properties:
        type:
          enum:
            - fixed
            - fleet
            - tariff
            - dynamic
          type: string
          description: Fixed price per KWh. Deprecated, use tariff type instead.
        perKwh:
          type: number
          maximum: 9999.99
          description: Price per kWh including VAT.
          example: 0.05
          default: 0.05
          format: float
          minimum: 0
        currency:
          type: string
          minLength: 3
          maxLength: 3
          description: >-
            The currency code defines the currency of the invoices. Must be in
            ISO-4217 format.
          example: EUR
      description: Fixed price per KWh. Deprecated, use tariff type instead.
      required:
        - type
        - perKwh
        - currency
    VoucherDynamicPricing:
      type: object
      properties:
        type:
          enum:
            - fixed
            - fleet
            - tariff
            - dynamic
          type: string
          description: Dynamic price. Deprecated, use tariff type instead.
        perKwhMinimum:
          type: number
          maximum: 99.99
          description: >-
            The minimum price per kWh a customer will be charged, regardless of
            the spot price. This will also be used as a fallback price in case
            spot price data is missing. NOTE: This will be the total end-user
            price incl.VAT. Beware that markup will not be added to this.
          example: 0.05
          default: 0.05
          format: float
          minimum: 0
        spotPriceMarkup:
          nullable: true
          description: >-
            Define markup to add on top of the spot price. The spot price is the
            raw market electricity price excluding transport fees, taxes etc.
            The spot price for the next 24 hours is displayed on the right if
            country is selected. You can choose none, one or both.
          allOf:
            - $ref: '#/components/schemas/SpotPriceMarkup'
        currency:
          type: string
          minLength: 3
          maxLength: 3
          description: >-
            The currency code defines the currency of the invoices. Must be in
            ISO-4217 format.
          example: EUR
      description: Dynamic price. Deprecated, use tariff type instead.
      required:
        - type
        - perKwhMinimum
        - spotPriceMarkup
        - currency
    VoucherFleetPricing:
      type: object
      properties:
        type:
          enum:
            - fixed
            - fleet
            - tariff
            - dynamic
          type: string
          description: >-
            When set, it makes sessions free for those who use this voucher.
            Used to expense fleet sessions.
      description: Fleet pricing makes sessions free for those who use this voucher.
      required:
        - type
    VoucherGroupPricing:
      type: object
      properties:
        type:
          enum:
            - fixed
            - fleet
            - tariff
            - dynamic
          type: string
          description: The identifier type of the voucher group.
      required:
        - type
    SpotPriceMarkup:
      type: object
      properties:
        markUpPct:
          type: number
          nullable: true
          maximum: 99.99
          description: >-
            Percentage will be applied to the spot price. Eg used to secure a
            revenue.
          example: 0.3
          format: percentage
          minimum: 0
        markUpFixed:
          type: number
          nullable: true
          maximum: 99.99
          description: >-
            Fixed amount applied after markup percentage. Eg used to control
            your costs.
          example: 20
          format: float
          minimum: 0
      required:
        - markUpPct
        - markUpFixed

````