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

# Manage customers

<div className="m-badge-page-wrapper">
  <Badge stroke color="orange" size="sm">Limited Release</Badge>
</div>

Customer management helps you update an existing customer's details and change their payment method. You can also remove customer information from PayPal when their business relationship ends.

## Update customer details

Use a <a href="/developer/how-to/api/get-started#2-get-an-access-token" target="_blank" rel="noopener noreferrer">valid access token</a> and make a PUT call to the `/v1/commerce/billing/customers/{external_customer_id}` endpoint with the modified request parameters such as customer name, email, address, phone, payment method token, and metadata.

**Path parameter**: `external_customer_id` is the `external_id` you provided when you <a href="/limited-release/usage-based-billing/set-up-billing-process/register-customers" target="_blank" rel="noopener noreferrer">registered the customer</a>.

For information on all parameters, see <a href="/reference/api/rest/customers/update-a-customer-by-id" target="_blank" rel="noopener noreferrer">API reference</a>.

<CodeGroup>
  ```shell lines expandable title="Sample request" theme={null}
  curl -X PUT 'https://api-m.sandbox.paypal.com/v1/commerce/billing/customers/5eb02857-a71e-4ea2-bcf9-57d3a41bc6b1' \
  -H 'Content-Type: application/json' \
  -H 'Authorization: Bearer <ACCESS-TOKEN>' \
  -d '{
    "name": "Jane Doe",
    "email": "jdoe@gmail.com",
    "billing_entity_code": "US_ENTITY",
    "address": {
      "line1": "123 First Street",
      "line2": "Alameda Court",
      "city": "San Jose",
      "state": "CA",
      "postal_code": "95110",
      "country": "US"
    },
    "phone": "5839458934",
    "payment_method_token": "6ta69628uw121251c",
    "tax_codes": [
      "standard_vat",
      "digital_services_tax"
    ],
    "metadata": [
      {
        "key": "Purchase Order",
        "value": "PO-2023-4521",
        "display_in_invoice": true
      },
      {
        "key": "Sales Region",
        "value": "West Coast",
        "display_in_invoice": false
      }
    ]
  }'
  ```

  ```json lines expandable title="Sample response" theme={null}
  {
    "name": "Jane Doe",
    "external_id": "5eb02857-a71e-4ea2-bcf9-57d3a41bc6b1",
    "email": "jdoe@gmail.com",
    "billing_entity_code": "US_ENTITY",
    "address": {
      "line1": "123 First Street",
      "line2": "Alameda Court",
      "city": "San Jose",
      "state": "CA",
      "postal_code": "95110",
      "country": "US"
    },
    "phone": "5839458934",
    "payment_method_token": "6ta69628uw121251c",
    "payment_method_type": "CARD",
    "taxes": [
      {
        "code": "standard_vat",
        "name": "Standard VAT",
        "rate": 20.0,
        "type": "VAT"
      },
      {
        "code": "digital_services_tax",
        "name": "Digital Services Tax",
        "rate": 3.0,
        "type": "DIGITAL_TAX"
      }
    ],
    "id": "f772b19c-c5c2-426d-8871-346a6cd094c5",
    "metadata": [
      {
        "key": "Purchase Order",
        "value": "PO-2023-4521",
        "display_in_invoice": true
      },
      {
        "key": "Sales Region",
        "value": "West Coast",
        "display_in_invoice": false
      }
    ]
  }
  ```
</CodeGroup>

A successful call returns a `200 OK` response with the updated customer information.

## Change payment method

Use a <a href="/developer/how-to/api/get-started#2-get-an-access-token" target="_blank" rel="noopener noreferrer">valid access token</a> and make a PUT call to the `/v1/commerce/billing/customers/{external_customer_id}` endpoint with the modified payment method token.

**Path parameter**: `external_customer_id` is the `external_id` you provided when you <a href="/limited-release/usage-based-billing/set-up-billing-process/register-customers" target="_blank" rel="noopener noreferrer">registered the customer</a>.

For information on all parameters, see <a href="/reference/api/rest/customers/update-a-customer-by-id" target="_blank" rel="noopener noreferrer">API reference</a>.

There are two scenarios for updating a customer's payment method:

**Scenario 1: Customer adding a new payment method**

1. <a href="/limited-release/usage-based-billing/set-up-billing-process/register-customers#1-save-payment-method-and-get-payment-method-token-pmt" target="_blank" rel="noopener noreferrer">Generate a payment method token</a>.
2. Update customer details with the new token.

**Scenario 2: Customer changing their payment method to an already vaulted payment method**

1. Retrieve the payment method token associated with the selected payment method. For information on this, see <a href="/limited-release/usage-based-billing/set-up-billing-process/register-customers#get-saved-payment-method-details-for-customer-confirmation" target="_blank" rel="noopener noreferrer">Get saved payment method details for customer confirmation</a>.
2. Update customer details with the retrieved token.

<CodeGroup>
  ```shell lines expandable title="Sample request" theme={null}
  curl -X PUT 'https://api-m.sandbox.paypal.com/v1/commerce/billing/customers/5eb02857-a71e-4ea2-bcf9-57d3a41bc6b1' \
  -H 'Content-Type: application/json' \
  -H 'Authorization: Bearer <ACCESS-TOKEN>' \
  -d '{
    "name": "Jane Doe",
    "email": "jdoe@gmail.com",
    "billing_entity_code": "US_ENTITY",
    "address": {
      "line1": "123 First Street",
      "line2": "Alameda Court",
      "city": "San Jose",
      "state": "CA",
      "postal_code": "95110",
      "country": "US"
    },
    "phone": "5839458934",
    "payment_method_token": "8kf93hd72jw903847",
    "tax_codes": [
      "standard_vat",
      "digital_services_tax"
    ],
    "metadata": [
      {
        "key": "Purchase Order",
        "value": "PO-2023-4521",
        "display_in_invoice": true
      },
      {
        "key": "Sales Region",
        "value": "West Coast",
        "display_in_invoice": false
      }
    ]
  }'
  ```

  ```json lines expandable title="Sample response" theme={null}
  {
    "name": "Jane Doe",
    "external_id": "5eb02857-a71e-4ea2-bcf9-57d3a41bc6b1",
    "email": "jdoe@gmail.com",
    "address": {
      "line1": "123 First Street",
      "line2": "Alameda Court",
      "city": "San Jose",
      "state": "CA",
      "postal_code": "95110",
      "country": "US"
    },
    "phone": "5839458934",
    "payment_method_token": "8kf93hd72jw903847",
    "payment_method_type": "CARD",
    "id": "f772b19c-c5c2-426d-8871-346a6cd094c5",
    "metadata": [
      {
        "key": "Purchase Order",
        "value": "PO-2023-4521",
        "display_in_invoice": true
      },
      {
        "key": "Sales Region", 
        "value": "West Coast",
        "display_in_invoice": false
      }
    ]
  }
  ```
</CodeGroup>

A successful call returns a `200 OK` response with the updated customer information.

## Delete customer information

Use a <a href="/developer/how-to/api/get-started#2-get-an-access-token" target="_blank" rel="noopener noreferrer">valid access token</a> and make a DELETE call to the `/v1/commerce/billing/customers/{external_customer_id}` endpoint.

**Path parameter**: `external_customer_id` is the `external_id` you provided when you <a href="/limited-release/usage-based-billing/set-up-billing-process/register-customers" target="_blank" rel="noopener noreferrer">registered the customer</a>.

<CodeGroup>
  ```shell lines title="Sample request" theme={null}
  curl -X DELETE 'https://api-m.sandbox.paypal.com/v1/commerce/billing/customers/5eb02857-a71e-4ea2-bcf9-57d3a41bc6b1' \
  -H 'Content-Type: application/json' \
  -H 'Authorization: Bearer <ACCESS-TOKEN>'
  ```
</CodeGroup>

A successful call returns a `204 No Content` response.
