> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.middesk.com/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.middesk.com/_mcp/server.

# Create lien filings in batch

POST https://api.middesk.com/v1/businesses/{business_id}/liens/batch
Content-Type: application/json

Creates multiple lien filings in a single request. Each entry is processed independently. Successful entries return lien objects, failed entries return per-item errors.

Reference: https://docs.middesk.com/api-reference/business-verification/liens/create-lien-filings-in-batch

## Authentication

- `Authorization` header (bearer token, required) — Bearer authentication of the form `Bearer <token>`, where token is your auth token.

## Request

### Path parameters

- `business_id` (string, required) — Business ID

### Body (application/json)

This endpoint expects an object.

- `liens` (list of LienBatchRequestParamLiensItem, required) — Array of lien filing entries. Each entry creates one lien. Each entry must have a unique state. Maximum 50 entries per request.

## Response

### 200

batch processed

- `any`

## Errors

### 422 Create Lien Filings IN Batch Request Unprocessable Entity Error

batch validation failed

- `errors` (list of UnprocessableEntityErrorBodyErrorsItem, required)

## Types

### LienBatchRequestParamLiensItem

- `state` (enum, required) — State where the lien will be filed
  - Allowed values: `AL`, `AK`, `AZ`, `AR`, `CA`, `CO`, `CT`, `DE`, `FL`, `GA`, `HI`, `ID`, `IL`, `IN`, `IA`, `KS`, `KY`, `LA`, `ME`, `MD`, `MA`, `MI`, `MN`, `MS`, `MO`, `MT`, `NE`, `NV`, `NH`, `NJ`, `NM`, `NY`, `NC`, `ND`, `OH`, `OK`, `OR`, `PA`, `RI`, `SC`, `SD`, `TN`, `TX`, `UT`, `VT`, `VA`, `WA`, `WV`, `WI`, `WY`
- `debtors` (list of LienBatchRequestParamLiensItemDebtorsItem, required) — Array of debtor details
- `secured_parties` (list of LienBatchRequestParamLiensItemSecuredPartiesItem, optional) — Secured party details for this entry. Falls back to account defaults if not provided.
- `collateral` (string, optional) — Collateral description. Falls back to account default if not provided.
- `loan_principal_amount_cents` (integer, optional) — Loan principal amount in cents
- `packet_number` (string, optional) — Packet number for the filing. Auto-generated if not provided. Cannot contain underscores.
- `alternative_designation` (string, optional) — Alternative designation (for Tennessee filings)

### UnprocessableEntityErrorBodyErrorsItem

- `message` (string, required)

### LienBatchRequestParamLiensItemDebtorsItem

- `organization_name` (string, optional) — Debtor organization name
- `tin` (string, optional) — Tax identification number (required for certain states)
- `addresses` (list of LienAddress, optional)

### LienBatchRequestParamLiensItemSecuredPartiesItem

- `organization_name` (string, optional)
- `role` (enum, optional)
  - Allowed values: `assignee`, `assignor`
- `addresses` (list of LienAddress, optional)

### LienAddress

- `address_line1` (string, optional)
- `address_line2` (string, optional)
- `city` (string, optional)
- `state` (enum, optional)
  - Allowed values: `AL`, `AK`, `AZ`, `AR`, `CA`, `CO`, `CT`, `DE`, `FL`, `GA`, `HI`, `ID`, `IL`, `IN`, `IA`, `KS`, `KY`, `LA`, `ME`, `MD`, `MA`, `MI`, `MN`, `MS`, `MO`, `MT`, `NE`, `NV`, `NH`, `NJ`, `NM`, `NY`, `NC`, `ND`, `OH`, `OK`, `OR`, `PA`, `RI`, `SC`, `SD`, `TN`, `TX`, `UT`, `VT`, `VA`, `WA`, `WV`, `WI`, `WY`
- `postal_code` (string, optional)

## Examples

### Batch lien filing request

**Request**

```json
{
  "liens": [
    {
      "state": "CA",
      "debtors": [
        {
          "organization_name": "Acme Corporation",
          "addresses": [
            {
              "address_line1": "123 Main Street",
              "city": "San Francisco",
              "state": "CA",
              "postal_code": "94105"
            }
          ]
        }
      ],
      "collateral": "All business assets and inventory",
      "loan_principal_amount_cents": 50000000
    },
    {
      "state": "TX",
      "debtors": [
        {
          "organization_name": "Acme Corporation",
          "addresses": [
            {
              "address_line1": "456 Commerce Street",
              "city": "Dallas",
              "state": "TX",
              "postal_code": "75201"
            }
          ]
        }
      ],
      "collateral": "All business assets and inventory",
      "loan_principal_amount_cents": 25000000
    }
  ]
}
```

**Response**

```json
{
  "data": [
    {
      "business_id": "b2c3d4e5-f6a7-8901-bcde-f12345678901",
      "collateral": "All business assets",
      "debtors": [
        {
          "addresses": [
            {
              "address_line1": "123 Main St",
              "city": "San Francisco",
              "full_address": "123 Main St, San Francisco, CA 94102",
              "postal_code": "94102",
              "state": "CA"
            }
          ],
          "organization_name": "Test Debtor LLC"
        }
      ],
      "filed_by_account": true,
      "id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
      "loan_principal_amount_cents": 100000,
      "negative_pledge": false,
      "object": "lien",
      "owner_id": "b2c3d4e5-f6a7-8901-bcde-f12345678901",
      "owner_type": "Business",
      "secured_parties": [
        {
          "addresses": [
            {
              "address_line1": "456 Finance Ave",
              "city": "New York",
              "full_address": "456 Finance Ave, New York, NY 10001",
              "postal_code": "10001",
              "state": "NY"
            }
          ],
          "organization_name": "Example Secured Party"
        }
      ],
      "state": "CA",
      "status": "created",
      "status_category": "pending",
      "type": "ucc"
    },
    {
      "business_id": "b2c3d4e5-f6a7-8901-bcde-f12345678901",
      "collateral": "All business assets",
      "debtors": [
        {
          "addresses": [
            {
              "address_line1": "123 Main St",
              "city": "San Francisco",
              "full_address": "123 Main St, San Francisco, CA 94102",
              "postal_code": "94102",
              "state": "CA"
            }
          ],
          "organization_name": "Test Debtor LLC"
        }
      ],
      "filed_by_account": true,
      "id": "c3d4e5f6-a7b8-9012-cdef-345678901234",
      "loan_principal_amount_cents": 50000,
      "negative_pledge": false,
      "object": "lien",
      "owner_id": "b2c3d4e5-f6a7-8901-bcde-f12345678901",
      "owner_type": "Business",
      "secured_parties": [
        {
          "addresses": [
            {
              "address_line1": "456 Finance Ave",
              "city": "New York",
              "full_address": "456 Finance Ave, New York, NY 10001",
              "postal_code": "10001",
              "state": "NY"
            }
          ],
          "organization_name": "Example Secured Party"
        }
      ],
      "state": "TX",
      "status": "created",
      "status_category": "pending",
      "type": "ucc"
    }
  ],
  "object": "list"
}
```

**SDK Code**

```python Batch lien filing request
import requests

url = "https://api.middesk.com/v1/businesses/business_id/liens/batch"

payload = { "liens": [
        {
            "state": "CA",
            "debtors": [
                {
                    "organization_name": "Acme Corporation",
                    "addresses": [
                        {
                            "address_line1": "123 Main Street",
                            "city": "San Francisco",
                            "state": "CA",
                            "postal_code": "94105"
                        }
                    ]
                }
            ],
            "collateral": "All business assets and inventory",
            "loan_principal_amount_cents": 50000000
        },
        {
            "state": "TX",
            "debtors": [
                {
                    "organization_name": "Acme Corporation",
                    "addresses": [
                        {
                            "address_line1": "456 Commerce Street",
                            "city": "Dallas",
                            "state": "TX",
                            "postal_code": "75201"
                        }
                    ]
                }
            ],
            "collateral": "All business assets and inventory",
            "loan_principal_amount_cents": 25000000
        }
    ] }
headers = {
    "Authorization": "Bearer <token>",
    "Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.json())
```

```javascript Batch lien filing request
const url = 'https://api.middesk.com/v1/businesses/business_id/liens/batch';
const options = {
  method: 'POST',
  headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
  body: '{"liens":[{"state":"CA","debtors":[{"organization_name":"Acme Corporation","addresses":[{"address_line1":"123 Main Street","city":"San Francisco","state":"CA","postal_code":"94105"}]}],"collateral":"All business assets and inventory","loan_principal_amount_cents":50000000},{"state":"TX","debtors":[{"organization_name":"Acme Corporation","addresses":[{"address_line1":"456 Commerce Street","city":"Dallas","state":"TX","postal_code":"75201"}]}],"collateral":"All business assets and inventory","loan_principal_amount_cents":25000000}]}'
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go Batch lien filing request
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://api.middesk.com/v1/businesses/business_id/liens/batch"

	payload := strings.NewReader("{\n  \"liens\": [\n    {\n      \"state\": \"CA\",\n      \"debtors\": [\n        {\n          \"organization_name\": \"Acme Corporation\",\n          \"addresses\": [\n            {\n              \"address_line1\": \"123 Main Street\",\n              \"city\": \"San Francisco\",\n              \"state\": \"CA\",\n              \"postal_code\": \"94105\"\n            }\n          ]\n        }\n      ],\n      \"collateral\": \"All business assets and inventory\",\n      \"loan_principal_amount_cents\": 50000000\n    },\n    {\n      \"state\": \"TX\",\n      \"debtors\": [\n        {\n          \"organization_name\": \"Acme Corporation\",\n          \"addresses\": [\n            {\n              \"address_line1\": \"456 Commerce Street\",\n              \"city\": \"Dallas\",\n              \"state\": \"TX\",\n              \"postal_code\": \"75201\"\n            }\n          ]\n        }\n      ],\n      \"collateral\": \"All business assets and inventory\",\n      \"loan_principal_amount_cents\": 25000000\n    }\n  ]\n}")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("Authorization", "Bearer <token>")
	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby Batch lien filing request
require 'uri'
require 'net/http'

url = URI("https://api.middesk.com/v1/businesses/business_id/liens/batch")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"liens\": [\n    {\n      \"state\": \"CA\",\n      \"debtors\": [\n        {\n          \"organization_name\": \"Acme Corporation\",\n          \"addresses\": [\n            {\n              \"address_line1\": \"123 Main Street\",\n              \"city\": \"San Francisco\",\n              \"state\": \"CA\",\n              \"postal_code\": \"94105\"\n            }\n          ]\n        }\n      ],\n      \"collateral\": \"All business assets and inventory\",\n      \"loan_principal_amount_cents\": 50000000\n    },\n    {\n      \"state\": \"TX\",\n      \"debtors\": [\n        {\n          \"organization_name\": \"Acme Corporation\",\n          \"addresses\": [\n            {\n              \"address_line1\": \"456 Commerce Street\",\n              \"city\": \"Dallas\",\n              \"state\": \"TX\",\n              \"postal_code\": \"75201\"\n            }\n          ]\n        }\n      ],\n      \"collateral\": \"All business assets and inventory\",\n      \"loan_principal_amount_cents\": 25000000\n    }\n  ]\n}"

response = http.request(request)
puts response.read_body
```

```java Batch lien filing request
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://api.middesk.com/v1/businesses/business_id/liens/batch")
  .header("Authorization", "Bearer <token>")
  .header("Content-Type", "application/json")
  .body("{\n  \"liens\": [\n    {\n      \"state\": \"CA\",\n      \"debtors\": [\n        {\n          \"organization_name\": \"Acme Corporation\",\n          \"addresses\": [\n            {\n              \"address_line1\": \"123 Main Street\",\n              \"city\": \"San Francisco\",\n              \"state\": \"CA\",\n              \"postal_code\": \"94105\"\n            }\n          ]\n        }\n      ],\n      \"collateral\": \"All business assets and inventory\",\n      \"loan_principal_amount_cents\": 50000000\n    },\n    {\n      \"state\": \"TX\",\n      \"debtors\": [\n        {\n          \"organization_name\": \"Acme Corporation\",\n          \"addresses\": [\n            {\n              \"address_line1\": \"456 Commerce Street\",\n              \"city\": \"Dallas\",\n              \"state\": \"TX\",\n              \"postal_code\": \"75201\"\n            }\n          ]\n        }\n      ],\n      \"collateral\": \"All business assets and inventory\",\n      \"loan_principal_amount_cents\": 25000000\n    }\n  ]\n}")
  .asString();
```

```php Batch lien filing request
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.middesk.com/v1/businesses/business_id/liens/batch', [
  'body' => '{
  "liens": [
    {
      "state": "CA",
      "debtors": [
        {
          "organization_name": "Acme Corporation",
          "addresses": [
            {
              "address_line1": "123 Main Street",
              "city": "San Francisco",
              "state": "CA",
              "postal_code": "94105"
            }
          ]
        }
      ],
      "collateral": "All business assets and inventory",
      "loan_principal_amount_cents": 50000000
    },
    {
      "state": "TX",
      "debtors": [
        {
          "organization_name": "Acme Corporation",
          "addresses": [
            {
              "address_line1": "456 Commerce Street",
              "city": "Dallas",
              "state": "TX",
              "postal_code": "75201"
            }
          ]
        }
      ],
      "collateral": "All business assets and inventory",
      "loan_principal_amount_cents": 25000000
    }
  ]
}',
  'headers' => [
    'Authorization' => 'Bearer <token>',
    'Content-Type' => 'application/json',
  ],
]);

echo $response->getBody();
```

```csharp Batch lien filing request
using RestSharp;

var client = new RestClient("https://api.middesk.com/v1/businesses/business_id/liens/batch");
var request = new RestRequest(Method.POST);
request.AddHeader("Authorization", "Bearer <token>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"liens\": [\n    {\n      \"state\": \"CA\",\n      \"debtors\": [\n        {\n          \"organization_name\": \"Acme Corporation\",\n          \"addresses\": [\n            {\n              \"address_line1\": \"123 Main Street\",\n              \"city\": \"San Francisco\",\n              \"state\": \"CA\",\n              \"postal_code\": \"94105\"\n            }\n          ]\n        }\n      ],\n      \"collateral\": \"All business assets and inventory\",\n      \"loan_principal_amount_cents\": 50000000\n    },\n    {\n      \"state\": \"TX\",\n      \"debtors\": [\n        {\n          \"organization_name\": \"Acme Corporation\",\n          \"addresses\": [\n            {\n              \"address_line1\": \"456 Commerce Street\",\n              \"city\": \"Dallas\",\n              \"state\": \"TX\",\n              \"postal_code\": \"75201\"\n            }\n          ]\n        }\n      ],\n      \"collateral\": \"All business assets and inventory\",\n      \"loan_principal_amount_cents\": 25000000\n    }\n  ]\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift Batch lien filing request
import Foundation

let headers = [
  "Authorization": "Bearer <token>",
  "Content-Type": "application/json"
]
let parameters = ["liens": [
    [
      "state": "CA",
      "debtors": [
        [
          "organization_name": "Acme Corporation",
          "addresses": [
            [
              "address_line1": "123 Main Street",
              "city": "San Francisco",
              "state": "CA",
              "postal_code": "94105"
            ]
          ]
        ]
      ],
      "collateral": "All business assets and inventory",
      "loan_principal_amount_cents": 50000000
    ],
    [
      "state": "TX",
      "debtors": [
        [
          "organization_name": "Acme Corporation",
          "addresses": [
            [
              "address_line1": "456 Commerce Street",
              "city": "Dallas",
              "state": "TX",
              "postal_code": "75201"
            ]
          ]
        ]
      ],
      "collateral": "All business assets and inventory",
      "loan_principal_amount_cents": 25000000
    ]
  ]] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://api.middesk.com/v1/businesses/business_id/liens/batch")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```

### Batch with partial errors

**Request**

```json
{
  "liens": [
    {
      "state": "CA",
      "debtors": [
        {
          "organization_name": "Acme Corporation",
          "addresses": [
            {
              "address_line1": "123 Main Street",
              "city": "San Francisco",
              "state": "CA",
              "postal_code": "94105"
            }
          ]
        }
      ],
      "collateral": "All business assets and inventory",
      "loan_principal_amount_cents": 50000000
    },
    {
      "state": "TX",
      "debtors": [
        {
          "organization_name": "Acme Corporation",
          "addresses": [
            {
              "address_line1": "456 Commerce Street",
              "city": "Dallas",
              "state": "TX",
              "postal_code": "75201"
            }
          ]
        }
      ],
      "collateral": "All business assets and inventory",
      "loan_principal_amount_cents": 25000000
    }
  ]
}
```

**Response**

```json
{
  "data": [
    {
      "business_id": "b2c3d4e5-f6a7-8901-bcde-f12345678901",
      "collateral": "All business assets",
      "debtors": [
        {
          "addresses": [
            {
              "address_line1": "123 Main St",
              "city": "San Francisco",
              "full_address": "123 Main St, San Francisco, CA 94102",
              "postal_code": "94102",
              "state": "CA"
            }
          ],
          "organization_name": "Test Debtor LLC"
        }
      ],
      "filed_by_account": true,
      "id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
      "loan_principal_amount_cents": 100000,
      "negative_pledge": false,
      "object": "lien",
      "owner_id": "b2c3d4e5-f6a7-8901-bcde-f12345678901",
      "owner_type": "Business",
      "secured_parties": [
        {
          "addresses": [
            {
              "address_line1": "456 Finance Ave",
              "city": "New York",
              "full_address": "456 Finance Ave, New York, NY 10001",
              "postal_code": "10001",
              "state": "NY"
            }
          ],
          "organization_name": "Example Secured Party"
        }
      ],
      "state": "CA",
      "status": "created",
      "status_category": "pending",
      "type": "ucc"
    },
    {
      "error": {
        "details": "Validation failed: Debtors must have at least one debtor",
        "message": "Failed to create lien for state TX"
      },
      "object": "error",
      "state": "TX"
    }
  ],
  "object": "list"
}
```

**SDK Code**

```python Batch with partial errors
import requests

url = "https://api.middesk.com/v1/businesses/business_id/liens/batch"

payload = { "liens": [
        {
            "state": "CA",
            "debtors": [
                {
                    "organization_name": "Acme Corporation",
                    "addresses": [
                        {
                            "address_line1": "123 Main Street",
                            "city": "San Francisco",
                            "state": "CA",
                            "postal_code": "94105"
                        }
                    ]
                }
            ],
            "collateral": "All business assets and inventory",
            "loan_principal_amount_cents": 50000000
        },
        {
            "state": "TX",
            "debtors": [
                {
                    "organization_name": "Acme Corporation",
                    "addresses": [
                        {
                            "address_line1": "456 Commerce Street",
                            "city": "Dallas",
                            "state": "TX",
                            "postal_code": "75201"
                        }
                    ]
                }
            ],
            "collateral": "All business assets and inventory",
            "loan_principal_amount_cents": 25000000
        }
    ] }
headers = {
    "Authorization": "Bearer <token>",
    "Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.json())
```

```javascript Batch with partial errors
const url = 'https://api.middesk.com/v1/businesses/business_id/liens/batch';
const options = {
  method: 'POST',
  headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
  body: '{"liens":[{"state":"CA","debtors":[{"organization_name":"Acme Corporation","addresses":[{"address_line1":"123 Main Street","city":"San Francisco","state":"CA","postal_code":"94105"}]}],"collateral":"All business assets and inventory","loan_principal_amount_cents":50000000},{"state":"TX","debtors":[{"organization_name":"Acme Corporation","addresses":[{"address_line1":"456 Commerce Street","city":"Dallas","state":"TX","postal_code":"75201"}]}],"collateral":"All business assets and inventory","loan_principal_amount_cents":25000000}]}'
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go Batch with partial errors
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://api.middesk.com/v1/businesses/business_id/liens/batch"

	payload := strings.NewReader("{\n  \"liens\": [\n    {\n      \"state\": \"CA\",\n      \"debtors\": [\n        {\n          \"organization_name\": \"Acme Corporation\",\n          \"addresses\": [\n            {\n              \"address_line1\": \"123 Main Street\",\n              \"city\": \"San Francisco\",\n              \"state\": \"CA\",\n              \"postal_code\": \"94105\"\n            }\n          ]\n        }\n      ],\n      \"collateral\": \"All business assets and inventory\",\n      \"loan_principal_amount_cents\": 50000000\n    },\n    {\n      \"state\": \"TX\",\n      \"debtors\": [\n        {\n          \"organization_name\": \"Acme Corporation\",\n          \"addresses\": [\n            {\n              \"address_line1\": \"456 Commerce Street\",\n              \"city\": \"Dallas\",\n              \"state\": \"TX\",\n              \"postal_code\": \"75201\"\n            }\n          ]\n        }\n      ],\n      \"collateral\": \"All business assets and inventory\",\n      \"loan_principal_amount_cents\": 25000000\n    }\n  ]\n}")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("Authorization", "Bearer <token>")
	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby Batch with partial errors
require 'uri'
require 'net/http'

url = URI("https://api.middesk.com/v1/businesses/business_id/liens/batch")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"liens\": [\n    {\n      \"state\": \"CA\",\n      \"debtors\": [\n        {\n          \"organization_name\": \"Acme Corporation\",\n          \"addresses\": [\n            {\n              \"address_line1\": \"123 Main Street\",\n              \"city\": \"San Francisco\",\n              \"state\": \"CA\",\n              \"postal_code\": \"94105\"\n            }\n          ]\n        }\n      ],\n      \"collateral\": \"All business assets and inventory\",\n      \"loan_principal_amount_cents\": 50000000\n    },\n    {\n      \"state\": \"TX\",\n      \"debtors\": [\n        {\n          \"organization_name\": \"Acme Corporation\",\n          \"addresses\": [\n            {\n              \"address_line1\": \"456 Commerce Street\",\n              \"city\": \"Dallas\",\n              \"state\": \"TX\",\n              \"postal_code\": \"75201\"\n            }\n          ]\n        }\n      ],\n      \"collateral\": \"All business assets and inventory\",\n      \"loan_principal_amount_cents\": 25000000\n    }\n  ]\n}"

response = http.request(request)
puts response.read_body
```

```java Batch with partial errors
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://api.middesk.com/v1/businesses/business_id/liens/batch")
  .header("Authorization", "Bearer <token>")
  .header("Content-Type", "application/json")
  .body("{\n  \"liens\": [\n    {\n      \"state\": \"CA\",\n      \"debtors\": [\n        {\n          \"organization_name\": \"Acme Corporation\",\n          \"addresses\": [\n            {\n              \"address_line1\": \"123 Main Street\",\n              \"city\": \"San Francisco\",\n              \"state\": \"CA\",\n              \"postal_code\": \"94105\"\n            }\n          ]\n        }\n      ],\n      \"collateral\": \"All business assets and inventory\",\n      \"loan_principal_amount_cents\": 50000000\n    },\n    {\n      \"state\": \"TX\",\n      \"debtors\": [\n        {\n          \"organization_name\": \"Acme Corporation\",\n          \"addresses\": [\n            {\n              \"address_line1\": \"456 Commerce Street\",\n              \"city\": \"Dallas\",\n              \"state\": \"TX\",\n              \"postal_code\": \"75201\"\n            }\n          ]\n        }\n      ],\n      \"collateral\": \"All business assets and inventory\",\n      \"loan_principal_amount_cents\": 25000000\n    }\n  ]\n}")
  .asString();
```

```php Batch with partial errors
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.middesk.com/v1/businesses/business_id/liens/batch', [
  'body' => '{
  "liens": [
    {
      "state": "CA",
      "debtors": [
        {
          "organization_name": "Acme Corporation",
          "addresses": [
            {
              "address_line1": "123 Main Street",
              "city": "San Francisco",
              "state": "CA",
              "postal_code": "94105"
            }
          ]
        }
      ],
      "collateral": "All business assets and inventory",
      "loan_principal_amount_cents": 50000000
    },
    {
      "state": "TX",
      "debtors": [
        {
          "organization_name": "Acme Corporation",
          "addresses": [
            {
              "address_line1": "456 Commerce Street",
              "city": "Dallas",
              "state": "TX",
              "postal_code": "75201"
            }
          ]
        }
      ],
      "collateral": "All business assets and inventory",
      "loan_principal_amount_cents": 25000000
    }
  ]
}',
  'headers' => [
    'Authorization' => 'Bearer <token>',
    'Content-Type' => 'application/json',
  ],
]);

echo $response->getBody();
```

```csharp Batch with partial errors
using RestSharp;

var client = new RestClient("https://api.middesk.com/v1/businesses/business_id/liens/batch");
var request = new RestRequest(Method.POST);
request.AddHeader("Authorization", "Bearer <token>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"liens\": [\n    {\n      \"state\": \"CA\",\n      \"debtors\": [\n        {\n          \"organization_name\": \"Acme Corporation\",\n          \"addresses\": [\n            {\n              \"address_line1\": \"123 Main Street\",\n              \"city\": \"San Francisco\",\n              \"state\": \"CA\",\n              \"postal_code\": \"94105\"\n            }\n          ]\n        }\n      ],\n      \"collateral\": \"All business assets and inventory\",\n      \"loan_principal_amount_cents\": 50000000\n    },\n    {\n      \"state\": \"TX\",\n      \"debtors\": [\n        {\n          \"organization_name\": \"Acme Corporation\",\n          \"addresses\": [\n            {\n              \"address_line1\": \"456 Commerce Street\",\n              \"city\": \"Dallas\",\n              \"state\": \"TX\",\n              \"postal_code\": \"75201\"\n            }\n          ]\n        }\n      ],\n      \"collateral\": \"All business assets and inventory\",\n      \"loan_principal_amount_cents\": 25000000\n    }\n  ]\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift Batch with partial errors
import Foundation

let headers = [
  "Authorization": "Bearer <token>",
  "Content-Type": "application/json"
]
let parameters = ["liens": [
    [
      "state": "CA",
      "debtors": [
        [
          "organization_name": "Acme Corporation",
          "addresses": [
            [
              "address_line1": "123 Main Street",
              "city": "San Francisco",
              "state": "CA",
              "postal_code": "94105"
            ]
          ]
        ]
      ],
      "collateral": "All business assets and inventory",
      "loan_principal_amount_cents": 50000000
    ],
    [
      "state": "TX",
      "debtors": [
        [
          "organization_name": "Acme Corporation",
          "addresses": [
            [
              "address_line1": "456 Commerce Street",
              "city": "Dallas",
              "state": "TX",
              "postal_code": "75201"
            ]
          ]
        ]
      ],
      "collateral": "All business assets and inventory",
      "loan_principal_amount_cents": 25000000
    ]
  ]] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://api.middesk.com/v1/businesses/business_id/liens/batch")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```