> ## Documentation Index
> Fetch the complete documentation index at: https://telnesstech-a0a16404.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Create payment link

> Create a new payment link that can be shared with customers to collect payments.

Payment links provide a hosted checkout experience without requiring integration
with payment widgets or handling sensitive payment data directly.




## OpenAPI

````yaml /api-reference/bundled_openapi.json post /payment-links
openapi: 3.1.0
info:
  title: Telness Tech Connect
  version: 2.0.0-alpha
  description: >
    Telness Tech Connect API provides all you need to own your user's
    connectivity experience.


    Go back to [Telnesstech.com](https://telnesstech.com)
servers:
  - url: https://apiv2.example.com
    description: Connect API URL for your domain
security:
  - apiKey: []
  - bearerAuth: []
    apiKey: []
tags:
  - name: Auth
    description: Authenticate users and obtain access tokens.
  - name: Users
    description: Manage users.
  - name: Customers
    description: Manage customers.
  - name: Subscriptions
    description: Manage subscriptions and subscription.
  - name: Subscription Addons
    description: Manage subscription addons.
  - name: Subscription Usage
    description: Get subscription usage.
  - name: Subscribers
    description: Manage subscribers.
  - name: Licenses
    description: Manage licenses.
  - name: Product Offerings
    description: Browse product offerings.
  - name: Product Catalogs
    description: Browse product catalogs.
  - name: Product Discounts
    description: Discounts and promotions.
  - name: Orders
    description: Manage orders and line items.
  - name: Payment Intents
    description: >-
      Inspect payment intents, the money collected over card rails for orders
      and renewals.
  - name: Payment Links
    description: Create and manage payment links for orders and invoices.
  - name: Payment Sessions
    description: Create and manage payment sessions for orders.
  - name: Payment Profiles
    description: Manage customer payment profiles and methods.
  - name: Payment Profile Sessions
    description: Create sessions for setting up payment profiles.
  - name: Signing sessions
    description: Handle contract signing sessions for postpaid orders.
  - name: Porting
    description: Manage number porting for subscriptions.
  - name: Taxes
    description: Calculate taxes for products and line items.
  - name: Invoices
    description: Manage invoices and invoice items.
  - name: Tools
    description: >-
      Tools for address validation, number porting, device info, and network
      coverage.
  - name: Inventory
    description: Manage phone number inventory, SIM cards, and reservations.
  - name: Workflows
    description: Dynamic processing of customer journeys and events.
paths:
  /payment-links:
    post:
      tags:
        - Payment Links
      summary: Create payment link
      description: >
        Create a new payment link that can be shared with customers to collect
        payments.


        Payment links provide a hosted checkout experience without requiring
        integration

        with payment widgets or handling sensitive payment data directly.
      operationId: createPaymentLink
      parameters:
        - $ref: '#/components/parameters/IdempotencyKey'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreatePaymentLinkRequest'
      responses:
        '201':
          description: Payment link created successfully.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PaymentLink'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '412':
          $ref: '#/components/responses/PreconditionFailed'
        '500':
          $ref: '#/components/responses/InternalServerError'
components:
  parameters:
    IdempotencyKey:
      in: header
      name: X-Idempotency-Key
      required: false
      description: >
        A unique key to ensure idempotency of requests. If a request with the
        same key has already been processed, the same result will be returned.

        The key must be unique for each distinct operation. Keys are expired
        after 24 hours, but we recommend using a new key for each request.


        Modified requests with the same idempotency keys are rejected with a
        `409 Conflict` status code.
      schema:
        type: string
        maxLength: 256
  schemas:
    CreatePaymentLinkRequest:
      type: object
      description: >-
        Request to create a new payment link for processing payment for an order
        or invoice. Either orderId or invoiceId must be provided, not both.
      additionalProperties: false
      properties:
        orderId:
          type: string
          description: >-
            The unique identifier of the order to create a payment link for.
            Either orderId or invoiceId must be provided, not both.
          example: f47ac10b-58cc-4372-a567-0e02b2c3d479
        invoiceId:
          type: string
          description: >-
            The unique identifier of the invoice to create a payment link for.
            Either orderId or invoiceId must be provided, not both.
          example: 123e4567-e89b-12d3-a456-426614174000
        paymentProfileId:
          type: string
          description: >-
            You can add the previously saved payment method to prefill in the
            payment details.
          example: 6ba7b810-9dad-11d1-80b4-00c04fd430c8
        savePaymentProfile:
          type: boolean
          description: >-
            Whether to save the payment profile for future use. Only applicable
            if the customer is authenticated or for the initial order. Defaults
            to false.
          example: true
        setAsDefaultPaymentProfile:
          type: boolean
          description: >
            Whether to set the payment method as the default for future
            payments. Only applicable if savePaymentProfile is true and the
            customer is authenticated or for the initial order. Defaults to
            false.
          example: false
        description:
          type: string
          description: Optional description to display on the payment page.
          example: Payment for Telness mobile subscription
        returnUrl:
          type: string
          format: uri
          description: URL to redirect customers to after successful payment.
          example: https://your-domain.com/success
        cancelUrl:
          type: string
          format: uri
          description: URL to redirect customers to if they cancel the payment.
          example: https://your-domain.com/cancel
        metadata:
          $ref: '#/components/schemas/Metadata'
    PaymentLink:
      type: object
      description: >-
        A hosted payment link created from a payment intent that can be shared
        with customers.
      required:
        - paymentLinkId
        - hostedUrl
        - status
        - createdAt
        - updatedAt
      additionalProperties: false
      properties:
        paymentLinkId:
          type: string
          description: Unique identifier for the payment link.
          example: j47ac10b-58cc-4372-a567-0e02b2c3d479
        orderId:
          type: string
          description: The order this payment link collects payment for.
          example: 44567801-a504-4f09-8089-31ea78bc239b
        customerId:
          type: string
          description: The customer this payment link collects payment from.
          example: a1b2c3d4-e5f6-4a5b-8c9d-0e1f2a3b4c5d
        paymentProvider:
          $ref: '#/components/schemas/PaymentProvider'
        paymentProfileId:
          type: string
          description: The saved payment method pre-selected for the customer, if any.
          example: 6ba7b810-9dad-11d1-80b4-00c04fd430c8
        hostedUrl:
          type: string
          format: uri
          description: The URL where customers can complete their payment.
          example: >-
            https://checkout.yourapp.com/pay/j47ac10b-58cc-4372-a567-0e02b2c3d479
        status:
          $ref: '#/components/schemas/PaymentLinkStatus'
        description:
          type: string
          description: Optional description displayed on the payment page.
          example: Pay your monthly subscription
        paymentIntentId:
          type: string
          description: >-
            The payment intent that collected the payment, available once the
            link has been paid.
          example: 64870b5c-fb61-4c9a-955a-e148e0826c20
        completedAt:
          type: string
          format: date-time
          description: When the payment was completed, if the link has been paid.
          example: '2024-01-15T14:30:00Z'
        createdAt:
          type: string
          format: date-time
          description: When the payment link was created.
          example: '2024-01-15T10:00:00Z'
        updatedAt:
          type: string
          format: date-time
          description: When the payment link was last updated.
          example: '2024-01-15T10:00:00Z'
        metadata:
          $ref: '#/components/schemas/Metadata'
    Metadata:
      type: object
      additionalProperties:
        type: string
      description: >
        A set of key-value pairs that can be attached to an object for storing
        additional information in a semi-structured format.
    PaymentProvider:
      type: string
      description: Payment service provider that processes the transaction.
      enum:
        - STRIPE
        - BILLOGRAM
      example: STRIPE
    PaymentLinkStatus:
      type: string
      description: Current status of a payment link.
      enum:
        - ACTIVE
        - EXPIRED
        - COMPLETED
        - CANCELED
        - FAILED
    Error:
      type: object
      required:
        - message
        - code
      properties:
        message:
          type: string
          description: A human-readable message providing more details about the error.
        code:
          type: string
          description: A machine-readable code for the error.
        details:
          type: array
          description: Additional details about the error.
          items:
            type: object
            required:
              - message
              - code
            properties:
              message:
                type: string
                description: >-
                  A human-readable message providing more details about the
                  error.
              code:
                type: string
                description: A machine-readable code for the specific detail.
              property:
                type: string
                description: The property or field related to the error.
              suggestion:
                $ref: '#/components/schemas/Any'
                description: >
                  A suggested value for the particular property.


                  For example, this may be set when validating an address with
                  an alias, suggesting the expected value by the operator.
        hint:
          type: string
          description: A hint to help resolve the error.
    Any:
      oneOf:
        - type: string
        - type: number
        - type: boolean
        - type: object
          additionalProperties: true
        - type: array
  responses:
    BadRequest:
      description: The request was malformed or invalid.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    Unauthorized:
      description: Authentication is required to access this resource.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    Forbidden:
      description: Access to this resource is forbidden.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    NotFound:
      description: The requested resource was not found.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    PreconditionFailed:
      description: Precondition Failed
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    InternalServerError:
      description: An unexpected error occurred on the server.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
  securitySchemes:
    apiKey:
      type: apiKey
      in: header
      name: X-Api-Key
      description: >
        An API key that grants access to the Connect API. You can create and
        manage API keys in the portal.
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: >
        Bearer authentication with JWT tokens is used to authenticate users.


        Do note that a valid API keys is also required to access the Connect API
        to prove that requests are made by a trusted party.


        Requests with a JWT token is scoped to the permissions of the user the
        token belongs to, regardless of the API key used.

````

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