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

# Update a customer

> Changes the name, the email or the phone; fields left out are kept, and `null` clears one. The change shows in the Payra dashboard at once, and a new email is where receipts go and who can sign in to the customer portal from then on. `reference` cannot be changed. Not available on a workspace whose customers come from an ERP integration.



## OpenAPI

````yaml /api-reference/openapi-v1.json post /customers/{id}
openapi: 3.1.0
info:
  title: Payra API
  version: v1
  description: >-
    The Payra API. Authenticate with a secret key: `Authorization: Bearer
    sk_test_...`. The two payment method session endpoints Payra Elements calls
    also take a publishable key with the session's `client_secret`.
servers:
  - url: https://api-dashboard.payra.com/v1
    description: 'Sandbox and live: the key decides which'
security: []
paths:
  /customers/{id}:
    post:
      tags:
        - Customers
      summary: Update a customer
      description: >-
        Changes the name, the email or the phone; fields left out are kept, and
        `null` clears one. The change shows in the Payra dashboard at once, and
        a new email is where receipts go and who can sign in to the customer
        portal from then on. `reference` cannot be changed. Not available on a
        workspace whose customers come from an ERP integration.
      parameters:
        - schema:
            type: string
            minLength: 1
            maxLength: 64
          required: true
          name: id
          in: path
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                name:
                  type:
                    - string
                    - 'null'
                  minLength: 1
                  maxLength: 200
                  example: Ada Lovelace
                  description: >-
                    The name shown in the Payra dashboard. `null` shows the
                    email instead, or the reference.
                email:
                  type:
                    - string
                    - 'null'
                  maxLength: 254
                  format: email
                  example: ada@example.com
                  description: >-
                    Where Payra sends this customer's payment receipts, and the
                    address that signs in to the customer portal. `null` removes
                    it. Other addresses your team added in the dashboard are
                    kept either way.
                phone:
                  type:
                    - string
                    - 'null'
                  pattern: ^\+[1-9]\d{9,14}$
                  example: '+15555550123'
                  description: E.164; `null` removes it.
              additionalProperties: false
      responses:
        '200':
          description: The customer
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Customer'
        '400':
          description: >-
            Invalid parameters, or `name: null` on a customer with no email or
            reference
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          description: Missing, invalid or revoked API key
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '403':
          description: >-
            The API is not enabled for the workspace, the key lacks the scope,
            or the workspace's customers come from its ERP integration
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: No such customer in this workspace
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '429':
          description: Rate limit exceeded; see Retry-After
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '500':
          description: Internal error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
      security:
        - bearerAuth: []
components:
  schemas:
    Customer:
      type: object
      properties:
        object:
          type: string
          enum:
            - customer
        id:
          type: string
          format: uuid
          example: 019e2b4c-7a1d-7c3e-9f20-5b8d4e6a1c30
          description: >-
            Pass it as `customer` on a payment method session, a checkout
            session or a payment.
        reference:
          type:
            - string
            - 'null'
          example: user_48213
          description: >-
            Your own id for the customer; null for customers created in the
            Payra dashboard or by an ERP.
        name:
          type:
            - string
            - 'null'
          example: Ada Lovelace
          description: >-
            The name shown in the Payra dashboard: the email, or the reference,
            when created without one.
        email:
          type:
            - string
            - 'null'
          example: ada@example.com
        phone:
          type:
            - string
            - 'null'
          example: '+15555550123'
        created_at:
          type: string
          format: date-time
          example: '2026-09-29T14:00:00.000Z'
      required:
        - object
        - id
        - reference
        - name
        - email
        - phone
        - created_at
    Error:
      type: object
      properties:
        error:
          type: object
          properties:
            type:
              type: string
              enum:
                - invalid_request_error
                - authentication_error
                - permission_error
                - rate_limit_error
                - idempotency_error
                - card_error
                - api_error
            code:
              type: string
            message:
              type: string
            param:
              type: string
            request_id:
              type: string
          required:
            - type
            - code
            - message
            - request_id
          additionalProperties:
            type: string
      required:
        - error
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: >-
        A secret key, `sk_test_...` or `sk_live_...`; a publishable key
        (`pk_...`) on the browser routes only

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.