# Create or update a customer by your own id

`PUT /api/v1/customers/by-external-id/{externalId}`

Needs the `customers:write` scope, or a full-access key.

## Path parameters

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `externalId` | string | required |  |

## Request body

JSON Schema:

```json
{
  "type": "object",
  "properties": {
    "email": {
      "type": "string",
      "format": "email"
    },
    "name": {
      "type": "string",
      "maxLength": 200
    },
    "currency": {
      "type": "string",
      "enum": [
        "USD",
        "AUD",
        "CAD",
        "GBP",
        "EUR",
        "INR",
        "NPR"
      ],
      "example": "USD"
    },
    "tax_id": {
      "type": "string",
      "maxLength": 100
    },
    "billing_address": {
      "type": "object",
      "additionalProperties": {},
      "description": "`country` (ISO alpha-2) and `state` drive tax selection."
    },
    "metadata": {
      "type": "object",
      "additionalProperties": {}
    }
  },
  "required": [
    "email"
  ]
}
```

## Responses

### 200

Updated.

JSON Schema:

```json
{
  "type": "object",
  "properties": {
    "data": {
      "type": "object",
      "additionalProperties": {},
      "description": "Same shape as `GET /customers/{id}`."
    },
    "_agent": {
      "type": "object",
      "properties": {
        "summary": {
          "type": "string"
        },
        "status": {
          "type": "string",
          "enum": [
            "ok"
          ]
        },
        "next_actions": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "warnings": {
          "type": "array",
          "items": {
            "type": "string"
          }
        }
      },
      "required": [
        "summary",
        "status",
        "next_actions",
        "warnings"
      ]
    },
    "api_version": {
      "type": "string",
      "example": "2026-07-01"
    }
  },
  "required": [
    "data",
    "_agent",
    "api_version"
  ]
}
```

### 201

Created (same body).
