# Brand

The `Brand` object allows you to customize the publicly-accessible HMTL page that shows tracking details for every EasyPost tracker.

You can change your logo, brand color, include an ad to keep your customers engaged, as well as some other theme-specific details to customize the way your tracking pages will look.

Your `Brand` can be set from the EasyPost dashboard or via the API.

---

## Brand object

| Property | Type | Description |
|----------|------|-------------|
| id | string | Unique, begins with 'brd_' |
| background_color | string | Valid hex code |
| color | string | Valid hex code |
| logo | string | Base64-encoded string for a PNG, GIF, JPEG, or SVG |
| logo_href | string | Valid URL, under 255 characters |
| ad | string | Base64-encoded string for a PNG, GIF, JPEG, or SVG |
| ad_href | string | Valid URL, under 255 characters |
| name | string | The name associated with the User object |
| user_id | string | The ID of the User object |
| theme | string | The name of the theme template. Possible values: theme1 theme2 |

Example Object:

```json
{
  "ad": null,
  "ad_href": null,
  "background_color": null,
  "color": "#123456",
  "id": "brd_aa3f5a1043ca46cf8e2e9b879c9a5895",
  "logo": "https://assets.easypost.com/assets/images/branding/easypost-primary-logo.7324aa54b64b34d6cd70ca5ba4d1842d.svg",
  "logo_href": "https://www.easypost.com",
  "name": "EasyPost",
  "object": "Brand",
  "theme": "theme1",
  "user_id": "user_060ab38db3c04ffaa60f262e5781a9be"
}
```

---

## Update a Brand

### Example: PATCH /users/:id/brand

#### cURL

```shell
curl -X PATCH https://api.easypost.com/v2/users/user_.../brand \
  -u "EASYPOST_API_KEY": \
  -H 'Content-Type: application/json' \
  -d '{
    "brand": {
      "background_color": "#FFFFFF",
      "color": "#303F9F",
      "logo": "data:image/png;base64,iVBORw0K...",
      "logo_href": "https://easypost.com",
      "ad": "null",
      "ad_href": "null",
      "theme": "theme1"
    }
  }'
```

#### Go

```go
package example

import (
	"fmt"

	"github.com/EasyPost/easypost-go/v5"
)

func brand() {
	client := easypost.New("EASYPOST_API_KEY")

	brand, _ := client.UpdateBrand(
		"user_...",
		map[string]interface{}{
			"color": "#303F9F",
		},
	)

	fmt.Println(brand)
}
```

#### Java

```java
package brand;

import com.easypost.exception.EasyPostException;
import com.easypost.model.Brand;
import com.easypost.service.EasyPostClient;

import java.util.HashMap;

public class Update {
    public static void main(String[] args) throws EasyPostException {
        EasyPostClient client = new EasyPostClient("EASYPOST_API_KEY");

        HashMap<String, Object> params = new HashMap<>();
        params.put("color", "303F9F");

        Brand brand = client.user.updateBrand("user_...", params);

        System.out.println(brand);
    }
}
```

#### C#

```csharp
using System;
using System.Collections.Generic;
using System.Threading.Tasks;
using EasyPost;
using Newtonsoft.Json;

namespace EasyPostExamples
{
    public class Examples
    {
        public static async Task Main()
        {
            var client = new EasyPost.Client(new EasyPost.ClientConfiguration("EASYPOST_API_KEY"));

            EasyPost.Parameters.User.UpdateBrand parameters = new()
            {
                BackgroundColorHexCode = "#FFFFFF",
                ColorHexCode = "#303F9F",
                LogoBase64 = "data:image/png;base64,iVBORw0K...",
                LogoUrl = "https://easypost.com",
                AdBase64 = null,
                AdUrl = null,
                Theme = "theme1"
            };

            EasyPost.Models.API.Brand brand = await client.User.UpdateBrand("user_...", parameters);

            Console.WriteLine(JsonConvert.SerializeObject(user, Formatting.Indented));
        }
    }
}
```

#### Node.js

```javascript
const EasyPostClient = require('@easypost/api');

const client = new EasyPostClient('EASYPOST_API_KEY');

(async () => {
  const brand = await client.User.updateBrand('user_...', { color: '#303F9F' });

  console.log(brand);
})();
```

#### PHP

```php
<?php

$client = new \EasyPost\EasyPostClient('EASYPOST_API_KEY');

$brand = $client->user->updateBrand(
    'user_...',
    ['color' => '#303F9F']
);

echo $brand;
```

#### Python

```python
import easypost

client = easypost.EasyPostClient("EASYPOST_API_KEY")

brand = client.user.update_brand("user_...", color="#303F9F")

print(brand)
```

#### Ruby

```ruby
require 'easypost'

client = EasyPost::Client.new(api_key: 'EASYPOST_API_KEY')

brand = client.user.update_brand(
  'user_...',
  color: '#303F9F',
)

puts brand
```

To update a `Brand`, you need to specify the `User`.