> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.usglobalmail.com/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.usglobalmail.com/_mcp/server.

# Add address

POST https://api.usglobalmail.com/v1/addresses
Content-Type: application/json

Add a new shipping or check-deposit address to your account

Reference: https://docs.usglobalmail.com/api/api-reference/addresses/create

## Authentication

- `Authorization` header (bearer token, required) — Your API key, sent as `Authorization: Bearer usgmk_live_…` in production or `usgmk_test_…` in the sandbox.

## Servers

- `https://api.usglobalmail.com` (Production, default)
- `https://api-sandbox.usglobalmail.com` (Sandbox)

## Request

### Body (application/json)

This endpoint expects a CreateAddressDto.

- `type` (enum, required) — `shipping` = a shipment destination; `deposit` = where check deposits are sent.
  - Allowed values: `shipping`, `deposit`
- `name` (string, required)
- `line1` (string, required)
- `city` (string, required)
- `state` (string, required)
- `postal_code` (string, required)
- `country` (string, required)
- `phone_number` (string, required)
- `line2` (string, optional)
- `line3` (string, optional)
- `tax_id` (string, optional)

## Response

### 201

- `id` (string, required) — Address id (UUID).
- `type` (enum, required) — `shipping` = a shipment destination; `deposit` = where check deposits are sent.
  - Allowed values: `shipping`, `deposit`
- `is_default` (boolean, required) — The default address of its `type` — one per type.
- `name` (string, optional, nullable) — Recipient name on the address.
- `line1` (string, optional, nullable)
- `line2` (string, optional, nullable)
- `city` (string, optional, nullable)
- `state` (string, optional, nullable)
- `postal_code` (string, optional, nullable)
- `country` (string, optional, nullable)
- `line3` (string, optional, nullable)
- `phone_number` (string, optional, nullable)
- `tax_id` (string, optional, nullable)

## Errors

### 400 Bad Request Error

Bad request.

- `type` (string, required)
- `title` (string, required)
- `status` (integer, required)
- `code` (string, required)
- `request_id` (string, required)
- `detail` (string, optional)
- `instance` (string, optional)
- `errors` (list of ProblemDetailsDtoErrorsItems, optional)

### 401 Unauthorized Error

Authentication is required or the API key is invalid.

- `type` (string, required)
- `title` (string, required)
- `status` (integer, required)
- `code` (string, required)
- `request_id` (string, required)
- `detail` (string, optional)
- `instance` (string, optional)
- `errors` (list of ProblemDetailsDtoErrorsItems, optional)

### 403 Forbidden Error

You are not permitted to perform this action.

- `type` (string, required)
- `title` (string, required)
- `status` (integer, required)
- `code` (string, required)
- `request_id` (string, required)
- `detail` (string, optional)
- `instance` (string, optional)
- `errors` (list of ProblemDetailsDtoErrorsItems, optional)

### 404 Not Found Error

Resource not found.

- `type` (string, required)
- `title` (string, required)
- `status` (integer, required)
- `code` (string, required)
- `request_id` (string, required)
- `detail` (string, optional)
- `instance` (string, optional)
- `errors` (list of ProblemDetailsDtoErrorsItems, optional)

### 409 Conflict Error

The request conflicts with the current state of the resource.

- `type` (string, required)
- `title` (string, required)
- `status` (integer, required)
- `code` (string, required)
- `request_id` (string, required)
- `detail` (string, optional)
- `instance` (string, optional)
- `errors` (list of ProblemDetailsDtoErrorsItems, optional)

### 422 Unprocessable Entity Error

Validation failed.

- `type` (string, required)
- `title` (string, required)
- `status` (integer, required)
- `code` (string, required)
- `request_id` (string, required)
- `detail` (string, optional)
- `instance` (string, optional)
- `errors` (list of ProblemDetailsDtoErrorsItems, optional)

### 429 Too Many Requests Error

Rate limit exceeded.

- `type` (string, required)
- `title` (string, required)
- `status` (integer, required)
- `code` (string, required)
- `request_id` (string, required)
- `detail` (string, optional)
- `instance` (string, optional)
- `errors` (list of ProblemDetailsDtoErrorsItems, optional)

### 500 Internal Server Error

Internal error.

- `type` (string, required)
- `title` (string, required)
- `status` (integer, required)
- `code` (string, required)
- `request_id` (string, required)
- `detail` (string, optional)
- `instance` (string, optional)
- `errors` (list of ProblemDetailsDtoErrorsItems, optional)

## Types

### ProblemDetailsDtoErrorsItems

- `field` (string, required)
- `message` (string, required)
- `code` (string, optional)

## Examples

**Request**

```json
{
  "type": "shipping",
  "name": "John Doe",
  "line1": "1234 Elm Street",
  "city": "Springfield",
  "state": "IL",
  "postal_code": "62704",
  "country": "USA",
  "phone_number": "+1-217-555-1234"
}
```

**Response**

```json
{
  "id": "a3f1c9e2-7b4d-4f8a-9c2e-1d2f3b4a5c6d",
  "type": "shipping",
  "is_default": true,
  "name": "John Doe",
  "line1": "1234 Elm Street",
  "line2": "Apt 101",
  "city": "Springfield",
  "state": "IL",
  "postal_code": "62704",
  "country": "USA",
  "line3": "Building B",
  "phone_number": "+1-217-555-1234",
  "tax_id": "98-7654321"
}
```

**SDK Code**

```python
import requests

url = "https://api.usglobalmail.com/v1/addresses"

payload = {
    "type": "shipping",
    "name": "John Doe",
    "line1": "1234 Elm Street",
    "city": "Springfield",
    "state": "IL",
    "postal_code": "62704",
    "country": "USA",
    "phone_number": "+1-217-555-1234"
}
headers = {
    "Authorization": "Bearer <token>",
    "Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.json())
```

```javascript
const url = 'https://api.usglobalmail.com/v1/addresses';
const options = {
  method: 'POST',
  headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
  body: '{"type":"shipping","name":"John Doe","line1":"1234 Elm Street","city":"Springfield","state":"IL","postal_code":"62704","country":"USA","phone_number":"+1-217-555-1234"}'
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://api.usglobalmail.com/v1/addresses"

	payload := strings.NewReader("{\n  \"type\": \"shipping\",\n  \"name\": \"John Doe\",\n  \"line1\": \"1234 Elm Street\",\n  \"city\": \"Springfield\",\n  \"state\": \"IL\",\n  \"postal_code\": \"62704\",\n  \"country\": \"USA\",\n  \"phone_number\": \"+1-217-555-1234\"\n}")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("Authorization", "Bearer <token>")
	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby
require 'uri'
require 'net/http'

url = URI("https://api.usglobalmail.com/v1/addresses")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"type\": \"shipping\",\n  \"name\": \"John Doe\",\n  \"line1\": \"1234 Elm Street\",\n  \"city\": \"Springfield\",\n  \"state\": \"IL\",\n  \"postal_code\": \"62704\",\n  \"country\": \"USA\",\n  \"phone_number\": \"+1-217-555-1234\"\n}"

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

```java
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://api.usglobalmail.com/v1/addresses")
  .header("Authorization", "Bearer <token>")
  .header("Content-Type", "application/json")
  .body("{\n  \"type\": \"shipping\",\n  \"name\": \"John Doe\",\n  \"line1\": \"1234 Elm Street\",\n  \"city\": \"Springfield\",\n  \"state\": \"IL\",\n  \"postal_code\": \"62704\",\n  \"country\": \"USA\",\n  \"phone_number\": \"+1-217-555-1234\"\n}")
  .asString();
```

```php
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.usglobalmail.com/v1/addresses', [
  'body' => '{
  "type": "shipping",
  "name": "John Doe",
  "line1": "1234 Elm Street",
  "city": "Springfield",
  "state": "IL",
  "postal_code": "62704",
  "country": "USA",
  "phone_number": "+1-217-555-1234"
}',
  'headers' => [
    'Authorization' => 'Bearer <token>',
    'Content-Type' => 'application/json',
  ],
]);

echo $response->getBody();
```

```csharp
using RestSharp;

var client = new RestClient("https://api.usglobalmail.com/v1/addresses");
var request = new RestRequest(Method.POST);
request.AddHeader("Authorization", "Bearer <token>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"type\": \"shipping\",\n  \"name\": \"John Doe\",\n  \"line1\": \"1234 Elm Street\",\n  \"city\": \"Springfield\",\n  \"state\": \"IL\",\n  \"postal_code\": \"62704\",\n  \"country\": \"USA\",\n  \"phone_number\": \"+1-217-555-1234\"\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let headers = [
  "Authorization": "Bearer <token>",
  "Content-Type": "application/json"
]
let parameters = [
  "type": "shipping",
  "name": "John Doe",
  "line1": "1234 Elm Street",
  "city": "Springfield",
  "state": "IL",
  "postal_code": "62704",
  "country": "USA",
  "phone_number": "+1-217-555-1234"
] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://api.usglobalmail.com/v1/addresses")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```