# Customer Address Widget via API

## Overview

Use this flow when you want to keep your own UI while letting inabit Terminal handle the crypto backend.\
This guide covers only the Customer Address widget end-to-end backend flow:\
your backend will 1) identify the customer, 2) request a one-time address token, 3) (optionally) fetch allowed assets/blockchains, and 4) generate a deposit address for the chosen blockchain + asset.

### **Scope**

* Widget type: Customer Address only (not Purchase or other widgets).
* Side: Backend/server only (no client-side API calls here).

### **Security (important):**

* All API calls on this page must be made from your server
* Never expose your Widget API Key to the browser or mobile client.

### Prerequisites

* A Customer Address widget configured in the inabit UI (copy the Widget API Key from the code/snippet panel).
* The list of blockchains you want to support in the widget (configure in the UI).

Base URL : <https://api.inabit.biz>

### Step 1 - Create or Get the Customer UUID

Each customer is identified by a customerUuid. Use your own stable identifier (email, user ID) as the customerIdentifier.

#### 1.1 Create (if the customer does not exist)

```
curl --location 'https://api.inabit.biz/v1/customer' \
  --header 'Content-Type: application/json' \
  --header 'Authorization: Bearer {widget api key}' \
  --data-raw '{
    "customerIdentifier": "exampleemail@gmail.com"
  }'
```

**Response**

```
{
  "data": {
    "id": "f8a68b70-657d-4bfb-b343-52e733f4e78b",
    "widgetId": "85b8e3d5-1030-4a7c-8e64-5269462ec811",
    "customerIdentifier": "exampleemail@gmail.com"
  }
}
```

#### 1.2 Get existing customer id

{% hint style="info" %}
If the customer already exists and you saved the customer id - you can skip this step do go to create token)
{% endhint %}

```
curl --location 'https://api.inabit.biz/v1/customer?customerIdentifier=exampleemail@gmail.com' \
  --header 'Authorization: Bearer {widget api key}' \
  --data ''
```

**Response**

```
{
  "data": {
    "id": "54c18bc5-70d3-45bd-81c2-e2bbaba27464",
    "widgetId": "85b8e3d5-1030-4a7c-8e64-5269462ec811",
    "customerIdentifier": "exampleemail@gmail.com"
  }
}
```

#### Step 2 - Create an Address Token for the Customer

The **address** **token** authorizes address creation for this specific customer.

```
curl --location 'https://api.inabit.biz/v1/customer/address-token' \
  --header 'Content-Type: application/json' \
  --header 'Authorization: Bearer {widget api key}' \
  --data '{
    "customerUuid": "54c18bc5-70d3-45bd-81c2-e2bbaba27464"
  }'
```

**Response**

```
{
  "data": {
    "customerUuid": "54c18bc5-70d3-45bd-81c2-e2bbaba27464",
    "addressGenerationToken": "b92605cb-ed0d-4d7e-89d4-a03f3ec26a6a"
  }
}
```

* Store the `addressGenerationToken` temporarily (it’s one-time/short-lived).

From this point on, the **Authorization header must use the address token**, not the API key.

#### Step 3 - (Optional) Fetch Allowed Assets/Blockchains

If needed fetch the widget  asset list&#x20;

```
curl --location 'https://api.inabit.biz/v1/customer/asset' \
  --header 'Authorization: Bearer b92605cb-ed0d-4d7e-89d4-a03f3ec26a6a' \
  --data ''
```

Response

```
{
  "data": {
    "assets": [
      { "asset": "TRX",  "blockchains": ["tron"] },
      { "asset": "USDT", "blockchains": ["tron"] },
      { "asset": "BUSD", "blockchains": ["ethereum"] }
    ],
    "total": 3
  }
}
```

This is the list of all supported asset for the widget.

### Step 4 - Generate the Deposit Address (per Blockchain & Asset)

Request the address for the chosen blockchain and asset.

```
curl --location 'https://api.inabit.biz/v1/customer/deposit-address' \
  --header 'Content-Type: application/json' \
  --header 'Authorization: Bearer b92605cb-ed0d-4d7e-89d4-a03f3ec26a6a' \
  --data '{
    "blockchain": "tron",
    "asset": "TRX"
}'
```

**Response**

```
{
  "data": {
    "id": 273,
    "address": "TTf28GEr2eGKAB5YnhnE1x38b9QB6CArSe",
    "walletIdInabit": "cmcf6ko51000l6701ho72vqgw",
    "blockchainCode": "tron",
    "customerId": "54c18bc5-70d3-45bd-81c2-e2bbaba27464",
    "widgetId": "85b8e3d5-1030-4a7c-8e64-5269462ec811"
  }
}
```

Use `data.address` as the **customer’s deposit address** for that blockchain/asset and save it for further use of the customer (this will be the customer’s address moving forward for this given blockchain and Asset)

\ <br>


---

# 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.inabit.com/inabit-terminal/how-to-get-started/deploy-widgets-on-your-site/customer-address-widget/customer-address-widget-via-api.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.
