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

# Create a Session

> Create a Realtime Collections session to obtain the session key required to create payment links.



## OpenAPI

````yaml products/realtime-collections/api-reference/payment-links.json POST /v1/payment-links/sessions
openapi: 3.1.0
info:
  title: Realtime Collections API
  description: >-
    Partner API for Meridian Realtime Collections: operator sessions, and
    creating, updating, and retrieving payment links used to collect funds from
    customers.
  version: 1.0.0
servers:
  - url: https://us-merchant.sandbox.api-us.meridianapps.dev
    description: Sandbox
  - url: https://us-merchant.api-us.payments.meridianpay.com
    description: Production
security: []
tags: []
externalDocs:
  url: /
paths:
  /v1/payment-links/sessions:
    post:
      tags:
        - Sessions
      summary: Create a Realtime Collections Session
      description: >-
        Validates the supplied credentials and returns a session key used to
        create payment links.


        Session keys expire after 15 minutes. The session key is tied to the
        operator data supplied here, so if anything about the operator changes
        you must obtain a new key. This endpoint does not perform
        duplicate-payload checks: a new session key is generated on every call.
      operationId: createPaymentLinksSessions
      parameters:
        - $ref: '#/components/parameters/MeridianApiKeyHeader'
        - $ref: '#/components/parameters/MeridianTimestampHeader'
      requestBody:
        description: >-
          Operator context used for auditing when creating a Realtime
          Collections API session.
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreatePaymentLinkSessionRequest'
            examples:
              PaymentLinkSessionRequest:
                $ref: '#/components/examples/PaymentLinkSessionRequest'
        required: true
      responses:
        '201':
          description: Created the session and stored the contents for later use
          headers: {}
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CreatePaymentLinkSessionResponse'
              examples:
                PaymentLinkSessionCreated:
                  $ref: '#/components/examples/PaymentLinkSessionCreated'
        '400':
          description: >-
            Malformed or invalid submission. Also returned when the API key is
            valid but does not belong to a merchant.
          headers: {}
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MeridianError'
        '401':
          description: >-
            Missing, unknown, or incorrectly signed API key. The response body
            is empty.
          headers: {}
        '500':
          description: Internal Server Error
          headers: {}
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MeridianError'
      deprecated: false
      security:
        - MeridianHmacAuth: []
components:
  parameters:
    MeridianApiKeyHeader:
      name: X-Meridian-Api-Key
      in: header
      required: true
      description: API key issued by Meridian during provisioning.
      schema:
        type: string
      example: your-api-key
    MeridianTimestampHeader:
      name: X-Meridian-Timestamp
      in: header
      required: true
      description: >-
        Current time in milliseconds since the Unix epoch. Must be within 10
        seconds of the request.
      schema:
        type: string
      example: '1749566400000'
  schemas:
    CreatePaymentLinkSessionRequest:
      type: object
      description: >-
        Operator context used for auditing when creating a Realtime Collections
        API session.
      properties:
        operatorId:
          type: string
          description: >-
            Unique identifier of the operator (user) initiating the session in
            the merchant system. Used for audit and traceability; must be
            present and non-blank but is not otherwise validated.
          title: String
        operatorName:
          type: string
          description: >-
            Human-readable name of the operator (user) initiating the session,
            stored for audit logs so actions can be attributed to a specific
            person.
          title: String
      required:
        - operatorId
        - operatorName
      title: CreatePaymentLinkSessionRequest
    CreatePaymentLinkSessionResponse:
      type: object
      description: >-
        Session key issued for the Realtime Collections API, valid for 15
        minutes.
      properties:
        sessionKey:
          type: string
          description: >-
            Unique session key to pass in the body of the create-payment-link
            request.
          title: String
        expiresAt:
          type: string
          format: date-time
          description: >-
            ISO-8601 datetime (UTC) at which the session key expires, 15 minutes
            after it was issued.
          title: String
      required:
        - sessionKey
        - expiresAt
      title: CreatePaymentLinkSessionResponse
    MeridianError:
      type: object
      description: >-
        Standard error response returned when a request cannot be completed.
        Includes a human-readable message and, for validation failures, a list
        of field-level errors.
      properties:
        validationErrors:
          type: array
          description: >-
            List of field-level validation errors, empty when the failure is not
            validation-related.
          items:
            $ref: '#/components/schemas/ValidationError'
          title: Array_ValidationError
        message:
          type: string
          description: Human-readable description of the error.
          title: String
        errorCode:
          type: string
          description: >-
            Machine-readable error code identifying the failure. Omitted when no
            specific code applies.
          title: String
      required:
        - validationErrors
        - message
      title: MeridianError
    ValidationError:
      description: >-
        A single validation error describing why a specific field or parameter
        was rejected. The `type` property identifies which variant it is.
      oneOf:
        - $ref: '#/components/schemas/InvalidFormat'
        - $ref: '#/components/schemas/InvalidValue'
        - $ref: '#/components/schemas/MissingPathParameter'
        - $ref: '#/components/schemas/MissingQueryParameter'
        - $ref: '#/components/schemas/MissingRequestBody'
        - $ref: '#/components/schemas/MissingValue'
        - $ref: '#/components/schemas/NotFound'
        - $ref: '#/components/schemas/UnexpectedVerificationError'
        - $ref: '#/components/schemas/UnprocessableValue'
        - $ref: '#/components/schemas/Unknown'
      discriminator:
        propertyName: type
        mapping:
          InvalidFormat:
            $ref: '#/components/schemas/InvalidFormat'
          InvalidValue:
            $ref: '#/components/schemas/InvalidValue'
          MissingPathParameter:
            $ref: '#/components/schemas/MissingPathParameter'
          MissingQueryParameter:
            $ref: '#/components/schemas/MissingQueryParameter'
          MissingRequestBody:
            $ref: '#/components/schemas/MissingRequestBody'
          MissingValue:
            $ref: '#/components/schemas/MissingValue'
          NotFound:
            $ref: '#/components/schemas/NotFound'
          UnexpectedVerificationError:
            $ref: '#/components/schemas/UnexpectedVerificationError'
          UnprocessableValue:
            $ref: '#/components/schemas/UnprocessableValue'
          Unknown:
            $ref: '#/components/schemas/Unknown'
      title: ValidationError
    InvalidFormat:
      type: object
      description: A field was supplied in a format the API could not interpret.
      properties:
        type:
          type: string
          enum:
            - InvalidFormat
          description: Validation error type discriminator.
        fieldRef:
          type: string
          description: Reference to the request field that caused the validation error.
          title: String
        message:
          type: string
          description: Human-readable explanation of why the field failed validation.
          title: String
      required:
        - type
        - fieldRef
        - message
      title: InvalidFormat
    InvalidValue:
      type: object
      description: A field was well-formed but its value is not allowed.
      properties:
        type:
          type: string
          enum:
            - InvalidValue
          description: Validation error type discriminator.
        fieldRef:
          type: string
          description: Reference to the request field that caused the validation error.
          title: String
        message:
          type: string
          description: Human-readable explanation of why the field failed validation.
          title: String
      required:
        - type
        - fieldRef
        - message
      title: InvalidValue
    MissingPathParameter:
      type: object
      description: A required path parameter was missing from the request URL.
      properties:
        type:
          type: string
          enum:
            - MissingPathParameter
          description: Validation error type discriminator.
        fieldRef:
          type: string
          description: Name of the path parameter that was missing.
          title: String
        message:
          type: string
          description: Human-readable explanation of why the parameter failed validation.
          title: String
      required:
        - type
        - fieldRef
        - message
      title: MissingPathParameter
    MissingQueryParameter:
      type: object
      description: A required query parameter was missing from the request URL.
      properties:
        type:
          type: string
          enum:
            - MissingQueryParameter
          description: Validation error type discriminator.
        fieldRef:
          type: string
          description: Name of the query parameter that was missing.
          title: String
        message:
          type: string
          description: Human-readable explanation of why the parameter failed validation.
          title: String
      required:
        - type
        - fieldRef
        - message
      title: MissingQueryParameter
    MissingRequestBody:
      type: object
      description: The request body was absent, or was missing fields that may not be null.
      properties:
        type:
          type: string
          enum:
            - MissingRequestBody
          description: Validation error type discriminator.
        fieldRef:
          type: string
          description: Always `requestBody` for this error type.
          title: String
        message:
          type: string
          description: >-
            Human-readable explanation of why the request body failed
            validation.
          title: String
      required:
        - type
        - fieldRef
        - message
      title: MissingRequestBody
    MissingValue:
      type: object
      description: A required field was missing from the request body.
      properties:
        type:
          type: string
          enum:
            - MissingValue
          description: Validation error type discriminator.
        fieldRef:
          type: string
          description: Reference to the request field that was missing.
          title: String
        message:
          type: string
          description: Human-readable explanation of why the field failed validation.
          title: String
      required:
        - type
        - fieldRef
        - message
      title: MissingValue
    NotFound:
      type: object
      description: A referenced resource could not be found.
      properties:
        type:
          type: string
          enum:
            - NotFound
          description: Validation error type discriminator.
        fieldRef:
          type: string
          description: >-
            Reference to the request field naming the resource that was not
            found.
          title: String
        message:
          type: string
          description: Human-readable explanation of what could not be found.
          title: String
      required:
        - type
        - fieldRef
        - message
      title: NotFound
    UnexpectedVerificationError:
      type: object
      description: An unexpected error occurred while verifying the value of a field.
      properties:
        type:
          type: string
          enum:
            - UnexpectedVerificationError
          description: Validation error type discriminator.
        fieldRef:
          type: string
          description: Reference to the request field that could not be verified.
          title: String
        message:
          type: string
          description: Human-readable explanation of the verification failure.
          title: String
      required:
        - type
        - fieldRef
        - message
      title: UnexpectedVerificationError
    UnprocessableValue:
      type: object
      description: >-
        A field was valid in isolation but cannot be processed in the context of
        this request.
      properties:
        type:
          type: string
          enum:
            - UnprocessableValue
          description: Validation error type discriminator.
        fieldRef:
          type: string
          description: Reference to the request field that could not be processed.
          title: String
        message:
          type: string
          description: Human-readable explanation of why the field could not be processed.
          title: String
      required:
        - type
        - fieldRef
        - message
      title: UnprocessableValue
    Unknown:
      type: object
      description: >-
        The request was rejected but the specific field at fault could not be
        determined.
      properties:
        type:
          type: string
          enum:
            - Unknown
          description: Validation error type discriminator.
        fieldRef:
          type: string
          description: Always `unknown` for this error type.
          title: String
        message:
          type: string
          description: Human-readable explanation of the failure.
          title: String
      required:
        - type
        - fieldRef
        - message
      title: Unknown
  examples:
    PaymentLinkSessionRequest:
      summary: Operator initiating a session
      value:
        operatorId: op-123
        operatorName: Carlos Tester
    PaymentLinkSessionCreated:
      summary: Session key issued
      value:
        sessionKey: uslocal-b1x2k0dzsbpc4cz8c8xrvfel
        expiresAt: '2026-07-02T20:45:50Z'
  securitySchemes:
    MeridianHmacAuth:
      type: apiKey
      in: header
      name: X-Meridian-Signature
      description: >-
        Meridian HMAC header authentication.


        Required headers:
          - X-Meridian-Api-Key
          - X-Meridian-Timestamp
          - X-Meridian-Signature

        X-Meridian-Signature is the HMAC SHA-256 signature of the canonical
        request string, computed per request as HMAC-SHA256(apiKey + timestamp +
        method + request URI including any query string + body). See
        [Authentication](/products/realtime-collections/authentication) for how
        to construct it.

````