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

# Create payment link



## OpenAPI

````yaml /openapi.yaml post /v1/payment-links
openapi: 3.1.0
info:
  title: Meum Public Merchant API
  version: 1.0.0
  description: >
    Public merchant API for programmatic payment management: invoices,
    transactions,

    payment links, webhooks, and WooCommerce integration.


    Authenticate with a store-scoped API key (`sk_live_*`) via Bearer token.

    Base URL: https://api.meum.io
  contact:
    name: Meum Support
    email: support@meum.io
    url: https://meum.io
servers:
  - url: https://api.meum.io
    description: Production
security:
  - bearerAuth: []
tags:
  - name: Health
    description: Service health checks
  - name: Invoices
    description: Invoice lifecycle
  - name: Transactions
    description: On-chain payment transactions
  - name: Payment Links
    description: Reusable payment link management
  - name: Webhooks
    description: Webhook endpoint and delivery management
  - name: Integrations
    description: Third-party platform integrations
paths:
  /v1/payment-links:
    post:
      tags:
        - Payment Links
      summary: Create payment link
      operationId: createPaymentLink
      parameters:
        - $ref: '#/components/parameters/IdempotencyKey'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreatePaymentLinkRequest'
            example:
              title: Summer fundraiser
              amount_mode: fixed_amount
              amount: '25.00'
              allow_multiple_payments: true
              public_visible: true
      responses:
        '201':
          description: Payment link created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PaymentLink'
        '400':
          $ref: '#/components/responses/BadRequest'
        '403':
          $ref: '#/components/responses/Forbidden'
components:
  parameters:
    IdempotencyKey:
      name: Idempotency-Key
      in: header
      description: >
        **Optional.** Unique key (1–128 characters) so retrying the same request
        does not create duplicates.

        If you send the same key again, you get the original response. Omit if
        you do not need retry safety.
      schema:
        type: string
        minLength: 1
        maxLength: 128
        example: pl_create_demo_001
  schemas:
    CreatePaymentLinkRequest:
      type: object
      required:
        - title
        - amount_mode
      properties:
        title:
          type: string
          minLength: 1
          maxLength: 200
          description: >
            **Required.** Name shown on the checkout page and in your dashboard
            (1–200 characters).

            Example: `"Summer fundraiser"`.
        description:
          type: string
          maxLength: 2000
          description: >
            **Optional.** Longer text for payers (max 2000 characters). Omit if
            not needed.
        image_url:
          type:
            - string
            - 'null'
          maxLength: 2048
          description: >
            **Optional.** HTTPS image URL for checkout (logo or product photo).
            Omit for no image.
        amount_mode:
          $ref: '#/components/schemas/PaymentLinkAmountMode'
        amount:
          type:
            - string
            - 'null'
          description: >
            **Required when `amount_mode` is `fixed_amount`.** Price as a
            decimal string (e.g. `"25.00"`).

            Omit when customers choose their own amount.
          example: '25.00'
        min_amount:
          type:
            - string
            - 'null'
          description: >
            **Optional.** Lowest amount a customer can pay when `amount_mode` is
            `customer_defined_amount`.

            Omit to allow any positive amount (subject to platform limits).
        max_amount:
          type:
            - string
            - 'null'
          description: >
            **Optional.** Highest amount a customer can pay when `amount_mode`
            is `customer_defined_amount`.

            Omit for no upper cap (subject to platform limits).
        suggested_amounts:
          type: array
          items:
            type:
              - number
              - 'null'
            exclusiveMinimum: 0
          description: >
            **Optional.** Quick-pick buttons on checkout (e.g. `[10, 25, 50]`).
            Omit for a free-form amount field only.
        allow_multiple_payments:
          type: boolean
          default: true
          description: >
            **Optional.** `true` (default): many customers can pay through this
            link.

            `false`: treat as one-time use after the first successful payment.
        public_visible:
          type: boolean
          default: true
          description: |
            **Optional.** `true` (default): anyone with the link URL can pay.
            `false`: hide from public checkout (API-only use).
        expires_at:
          type:
            - string
            - 'null'
          format: date-time
          description: >
            **Optional.** When the link stops accepting payments (UTC, e.g.
            `2025-09-01T14:31:44.171Z`).

            Omit for no expiration.
        success_url:
          type: string
          format: uri
          description: >
            **Optional.** Where to send the customer after a successful payment.

            Only works if redirect URLs are enabled for Pay Links on your
            account.
        metadata:
          type: object
          additionalProperties: true
          description: >
            **Optional.** Custom key-value data stored on the link and copied to
            invoices from it.

            Omit if not needed.
    PaymentLink:
      type: object
      description: Merchant-facing Pay Link resource with configuration and stats.
      properties:
        id:
          type: string
          pattern: ^(inv_|txn_|plink_|wh_|whd_|evt_|int_)[0-9a-z]{20,32}$
          description: Merchant resource ID (`plink_...`). Use in API paths and webhooks.
        public_id:
          type: string
          pattern: ^plpub_[0-9a-z]{20,32}$
          description: Buyer-facing token (`plpub_...`) embedded in public checkout URLs.
        public_url:
          type: string
          format: uri
          description: Shareable checkout page URL for this link.
          example: https://pay.meum.io/plpub_c9a9bb730611077574c828af5af5fed1
        title:
          type: string
          description: Link title shown on checkout and in the merchant dashboard.
          example: Summer fundraiser
        description:
          type:
            - string
            - 'null'
          description: Optional description for payers.
        image_url:
          type:
            - string
            - 'null'
          format: uri
          description: Optional image URL displayed on the checkout page.
        amount_mode:
          $ref: '#/components/schemas/PaymentLinkAmountMode'
        amount:
          type:
            - string
            - 'null'
          description: Fixed price when `amount_mode` is `fixed_amount`.
          example: '25.00'
        currency:
          type: string
          description: Currency for all amounts on this link.
          example: USD
        min_amount:
          type:
            - string
            - 'null'
          description: Minimum payer-entered amount for variable-amount links.
        max_amount:
          type:
            - string
            - 'null'
          description: Maximum payer-entered amount for variable-amount links.
        suggested_amounts:
          type: array
          items:
            type: number
          description: Suggested preset amounts shown as quick-select buttons on checkout.
          example:
            - 10
            - 25
            - 50
        allow_multiple_payments:
          type: boolean
          description: >-
            When true, the link can generate multiple paid invoices over its
            lifetime.
        public_visible:
          type: boolean
          description: >-
            When true, the link is reachable via its public URL without extra
            auth.
        status:
          $ref: '#/components/schemas/PaymentLinkStatus'
        effective_status:
          $ref: '#/components/schemas/PaymentLinkStatus'
          description: Computed status accounting for expiry and usage limits.
        expires_at:
          type:
            - string
            - 'null'
          format: date-time
          description: >-
            After this time (UTC) the link no longer accepts payments. `null` if
            it never expires.
        created_at:
          type: string
          format: date-time
          description: When the link was created.
        updated_at:
          type: string
          format: date-time
          description: When the link was last modified.
        stats:
          $ref: '#/components/schemas/PaymentLinkStats'
    PaymentLinkAmountMode:
      type: string
      description: >
        How pricing works on this Pay Link:

        - `fixed_amount`: you set the price; the customer pays exactly that
        amount

        - `customer_defined_amount`: the customer chooses how much to pay
        (within min/max you set)
      enum:
        - fixed_amount
        - customer_defined_amount
    PaymentLinkStatus:
      type: string
      description: |
        Whether the Pay Link can accept payments right now:
        - `active`: open for payments
        - `inactive`: turned off by you; no new payments
        - `expired`: past its expiration date
        - `completed`: single-use link already paid, or usage limit reached
      enum:
        - active
        - inactive
        - expired
        - completed
    PaymentLinkStats:
      type: object
      description: Aggregated payment metrics for a Pay Link.
      properties:
        total_payments:
          type: string
          description: Total checkout attempts or invoices created from this link.
          example: '12'
        paid_payments:
          type: string
          description: Number of successfully paid invoices from this link.
          example: '10'
        total_volume:
          type: string
          description: Sum of paid amounts in the link's currency (decimal string).
          example: '250.00'
    PublicApiError:
      type: object
      description: Standard error envelope for Public API v1 endpoints.
      required:
        - error
      properties:
        error:
          type: object
          description: Error details for the failed request.
          required:
            - type
            - code
            - message
            - request_id
          properties:
            type:
              type: string
              description: High-level error category used for programmatic handling.
              enum:
                - invalid_request
                - authentication_error
                - permission_error
                - not_found
                - conflict
                - rate_limit_error
                - api_error
              example: not_found
            code:
              type: string
              description: >-
                Stable machine-readable error code (for example
                `invoice_not_found`).
              example: invoice_not_found
            message:
              type: string
              description: Human-readable explanation suitable to show in logs or UI.
              example: Invoice not found
            param:
              type: string
              description: Request field associated with the error, when applicable.
              example: url
            request_id:
              type: string
              description: Unique request ID. Include when contacting support.
              example: req_a1b2c3d4e5f6789012345678
      example:
        error:
          type: not_found
          code: invoice_not_found
          message: Invoice not found
          request_id: req_a1b2c3d4e5f6789012345678
  responses:
    BadRequest:
      description: Invalid request
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/PublicApiError'
    Forbidden:
      description: Insufficient scope or permission
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/PublicApiError'
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: |
        Store-scoped API key. Prefix with `sk_live_`.
        Example: `Authorization: Bearer sk_live_EXAMPLE_DO_NOT_USE`

````