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

# Create Voucher

> Admin: create a new gift voucher.



## OpenAPI

````yaml https://api.vellaro.io/openapi.json post /api/v1/admin/vouchers
openapi: 3.1.0
info:
  title: Vellaro API
  description: Vellaro 2026 — E-commerce API
  version: 0.1.0
servers:
  - url: https://api.vellaro.io
    description: Produzione
security: []
tags: []
paths:
  /api/v1/admin/vouchers:
    post:
      tags:
        - admin:vouchers
      summary: Create Voucher
      description: 'Admin: create a new gift voucher.'
      operationId: create_voucher_api_v1_admin_vouchers_post
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/VoucherCreate'
      responses:
        '201':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiResponse_VoucherOut_'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - HTTPBearer: []
components:
  schemas:
    VoucherCreate:
      properties:
        order_id:
          anyOf:
            - type: string
              format: uuid
            - type: 'null'
          title: Order Id
        code:
          type: string
          title: Code
        from_name:
          type: string
          title: From Name
        from_email:
          type: string
          title: From Email
        to_name:
          type: string
          title: To Name
        to_email:
          type: string
          title: To Email
        voucher_theme_id:
          type: string
          format: uuid
          title: Voucher Theme Id
        message:
          anyOf:
            - type: string
            - type: 'null'
          title: Message
        amount:
          anyOf:
            - type: number
            - type: string
              pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$
          title: Amount
        is_active:
          type: boolean
          title: Is Active
          default: true
      type: object
      required:
        - code
        - from_name
        - from_email
        - to_name
        - to_email
        - voucher_theme_id
        - amount
      title: VoucherCreate
    ApiResponse_VoucherOut_:
      properties:
        data:
          anyOf:
            - $ref: '#/components/schemas/VoucherOut'
            - type: 'null'
        meta:
          anyOf:
            - $ref: '#/components/schemas/PaginationMeta'
            - type: 'null'
        error:
          anyOf:
            - type: string
            - type: 'null'
          title: Error
        error_code:
          anyOf:
            - type: string
            - type: 'null'
          title: Error Code
      type: object
      title: ApiResponse[VoucherOut]
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    VoucherOut:
      properties:
        id:
          type: string
          format: uuid
          title: Id
        order_id:
          anyOf:
            - type: string
              format: uuid
            - type: 'null'
          title: Order Id
        code:
          type: string
          title: Code
        from_name:
          type: string
          title: From Name
        from_email:
          type: string
          title: From Email
        to_name:
          type: string
          title: To Name
        to_email:
          type: string
          title: To Email
        voucher_theme_id:
          type: string
          format: uuid
          title: Voucher Theme Id
        message:
          anyOf:
            - type: string
            - type: 'null'
          title: Message
        amount:
          type: number
          title: Amount
        is_active:
          type: boolean
          title: Is Active
        created_at:
          type: string
          format: date-time
          title: Created At
        voucher_theme:
          anyOf:
            - $ref: '#/components/schemas/VoucherThemeOut'
            - type: 'null'
        amount_remaining:
          type: number
          title: Amount Remaining
          default: 0
      type: object
      required:
        - id
        - order_id
        - code
        - from_name
        - from_email
        - to_name
        - to_email
        - voucher_theme_id
        - message
        - amount
        - is_active
        - created_at
      title: VoucherOut
    PaginationMeta:
      properties:
        page:
          type: integer
          title: Page
        page_size:
          type: integer
          title: Page Size
        total:
          type: integer
          title: Total
        total_pages:
          type: integer
          title: Total Pages
      type: object
      required:
        - page
        - page_size
        - total
        - total_pages
      title: PaginationMeta
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
        input:
          title: Input
        ctx:
          type: object
          title: Context
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
    VoucherThemeOut:
      properties:
        id:
          type: string
          format: uuid
          title: Id
        name_i18n:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Name I18N
        image:
          type: string
          title: Image
      type: object
      required:
        - id
        - name_i18n
        - image
      title: VoucherThemeOut
  securitySchemes:
    HTTPBearer:
      type: http
      scheme: bearer

````