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

# Create a customer linked to a merchant



## OpenAPI

````yaml /openapi.json post /merchants/{merchantId}/customers
openapi: 3.0.0
info:
  title: PayGood Merchant API
  description: Server-to-server integration surface for merchant API keys.
  version: '1.0'
  contact: {}
servers:
  - url: https://api-sandbox.paygood.co
    description: Sandbox
  - url: https://api.paygood.co
    description: Production
security: []
paths:
  /merchants/{merchantId}/customers:
    post:
      tags:
        - customers
      summary: Create a customer linked to a merchant
      operationId: MerchantCustomersController_create
      parameters:
        - name: merchantId
          required: true
          in: path
          description: Merchant TypeID (`mer_...`) for the owner context.
          schema:
            type: string
      requestBody:
        required: true
        description: >-
          Create a customer under the merchant scope. Request shape depends on
          `entityType`.
        content:
          application/json:
            schema:
              oneOf:
                - type: object
                  properties:
                    entityType:
                      type: string
                      enum:
                        - individual
                    firstName:
                      type: string
                      minLength: 1
                      description: Individual legal first name.
                    lastName:
                      type: string
                      minLength: 1
                      description: Individual legal last name.
                    email:
                      type: string
                      format: email
                    phone:
                      type: string
                      minLength: 1
                      description: Optional customer phone number.
                    idempotencyKey:
                      type: string
                      minLength: 1
                      description: Idempotency key for safe create retries.
                  required:
                    - entityType
                    - firstName
                    - lastName
                    - email
                    - idempotencyKey
                - type: object
                  properties:
                    entityType:
                      type: string
                      enum:
                        - organization
                    organizationName:
                      type: string
                      minLength: 1
                      description: Registered business or organization name.
                    email:
                      type: string
                      format: email
                    phone:
                      type: string
                      minLength: 1
                      description: Optional customer phone number.
                    idempotencyKey:
                      type: string
                      minLength: 1
                      description: Idempotency key for safe create retries.
                  required:
                    - entityType
                    - organizationName
                    - email
                    - idempotencyKey
              discriminator:
                propertyName: entityType
            examples:
              individual:
                summary: Individual customer linked to merchant
                value:
                  entityType: individual
                  firstName: Ahmadou
                  lastName: Diallo
                  email: ahmadou.diallo@example.com
                  phone: '+12025550125'
                  idempotencyKey: idem_merchant_customer_individual_001
              organization:
                summary: Organization customer linked to merchant
                value:
                  entityType: organization
                  organizationName: Sahel Trade Co
                  email: ops@saheltrade.example.com
                  phone: '+12025550126'
                  idempotencyKey: idem_merchant_customer_organization_001
      responses:
        '201':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MerchantScopedCustomerResponseDto'
      security:
        - bearer: []
components:
  schemas:
    MerchantScopedCustomerResponseDto:
      type: object
      properties:
        customerId:
          type: string
        name:
          type: string
          minLength: 1
        displayName:
          type: string
          minLength: 1
        firstName:
          type: string
        lastName:
          type: string
        organizationName:
          type: string
        email:
          type: string
          format: email
          pattern: >-
            ^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$
        entityType:
          type: string
          enum:
            - individual
            - organization
        phone:
          type: string
        createdAt:
          type: string
          format: date-time
          pattern: >-
            ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z))$
      required:
        - customerId
        - name
        - displayName
        - email
        - entityType
        - createdAt
  securitySchemes:
    bearer:
      scheme: bearer
      bearerFormat: merchant_<prefix>_<secret>
      type: http
      description: >-
        Merchant API key bearer token. Legacy wire prefixes `api_key_` and
        `api_` are also accepted.

````