> For the complete documentation index, see [llms.txt](https://docs.delos.financial/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.delos.financial/limits/set-limit.md).

# Set Limit

Creates or updates transaction limits for operations. Can set system-wide limits or customer-specific limits for various operation types and payment methods.

**Endpoint**

`POST/v2/billing/limits`

**Link**

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

### **Request**

#### **Headers**

| Key             | Value              | Required |
| --------------- | ------------------ | -------- |
| `Authorization` | `Bearer <JWT>`     | Yes      |
| `Content-Type`  | `application/json` | Yes      |
| `Accept`        | `application/json` | Yes      |

#### **Request Body (JSON)**

| Field                 | Type      | Description & Requirements                                                                                                                                                                                                                                          | Required | Example        |
| --------------------- | --------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------- | -------------- |
| **`id`**              | `integer` | **Limit ID**  - limit number associ                                                                                                                                                                                                                                 | No       | `101`          |
| **`customerId`**      | `string`  | **Customer ID** for customer-specific limits. Omit for system limits.                                                                                                                                                                                               | No       | `"cust_12345"` |
| **`currencyIsoFrom`** | `string`  | **Source currency** (ISO 4217).                                                                                                                                                                                                                                     | Yes      | `"USD"`        |
| **`currencyIsoTo`**   | `string`  | **Target currency** (ISO 4217).                                                                                                                                                                                                                                     | Yes      | `"EUR"`        |
| **`operationType`**   | `string`  | <p><strong>Operation type</strong>:<br>- <code>NOTSET</code><br>- <code>DEPOSIT</code><br>- <code>TRANSFER</code><br>- <code>WITHDRAW</code><br>- <code>COMMISSION</code><br>- <code>EXCHANGE</code><br>- <code>CORRECTING</code></p>                               | Yes      | `"TRANSFER"`   |
| **`paymentType`**     | `string`  | <p><strong>Payment method</strong>:<br>- <code>NOT\_SET</code><br>- <code>EMPTY</code><br>- <code>ACH</code><br>- <code>FEDWIRE</code><br>- <code>SWIFT</code><br>- <code>CRYPTO</code><br>- <code>EFT</code><br>- <code>SEPA\_CT</code><br>- <code>IMPS</code></p> | Yes      | `"SWIFT"`      |
| **`min`**             | `number`  | **Minimum amount** allowed.                                                                                                                                                                                                                                         | Yes      | `10.0`         |
| **`max`**             | `number`  | **Maximum amount** allowed.                                                                                                                                                                                                                                         | Yes      | `5000.0`       |

**Example Request Body (System Limit):**

```json
{
  "currencyIsoFrom": "USD",
  "currencyIsoTo": "EUR",
  "operationType": "TRANSFER",
  "paymentType": "SWIFT",
  "min": 50.0,
  "max": 10000.0
}
```

**Example Request Body (Customer-Specific Limit):**

```json
{
  "customerId": "cust_12345",
  "currencyIsoFrom": "USD",
  "currencyIsoTo": "USD",
  "operationType": "WITHDRAW",
  "paymentType": "ACH",
  "min": 100.0,
  "max": 2500.0
}
```

**Example Request Body (Update Existing Limit):**

```json
{
  "id": 101,
  "currencyIsoFrom": "USD",
  "currencyIsoTo": "EUR",
  "operationType": "TRANSFER",
  "paymentType": "SWIFT",
  "min": 100.0,
  "max": 15000.0
}
```

***

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

Returns the created or updated limit configuration.

#### **Response Fields**

| Field                 | Type      | Description                          | Example                  |
| --------------------- | --------- | ------------------------------------ | ------------------------ |
| **`id`**              | `integer` | **Unique limit identifier**.         | `101`                    |
| **`owner`**           | `integer` | **Owner ID** (system=0, customer>0). | `15`                     |
| **`currencyIsoFrom`** | `string`  | **Source currency**.                 | `"USD"`                  |
| **`currencyIsoTo`**   | `string`  | **Target currency**.                 | `"EUR"`                  |
| **`operationType`**   | `string`  | **Operation type**.                  | `"TRANSFER"`             |
| **`paymentType`**     | `string`  | **Payment method**.                  | `"SWIFT"`                |
| **`min`**             | `number`  | **Minimum amount**.                  | `50.0`                   |
| **`max`**             | `number`  | **Maximum amount**.                  | `10000.0`                |
| **`createdAt`**       | `string`  | Creation timestamp (ISO 8601).       | `"2024-01-15T10:30:00Z"` |
| **`updatedAt`**       | `string`  | **Last update timestamp**.           | `"2024-05-21T14:45:00Z"` |
| **`customerName`**    | `string`  | **Customer name** (if applicable).   | `"John Doe"`             |
| **`customerId`**      | `string`  | **Customer ID** (if applicable).     | `"cust_12345"`           |

**Example Response (System Limit):**

```json
{
  "item": {
    "id": 101,
    "owner": 0,
    "currencyIsoFrom": "USD",
    "currencyIsoTo": "EUR",
    "operationType": "TRANSFER",
    "paymentType": "SWIFT",
    "min": 50.0,
    "max": 10000.0,
    "createdAt": "2024-05-21T14:45:00Z",
    "updatedAt": "2024-05-21T14:45:00Z",
    "customerName": "",
    "customerId": ""
  }
}
```

**Example Response (Customer Limit):**

```json
{
  "item": {
    "id": 102,
    "owner": 15,
    "currencyIsoFrom": "USD",
    "currencyIsoTo": "USD",
    "operationType": "WITHDRAW",
    "paymentType": "ACH",
    "min": 100.0,
    "max": 2500.0,
    "createdAt": "2024-05-21T14:45:00Z",
    "updatedAt": "2024-05-21T14:45:00Z",
    "customerName": "John Doe",
    "customerId": "cust_12345"
  }
}
```

***

### **Examples**

#### **Request (Create Crypto Limit)**

```bash
curl -X POST 'https://stagep.tst-apidmndelss.com/v2/billing/limits' \
  -H 'Authorization: Bearer eyJhbGci...wNLGA' \
  -H 'Content-Type: application/json' \
  -d '{
    "currencyIsoFrom": "BTC",
    "currencyIsoTo": "BTC",
    "operationType": "WITHDRAW",
    "paymentType": "CRYPTO",
    "min": 0.001,
    "max": 10.0
  }'
```

#### **Request (Update Existing Limit)**

```bash
curl -X POST 'https://stagep.tst-apidmndelss.com/v2/billing/limits' \
  -H 'Authorization: Bearer eyJhbGci...wNLGA' \
  -H 'Content-Type: application/json' \
  -d '{
    "id": 101,
    "currencyIsoFrom": "USD",
    "currencyIsoTo": "EUR",
    "operationType": "TRANSFER",
    "paymentType": "SWIFT",
    "min": 100.0,
    "max": 20000.0
  }'
```

***

### **Error Responses**

1. **Invalid Amounts**:

   ```json
   { "error": "Minimum amount cannot exceed maximum amount" }
   ```
2. **Customer Not Found**:

   ```json
   { "error": "Customer not found: cust_99999" }
   ```
3. **Duplicate Limit**:

   ```json
   { "error": "Limit already exists for this configuration" }
   ```

***

### **Notes**

* **Create vs Update**:
  * Include `id` to update existing limit
  * Omit `id` to create new limit
* **Customer Limits**: Take precedence over system limits for the same customer
* **Validation**: Minimum must be less than or equal to maximum
* **Currency Pairs**: Use same currency for single-currency operations

Real request\
`"{`\
`""id"": 2378,`\
`""customerId"": ""DaKFXt2-1vfp-e00RmYfclJTS"",`\
`""currencyCodeFrom"": ""USD"",`\
`""currencyCodeTo"": ""USD"",`\
`""operationType"": ""TRANSFER"",`\
`""paymentType"": ""EMPTY"",`\
`""min"": 1000,`\
`""max"": 2000`\
`}"`

Real response

`"{`\
`""item"": {`\
`""id"": 2378,`\
`""owner"": 232,`\
`""currencyCodeFrom"": ""USD"",`\
`""currencyCodeTo"": ""USD"",`\
`""operationType"": ""TRANSFER"",`\
`""paymentType"": ""EMPTY"",`\
`""min"": 1000,`\
`""max"": 2000,`\
`""createdAt"": ""2025-11-09T05:10:58Z"",`\
`""updatedAt"": ""2025-11-09T05:10:58Z"",`\
`""customerName"": """",`\
`""customerId"": """"`\
`}`\
`}"`


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` query parameter:

```
GET https://docs.delos.financial/limits/set-limit.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
