# Carrier accounts

Commerce Layer integrates with **100+ shipping carriers** via [EasyPost](https://www.easypost.com/carriers).

{% hint style="info" %}
Among all the EastPost carriers, we support only the ones that provide a full integration (i.e. shipping **labels**, **rates**, and **tracking**).
{% endhint %}

Configuring a carrier account for a market is optional and enables you to purchase and print shipping labels in one click and provide real-time tracking updates to your customers. You can connect more carriers to the same market to get more rate options and choose the best one for each shipment.

## Setting up a carrier account

You can set up a carrier account from the admin UI. All you need to do is choose the carrier type and provide all the credentials requested by the selected shipping service. Otherwise, you can create it via API. To do that you need to give it a meaningful name within your organization, specify the type of carrier among the ones provided by Easypost as the value of the `easypost_type` attribute, and fill the `credentials` object accordingly. The required credentials differ based on the selected carrier. To check which credential keys are requested by each carrier you can fetch the carrier accounts schema from the core public endpoint `/api/public/schemas/carrier_accounts`:

{% tabs %}
{% tab title="Request" %}
The following request fetches the available types of carrier accounts:

```shell

curl -g -X GET \
  'https://core.commercelayer.io/api/public/schemas/carrier_accounts' \
  -H 'Content-Type: application/vnd.api+json'
```

{% endtab %}

{% tab title="Response" %}
On success, the API responds with a `200 OK` status code, returning the list of all the available carrier accounts with the related credentials and useful information:

<pre class="language-json"><code class="lang-json">
{
  "data": [
    {
      "object": "CarrierType",
<strong>      "type": "AccurateAccount",
</strong>      "readable": "Accurate",
      "logo": null,
      "fields": {
<strong>        "credentials": {
</strong><strong>          "username": {
</strong>            "visibility": "visible",
            "label": "Accurate username"
          },
<strong>          "password": {
</strong>            "visibility": "password",
            "label": "Accurate password"
          }
        },
        "test_credentials": {
          "username": {
            "visibility": "visible",
            "label": "Accurate test username"
          },
          "password": {
            "visibility": "password",
            "label": "Accurate test password"
          }
        }
      }
    },
    {
      "object": "CarrierType",
<strong>       "type": "AmazonMwsAccount",
</strong>      "readable": "Amazon MWS",
      "logo": null,
      "fields": {
<strong>         "credentials": {
</strong><strong>           "access_key_id": {
</strong>            "visibility": "visible",
             "label": "AWS Access Key ID"
           },
<strong>           "secret_key": {
</strong>             "visibility": "password",
             "label": "Secret Key"
           },
<strong>           "merchant_id": {
</strong>             "visibility": "visible",
             "label": "Seller ID"
           }
         }
      }
    },
    { ... }
  ]
}
</code></pre>

{% endtab %}
{% endtabs %}

{% hint style="info" %}
In case you're working in test mode, remember to use the `test_credentials` object instead of the `credentials` object (if it's provided by the carrier, otherwise keep using `credentials`).
{% endhint %}

<details>

<summary>Data model</summary>

Check the related [ER diagram](/data-model/shipping/shipping-carriers.md) and explore the flowchart that illustrates how the carrier account resource relates to the other API entities.

</details>


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.commercelayer.io/core-api-reference/carrier_accounts.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
