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

# Create a chat payment session

> Create a chat/web payment session.

Call this from your **server** with your secret API key. Hand the returned
`session_id` to your frontend and mount the widget:
`Maven.createPayment({ sessionId }).mount("#slot")`.

Theme, labels, and fields are set once per project in the dashboard
(Chat Payments tab → Customize) and applied automatically.



## OpenAPI

````yaml /openapi.json post /v1/widget-sessions
openapi: 3.1.0
info:
  title: Maven API
  description: >-
    Voice payment infrastructure — collect credit card payments securely over
    phone calls.
  version: 1.0.0
servers: []
security: []
paths:
  /v1/widget-sessions:
    post:
      tags:
        - Widget Sessions
      summary: Create a chat payment session
      description: >-
        Create a chat/web payment session.


        Call this from your **server** with your secret API key. Hand the
        returned

        `session_id` to your frontend and mount the widget:

        `Maven.createPayment({ sessionId }).mount("#slot")`.


        Theme, labels, and fields are set once per project in the dashboard

        (Chat Payments tab → Customize) and applied automatically.
      operationId: create_widget_session_v1_widget_sessions_post
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateWidgetSession'
        required: true
      responses:
        '201':
          description: Successful Response
          content:
            application/json:
              schema: {}
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - API Key: []
components:
  schemas:
    CreateWidgetSession:
      properties:
        project:
          type: string
          title: Project
          description: Project UUID or slug
        amount_cents:
          type: integer
          minimum: 0
          title: Amount Cents
          description: Charge amount in cents. For mode='tokenize' may be 0.
        gateway:
          type: string
          title: Gateway
          description: stripe | authorizenet | braintree | shift4
        mode:
          type: string
          pattern: ^(charge|tokenize)$
          title: Mode
          default: charge
        description:
          anyOf:
            - type: string
            - type: 'null'
          title: Description
      type: object
      required:
        - project
        - amount_cents
        - gateway
      title: CreateWidgetSession
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
  securitySchemes:
    API Key:
      type: http
      description: 'Enter your API key: mvn_test_xxx or mvn_live_xxx'
      scheme: bearer

````