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

# Create payment method link

> Create a link to request the customer to add a new payment method. The link can be sent to the customer via email.

<sup>Required permissions: `payment-method:add`</sup>



## OpenAPI

````yaml post /payment-methods/link
openapi: 3.1.0
info:
  title: Fynn API
  description: ''
  termsOfService: https://www.fynn.eu/tos
  contact:
    name: Fynn UG (haftungsbeschränkt)
    url: https://www.fynn.eu
    email: hi@fynn.eu
  license:
    name: Proprietary
    url: https://www.fynn.eu/license
  version: 0.0.0
servers:
  - url: https://coreapi.io
    description: Production
  - url: https://preview.coreapi.io
    description: Sandbox
security:
  - JWT: []
tags: []
paths:
  /payment-methods/link:
    parameters: []
    post:
      tags:
        - PaymentMethod
      summary: Create payment method link
      description: >-
        Create a link to request the customer to add a new payment method. The
        link can be sent to the customer via email.


        <sup>Required permissions: `payment-method:add`</sup>
      operationId: createPaymentMethodLink
      parameters: []
      requestBody:
        description: The new PaymentMethod resource
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PaymentMethod.PaymentMethodLinkRequest'
            example:
              customer: ad8f3b9e-1b1a-4b9a-9b9a-9b9a9b9a9b9a
              allowedPaymentMethodTypes: card
              sendEmail: true
              redirectUrl: https://example.com/done
          text/html:
            schema:
              $ref: '#/components/schemas/PaymentMethod.PaymentMethodLinkRequest'
            example:
              customer: ad8f3b9e-1b1a-4b9a-9b9a-9b9a9b9a9b9a
              allowedPaymentMethodTypes: card
              sendEmail: true
              redirectUrl: https://example.com/done
        required: true
      responses:
        '201':
          description: The link to add a new payment method
          content:
            application/json:
              schema:
                type: object
                properties:
                  link:
                    type: string
                    example: >-
                      https://my.customerfront.app/self-service/payment-method-link/1234
                    description: The link to add a new payment method
              example:
                link: >-
                  https://my.customerfront.app/self-service/payment-method-link/abc123def456
        '204':
          description: The link was sent to the customer
        '400':
          description: Invalid input
        '422':
          description: Unprocessable entity
      deprecated: false
      security:
        - JWT:
            - payment-method:add
      x-codeSamples:
        - lang: bash
          label: cURL
          source: |-
            curl -X POST \
             /payment-methods/link \
             --header "Content-Type: application/json" \
             --header "Authorization: Bearer <token>" \
             --data '{
                "customer": "ad8f1c2c-3b1c-4b0a-8b0a-0b0b0b0b0b0b",
                "sendEmail": "1"
            }'
components:
  schemas:
    PaymentMethod.PaymentMethodLinkRequest:
      type: object
      description: >-
        Request body for creating a link to request the customer to add a new
        payment method.
      deprecated: false
      required:
        - customer
      properties:
        customer:
          description: The customer id
          example: ad8f1c2c-3b1c-4b0a-8b0a-0b0b0b0b0b0b
          type: string
        allowedPaymentMethodTypes:
          description: >-
            The allowed payment method types. If none is provided, all available
            will be shown.
          example: card
          enum:
            - sepa_debit
            - card
            - paypal
            - bank_transfer
            - wallet
        sendEmail:
          description: Whether to send an email to the customer with the link.
          default: true
          example: true
          type: boolean
        redirectUrl:
          description: >-
            Optional URL to redirect the customer to after the payment method
            has been added. If not provided, the default status page is used.
          example: https://example.com/done
          type: string
          nullable: true
  securitySchemes:
    JWT:
      type: http
      scheme: bearer

````