# Property License Retrieve All Rule (Without property id)

This endpoint allows you to retrieve the license rules for a property based on location and category. The request requires geographical coordinates, a country code, and a property category.

***

### <mark style="color:yellow;">Endpoint</mark>

<mark style="color:green;background-color:green;">**`POST`**</mark>&#x20;

<div align="left"><figure><img src="https://958347541-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FM9bn2UcBkeqtqixkl5eF%2Fuploads%2FpsybX0n39kUB8Z8WOk4X%2FSandbox%20image.png?alt=media&#x26;token=4ae73d0f-0d1a-4d73-a4e2-673dbc081d6a" alt="" width="56"><figcaption></figcaption></figure></div>

{% code overflow="wrap" %}
```url
https://connect-sandbox.su-api.com/SUAPI/jservice/bdc/property/license/retrieveAllRule
```
{% endcode %}

#### <mark style="color:yellow;">Header</mark>

```xml
-app-id: YOUR_APP_ID
Authorization: YOUR_API_KEY
Content-Type:application/json
```

<table><thead><tr><th width="185">Header</th><th width="85">Type</th><th width="101">Required</th><th>Description</th></tr></thead><tbody><tr><td><code>app-id</code></td><td>string</td><td>Yes</td><td>Your application ID. Required for authentication.</td></tr><tr><td><code>Authorization</code></td><td>string</td><td>Yes</td><td>Your API key. for authorization. Required for authentication.</td></tr><tr><td><code>Content-Type</code></td><td>string</td><td>Yes</td><td>Must be set to <code>application/json</code>.</td></tr></tbody></table>

***

#### <mark style="color:yellow;">Attributes</mark>

`latitude` <mark style="color:orange;">**float (Required)**</mark>

Specifies the latitude of the property location.&#x20;

{% hint style="info" %}
Valid range: -90 to 90.
{% endhint %}

***

`longitude`  <mark style="color:orange;">**float (Required)**</mark>

Specifies the longitude of the property location.&#x20;

{% hint style="info" %}
Valid range: -180 to 180.
{% endhint %}

***

`country_code` <mark style="color:orange;">**string (Required)**</mark>

Specifies the country code of the property.

To retrieve a list of the available country codes, see [retrieving country codes](broken-reference).

***

`property_category` <mark style="color:orange;">**integer (Required)**</mark>

Specifies the category of the property.

***

## <mark style="color:yellow;">**Sample Request**</mark>

```json
{
    "latitude": 41.8967,
    "longitude": 12.4822,
    "country_code": "IT",
    "property_category": 3
}
```

***

## <mark style="color:yellow;">Response</mark>

#### <mark style="color:green;">**Sample Success Response**</mark>

```json
{
  "Status": "Success",
  "Data": {
    "variants": [
      {
        "name": "lazio_v1",
        "id": 25,
        "content": [
          {
            "format": "^(?i:(IT)\\d{6}[A-Za-z]\\d[A-Za-z\\d]{4,8})(?:,(IT\\d{6}[A-Za-z]\\d[A-Za-z\\d]{4,8}))*$",
            "name": "National_licence_number",
            "required": false,
            "dataType": "string"
          },
          {
            "format": "^([a-zA-Z0-9!@#$%^&*()_+\\-=\\[\\]{};':\"\\\\|,.<>\\/?]+)(,[a-zA-Z0-9!@#$%^&*()_+\\-=\\[\\]{};':\"\\\\|,.<>\\/?]+)*$",
            "name": "number",
            "required": false,
            "dataType": "string",
            "possibleValues": [
              "primary",
              "secondary",
              "other"
            ]
          }
        ]
      }
    ],
    "name": "lazio",
    "id": 20,
    "active": true,
    "level": "property"
  },
  "Message": "License All Rule fetched successfully"
}

```

#### <mark style="color:yellow;">Success Response Body Elements</mark>

`Status` <mark style="color:orange;">**string**</mark>

Indicates the result of the API call.

***

`Data` <mark style="color:orange;">**object**</mark>

Contains the data returned by the API when the request is successful.



`variants` <mark style="color:orange;">**array of objects**</mark>

A list of variants for the property license rules.

***

`content` <mark style="color:orange;">**array of objects**</mark>&#x20;

A list of fields for each variant.

`format` <mark style="color:orange;">**string**</mark>

A regular expression pattern that validates the field.

`required` <mark style="color:orange;">**boolean**</mark>

Specifies whether the field is required or optional.

{% hint style="info" %}
**Possible Values**:

* `false`: The field is optional.
* `true`: The field is required.
{% endhint %}

`dataType` <mark style="color:orange;">**string**</mark>

Specifies the data type of the field.

{% hint style="info" %}
For example, `string.`
{% endhint %}

***

`possibleValues` <mark style="color:orange;">**array**</mark>

Contains three possible values in an array (possible string values):

* `"primary"`
* `"secondary"`
* `"other"`

***

`name` <mark style="color:orange;">**string**</mark>

Specifies the name of the license variant.

`id` <mark style="color:orange;">**integer**</mark>

Specifies the unique identifier of the license variant.

`active` <mark style="color:orange;">**boolean**</mark>

Indicates whether the variant is active.&#x20;

{% hint style="info" %}
**Possible Values**:

* `true`: The variant is active.
* `false`: The variant is inactive.
{% endhint %}

`level` <mark style="color:orange;">**string**</mark>

Specifies the level of the license rule.&#x20;

{% hint style="info" %}
For example, `property.`
{% endhint %}

***

`Message` <mark style="color:orange;">**string**</mark>

Provides a descriptive message about the result of the request.&#x20;

{% hint style="info" %}
In this case, `"License All Rule fetched successfully"`.
{% endhint %}

***

#### <mark style="color:red;">Errors</mark>

<mark style="color:red;">**Sample Error Response 1 - Validation Error Response**</mark>

```json
{
    "Status": "Fail",
    "Errors": [
        {
            "Code": "898",
            "ShortText": "Latitude: Value is not a latitude (a valid latitude (-90 to 90)), found ':value_replace'"
        },
        {
            "Code": "899",
            "ShortText": "Longitude: Value is not a longitude (a valid longitude (-180 to 180)), found ':value_replace'"
        },
        {
            "Code": "991",
            "ShortText": "Enter valid countrycode"
        },
        {
            "Code": "599",
            "ShortText": "property_category is invalid or not found!"
        }
    ],
    "Message": ""
}
```

<mark style="color:red;">**Sample Error Response 2 - Booking.com Error Response**</mark>

```json
{
    "Status": "Fail",
    "Errors": [],
    "Message": "Not found"
}
```

***

<mark style="color:yellow;">**Error Response Body Elements**</mark>

`Status` <mark style="color:orange;">**string**</mark>

Indicates the result of the API call, which will be always `"Fail"` in case of an error response.

***

`Error` <mark style="color:orange;">**array**</mark>

Array that contains details about any errors that occurred during the API call. Each object in the `Errors` array contains the following properties:

`Code` <mark style="color:orange;">**string**</mark>

Specific error code that helps identify the type of error.

{% hint style="info" %}
For example: `"898"` indicates a bad request.
{% endhint %}

`ShortText` <mark style="color:orange;">**string**</mark>

A short description of the error.

***

`Message` <mark style="color:orange;">**string**</mark>

A message providing more information about the error.

