# Update counterparty account

This endpoint supports partial updates - only include the fields you want to modify.

**Endpoint**

`PATCH/v2/counterparty/{counterpartyId}/account/{accountId`

**Link**

{% embed url="<https://stagep.tst-apidmndelss.com/openapi/v2.html#/operations/Counterparties_UpdateAccount>" %}

### **Request**

#### **Path Parameters**

| Parameter            | Type     | Description                                | Required | Example       |
| -------------------- | -------- | ------------------------------------------ | -------- | ------------- |
| **`counterpartyId`** | `string` | **Counterparty ID** that owns the account. | Yes      | `"cp_12345"`  |
| **`accountId`**      | `string` | **Account ID** to update.                  | Yes      | `"acc_12345"` |

#### **Headers**

| Key                 | Value              | Required |
| ------------------- | ------------------ | -------- |
| **`Authorization`** | `123`              | Yes      |
| **`Content-Type`**  | `application/json` | Yes      |
| **`Accept`**        | `application/json` | Yes      |

#### **Request Body**

All fields are optional - only include fields that need to be updated.

json

```
{
  "item": {
    "currencyCode": "USD",
    "status": "ACCEPT",
    "bank": {
      "name": "Updated Bank Name",
      "number": "987654321",
      "address": {
        "addressLine1": "789 Updated Bank Street",
        "city": "New York",
        "stateIso": "NY",
        "countryIso": "US",
        "postalCode": "10003"
      },
      "routingNumber": "021000022"
    },
    "fiat": {
      "number": "987654321",
      "routingNumber": "021000022",
      "additionalInformation": {
        "type": "TYPE_FIAT_US",
        "supportedRails": ["ACH", "FEDWIRE", "SWIFT"],
        "accountType": "SAVING"
      }
    }
  }
}
```

***

### **Request Fields**

**1. Main Account Fields**

| Field              | Type     | Required | Description                       | Example    |
| ------------------ | -------- | -------- | --------------------------------- | ---------- |
| **`currencyCode`** | `string` | No       | Updated currency code (ISO 4217). | `"USD"`    |
| **`status`**       | `string` | No       | Updated account status.           | `"ACCEPT"` |

**2. Bank Object (Traditional Banking)**

| Field                    | Type     | Required | Description             | Example               |
| ------------------------ | -------- | -------- | ----------------------- | --------------------- |
| **`bank.name`**          | `string` | No       | Updated bank name.      | `"Updated Bank Name"` |
| **`bank.number`**        | `string` | No       | Updated account number. | `"987654321"`         |
| **`bank.routingNumber`** | `string` | No       | Updated routing number. | `"021000022"`         |

**Bank Address Object**

| Field                           | Type     | Required | Description              | Example                     |
| ------------------------------- | -------- | -------- | ------------------------ | --------------------------- |
| **`bank.address.addressLine1`** | `string` | No       | Updated primary address. | `"789 Updated Bank Street"` |
| **`bank.address.addressLine2`** | `string` | No       | Updated suite/floor.     | `"Floor 20"`                |
| **`bank.address.city`**         | `string` | No       | Updated city.            | `"New York"`                |
| **`bank.address.stateIso`**     | `string` | No       | Updated state code.      | `"NY"`                      |
| **`bank.address.countryIso`**   | `string` | No       | Updated country code.    | `"US"`                      |
| **`bank.address.postalCode`**   | `string` | No       | Updated postal code.     | `"10003"`                   |

**3. Crypto Object (Cryptocurrency)**

| Field                | Type     | Required | Description                    | Example                    |
| -------------------- | -------- | -------- | ------------------------------ | -------------------------- |
| **`crypto.address`** | `string` | No       | Updated crypto wallet address. | `"0xupdatedAddress123..."` |

**Crypto Additional Information**

| Field                                             | Type     | Required | Description              | Allowed Values                                | Example             |
| ------------------------------------------------- | -------- | -------- | ------------------------ | --------------------------------------------- | ------------------- |
| **`crypto.additionalInformation.walletType`**     | `string` | No       | Updated wallet type.     | `CPW_INSTITUTION`, `CPW_OTHER`, `CPW_UNKNOWN` | `"CPW_INSTITUTION"` |
| **`crypto.additionalInformation.type`**           | `string` | No       | Updated account type.    | `TYPE_CRYPTO`                                 | `"TYPE_CRYPTO"`     |
| **`crypto.additionalInformation.supportedRails`** | `array`  | No       | Updated payment methods. | `CRYPTO`, `NFT`                               | `["CRYPTO"]`        |

**4. Fiat Object (Detailed Banking)**

| Field                    | Type     | Required | Description                      | Example                  |
| ------------------------ | -------- | -------- | -------------------------------- | ------------------------ |
| **`fiat.number`**        | `string` | No       | Updated account number.          | `"987654321"`            |
| **`fiat.ifsc`**          | `string` | No       | Updated IFSC code (India).       | `"SBIN0000002"`          |
| **`fiat.swift`**         | `string` | No       | Updated SWIFT/BIC code.          | `"UPDATEDBIC"`           |
| **`fiat.sortCode`**      | `string` | No       | Updated sort code (UK).          | `"50-40-30"`             |
| **`fiat.name`**          | `string` | No       | Updated account name.            | `"Updated Account Name"` |
| **`fiat.transitNumber`** | `string` | No       | Updated transit number (Canada). | `"54321"`                |
| **`fiat.routingNumber`** | `string` | No       | Updated routing number (US).     | `"021000022"`            |

**Fiat Additional Information**

| Field                                           | Type     | Required | Description                    | Allowed Values                       | Example                       |
| ----------------------------------------------- | -------- | -------- | ------------------------------ | ------------------------------------ | ----------------------------- |
| **`fiat.additionalInformation.type`**           | `string` | No       | Updated regional account type. | `TYPE_FIAT_US`, `TYPE_FIAT_GB`, etc. | `"TYPE_FIAT_US"`              |
| **`fiat.additionalInformation.supportedRails`** | `array`  | No       | Updated payment rails.         | `ACH`, `FEDWIRE`, `SWIFT`, etc.      | `["ACH", "FEDWIRE", "SWIFT"]` |
| **`fiat.additionalInformation.accountType`**    | `string` | No       | Updated account type.          | `CHECKING`, `SAVING`                 | `"SAVING"`                    |

**Intermediary Bank Updates**

| Field                                                            | Type     | Required | Description                     | Example                       |
| ---------------------------------------------------------------- | -------- | -------- | ------------------------------- | ----------------------------- |
| **`fiat.additionalInformation.intermediary.bank.name`**          | `string` | No       | Updated intermediary bank name. | `"Updated Intermediary Bank"` |
| **`fiat.additionalInformation.intermediary.bank.number`**        | `string` | No       | Updated intermediary account.   | `"999888777"`                 |
| **`fiat.additionalInformation.intermediary.bank.routingNumber`** | `string` | No       | Updated intermediary routing.   | `"021000099"`                 |

***

### **Response (200 OK)**

Returns the updated account object with all current information including counterparty and customer details.

**Example Response:**

json

```
{
  "item": {
    "accountId": "acc_12345",
    "currencyCode": "USD",
    "status": "ACCEPT",
    "bank": {
      "name": "Updated Bank Name",
      "number": "987654321",
      "address": {
        "addressLine1": "789 Updated Bank Street",
        "city": "New York",
        "stateIso": "NY",
        "countryIso": "US",
        "postalCode": "10003"
      },
      "routingNumber": "021000022"
    },
    "name": "Updated Business Account",
    "number": "987654321",
    "type": "SAVING",
    "fiat": {
      "number": "987654321",
      "routingNumber": "021000022",
      "additionalInformation": {
        "type": "TYPE_FIAT_US",
        "supportedRails": ["ACH", "FEDWIRE", "SWIFT"],
        "accountType": "SAVING"
      }
    },
    "counterparty": {
      "id": "cp_12345",
      "name": "Tech Supplies Corp",
      "phone": "+19876543210",
      "email": "contact@techsupplies.com"
    },
    "customer": {
      "id": "cust_12345",
      "name": "John Doe",
      "phone": "+1234567890",
      "email": "john@example.com",
      "status": "ACCEPT"
    },
    "createdAt": "2024-01-15T10:30:00Z",
    "updatedAt": "2024-05-21T16:45:00Z"
  }
}
```

***

### **Response Fields**

| Field                   | Type     | Description             | Example                      |
| ----------------------- | -------- | ----------------------- | ---------------------------- |
| **`item.accountId`**    | `string` | Account ID (unchanged). | `"acc_12345"`                |
| **`item.name`**         | `string` | Updated account name.   | `"Updated Business Account"` |
| **`item.number`**       | `string` | Updated account number. | `"987654321"`                |
| **`item.type`**         | `string` | Updated account type.   | `"SAVING"`                   |
| **`item.updatedAt`**    | `string` | New update timestamp.   | `"2024-05-21T16:45:00Z"`     |
| **`item.counterparty`** | `object` | Counterparty details.   | -                            |
| **`item.customer`**     | `object` | Customer details.       | -                            |

***

### **Field Details**

#### **Account Status Values**

| Status             | Description                                   |
| ------------------ | --------------------------------------------- |
| **`NEW`**          | Account newly created, pending verification   |
| **`AWAIT`**        | Awaiting additional information/documentation |
| **`MODERATION`**   | Under review by compliance team               |
| **`ACCEPT`**       | Approved and active for transactions          |
| **`REJECT`**       | Rejected during verification                  |
| **`BANNED`**       | Permanently blocked from transactions         |
| **`VERIFICATION`** | In verification process                       |

#### **Account Type Values**

| Type           | Description                                     |
| -------------- | ----------------------------------------------- |
| **`CHECKING`** | Checking/current account for daily transactions |
| **`SAVING`**   | Savings account for storing funds               |

#### **Supported Payment Rails**

| Rail          | Description                  | Region |
| ------------- | ---------------------------- | ------ |
| **`ACH`**     | Automated Clearing House     | US     |
| **`FEDWIRE`** | Federal Wire Transfer        | US     |
| **`SWIFT`**   | International wire transfers | Global |
| **`SEPA_CT`** | SEPA Credit Transfer         | EU     |
| **`FPS`**     | Faster Payments              | UK     |
| **`IMPS`**    | Immediate Payment Service    | India  |

***

### **Examples**

#### **Request**

bash

```
curl -X PATCH 'https://stagep.tst-apidmndelss.com/v2/counterparty/cp_12345/account/acc_12345' \
  -H 'Authorization: 123' \
  -H 'Content-Type: application/json' \
  -H 'Accept: application/json' \
  -d '{
    "item": {
      "status": "ACCEPT",
      "fiat": {
        "additionalInformation": {
          "accountType": "SAVING"
        }
      }
    }
  }'
```

#### **Minimal Update Example**

**Request (update only account type):**

json

```
{
  "item": {
    "fiat": {
      "additionalInformation": {
        "accountType": "SAVING"
      }
    }
  }
}
```

**Response:**

json

```
{
  "item": {
    "accountId": "acc_67890",
    "currencyCode": "GBP",
    "status": "ACCEPT",
    "name": "Sterling Business Account",
    "number": "98765432",
    "type": "SAVING",
    "fiat": {
      "number": "98765432",
      "sortCode": "40-30-20",
      "additionalInformation": {
        "type": "TYPE_FIAT_GB",
        "supportedRails": ["FPS", "SWIFT"],
        "accountType": "SAVING"
      }
    },
    "counterparty": {
      "id": "cp_67890",
      "name": "London Consulting Ltd",
      "phone": "+442076543210",
      "email": "accounts@londonconsulting.com"
    },
    "customer": {
      "id": "cust_22222",
      "name": "Sarah Wilson",
      "phone": "+447123456789",
      "email": "sarah@example.com",
      "status": "ACCEPT"
    },
    "createdAt": "2024-03-10T14:20:00Z",
    "updatedAt": "2024-05-21T17:30:00Z"
  }
}
```

#### **Bank Details Update Example**

**Request (update bank information):**

json

```
{
  "item": {
    "bank": {
      "name": "New Bank Corporation",
      "number": "555666777",
      "routingNumber": "021000033",
      "address": {
        "addressLine1": "123 New Bank Plaza",
        "city": "Chicago",
        "stateIso": "IL",
        "countryIso": "US",
        "postalCode": "60601"
      }
    },
    "fiat": {
      "number": "555666777",
      "routingNumber": "021000033"
    }
  }
}
```

#### **Crypto Account Update Example**

**Request (update crypto wallet):**

json

```
{
  "item": {
    "crypto": {
      "address": "0xupdatedCryptoAddress456",
      "additionalInformation": {
        "walletType": "CPW_OTHER",
        "supportedRails": ["CRYPTO", "NFT"]
      }
    }
  }
}
```

#### **Status Update Example**

**Request (update account status):**

json

```
{
  "item": {
    "status": "MODERATION"
  }
}
```

**Response:**

json

```
{
  "item": {
    "accountId": "acc_99999",
    "currencyCode": "BTC",
    "status": "MODERATION",
    "name": "Bitcoin Institutional Wallet",
    "number": "0x742d35Cc6634C0532925a3b8D6B3985f8e091be1",
    "type": "CRYPTO_WALLET",
    "crypto": {
      "address": "0x742d35Cc6634C0532925a3b8D6B3985f8e091be1",
      "additionalInformation": {
        "walletType": "CPW_INSTITUTION",
        "type": "TYPE_CRYPTO",
        "supportedRails": ["CRYPTO"]
      }
    },
    "counterparty": {
      "id": "cp_99999",
      "name": "Crypto Ventures LLC",
      "phone": "+17864567890",
      "email": "info@cryptoventures.com"
    },
    "customer": {
      "id": "cust_44444",
      "name": "Michael Chen",
      "phone": "+16504561234",
      "email": "michael@example.com",
      "status": "ACCEPT"
    },
    "createdAt": "2024-02-28T11:15:00Z",
    "updatedAt": "2024-05-21T18:15:00Z"
  }
}
```

***

### **Error Responses**

1. **Counterparty Not Found**:

   json

   ```
   { "error": "Counterparty not found: cp_99999" }
   ```
2. **Account Not Found**:

   json

   ```
   { "error": "Account not found: acc_99999" }
   ```
3. **Invalid Status**:

   json

   ```
   { "error": "Invalid status value: INVALID_STATUS" }
   ```
4. **Unauthorized**:

   json

   ```
   { "error": "Unauthorized" }
   ```

***

### **Notes**

* **Partial Updates**: Only include fields that need to be changed
* **Status Impact**: Changing account details may trigger re-verification
* **Verification**: Status updates to `ACCEPT` may require compliance approval
* **Audit Trail**: `updatedAt` timestamp reflects when changes were applied
* **Field Validation**: All updated fields undergo the same validation as creation

**Common Update Scenarios**:

* Correcting bank account information
* Adding additional payment rails
* Changing account status for compliance
* Updating crypto wallet addresses
* Modifying account types


---

# 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.delos.financial/counterparties/update-counterparty-account.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.
