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

# Get payment link

> Retrieve a payment link by ID



## OpenAPI

````yaml /api-reference/link-product-openapi.json get /payment-links/{id}
openapi: 3.0.0
info:
  title: Link Product API
  description: RESTful API for managing payment links, customers, and invoices
  version: 1.0.0
servers:
  - url: https://api.sandbox.cheqpay.mx/lps
    description: Sandbox environment
  - url: https://prod.cheqpay.mx/lps
    description: Production environment
security: []
tags:
  - name: Payment Links
    description: Operations related to payment links
  - name: Invoices
    description: Invoice creation and retrieval
  - name: Products
    description: Product management operations
paths:
  /payment-links/{id}:
    get:
      tags:
        - Payment Links
      summary: Get payment link
      description: Retrieve a payment link by ID
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: string
          description: Payment link ID
      responses:
        '200':
          description: Payment link retrieved successfully
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/PaymentLink'
                  - type: object
                    properties:
                      invoiceCount:
                        type: integer
                        description: Number of invoices generated from this payment link
                      merchant:
                        type: object
                        properties:
                          name:
                            type: string
                            description: Merchant name
                          logo:
                            type: string
                            description: Merchant logo URL
                          refundPolicyUrl:
                            type: string
                            description: Refund policy URL
                          returnsAndExchangesPolicyUrl:
                            type: string
                            description: Returns and exchanges policy URL
                          country:
                            type: string
                            pattern: ^[A-Z]{2}$
                            description: Merchant country code (2 letters)
                          language:
                            type: string
                            pattern: ^[a-z]{2}$
                            default: en
                            description: Merchant language code (2 letters)
                          transactionFees:
                            $ref: '#/components/schemas/TransactionFees'
        '404':
          description: Payment link not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NotFoundError'
        '500':
          description: Internal server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/InternalError'
components:
  schemas:
    PaymentLink:
      type: object
      description: Payment link entity
      required:
        - id
        - merchantId
        - type
        - currency
        - totals
        - paymentMethods
        - isDraft
        - isEnabled
      properties:
        _id:
          type: string
          description: MongoDB ObjectId
        name:
          type: string
          maxLength: 255
          description: Payment link name
        url:
          type: string
          description: Payment link URL
        id:
          type: string
          description: Unique payment link identifier
        merchantId:
          type: string
          description: Merchant identifier
        type:
          type: string
          enum:
            - products_subscriptions
            - customer_choice
            - products
            - subscription
          description: Payment link type
        products:
          type: array
          items:
            $ref: '#/components/schemas/PaymentLinkProduct'
          description: Products in the payment link
        plans:
          type: array
          maxItems: 1
          items:
            $ref: '#/components/schemas/SubscriptionPlan'
          description: Subscription plans (required when type is subscription, max 1)
        currency:
          type: string
          pattern: ^[A-Z]{3}$
          description: Currency code (3 letters)
        totals:
          $ref: '#/components/schemas/PaymentLinkTotals'
        options:
          type: object
          description: Payment link options
          properties:
            collectShippingAddress:
              type: boolean
              default: false
              description: Whether to collect shipping address
            taxIdCollection:
              type: object
              description: Tax ID collection settings for checkout
              properties:
                enabled:
                  type: boolean
                  description: Whether checkout should ask for tax ID
                required:
                  type: boolean
                  default: false
                  description: When enabled is true, whether tax ID is mandatory
              required:
                - enabled
        customFields:
          type: array
          items:
            $ref: '#/components/schemas/CustomField'
          minItems: 1
          maxItems: 20
          description: Additional questions to ask the customer at checkout
        numberOfPayments:
          type: number
          minimum: 1
          description: Number of payments for subscription
        paymentMethods:
          type: array
          items:
            type: string
            enum:
              - card
              - spei
              - cie_cash_net
              - paycash
          minItems: 1
          description: Available payment methods
        isDraft:
          type: boolean
          description: Whether the payment link is a draft
        isEnabled:
          type: boolean
          description: Whether the payment link is enabled
        redirectUrl:
          type: string
          description: URL to redirect after payment completion
        cancelUrl:
          type: string
          format: uri
          nullable: true
          description: URL the customer returns to when cancelling the checkout
        reference:
          type: string
          maxLength: 128
          description: Merchant reference for the payment link
        invoiceNumber:
          type: string
          maxLength: 64
          description: >-
            Merchant-provided invoice number shown to customers instead of the
            system order number when present. Free-form, not unique. Forwarded
            to the payment order on charge.
        description:
          type: string
          maxLength: 500
          description: >-
            Payment link description. Forwarded to the payment order on charge
            unless overridden in the charge request.
        externalId:
          type: string
          maxLength: 128
          description: External identifier for idempotent payment link creation
        defaults:
          type: object
          description: Default values for customer choice payment links
          properties:
            persistPaymentMethod:
              type: boolean
              description: >-
                Whether to persist the customer's payment method for future
                purchases
              default: false
            billingAddress:
              $ref: '#/components/schemas/BillingAddress'
            shippingAddress:
              $ref: '#/components/schemas/Address'
        metadata:
          type: object
          additionalProperties: true
          description: Additional metadata
        expiresAt:
          type: string
          format: date-time
          description: Expiration date
        createdAt:
          type: string
          format: date-time
          description: Creation timestamp
        updatedAt:
          type: string
          format: date-time
          description: Last update timestamp
    TransactionFees:
      type: object
      description: >-
        Customer-facing transaction fee configuration. Defines how fees or
        discounts are presented to the customer at checkout. The four modes
        (cashDiscount, convenience, service, surcharge) are mutually exclusive
        at most one of them can have `active: true` at a time. If none are
        active, no extra fee is applied (the "None" mode).
      properties:
        cashDiscount:
          $ref: '#/components/schemas/CashDiscountTransactionFee'
        convenience:
          $ref: '#/components/schemas/ConvenienceTransactionFee'
        service:
          $ref: '#/components/schemas/ServiceTransactionFee'
        surcharge:
          $ref: '#/components/schemas/SurchargeTransactionFee'
    NotFoundError:
      type: object
      description: Not found error response
      properties:
        message:
          type: string
          description: Error message
          example: Resource not found
    InternalError:
      type: object
      description: Internal server error response
      properties:
        message:
          type: string
          description: Error message
          example: Internal server error
    PaymentLinkProduct:
      type: object
      description: Product in a payment link
      required:
        - name
        - qty
        - price
        - total
      properties:
        id:
          type: string
          description: Product identifier (optional for new products)
        name:
          type: string
          description: Product name
        description:
          type: string
          description: Product description
        qty:
          type: number
          minimum: 1
          description: Product quantity
        price:
          type: number
          minimum: 0
          description: Product price
        total:
          type: number
          minimum: 0
          description: Total price for this product
        imageUrl:
          type: string
          description: Product image URL
        isQtyAdjustable:
          type: boolean
          description: Whether the quantity is adjustable by the customer
        minQty:
          type: number
          description: Minimum quantity if adjustable
        maxQty:
          type: number
          description: Maximum quantity if adjustable
    SubscriptionPlan:
      type: object
      description: Full subscription plan details
      properties:
        id:
          type: string
          description: Plan identifier
        merchantId:
          type: string
          description: Merchant identifier
        externalId:
          type: string
          description: External identifier
        name:
          type: string
          description: Plan name
        description:
          type: string
          description: Plan description
        amount:
          type: number
          description: Plan amount
        currency:
          type: string
          enum:
            - MXN
            - USD
          description: Plan currency
        interval:
          type: string
          enum:
            - DAY
            - WEEK
            - MONTH
            - YEAR
          description: Billing interval
        intervalCount:
          type: number
          description: Number of intervals between billings
        trialDays:
          type: number
          description: Number of trial days
        active:
          type: boolean
          description: Whether the plan is active
        metadata:
          type: object
          description: Additional metadata
        createdAt:
          type: string
          format: date-time
          description: Creation timestamp
        updatedAt:
          type: string
          format: date-time
          description: Last update timestamp
    PaymentLinkTotals:
      type: object
      description: Payment link totals
      required:
        - total
      properties:
        total:
          type: number
          minimum: 0
          description: Total amount
        taxes:
          type: number
          minimum: 0
          description: Tax amount
        shipping:
          type: number
          minimum: 0
          description: Shipping amount
        fees:
          type: number
          minimum: 0
          description: Fees amount
        discounts:
          type: number
          minimum: 0
          description: Discount amount
    CustomField:
      type: object
      description: >-
        Custom field asked of the customer at checkout. `options` is required
        when `type` is `radio`, `checkbox`, or `select`, and must be omitted for
        all other types.
      required:
        - type
        - label
      properties:
        type:
          type: string
          enum:
            - text
            - number
            - email
            - phone
            - date
            - switch
            - radio
            - checkbox
            - select
          description: Field input type
        label:
          type: string
          minLength: 1
          maxLength: 255
          description: Label shown to the customer
        required:
          type: boolean
          default: false
          description: Whether the customer must provide a value
        options:
          type: array
          items:
            type: string
            minLength: 1
            maxLength: 255
          minItems: 1
          maxItems: 50
          description: Available choices; required for `radio`, `checkbox`, and `select`
    BillingAddress:
      allOf:
        - $ref: '#/components/schemas/Address'
        - type: object
          properties:
            isSameAsShipping:
              type: boolean
              description: Whether billing address is same as shipping
    Address:
      type: object
      description: Address information
      properties:
        firstName:
          type: string
          description: First name
        lastName:
          type: string
          description: Last name
        organizationName:
          type: string
          description: Organization name
        email:
          type: string
          format: email
          description: Email address
        phone:
          type: string
          description: Phone number
        addressLine1:
          type: string
          description: Street address
        addressLine2:
          type: string
          description: Additional address information (apartment, suite, unit, etc.)
        city:
          type: string
          description: City
        state:
          type: string
          description: State
        postalCode:
          type: string
          description: Postal code
        country:
          type: string
          pattern: ^[A-Z]{2}$
          description: Country code (2 letters)
    CashDiscountTransactionFee:
      type: object
      description: >-
        Cash discount transaction fee mode. The merchant offers a discount when
        the customer pays with cash or ACH instead of a card.
      properties:
        available:
          type: boolean
          description: Whether this fee mode is available for the merchant to select.
        active:
          type: boolean
          description: >-
            Whether this fee mode is currently active. At most one
            transactionFees mode can be active at a time.
        rate:
          type: string
          description: >-
            Cash discount rate as a percentage string with up to 2 decimals
            (e.g., "3", "3.00", "50.00").
          pattern: ^\d+(\.\d{1,2})?$
          example: '50.00'
        displayStyle:
          type: string
          enum:
            - subtle
            - sideBySide
          description: >-
            How the cash discount is presented to the customer. `subtle` shows
            the standard Cash Discount layout; `sideBySide` shows Dual Pricing
            (card price and cash price side by side).
        autoAdjustPrices:
          type: boolean
          description: >-
            When true, the merchant's listed price is treated as the cash price
            and the card price is computed as `basePrice * (1 + rate)`. When
            false, the listed price is the card price and the cash price is
            computed as `basePrice / (1 + rate)`.
        cardPriceLabel:
          type: string
          description: >-
            Label shown for the card price at checkout. Defaults to "Card Price"
            at the render layer if not set.
        cashPriceLabel:
          type: string
          description: >-
            Label shown for the cash/ACH price at checkout. Defaults to
            "Cash/ACH Price" at the render layer if not set.
    ConvenienceTransactionFee:
      type: object
      description: >-
        Convenience fee transaction mode. A flat fee is added to every
        transaction.
      properties:
        available:
          type: boolean
          description: Whether this fee mode is available for the merchant to select.
        active:
          type: boolean
          description: >-
            Whether this fee mode is currently active. At most one
            transactionFees mode can be active at a time.
        amount:
          type: string
          description: >-
            Convenience fee amount as a non-negative integer in cents (e.g.,
            "500" for $5.00).
          pattern: ^\d+$
          example: '500'
    ServiceTransactionFee:
      type: object
      description: >-
        Service fee transaction mode. A percentage-based fee is applied to all
        transactions.
      properties:
        available:
          type: boolean
          description: Whether this fee mode is available for the merchant to select.
        active:
          type: boolean
          description: >-
            Whether this fee mode is currently active. At most one
            transactionFees mode can be active at a time.
        rate:
          type: string
          description: >-
            Service fee rate as a percentage string with up to 2 decimals (e.g.,
            "5.00").
          pattern: ^\d+(\.\d{1,2})?$
          example: '5.00'
    SurchargeTransactionFee:
      type: object
      description: >-
        Surcharge transaction mode. A percentage-based surcharge is added at
        checkout as a separate line item when a card is used.
      properties:
        available:
          type: boolean
          description: Whether this fee mode is available for the merchant to select.
        active:
          type: boolean
          description: >-
            Whether this fee mode is currently active. At most one
            transactionFees mode can be active at a time.
        rate:
          type: string
          description: >-
            Surcharge rate as a percentage string with up to 2 decimals (e.g.,
            "3.00").
          pattern: ^\d+(\.\d{1,2})?$
          example: '3.00'
        maxAmount:
          type: string
          description: >-
            Optional per-transaction surcharge cap as a non-negative integer in
            cents (e.g., "5000" caps the surcharge at $50.00).
          pattern: ^\d+$
          example: '5000'
        appliesTo:
          type: string
          enum:
            - credit_only
            - credit_and_amex
            - all
          description: >-
            Which card types the surcharge applies to. Defaults to `credit_only`
            to avoid illegally surcharging debit cards under US Durbin rules.
        lineItemLabel:
          type: string
          description: >-
            Label used on the receipt for the surcharge line item. Defaults to
            "Surcharge" at the render layer if not set.

````