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

# Update Customer

> Update the details of an existing customer

Update the details of an existing customer, such as correcting a misspelled name or refreshing an email or phone number that has changed. Identify the customer by the Soap `customer_id` (the `cus_` id returned when the customer was created) in the URL.

Since this is a `PATCH` request, only the fields you include in the request body are changed, and any fields you leave out keep their current values. Updates are always scoped to the customer belonging to the merchant whose API key is used.

<Note>
  At least one updatable field (`first_name`, `last_name`, `email`, `phone_number`, `date_of_birth`) must be provided, and any unrecognized field will cause the request to be rejected.
</Note>

<RequestExample>
  ```json Curl theme={null}
  curl -X PATCH "https://api-sandbox.paywithsoap.com/api/v1/customers/cus_A3GuXEbThpqk2t6UTxEuoceVJyUEAX7V" \
    -H "Authorization:  YOUR_API_KEY" \
    -H "Content-Type: application/json" \
    -d '{
      "first_name": "Jane",
      "phone_number": "5551234567"
    }'
  ```

  ```ruby Ruby theme={null}
  require 'net/http'
  require 'uri'
  require 'json'

  uri = URI.parse('https://api-sandbox.paywithsoap.com/api/v1/customers/cus_A3GuXEbThpqk2t6UTxEuoceVJyUEAX7V')
  http = Net::HTTP.new(uri.host, uri.port)
  http.use_ssl = true

  request = Net::HTTP::Patch.new(uri.path)
  request['Authorization'] = 'YOUR_API_KEY'
  request['Content-Type'] = 'application/json'
  request.body = {
    first_name: 'Jane',
    phone_number: '5551234567'
  }.to_json

  response = http.request(request)
  puts response.body
  ```

  ```javascript JavaScript theme={null}
  const axios = require('axios');

  const updateCustomer = async () => {
    try {
      const response = await axios.patch('https://api-sandbox.paywithsoap.com/api/v1/customers/cus_A3GuXEbThpqk2t6UTxEuoceVJyUEAX7V', {
        first_name: 'Jane',
        phone_number: '5551234567'
      }, {
        headers: {
          'Authorization': 'YOUR_API_KEY',
          'Content-Type': 'application/json'
        }
      });

      console.log(response.data);
    } catch (error) {
      console.error(error);
    }
  };

  updateCustomer();
  ```

  ```python Python theme={null}
  import requests
  import json

  url = "https://api-sandbox.paywithsoap.com/api/v1/customers/cus_A3GuXEbThpqk2t6UTxEuoceVJyUEAX7V"

  headers = {
      "Authorization": "YOUR_API_KEY",
      "Content-Type": "application/json"
  }

  data = {
      "first_name": "Jane",
      "phone_number": "5551234567"
  }

  response = requests.patch(url, headers=headers, json=data)
  print(response.json())
  ```
</RequestExample>

<ResponseExample>
  ```json Response theme={null}
  {
    "id": "cus_A3GuXEbThpqk2t6UTxEuoceVJyUEAX7V",
    "internal_id": "cust_123",
    "email": "customer@example.com",
    "first_name": "Jane",
    "last_name": "Doe",
    "phone_number": "5551234567",
    "date_of_birth": "1990-01-01",
    "created_at": "2025-03-10T16:08:14.427Z",
    "updated_at": "2025-03-12T09:15:42.001Z"
  }
  ```
</ResponseExample>


## OpenAPI

````yaml PATCH /api/v1/customers/{id}
openapi: 3.1.0
info:
  title: Soap API
  description: >-
    API documentation for Soap - AI-native payments infrastructure for complex,
    compliance-heavy payment flows
  license:
    name: MIT
  version: 1.4.0
servers:
  - url: https://api-sandbox.paywithsoap.com
security:
  - bearerAuth: []
paths:
  /api/v1/customers/{id}:
    patch:
      tags:
        - Customers
      summary: Updates a customer
      description: >-
        Partially updates an existing customer. Only the fields supplied in the
        request body are changed; omitted fields are left untouched. At least
        one updatable field must be provided.
      parameters:
        - name: id
          in: path
          required: true
          description: >-
            Unique Soap identifier of the customer to update (the `cus_` id
            returned at creation).
          schema:
            type: string
            example: cus_pQsQ4kz3Af6Mb9rCupnWj6VFzxJsmkYK
      requestBody:
        description: >-
          At least one updatable field must be present. Unknown fields are
          rejected.
        content:
          application/json:
            schema:
              type: object
              minProperties: 1
              additionalProperties: false
              properties:
                email:
                  type: string
                  format: email
                  description: >-
                    Email address of the customer. Must be unique within your
                    business.
                  example: john@acme.com
                first_name:
                  type: string
                  example: John
                last_name:
                  type: string
                  example: Doe
                phone_number:
                  type: string
                  description: >-
                    Phone number of the customer in ISO 8601 format (10 digits,
                    no hyphens, no country code). Must be unique within your
                    business.
                  example: '8008001234'
                date_of_birth:
                  type: string
                  format: date
                  description: >-
                    Date of birth of the customer in ISO 8601 format
                    (YYYY-MM-DD)
                  example: '1990-01-01'
      responses:
        '200':
          description: Customer updated.
          content:
            application/json:
              schema:
                type: object
                properties:
                  id:
                    type: string
                    description: >-
                      Unique identifier for the customer to be used for future
                      transactions.
                    example: cus_pQsQ4kz3Af6Mb9rCupnWj6VFzxJsmkYK
                  internal_id:
                    type: string
                    example: 3f1b8c4e-7c2e-4c2c-8d2f-179cf0efb36b
                  email:
                    type: string
                    example: john@acme.com
                  first_name:
                    type: string
                    example: John
                  last_name:
                    type: string
                    example: Doe
                  phone_number:
                    type: string
                    example: '8008001234'
                  date_of_birth:
                    type: string
                    format: date
                    example: '1990-01-01'
                  created_at:
                    type: string
                    format: date-time
                    example: '2025-03-05T18:26:43.069Z'
                  updated_at:
                    type: string
                    format: date-time
                    example: '2025-03-10T16:08:14.427Z'
        '400':
          description: The request body could not be parsed as JSON.
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                  hint:
                    type: string
        '401':
          description: Unauthorized - Invalid or missing API key
        '422':
          description: >-
            Invalid request — empty body, an unknown field, an invalid value, a
            duplicate email/phone number, or no customer with the given id for
            this business.
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                  hint:
                    type: string
      security:
        - bearerAuth: []
components:
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: Bearer token authentication using your API key

````