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

# Mint a Payrix transaction session key

> Mints a short-lived Payrix transaction session key scoped to the given facility's merchant, for initialising PayFields.
Prefer this over the account-wide public key: the session is limited to a small number of requests and expires within minutes, so an intercepted key cannot be reused. Set it on `PayFields.config.txnSessionKey`.
Mint immediately before submitting the form rather than when it is rendered — the key expires faster than a shopper takes to enter a card — and mint a new one once the previous key is spent.



## OpenAPI

````yaml /openapi/shopping-openapi.json post /shopping/{portfolio}/v1/payment/payrix/txn-session/facility/{facilityUuid}
openapi: 3.0.0
info:
  title: Monument Shopping API
  description: Monument Shopping API
  version: '1.0'
  contact: {}
servers:
  - url: https://public-api.prd.monument.io
    description: Production
  - url: https://public-api.stg.monument.io
    description: Staging
security: []
tags:
  - name: Facilities
    description: Facility listing, details, and configuration
  - name: Leads
    description: Lead creation, updates, status, and pre-existing tenant validation
  - name: Shopping Cart
    description: Cart operations and access plans
  - name: Unit Groups
    description: Unit group details and taxes
  - name: Units
    description: Unit and gate access code retrieval
  - name: Payments
    description: Payment profiles and processor information
  - name: Brands
    description: Branding configuration and brand-scoped facilities
  - name: Coverages
    description: Coverage options and private coverage info
  - name: Leases
    description: Lease signing redirects
  - name: Organizations
    description: Portfolio organization information
  - name: Lead Marketing Sources
    description: Marketing source listing
  - name: Lead Sources
    description: Lead source listing
paths:
  /shopping/{portfolio}/v1/payment/payrix/txn-session/facility/{facilityUuid}:
    post:
      tags:
        - Payments
      summary: Mint a Payrix transaction session key
      description: >-
        Mints a short-lived Payrix transaction session key scoped to the given
        facility's merchant, for initialising PayFields.

        Prefer this over the account-wide public key: the session is limited to
        a small number of requests and expires within minutes, so an intercepted
        key cannot be reused. Set it on `PayFields.config.txnSessionKey`.

        Mint immediately before submitting the form rather than when it is
        rendered — the key expires faster than a shopper takes to enter a card —
        and mint a new one once the previous key is spent.
      operationId: PublicApiPaymentController_postPayrixTxnSession
      parameters:
        - name: facilityUuid
          required: true
          in: path
          schema:
            type: string
        - name: portfolio
          required: true
          in: path
          schema:
            type: string
        - in: header
          required: true
          name: x-api-key
          schema:
            example: monument-2230012-2312321
            description: >-
              Api key required to authenticate your request. Please reach out to
              monument for a key.
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PostPayrixTxnSessionDto'
        '201':
          description: A newly minted transaction session key and the PayFields script URL.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PostPayrixTxnSessionDto'
        '404':
          description: No merchant account is configured for the facility
components:
  schemas:
    PostPayrixTxnSessionDto:
      type: object
      properties:
        txnSessionKey:
          type: string
          description: >-
            Short-lived Payrix transaction session key, scoped to the facility’s
            merchant. Set it on `PayFields.config.txnSessionKey`.
        payfieldsUrl:
          type: string
      required:
        - txnSessionKey
        - payfieldsUrl

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.