> For the complete documentation index, see [llms.txt](https://docs.licensespring.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.licensespring.com/license-api/floating/features/borrow-floating-feature.md).

# Borrow Floating Feature

Borrows a floating license feature.

{% hint style="info" %}
Send null as a value for borrowed\_until if you want to set borrowed\_until to max\_borrow\_time from now + max\_borrow\_time value defined on a license feature.
{% endhint %}

### Endpoint

* Method: `POST`
* Path: `/api/v4/floating/feature_borrow`
* Description: Borrows a floating license feature.

### Authentication

See [License API Authorization](/license-api/license-api-authorization.md).

#### Required headers

* `Date` (string) — RFC7231 GMT date string
* `Authorization` (string)

#### Recommended headers

* `Accept: application/json`
* `Content-Type: application/json`

### Request

#### Body parameters

Required:

* `hardware_id` (string)
* `product` (string)
* `borrowed_until` (string | null) — ISO 8601 UTC timestamp. Send `null` to use `max_borrow_time`.
* `feature` (string)

One of:

* `license_key` (string)
* `username` + `password` (string)
* `id_token` (send access\_token value) + `customer_account_code` (string)
* `code` + `customer_account_code` (string)

Optional:

* `license_id` (number)
* `bundle_code` (string)
* `sdk_ver` (string)
* `redirect_uri` (string)

### Schema

<details>

<summary>Request Body (TypeScript + JSON Schema)</summary>

```typescript
type BorrowFloatingLicenseFeatureRequestBody = {
  // required parameters:
  product: string,
  hardware_id: string,
  feature: string,
  /**
   * `borrowed_until` is a string in ISO 8601 format (always in UTC timezone).
   * It contains a date component and optional time component, e.g.:
   * "2024-09-27T23:30:48.016Z"
   * "2024-09-27 23:30:48.016"
   * "2024-09-27 23:30:48"
   * "2024-09-27 23:30"
   * "2024-09-27"
   */
  borrowed_until: string,

  // required for key-based products:
  license_key?: string,

  // required for user-based products:
  username?: string,
  password?: string,

  // required for SSO with Implicit grant authorization:
  id_token?: string,

  // required for SSO with Authorization code grant:
  code?: string,

  // required for SSO with either authorization method:
  customer_acount_id?: string,

  // optional parameters:
  license_id?: number | undefined,
  bundle_code?: string | undefined,
  sdk_ver?: string | undefined,
  redirect_uri?: string | undefined
}
```

```json
{
  "$schema": "http://json-schema.org/draft/2026-05/schema#",
  "title": "BorrowFloatingLicenseFeatureRequestBody",
  "type": "object",
  "required": ["product", "hardware_id", "feature", "borrowed_until"],
  "properties": {
    "product": {
      "type": "string"
    },
    "hardware_id": {
      "type": "string"
    },
    "feature": {
      "type": "string"
    },
    "borrowed_until": {
      "type": "string",
      "description": "A string in ISO 8601 format (always in UTC timezone). Contains a date component and optional time component.",
      "examples": [
        "2024-09-27T23:30:48.016Z",
        "2024-09-27 23:30:48.016",
        "2024-09-27 23:30:48",
        "2024-09-27 23:30",
        "2024-09-27"
      ]
    },
    "license_key": {
      "type": "string",
      "description": "Required for key-based products."
    },
    "username": {
      "type": "string",
      "description": "Required for user-based products."
    },
    "password": {
      "type": "string",
      "description": "Required for user-based products."
    },
    "id_token": {
      "type": "string",
      "description": "Required for SSO with Implicit grant authorization."
    },
    "code": {
      "type": "string",
      "description": "Required for SSO with Authorization code grant."
    },
    "customer_acount_id": {
      "type": "string",
      "description": "Required for SSO with either authorization method."
    },
    "license_id": {
      "type": "integer"
    },
    "bundle_code": {
      "type": "string"
    },
    "sdk_ver": {
      "type": "string"
    },
    "redirect_uri": {
      "type": "string"
    }
  },
  "additionalProperties": false,
  "allOf": [
    {
      "title": "Key-based product requires license_key",
      "if": {
        "required": ["license_key"]
      },
      "then": {
        "required": ["license_key"]
      }
    },
    {
      "title": "User-based product: username requires password and vice versa",
      "if": {
        "anyOf": [
          { "required": ["username"] },
          { "required": ["password"] }
        ]
      },
      "then": {
        "required": ["username", "password"]
      }
    },
    {
      "title": "SSO Implicit grant: id_token requires customer_acount_id",
      "if": {
        "required": ["id_token"]
      },
      "then": {
        "required": ["customer_acount_id"]
      }
    },
    {
      "title": "SSO Authorization code grant: code requires customer_acount_id",
      "if": {
        "required": ["code"]
      },
      "then": {
        "required": ["customer_acount_id"]
      }
    },
    {
      "title": "SSO Authorization code grant: code requires redirect_uri",
      "if": {
        "required": ["code"]
      },
      "then": {
        "required": ["redirect_uri"]
      }
    },
    {
      "title": "customer_acount_id requires either id_token or code",
      "if": {
        "required": ["customer_acount_id"]
      },
      "then": {
        "anyOf": [
          { "required": ["id_token"] },
          { "required": ["code"] }
        ]
      }
    },
  ]
}
```

</details>

<details>

<summary>Response Body (TypeScript + JSON Schema)</summary>

```typescript
type BorrowFloatingLicenseFeatureResponseBody = {
  borrowed_until: string, // date in ISO8061 format
  max_borrow_time: number, // hours
  device_id: number,
  license_id: number,
  floating_in_use_devices: number,
  company:{
    id: number
  },
}
```

```json
{
  "$schema": "http://json-schema.org/draft/2026-05/schema#",
  "title": "BorrowFloatingLicenseFeatureResponseBody",
  "type": "object",
  "required": [
    "borrowed_until",
    "max_borrow_time",
    "device_id",
    "license_id",
    "floating_in_use_devices",
    "company"
  ],
  "additionalProperties": false,
  "properties": {
    "borrowed_until": {
      "type": "string",
      "description": "Date in ISO 8601 format."
    },
    "max_borrow_time": {
      "type": "number",
      "description": "Maximum borrow time in hours."
    },
    "device_id": {
      "type": "integer"
    },
    "license_id": {
      "type": "integer"
    },
    "floating_in_use_devices": {
      "type": "integer"
    },
    "company": {
      "type": "object",
      "required": ["id"],
      "additionalProperties": false,
      "properties": {
        "id": {
          "type": "integer"
        }
      }
    }
  }
}
```

</details>

### Examples

{% tabs %}
{% tab title="curl" %}

```bash
curl --location --request POST '/api/v4/floating/feature_borrow' \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--header 'Date: string' \
--header 'Authorization: string' \
--data-raw '{
  "hardware_id": "some-unique-id",
  "product": "XY",
  "feature": "YX",
  "license_key": "AAAA-BBBB-CCCC-DDDD",
  "borrowed_until": null
}'
```

{% endtab %}

{% tab title="nodejs" %}

```javascript
var request = require('request');
var options = {
  method: 'POST',
  url: '/api/v4/floating/feature_borrow',
  headers: {
    'Accept': 'application/json',
    'Content-Type': 'application/json',
    'Date': 'string',
    'Authorization': 'string'
  },
  body: JSON.stringify({
    hardware_id: 'some-unique-id',
    product: 'XY',
    feature: 'YX',
    license_key: 'AAAA-BBBB-CCCC-DDDD',
    borrowed_until: null,
  })
};
request(options, function (error, response) {
  if (error) throw new Error(error);
  console.log(response.body);
});
```

{% endtab %}

{% tab title="javascript (fetch)" %}

```javascript
var myHeaders = new Headers();
myHeaders.append("Accept", "application/json");
myHeaders.append("Content-Type", "application/json");
myHeaders.append("Date", "string");
myHeaders.append("Authorization", "string");

var raw = JSON.stringify({
  hardware_id: "some-unique-id",
  product: "XY",
  feature: "YX",
  license_key: "AAAA-BBBB-CCCC-DDDD",
  borrowed_until: null
});

var requestOptions = {
  method: 'POST',
  headers: myHeaders,
  body: raw,
  redirect: 'follow'
};

fetch("/api/v4/floating/feature_borrow", requestOptions)
  .then(response => response.text())
  .then(result => console.log(result))
  .catch(error => console.log('error', error));
```

{% endtab %}

{% tab title="python" %}

```python
import requests

url = "/api/v4/floating/feature_borrow"

payload = {
  "hardware_id": "some-unique-id",
  "product": "XY",
  "feature": "YX",
  "license_key": "AAAA-BBBB-CCCC-DDDD",
  "borrowed_until": None
}

headers = {
  "Accept": "application/json",
  "Content-Type": "application/json",
  "Date": "string",
  "Authorization": "string"
}

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

{% endtab %}

{% tab title="ruby" %}

```ruby
require "uri"
require "net/http"
require "json"

url = URI("/api/v4/floating/feature_borrow")

http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Post.new(url)
request["Accept"] = "application/json"
request["Content-Type"] = "application/json"
request["Date"] = "string"
request["Authorization"] = "string"
request.body = JSON.dump({
  hardware_id: "some-unique-id",
  product: "XY",
  feature: "YX",
  license_key: "AAAA-BBBB-CCCC-DDDD",
  borrowed_until: nil
})

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

{% endtab %}
{% endtabs %}

### License Authorization Method

There are two types of product licenses based on how the client application authorizes itself to interact with a license:

* Key-based product licenses: client interactions with the license have to be authorized using a license\_key
* User-based product licenses: the license has a corresponding "license user" instead of a license key. Client interactions with the license have to be authorized using a username and password

### Errors

If an error occurs, the response will have an HTTP status code of 400 or higher, and the response body will contain an error description in the following format:

<details>

<summary><strong>Error schema (TypeScript + JSON Schema)</strong></summary>

```typescript
{
  status: number,
  code: string,
  message: string
}
```

```json
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "status": { "type": "number" },
    "code": { "type": "string" },
    "message": { "type": "string" }
  },
  "required": [
    "status",
    "code",
    "message"
  ],
  "additionalProperties": false
}
```

</details>

#### List of exceptions

> **missing\_headers** (400): Some headers are missing.

> **missing\_parameters** (400): Some parameters are missing in the request: { params }.

> **unknown\_product** (400): Provided product was not found.

> **license\_not\_found** (400): License with the provided license user not found.

> **license\_not\_active** (400): The license is not active.

> **license\_not\_enabled** (400): The license is not enabled.

> **license\_expired** (400): The license has expired.

> **feature\_borrow\_not\_allowed** (400): License feature does not allow borrowing.

> **floating\_feature\_device\_not\_in\_use** (400): License feature device is not in use.

> **blacklisted** (400): This device is blacklisted.

> **device\_not\_found** (400): License feature device not found.

> **invalid\_license\_feature\_code** (400): License feature code: ' + param + ' is invalid or not assigned to the license.

> **feature\_not\_floating** (400): License feature is not a floating feature.

> **borrow\_until\_not\_valid** (400): Borrow until field is not valid.


---

# 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.licensespring.com/license-api/floating/features/borrow-floating-feature.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.
