---
title: "External Accounts"
description: "Register the bank accounts and crypto wallets your customer uses as the source or destination of funds before you create exchange orders."
canonical_url: "https://docs.stablegate.com/docs/guide/external-accounts"
---
# External Accounts

> Register the bank accounts and crypto wallets your customer uses as the source or destination of funds before you create exchange orders.

Before creating exchange orders, you must register your customer's external accounts — the bank accounts and crypto wallets that will serve as the source or destination of funds.

- **Bank accounts** — used for fiat transfers via SEPA, SWIFT, ACH and Wire, and for local payment methods
- **Crypto wallets** — used for digital asset transfers on blockchain networks

## Bank Accounts

::note
An account is registered for one payment scheme. The [Coverage](https://docs.stablegate.com/docs/getting-started/coverage) page lists the routes the platform runs now; Wire and local methods open per corridor, so ask us before registering an account for them.
::

### Create a Bank Account

Register a customer's bank account for the payment scheme the money moves on. One record describes one scheme: a SEPA account cannot carry ACH or FedWire details, and a US account cannot be used for SEPA. The number of bank accounts and wallets a customer can have is set by your account configuration; when the cap is reached the API answers `400` with the reason in `message`.

**Endpoint:**

```text
POST /v1/customers/{customer_uuid}/bank-accounts/
```

**Request Body:**

<table>
<thead>
  <tr>
    <th>
      Field
    </th>
    
    <th>
      Type
    </th>
    
    <th>
      Required
    </th>
    
    <th>
      Description
    </th>
  </tr>
</thead>

<tbody>
  <tr>
    <td>
      <code>
        supported_rails
      </code>
    </td>
    
    <td>
      string<span>
        
      </span>
    </td>
    
    <td>
      No
    </td>
    
    <td>
      Payment schemes this account is used for: <code>
        sepa
      </code>
      
      , <code>
        swift
      </code>
      
      , <code>
        ach
      </code>
      
      , <code>
        wire
      </code>
      
       (FedWire). Omitted or <code>
        null
      </code>
      
       means <code>
        sepa
      </code>
      
      . SEPA takes a separate record from ACH and FedWire
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        iban
      </code>
    </td>
    
    <td>
      string
    </td>
    
    <td>
      Conditional
    </td>
    
    <td>
      Customer's IBAN for SEPA, spaces allowed. For ACH, FedWire and SWIFT send <code>
        account_number
      </code>
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        account_number
      </code>
    </td>
    
    <td>
      string
    </td>
    
    <td>
      Conditional
    </td>
    
    <td>
      Beneficiary account number for ACH, FedWire and SWIFT
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        holder_name
      </code>
    </td>
    
    <td>
      string
    </td>
    
    <td>
      Yes
    </td>
    
    <td>
      Account holder name. It must match the bank account
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        bank_country
      </code>
    </td>
    
    <td>
      string
    </td>
    
    <td>
      Conditional
    </td>
    
    <td>
      ISO 3166-1 alpha-3 country of the bank (<code>
        DEU
      </code>
      
      ). Required for ACH, FedWire and US SWIFT, where it must be <code>
        USA
      </code>
      
      ; for SEPA it is taken from the IBAN
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        bank_code
      </code>
    </td>
    
    <td>
      string
    </td>
    
    <td>
      Conditional
    </td>
    
    <td>
      Bank BIC. Required for SWIFT; for SEPA derived from the IBAN when omitted or blank. Not used for ACH and FedWire
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        bank_routing_number
      </code>
    </td>
    
    <td>
      string
    </td>
    
    <td>
      Conditional
    </td>
    
    <td>
      9-digit ABA routing number. Required for US payments: ACH, FedWire and US SWIFT
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        bank_name
      </code>
    </td>
    
    <td>
      string
    </td>
    
    <td>
      No
    </td>
    
    <td>
      Bank name. For SEPA derived from the IBAN when omitted or blank
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        bank_address
      </code>
    </td>
    
    <td>
      string
    </td>
    
    <td>
      No
    </td>
    
    <td>
      Bank address
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        bank_city
      </code>
    </td>
    
    <td>
      string
    </td>
    
    <td>
      No
    </td>
    
    <td>
      Bank city
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        bank_postal_code
      </code>
    </td>
    
    <td>
      string
    </td>
    
    <td>
      No
    </td>
    
    <td>
      Bank postal code
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        bank_region
      </code>
    </td>
    
    <td>
      string
    </td>
    
    <td>
      No
    </td>
    
    <td>
      Bank state or region
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        holder_country
      </code>
    </td>
    
    <td>
      string
    </td>
    
    <td>
      No
    </td>
    
    <td>
      Account holder country
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        holder_city
      </code>
    </td>
    
    <td>
      string
    </td>
    
    <td>
      No
    </td>
    
    <td>
      Account holder city
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        holder_street
      </code>
    </td>
    
    <td>
      string
    </td>
    
    <td>
      No
    </td>
    
    <td>
      Account holder street and house number
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        holder_postal_code
      </code>
    </td>
    
    <td>
      string
    </td>
    
    <td>
      No
    </td>
    
    <td>
      Account holder postal code
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        holder_region
      </code>
    </td>
    
    <td>
      string
    </td>
    
    <td>
      No
    </td>
    
    <td>
      Account holder state or region
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        name
      </code>
    </td>
    
    <td>
      string
    </td>
    
    <td>
      No
    </td>
    
    <td>
      Friendly label for the account (e.g., "Main EUR Account")
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        is_third_party
      </code>
    </td>
    
    <td>
      boolean
    </td>
    
    <td>
      No
    </td>
    
    <td>
      <code>
        true
      </code>
      
       when the account belongs to someone other than the customer, for example a supplier. Defaults to <code>
        false
      </code>
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        receiver_type
      </code>
    </td>
    
    <td>
      string
    </td>
    
    <td>
      Conditional
    </td>
    
    <td>
      <code>
        individual
      </code>
      
       or <code>
        company
      </code>
      
      : who owns a third-party account. Required when <code>
        is_third_party
      </code>
      
       is <code>
        true
      </code>
      
      , must be omitted otherwise
    </td>
  </tr>
</tbody>
</table>

**What to send for each payment scheme:**

<table>
<thead>
  <tr>
    <th>
      Scheme
    </th>
    
    <th>
      <code>
        supported_rails
      </code>
    </th>
    
    <th>
      Account
    </th>
    
    <th>
      Bank
    </th>
    
    <th>
      Holder
    </th>
  </tr>
</thead>

<tbody>
  <tr>
    <td>
      SEPA (EUR)
    </td>
    
    <td>
      <code>
        ["sepa"]
      </code>
      
       or omitted
    </td>
    
    <td>
      <code>
        iban
      </code>
    </td>
    
    <td>
      <code>
        bank_code
      </code>
      
       and <code>
        bank_name
      </code>
      
       optional, <code>
        bank_country
      </code>
      
       from the IBAN
    </td>
    
    <td>
      <code>
        holder_name
      </code>
    </td>
  </tr>
  
  <tr>
    <td>
      SWIFT (non-US)
    </td>
    
    <td>
      <code>
        ["swift"]
      </code>
    </td>
    
    <td>
      <code>
        account_number
      </code>
    </td>
    
    <td>
      <code>
        bank_code
      </code>
      
      , <code>
        bank_country
      </code>
      
      , <code>
        bank_name
      </code>
      
      , <code>
        bank_address
      </code>
      
      , <code>
        bank_city
      </code>
      
      , <code>
        bank_postal_code
      </code>
    </td>
    
    <td>
      <code>
        holder_name
      </code>
      
      , <code>
        holder_country
      </code>
      
      , <code>
        holder_city
      </code>
      
      , <code>
        holder_street
      </code>
      
      , <code>
        holder_postal_code
      </code>
    </td>
  </tr>
  
  <tr>
    <td>
      SWIFT (US)
    </td>
    
    <td>
      <code>
        ["swift"]
      </code>
    </td>
    
    <td>
      <code>
        account_number
      </code>
      
      , numeric
    </td>
    
    <td>
      <code>
        bank_code
      </code>
      
       with a <code>
        US
      </code>
      
       country code, <code>
        bank_country: "USA"
      </code>
      
      , <code>
        bank_routing_number
      </code>
      
      , address fields
    </td>
    
    <td>
      <code>
        holder_name
      </code>
      
      , <code>
        holder_country
      </code>
      
      , <code>
        holder_city
      </code>
      
      , <code>
        holder_street
      </code>
      
      , <code>
        holder_postal_code
      </code>
      
      , <code>
        holder_region
      </code>
    </td>
  </tr>
  
  <tr>
    <td>
      ACH (USD)
    </td>
    
    <td>
      <code>
        ["ach"]
      </code>
    </td>
    
    <td>
      <code>
        account_number
      </code>
      
      , numeric
    </td>
    
    <td>
      <code>
        bank_country: "USA"
      </code>
      
      , <code>
        bank_routing_number
      </code>
      
      , <code>
        bank_name
      </code>
    </td>
    
    <td>
      <code>
        holder_name
      </code>
      
      , <code>
        holder_country
      </code>
      
      , <code>
        holder_city
      </code>
      
      , <code>
        holder_street
      </code>
      
      , <code>
        holder_postal_code
      </code>
    </td>
  </tr>
  
  <tr>
    <td>
      FedWire (USD)
    </td>
    
    <td>
      <code>
        ["wire"]
      </code>
    </td>
    
    <td>
      <code>
        account_number
      </code>
      
      , numeric
    </td>
    
    <td>
      <code>
        bank_country: "USA"
      </code>
      
      , <code>
        bank_routing_number
      </code>
      
      , <code>
        bank_name
      </code>
    </td>
    
    <td>
      <code>
        holder_name
      </code>
      
      , <code>
        holder_country
      </code>
      
      , <code>
        holder_city
      </code>
      
      , <code>
        holder_street
      </code>
      
      , <code>
        holder_postal_code
      </code>
    </td>
  </tr>
</tbody>
</table>

**Third-party accounts.** Mark the account as someone else's when it is not the customer's own: send `is_third_party: true` and `receiver_type`. Payouts to such an account above the invoice threshold ask for a supporting document — the order reports it with `third_party_document_required`; see [Third-Party Payouts and the Invoice](https://docs.stablegate.com/docs/guide/orders#third-party-payouts-and-the-invoice). An account marked as the customer's own, which is the default, must carry the customer's name as the holder exactly: any other name is rejected with `400`, so register such an account as third-party.

:warning[The bank decides which details it needs to execute a payout. The address fields are optional in the API, but for SWIFT and US payouts the bank can require the holder's address and the bank's address. A payout without them is rejected when the order is executed, and the order fails. Send them when you register the account.]**Request:** SEPA account

::code-switcher{body="{"iban":"DE89370400440532013000","holder_name":"Max Mustermann","name":"Main EUR Account","bank_name":"Commerzbank","bank_code":"COBADEFFXXX"}" method="POST" path="/v1/customers/c1d2e3f4-a5b6-7c8d-9e0f-1a2b3c4d5e6f/bank-accounts/"}
```bash
curl https://api.stablegate.com/v1/customers/c1d2e3f4-a5b6-7c8d-9e0f-1a2b3c4d5e6f/bank-accounts/ \
  --request POST \
  --header 'X-Api-Key: YOUR_API_KEY' \
  --header 'Content-Type: application/json' \
  --data '{
  "iban": "DE89370400440532013000",
  "holder_name": "Max Mustermann",
  "name": "Main EUR Account",
  "bank_name": "Commerzbank",
  "bank_code": "COBADEFFXXX"
}'
```
::

**Request:** SWIFT account

::code-switcher{body="{"supported_rails":["swift"],"account_number":"001234567890","holder_name":"John Smith","holder_country":"GB","holder_city":"London","holder_street":"10 Downing Street","holder_postal_code":"SW1A 2AA","bank_country":"GBR","bank_code":"BARCGB22","bank_name":"Barclays Bank","bank_address":"1 Churchill Place","bank_city":"London","bank_postal_code":"E14 5HP","name":"GBP account"}" method="POST" path="/v1/customers/c1d2e3f4-a5b6-7c8d-9e0f-1a2b3c4d5e6f/bank-accounts/"}
```bash
curl https://api.stablegate.com/v1/customers/c1d2e3f4-a5b6-7c8d-9e0f-1a2b3c4d5e6f/bank-accounts/ \
  --request POST \
  --header 'X-Api-Key: YOUR_API_KEY' \
  --header 'Content-Type: application/json' \
  --data '{
  "supported_rails": [
    "swift"
  ],
  "account_number": "001234567890",
  "holder_name": "John Smith",
  "holder_country": "GB",
  "holder_city": "London",
  "holder_street": "10 Downing Street",
  "holder_postal_code": "SW1A 2AA",
  "bank_country": "GBR",
  "bank_code": "BARCGB22",
  "bank_name": "Barclays Bank",
  "bank_address": "1 Churchill Place",
  "bank_city": "London",
  "bank_postal_code": "E14 5HP",
  "name": "GBP account"
}'
```
::

**Request:** US account for ACH

::code-switcher{body="{"supported_rails":["ach"],"account_number":"000123456789","holder_name":"John Smith","holder_country":"US","holder_city":"New York","holder_street":"350 Fifth Avenue","holder_postal_code":"10118","bank_country":"USA","bank_routing_number":"021000021","bank_name":"JPMorgan Chase","name":"USD account"}" method="POST" path="/v1/customers/c1d2e3f4-a5b6-7c8d-9e0f-1a2b3c4d5e6f/bank-accounts/"}
```bash
curl https://api.stablegate.com/v1/customers/c1d2e3f4-a5b6-7c8d-9e0f-1a2b3c4d5e6f/bank-accounts/ \
  --request POST \
  --header 'X-Api-Key: YOUR_API_KEY' \
  --header 'Content-Type: application/json' \
  --data '{
  "supported_rails": [
    "ach"
  ],
  "account_number": "000123456789",
  "holder_name": "John Smith",
  "holder_country": "US",
  "holder_city": "New York",
  "holder_street": "350 Fifth Avenue",
  "holder_postal_code": "10118",
  "bank_country": "USA",
  "bank_routing_number": "021000021",
  "bank_name": "JPMorgan Chase",
  "name": "USD account"
}'
```
::

**Response:**

```json
{
  "uuid": "ba1c2d3e-4f5a-6b7c-8d9e-0f1a2b3c4d5e",
  "name": "Main EUR Account",
  "iban": "DE89370400440532013000",
  "account_number": null,
  "supported_rails": ["sepa"],
  "bank_name": "Commerzbank",
  "bank_code": "COBADEFFXXX",
  "bank_country": "DEU",
  "bank_address": null,
  "bank_city": null,
  "bank_postal_code": null,
  "bank_region": null,
  "bank_routing_number": null,
  "holder_name": "Max Mustermann",
  "holder_country": null,
  "holder_city": null,
  "holder_street": null,
  "holder_postal_code": null,
  "holder_region": null,
  "created_at": "2025-01-15T10:30:00.000Z",
  "updated_at": "2025-01-15T10:30:00.000Z"
}
```

For a SEPA account `bank_code` and `bank_name` are filled from an offline bank registry, so most consumer flows need only the IBAN and the holder name. When the registry has no BIC for the IBAN — common for EMIs and fintechs — the request fails and you pass `bank_code` yourself:

```json
{
  "trace_id": "de104ee1-da4e-4eeb-a5e6-aded99b3f417",
  "error_code": "devapi_bank_code_required_error",
  "message": "Bank code (BIC) is not available for this IBAN, pass bank_code explicitly"
}
```

Use [Look Up a Bank by IBAN](#look-up-a-bank-by-iban) to check in advance what the registry knows.

### Look Up a Bank by IBAN

Returns the BIC, bank name and country the registry holds for an IBAN — the same values that are filled in when you create a bank account without `bank_code`.

**Endpoint:**

```text
GET /v1/bank-accounts/info-by-iban/?iban={iban}
```

**Query Parameters:**

<table>
<thead>
  <tr>
    <th>
      Parameter
    </th>
    
    <th>
      Type
    </th>
    
    <th>
      Required
    </th>
    
    <th>
      Description
    </th>
  </tr>
</thead>

<tbody>
  <tr>
    <td>
      <code>
        iban
      </code>
    </td>
    
    <td>
      string
    </td>
    
    <td>
      Yes
    </td>
    
    <td>
      IBAN to look up, spaces allowed
    </td>
  </tr>
</tbody>
</table>

**Request:**

::code-switcher{method="GET" path="/v1/bank-accounts/info-by-iban/" query="iban=DE89370400440532013000"}
```bash
curl 'https://api.stablegate.com/v1/bank-accounts/info-by-iban/?iban=DE89370400440532013000' \
  --header 'X-Api-Key: YOUR_API_KEY'
```
::

**Response:**

```json
{
  "bank_name": "Commerzbank",
  "bank_code": "COBADEFFXXX",
  "bank_country": "DEU"
}
```

<table>
<thead>
  <tr>
    <th>
      Field
    </th>
    
    <th>
      Type
    </th>
    
    <th>
      Description
    </th>
  </tr>
</thead>

<tbody>
  <tr>
    <td>
      <code>
        bank_name
      </code>
    </td>
    
    <td>
      string | null
    </td>
    
    <td>
      Bank name; <code>
        null
      </code>
      
       when the registry has no usable entry for the IBAN
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        bank_code
      </code>
    </td>
    
    <td>
      string | null
    </td>
    
    <td>
      Bank BIC; <code>
        null
      </code>
      
       when the registry has no entry for the IBAN
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        bank_country
      </code>
    </td>
    
    <td>
      string | null
    </td>
    
    <td>
      ISO 3166-1 alpha-3 country code taken from the IBAN
    </td>
  </tr>
</tbody>
</table>

An IBAN that cannot be parsed answers `400` with `error_code: devapi_iban_parse_error`.

### List Bank Accounts

Retrieve all registered bank accounts for a customer.

**Endpoint:**

```text
GET /v1/customers/{customer_uuid}/bank-accounts/
```

**Request:**

::code-switcher{method="GET" path="/v1/customers/c1d2e3f4-a5b6-7c8d-9e0f-1a2b3c4d5e6f/bank-accounts/"}
```bash
curl https://api.stablegate.com/v1/customers/c1d2e3f4-a5b6-7c8d-9e0f-1a2b3c4d5e6f/bank-accounts/ \
  --header 'X-Api-Key: YOUR_API_KEY'
```
::

**Response:**

```json
[
  {
    "uuid": "ba1c2d3e-4f5a-6b7c-8d9e-0f1a2b3c4d5e",
    "name": "Main EUR Account",
    "iban": "DE89370400440532013000",
    "account_number": null,
    "supported_rails": ["sepa"],
    "bank_name": "Commerzbank",
    "bank_code": "COBADEFFXXX",
    "bank_country": "DEU",
    "bank_address": null,
    "bank_city": null,
    "bank_postal_code": null,
    "bank_region": null,
    "bank_routing_number": null,
    "holder_name": "Max Mustermann",
    "holder_country": null,
    "holder_city": null,
    "holder_street": null,
    "holder_postal_code": null,
    "holder_region": null,
    "created_at": "2025-01-15T10:30:00.000Z",
    "updated_at": "2025-01-15T10:30:00.000Z"
  }
]
```

### Get a Bank Account

Retrieve a specific bank account by its UUID.

**Endpoint:**

```text
GET /v1/customers/{customer_uuid}/bank-accounts/{account_uuid}/
```

**Request:**

::code-switcher{method="GET" path="/v1/customers/c1d2e3f4-a5b6-7c8d-9e0f-1a2b3c4d5e6f/bank-accounts/ba1c2d3e-4f5a-6b7c-8d9e-0f1a2b3c4d5e/"}
```bash
curl https://api.stablegate.com/v1/customers/c1d2e3f4-a5b6-7c8d-9e0f-1a2b3c4d5e6f/bank-accounts/ba1c2d3e-4f5a-6b7c-8d9e-0f1a2b3c4d5e/ \
  --header 'X-Api-Key: YOUR_API_KEY'
```
::

### Update a Bank Account

Replace the details of an existing bank account. The request body is the same as for creating an account, with the same per-scheme rules: send the complete set of fields, because a field you leave out is cleared rather than kept. The third-party fields are the exception: leave `is_third_party` and `receiver_type` out to keep the stored values, or send them to change the flag.

**Endpoint:**

```text
PUT /v1/customers/{customer_uuid}/bank-accounts/{account_uuid}/
```

**Request:** SEPA account

::code-switcher{body="{"iban":"DE89370400440532013000","holder_name":"Max Mustermann","name":"Primary EUR Account","bank_name":"Commerzbank","bank_code":"COBADEFFXXX"}" method="PUT" path="/v1/customers/c1d2e3f4-a5b6-7c8d-9e0f-1a2b3c4d5e6f/bank-accounts/ba1c2d3e-4f5a-6b7c-8d9e-0f1a2b3c4d5e/"}
```bash
curl https://api.stablegate.com/v1/customers/c1d2e3f4-a5b6-7c8d-9e0f-1a2b3c4d5e6f/bank-accounts/ba1c2d3e-4f5a-6b7c-8d9e-0f1a2b3c4d5e/ \
  --request PUT \
  --header 'X-Api-Key: YOUR_API_KEY' \
  --header 'Content-Type: application/json' \
  --data '{
  "iban": "DE89370400440532013000",
  "holder_name": "Max Mustermann",
  "name": "Primary EUR Account",
  "bank_name": "Commerzbank",
  "bank_code": "COBADEFFXXX"
}'
```
::

**Request:** SWIFT account with the holder address

::code-switcher{body="{"supported_rails":["swift"],"account_number":"001234567890","holder_name":"John Smith","holder_country":"GB","holder_city":"London","holder_street":"10 Downing Street","holder_postal_code":"SW1A 2AA","bank_country":"GBR","bank_code":"BARCGB22","bank_name":"Barclays Bank","bank_address":"1 Churchill Place","bank_city":"London","bank_postal_code":"E14 5HP","name":"GBP account"}" method="PUT" path="/v1/customers/c1d2e3f4-a5b6-7c8d-9e0f-1a2b3c4d5e6f/bank-accounts/ba1c2d3e-4f5a-6b7c-8d9e-0f1a2b3c4d5e/"}
```bash
curl https://api.stablegate.com/v1/customers/c1d2e3f4-a5b6-7c8d-9e0f-1a2b3c4d5e6f/bank-accounts/ba1c2d3e-4f5a-6b7c-8d9e-0f1a2b3c4d5e/ \
  --request PUT \
  --header 'X-Api-Key: YOUR_API_KEY' \
  --header 'Content-Type: application/json' \
  --data '{
  "supported_rails": [
    "swift"
  ],
  "account_number": "001234567890",
  "holder_name": "John Smith",
  "holder_country": "GB",
  "holder_city": "London",
  "holder_street": "10 Downing Street",
  "holder_postal_code": "SW1A 2AA",
  "bank_country": "GBR",
  "bank_code": "BARCGB22",
  "bank_name": "Barclays Bank",
  "bank_address": "1 Churchill Place",
  "bank_city": "London",
  "bank_postal_code": "E14 5HP",
  "name": "GBP account"
}'
```
::

### Delete a Bank Account

Remove a registered bank account.

**Endpoint:**

```text
DELETE /v1/customers/{customer_uuid}/bank-accounts/{account_uuid}/
```

**Request:**

::code-switcher{method="DELETE" path="/v1/customers/c1d2e3f4-a5b6-7c8d-9e0f-1a2b3c4d5e6f/bank-accounts/ba1c2d3e-4f5a-6b7c-8d9e-0f1a2b3c4d5e/"}
```bash
curl https://api.stablegate.com/v1/customers/c1d2e3f4-a5b6-7c8d-9e0f-1a2b3c4d5e6f/bank-accounts/ba1c2d3e-4f5a-6b7c-8d9e-0f1a2b3c4d5e/ \
  --request DELETE \
  --header 'X-Api-Key: YOUR_API_KEY'
```
::

**Response:** `204 No Content`

---

## Crypto Wallets

### Create a Wallet

Register a customer's crypto wallet for use in on-ramp (receiving crypto) or off-ramp (sending crypto) orders.

**Endpoint:**

```text
POST /v1/customers/{customer_uuid}/wallets/
```

**Request Body:**

<table>
<thead>
  <tr>
    <th>
      Field
    </th>
    
    <th>
      Type
    </th>
    
    <th>
      Required
    </th>
    
    <th>
      Description
    </th>
  </tr>
</thead>

<tbody>
  <tr>
    <td>
      <code>
        rail
      </code>
    </td>
    
    <td>
      string
    </td>
    
    <td>
      Yes
    </td>
    
    <td>
      Blockchain network: <code>
        ethereum
      </code>
      
      , <code>
        polygon
      </code>
      
      , <code>
        algorand
      </code>
      
      , <code>
        ripple
      </code>
      
      , <code>
        stellar
      </code>
      
      , <code>
        xinfin
      </code>
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        address
      </code>
    </td>
    
    <td>
      string
    </td>
    
    <td>
      Yes
    </td>
    
    <td>
      Wallet address on the specified network
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        name
      </code>
    </td>
    
    <td>
      string
    </td>
    
    <td>
      No
    </td>
    
    <td>
      Friendly label for the wallet
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        wallet_message
      </code>
    </td>
    
    <td>
      string
    </td>
    
    <td>
      Conditional
    </td>
    
    <td>
      Hex-encoded ownership confirmation message. Required for Ethereum and Polygon.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        wallet_signature
      </code>
    </td>
    
    <td>
      string
    </td>
    
    <td>
      Conditional
    </td>
    
    <td>
      Signed ownership confirmation message. Required for Ethereum and Polygon.
    </td>
  </tr>
</tbody>
</table>

A wallet address is unique per network across all Stablegate customers, not only among your own. If the address is already linked to any customer, the request is rejected before the ownership proof (`wallet_message` and `wallet_signature`) is checked, so a valid signature does not help — ask the customer for another wallet.

<table>
<thead>
  <tr>
    <th>
      Status
    </th>
    
    <th>
      <code>
        error_code
      </code>
    </th>
    
    <th>
      <code>
        message
      </code>
    </th>
  </tr>
</thead>

<tbody>
  <tr>
    <td>
      <code>
        400
      </code>
    </td>
    
    <td>
      <code>
        oa_client_external_account_address_exists
      </code>
    </td>
    
    <td>
      <code>
        This wallet is already linked to another account
      </code>
    </td>
  </tr>
</tbody>
</table>

### []{id="wallet-ownership-verification-ethereum--polygon"}Wallet Ownership Verification (Ethereum / Polygon)

For wallets on Ethereum and Polygon, you must provide proof of ownership by signing a confirmation message.

**Step 1:** Construct the confirmation message:

```text
I confirm the ownership of address {wallet_address}. Signature time: {ISO_8601_timestamp}.
```

**Step 2:** Sign the message with the wallet's private key and convert the message to hex.

:warning[The signature timestamp must not be older than 24 hours (UTC).]**JavaScript example:**

```javascript
import { ethers } from "ethers";

function stringToHex(str) {
  let hex = "";
  for (let i = 0; i < str.length; i++) {
    hex += str.charCodeAt(i).toString(16);
  }
  return `0x${hex}`;
}

const wallet = new ethers.Wallet("YOUR_PRIVATE_KEY");
const ts = new Date().toISOString();
const message = `I confirm the ownership of address ${wallet.address}. Signature time: ${ts}.`;

const wallet_signature = await wallet.signMessage(message);
const wallet_message = stringToHex(message);

// Use wallet_message and wallet_signature in the API request
```

### Example: Create Ethereum Wallet (with ownership proof)

**Request:**

::code-switcher{body="{"rail":"ethereum","address":"0xDC1dCb46fC96C46c4F294866AFCA81874041bB2","name":"Customer ETH Wallet","wallet_message":"0x4920636f6e6669726d20746865206f776e657273686970206f662061646472657373203078444331644362343666433936433436633446323934383636364146434138313837343034316242322e205369676e61747572652074696d653a20323032352d30312d31355431303a33303a30302e3030305a2e","wallet_signature":"0x861818884bbf61f8d83bc3052e6c513f939512852fc92067dde5845b392248c949812e44366158d91d73ac0e9588c56dfb1d59549c3cbad52cfe4884fdc15c361"}" method="POST" path="/v1/customers/c1d2e3f4-a5b6-7c8d-9e0f-1a2b3c4d5e6f/wallets/"}
```bash
curl https://api.stablegate.com/v1/customers/c1d2e3f4-a5b6-7c8d-9e0f-1a2b3c4d5e6f/wallets/ \
  --request POST \
  --header 'X-Api-Key: YOUR_API_KEY' \
  --header 'Content-Type: application/json' \
  --data '{
  "rail": "ethereum",
  "address": "0xDC1dCb46fC96C46c4F294866AFCA81874041bB2",
  "name": "Customer ETH Wallet",
  "wallet_message": "0x4920636f6e6669726d20746865206f776e657273686970206f662061646472657373203078444331644362343666433936433436633446323934383636364146434138313837343034316242322e205369676e61747572652074696d653a20323032352d30312d31355431303a33303a30302e3030305a2e",
  "wallet_signature": "0x861818884bbf61f8d83bc3052e6c513f939512852fc92067dde5845b392248c949812e44366158d91d73ac0e9588c56dfb1d59549c3cbad52cfe4884fdc15c361"
}'
```
::

**Response:**

```json
{
  "uuid": "wa1b2c3d-4e5f-6a7b-8c9d-0e1f2a3b4c5d",
  "name": "Customer ETH Wallet",
  "rail": "ethereum",
  "address": "0xDC1dCb46fC96C46c4F294866AFCA81874041bB2",
  "status": "active",
  "verified_at": null,
  "created_at": "2025-01-15T10:35:00.000Z",
  "updated_at": "2025-01-15T10:35:00.000Z"
}
```

### Response Fields

<table>
<thead>
  <tr>
    <th>
      Field
    </th>
    
    <th>
      Type
    </th>
    
    <th>
      Description
    </th>
  </tr>
</thead>

<tbody>
  <tr>
    <td>
      <code>
        status
      </code>
    </td>
    
    <td>
      string
    </td>
    
    <td>
      Account status: <code>
        active
      </code>
      
       or <code>
        sanctioned
      </code>
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        verified_at
      </code>
    </td>
    
    <td>
      string | null
    </td>
    
    <td>
      Set once the Satoshi Test (or WalletConnect) ownership proof has been confirmed on-chain. <code>
        null
      </code>
      
       until verification completes — poll this field instead of assuming success right after the micro-transaction is sent.
    </td>
  </tr>
</tbody>
</table>

### Example: Create Wallet on Other Networks

For networks that do not require ownership verification (e.g., Algorand, Ripple, Stellar, XinFin), you can create a wallet without `wallet_message` and `wallet_signature`:

**Request:**

::code-switcher{body="{"rail":"stellar","address":"GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5","name":"Customer Stellar Wallet"}" method="POST" path="/v1/customers/c1d2e3f4-a5b6-7c8d-9e0f-1a2b3c4d5e6f/wallets/"}
```bash
curl https://api.stablegate.com/v1/customers/c1d2e3f4-a5b6-7c8d-9e0f-1a2b3c4d5e6f/wallets/ \
  --request POST \
  --header 'X-Api-Key: YOUR_API_KEY' \
  --header 'Content-Type: application/json' \
  --data '{
  "rail": "stellar",
  "address": "GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5",
  "name": "Customer Stellar Wallet"
}'
```
::

### List Wallets

Retrieve all registered wallets for a customer.

**Endpoint:**

```text
GET /v1/customers/{customer_uuid}/wallets/
```

**Request:**

::code-switcher{method="GET" path="/v1/customers/c1d2e3f4-a5b6-7c8d-9e0f-1a2b3c4d5e6f/wallets/"}
```bash
curl https://api.stablegate.com/v1/customers/c1d2e3f4-a5b6-7c8d-9e0f-1a2b3c4d5e6f/wallets/ \
  --header 'X-Api-Key: YOUR_API_KEY'
```
::

**Response:**

```json
[
  {
    "uuid": "wa1b2c3d-4e5f-6a7b-8c9d-0e1f2a3b4c5d",
    "name": "Customer ETH Wallet",
    "rail": "ethereum",
    "address": "0xDC1dCb46fC96C46c4F294866AFCA81874041bB2",
    "status": "active",
    "verified_at": "2026-08-21T12:09:40.000Z",
    "created_at": "2025-01-15T10:35:00.000Z",
    "updated_at": "2025-01-15T10:35:00.000Z"
  }
]
```

### Get a Wallet

```text
GET /v1/customers/{customer_uuid}/wallets/{wallet_uuid}/
```

### Update a Wallet

```text
PUT /v1/customers/{customer_uuid}/wallets/{wallet_uuid}/
```

The request body is the same as the create endpoint. For Ethereum and Polygon wallets, new `wallet_message` and `wallet_signature` must be provided.

### Delete a Wallet

```text
DELETE /v1/customers/{customer_uuid}/wallets/{wallet_uuid}/
```

**Response:** `204 No Content`

---

## Satoshi Test

The Satoshi Test endpoint returns an operational wallet address that can be used for wallet ownership verification via a micro-transaction.

**Endpoint:**

```text
GET /v1/customers/{customer_uuid}/wallets/satoshitest/?rail={crypto_rail}
```

**Query Parameters:**

<table>
<thead>
  <tr>
    <th>
      Parameter
    </th>
    
    <th>
      Type
    </th>
    
    <th>
      Required
    </th>
    
    <th>
      Description
    </th>
  </tr>
</thead>

<tbody>
  <tr>
    <td>
      <code>
        rail
      </code>
    </td>
    
    <td>
      string
    </td>
    
    <td>
      Yes
    </td>
    
    <td>
      Crypto rail code: <code>
        ethereum
      </code>
      
      , <code>
        polygon
      </code>
      
      , <code>
        algorand
      </code>
      
      , <code>
        ripple
      </code>
      
      , <code>
        stellar
      </code>
      
      , <code>
        xinfin
      </code>
    </td>
  </tr>
</tbody>
</table>

**Request:**

::code-switcher{method="GET" path="/v1/customers/c1d2e3f4-a5b6-7c8d-9e0f-1a2b3c4d5e6f/wallets/satoshitest/" query="rail=ethereum"}
```bash
curl 'https://api.stablegate.com/v1/customers/c1d2e3f4-a5b6-7c8d-9e0f-1a2b3c4d5e6f/wallets/satoshitest/?rail=ethereum' \
  --header 'X-Api-Key: YOUR_API_KEY'
```
::

**Response:**

```json
{
  "address": "0x742d35Cc6634C0532925a3b844Bc9e7595f2bD18",
  "segwit_address": null
}
```

### Response Fields

<table>
<thead>
  <tr>
    <th>
      Field
    </th>
    
    <th>
      Type
    </th>
    
    <th>
      Description
    </th>
  </tr>
</thead>

<tbody>
  <tr>
    <td>
      <code>
        address
      </code>
    </td>
    
    <td>
      string
    </td>
    
    <td>
      Operational wallet address to send the micro-transaction to
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        segwit_address
      </code>
    </td>
    
    <td>
      string | null
    </td>
    
    <td>
      SegWit address, if applicable for the network
    </td>
  </tr>
</tbody>
</table>


## Sitemap

See the full [sitemap](https://docs.stablegate.com/sitemap.md) for all pages.
