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

# Create a Pay connector

> Create a generic payment connector in the authenticated organization. The name must be unique in that organization. Authentication supplies ownership; do not send user_id or organization_id. Config is encrypted at rest; passwords and tokens are omitted from responses. This operation stores configuration and does not initiate a payment. See the [processor contract](/docs/voice/programmable-voice/pay#request-sent-to-the-payment-processor).



## OpenAPI

````yaml /openapi/source/external/call-control/pay-connectors.json post /pay_connectors
openapi: 3.1.0
info:
  title: Telnyx Pay Connectors API
  version: 2.0.0
  x-latency-category: responsive
  x-endpoint-cost: light
  description: >-
    Manage generic Pay connectors. This reference covers generic processor
    configuration only. Use a Telnyx API key for these endpoints; config
    authentication applies separately to requests sent to the payment processor.
  license:
    name: MIT
    url: https://opensource.org/licenses/MIT
  contact:
    email: support@telnyx.com
servers:
  - url: https://api.telnyx.com/v2
security:
  - bearerAuth: []
tags:
  - name: Pay Connectors
    description: Generic payment connector configuration.
paths:
  /pay_connectors:
    post:
      tags:
        - Pay Connectors
      summary: Create a Pay connector
      description: >-
        Create a generic payment connector in the authenticated organization.
        The name must be unique in that organization. Authentication supplies
        ownership; do not send user_id or organization_id. Config is encrypted
        at rest; passwords and tokens are omitted from responses. This operation
        stores configuration and does not initiate a payment. See the [processor
        contract](/docs/voice/programmable-voice/pay#request-sent-to-the-payment-processor).
      operationId: createPayConnector
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateGenericPayConnectorRequest'
            examples:
              none:
                summary: None processor authentication
                value:
                  name: my-payment-connector
                  type: generic
                  mode: test
                  config:
                    endpoint_url: https://processor.example.com/pay
                    auth_type: none
              basic:
                summary: Basic processor authentication
                value:
                  name: my-payment-connector
                  type: generic
                  mode: test
                  config:
                    endpoint_url: https://processor.example.com/pay
                    auth_type: basic
                    username: merchant-example
                    password: <processor-password>
              bearer:
                summary: Bearer processor authentication
                value:
                  name: my-payment-connector
                  type: generic
                  mode: test
                  config:
                    endpoint_url: https://processor.example.com/pay
                    auth_type: bearer
                    token: <processor-bearer-token>
      responses:
        '201':
          description: Connector created. Credentials are omitted.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PayConnectorResponse'
              example:
                data:
                  id: 550e8400-e29b-41d4-a716-446655440000
                  record_type: pay_connector
                  name: my-payment-connector
                  type: generic
                  mode: test
                  user_id: user-example
                  organization_id: organization-example
                  config:
                    endpoint_url: https://processor.example.com/pay
                    auth_type: bearer
                  created_at: '2026-10-01T12:00:00.000000Z'
                  updated_at: '2026-10-01T12:00:00.000000Z'
        '422':
          description: Invalid fields or duplicate name in the organization.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PayConnectorErrors'
              example:
                errors:
                  - code: '10000'
                    title: Invalid request
                    detail: >-
                      The 'config' parameter is invalid. Please consult the
                      documentation.
                    source:
                      pointer: /config
components:
  schemas:
    CreateGenericPayConnectorRequest:
      type: object
      required:
        - name
        - config
      properties:
        name:
          type: string
          description: >-
            Unique within the authenticated organization. Used in resource paths
            and as connector_name in the Call Control Pay request. Cannot be
            renamed by update.
          minLength: 1
          maxLength: 255
          pattern: \S
          example: my-payment-connector
        type:
          type: string
          description: Connector type covered by this reference.
          enum:
            - generic
          default: generic
        mode:
          type: string
          description: >-
            Defaults to test on creation. Test restricts collected card numbers
            but still contacts the configured processor; use a processor sandbox
            URL and sandbox credentials. Live removes the test-card restriction.
            Neither mode locks API updates.
          enum:
            - test
            - live
          default: test
        config:
          $ref: '#/components/schemas/GenericPayConnectorConfig'
    PayConnectorResponse:
      type: object
      properties:
        data:
          $ref: '#/components/schemas/PayConnector'
    PayConnectorErrors:
      type: object
      properties:
        errors:
          type: array
          items:
            type: object
            properties:
              code:
                type: string
                description: Telnyx error code.
              title:
                type: string
                description: Error title.
              detail:
                type: string
                description: Error detail.
              source:
                type: object
                properties:
                  pointer:
                    type: string
                    description: Invalid field pointer.
    GenericPayConnectorConfig:
      type: object
      description: >-
        Configuration for a generic connector. A config update replaces the
        complete object, not individual keys. Unknown config keys are discarded.
        Authentication credentials must be nonblank strings when required by the
        selected auth_type.
      required:
        - endpoint_url
      properties:
        endpoint_url:
          type: string
          description: >-
            HTTP or HTTPS processor URL with a host. Use HTTPS to protect
            payment data in transit.
          pattern: ^https?://\S+
          example: https://processor.example.com/pay
        auth_type:
          type: string
          description: >-
            Processor authentication, separate from the Telnyx API key. If
            omitted, validation requires basic credentials but no Basic
            Authorization header is added. Explicitly set basic or bearer to
            send its corresponding Authorization header, or none for no
            processor authentication.
          enum:
            - none
            - basic
            - bearer
        username:
          description: >-
            Nonblank string required for basic authentication. Returned in
            connector responses.
        password:
          description: >-
            Nonblank string required for basic authentication. Write-only;
            omitted from responses. Re-send when replacing a basic-auth config.
          writeOnly: true
        token:
          description: >-
            Nonblank string required for bearer authentication. Write-only;
            omitted from responses. Re-send when replacing a bearer-auth config.
          writeOnly: true
        timeout:
          type:
            - integer
            - 'null'
          minimum: 1
          maximum: 4294967295
          default: 10000
          description: >-
            Processor HTTP timeout in milliseconds. Omitted or null uses 10000;
            null is removed before storage. Not the IVR digit-gather timeout.
      oneOf:
        - title: Basic authentication (also the validation default)
          properties:
            auth_type:
              const: basic
            username:
              type: string
              description: Basic username.
              minLength: 1
              pattern: \S
            password:
              type: string
              description: Basic password.
              minLength: 1
              pattern: \S
          required:
            - username
            - password
        - title: Bearer authentication
          properties:
            auth_type:
              const: bearer
            token:
              type: string
              description: Processor bearer token.
              minLength: 1
              pattern: \S
          required:
            - auth_type
            - token
        - title: No processor authentication
          properties:
            auth_type:
              const: none
          required:
            - auth_type
    PayConnector:
      type: object
      description: >-
        Organization-owned connector. Examples and config properties here
        describe generic connectors; listing is not restricted to that type
        unless filter[type]=generic is supplied. Passwords and bearer tokens are
        omitted, not masked. Defaults for auth_type and timeout need not appear
        in stored config.
      properties:
        id:
          type: string
          description: Connector identifier.
          format: uuid
        name:
          type: string
          description: Connector name used for retrieval, update, deletion and Pay.
        record_type:
          type: string
          description: Resource type.
          enum:
            - pay_connector
        user_id:
          type: string
          description: Creating user; assigned from authentication, not request input.
        organization_id:
          type: string
          description: >-
            Owning organization; assigned from authentication, not request
            input.
        type:
          type: string
          description: >-
            Connector type; generic is covered by this reference. Other types
            may appear in unfiltered lists.
        mode:
          type: string
          enum:
            - test
            - live
          description: Configured mode.
        config:
          type: object
          description: >-
            Redacted stored configuration. Generic connector fields are shown
            here. Unknown config keys are discarded. Password and token are
            never returned.
          properties:
            endpoint_url:
              type: string
              description: >-
                HTTP or HTTPS processor URL with a host. Use HTTPS to protect
                payment data in transit.
              pattern: ^https?://\S+
              example: https://processor.example.com/pay
            auth_type:
              type: string
              description: >-
                Stored processor authentication selection. Omitted if it was not
                explicitly configured.
              enum:
                - none
                - basic
                - bearer
            username:
              description: >-
                Stored username, when supplied. Required to be a nonblank string
                for basic authentication.
            timeout:
              type: integer
              minimum: 1
              maximum: 4294967295
              description: >-
                Stored processor HTTP timeout in milliseconds. Omitted when no
                timeout was configured; the effective runtime default is 10000.
        created_at:
          type: string
          description: Creation time.
          format: date-time
        updated_at:
          type: string
          description: Last update time.
          format: date-time
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: Telnyx API key, not the processor bearer token.

````