> Index of every page: https://docs.merchantservicedepot.com/llms.txt

# Create address


`POST /v1/addresses`

Fields are allow-listed: anything else you send is not stored.

Auth: a secret key with the `addresses.create` permission. Returns `201` with Address.

## Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `customerId` | body | string | Yes | The customer that owns or receives this resource. |
| `firstName` | body | string | No | The recipient’s first name. |
| `lastName` | body | string | No | The recipient’s last name. |
| `line1` | body | string | No | The first street-address line. |
| `city` | body | string | No | The locality or city. |
| `postalCode` | body | string | No | The postal or ZIP code. |
| `country` | body | string · ISO 3166-1 alpha-2 | No | A two-letter ISO 3166-1 country code. |

## Request

**curl**

```curl
curl -X POST "https://payments-api-sandbox.merchantservicedepot.com/v1/addresses" \
  -H "Authorization: Bearer $MYELA_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "customerId": "{{CUSTOMER_ID}}",
  "firstName": "Ada",
  "lastName": "Lovelace",
  "line1": "12 Marylebone Road",
  "city": "London",
  "postalCode": "NW1 5JD",
  "country": "GB"
}'
```

**Node**

```node
const res = await fetch("https://payments-api-sandbox.merchantservicedepot.com/v1/addresses", {
  method: "POST",
  headers: {
    Authorization: `Bearer ${process.env.MYELA_API_KEY}`,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    "customerId": "{{CUSTOMER_ID}}",
    "firstName": "Ada",
    "lastName": "Lovelace",
    "line1": "12 Marylebone Road",
    "city": "London",
    "postalCode": "NW1 5JD",
    "country": "GB"
  }),
});

if (!res.ok) {
  const { error } = await res.json();
  // Branch on error.code — never on error.message.
  throw new Error(error.code);
}
const data = await res.json();
```

**Python**

```python
import os
import requests

res = requests.post(
    "https://payments-api-sandbox.merchantservicedepot.com/v1/addresses",
    headers={
        "Authorization": f"Bearer {os.environ['MYELA_API_KEY']}",
    },
    json={
        "customerId": "{{CUSTOMER_ID}}",
        "firstName": "Ada",
        "lastName": "Lovelace",
        "line1": "12 Marylebone Road",
        "city": "London",
        "postalCode": "NW1 5JD",
        "country": "GB"
    },
)

if not res.ok:
    # Branch on error["code"] — never on error["message"].
    raise RuntimeError(res.json()["error"]["code"])
data = res.json()
```

## Response

| Field | Type | Description |
| --- | --- | --- |
| `id` | string | Unique address identifier. |
| `object` | "address" | Stable resource discriminator. |
| `customerId` | string | Customer that owns the address. |
| `firstName` | string | Recipient first name. |
| `lastName` | string | Recipient last name. |
| `line1` | string | Street address. |
| `city` | string | City or locality. |
| `postalCode` | string | Postal code. |
| `country` | string | Two-letter country code. |
| `createdAt` | string | ISO 8601 creation timestamp. |

```json
{
  "id": "addr_01JEXAMPLE",
  "object": "address",
  "customerId": "cus_01JEXAMPLE",
  "firstName": "Ada",
  "lastName": "Lovelace",
  "line1": "12 Marylebone Road",
  "city": "London",
  "postalCode": "NW1 5JD",
  "country": "GB",
  "createdAt": "2026-08-10T20:49:51.653Z"
}
```

Source: https://docs.merchantservicedepot.com/api-reference/create-address/
