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

# Link a payment email to a contact

Associates a payment email from a payment processor (Stripe, Paddle, or Lemon Squeezy) with a contact. If the payment email differs from the contact's primary email, it creates or updates the payment email link. The endpoint then either propagates existing financial data or triggers an asynchronous task to fetch and propagate financial information from the payment processor.
Returns financial data immediately if available, otherwise returns empty response while processing continues in the background.


## OpenAPI

````yaml https://api.getfernand.com/openapi.json post /contacts/{id}/payment-email
openapi: 3.0.3
info:
  title: Fernand API Documentation
  version: '3.0'
  description: This is the documentation for the [Fernand](https://getfernand.com) API.
  termsOfService: https://getfernand.com/terms
  contact:
    name: Fernand Support
    url: https://getfernand.com
    email: support@getfernand.com
  x-logo:
    url: https://app.getfernand.com/images/favicon/icon_128.png
servers:
  - url: https://api.getfernand.com
    description: ''
    x-last-modified: 1764750693905
security:
  - apiKeyHeader: []
externalDocs:
  description: You can access our documentation online by visiting https://api.fernand.help
  url: https://api.fernand.help
paths:
  /contacts/{id}/payment-email:
    post:
      tags:
        - Contact Payments
      summary: Link a payment email to a contact
      description: >-
        Associates a payment email from a payment processor (Stripe, Paddle, or
        Lemon Squeezy) with a contact. If the payment email differs from the
        contact's primary email, it creates or updates the payment email link.
        The endpoint then either propagates existing financial data or triggers
        an asynchronous task to fetch and propagate financial information from
        the payment processor.

        Returns financial data immediately if available, otherwise returns empty
        response while processing continues in the background.
      operationId: linkPaymentEmail
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: integer
          description: ID of the contact to link the payment email to.
          example: 12345
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                source:
                  type: string
                  enum:
                    - STRIPE
                    - PADDLE
                    - LEMON
                  description: >-
                    Payment processor source (case-insensitive, will be
                    converted to uppercase).
                  example: STRIPE
                email:
                  type: string
                  format: email
                  description: Payment email address to link to the contact.
                  example: billing@piedpiper.com
              required:
                - source
                - email
      responses:
        '200':
          description: Payment email linked successfully with financial data returned.
          content:
            application/json:
              schema:
                type: object
                properties:
                  subscription_status:
                    type: string
                    nullable: true
                    enum:
                      - active
                      - past_due
                      - unpaid
                      - canceled
                      - churned
                      - incomplete
                      - trialing
                  subscription_start:
                    type: string
                    format: date-time
                    nullable: true
                  financials:
                    type: object
                    nullable: true
        '204':
          description: >-
            Payment email link created, financial data will be processed
            asynchronously.
        '400':
          description: Invalid source or email format.
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
        '404':
          description: Contact not found.
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
components:
  securitySchemes:
    apiKeyHeader:
      type: apiKey
      description: >-
        Authenticate your account by including your secret key in API requests.

        You can manage your API keys in the
        [Dashboard](https://app.getfernand.com/).


        Authentication to the API is performed by using the HTTP Header
        X-API-Key.
      name: X-API-Key
      in: header
      x-last-modified: 1764750344730

````