# Static Data



Overview [#overview]

Some information that pertains to quotes, policies, and other entities need not be governed by the data revision rules of policy transactions. Static Data supports the management of such information.

Context and Use Cases [#context-and-use-cases]

Static Data was designed to enable customers to capture context-setting, structured data as they saw fit, and to manage such data without having to execute policy transactions.

Some use cases include:

* Capturing a custom quote name generated externally
* Capturing a custom quote or policy number generated externally
* Capturing contact data related to a quote or policy
* Capturing diaries or notes about a quote or transaction

While Static Data remains a viable approach for managing such context data, Socotra now supports many of these use cases through a variety of targeted features, including;

* [Custom Entity Numbering](/configuration/general-topics/entity-numbering)
* [Contact Management](/features/contacts)
* [Diaries](/features/work-management/diaries)

A common question is, "How does static data differ from [Auxiliary Data](/api/aux-data/aux-data)?". There are several key distinctions:

* Static data is declared in configuration and is explicitly associated with the root element of a product.
* The extension data approach to this configuration gives static data a highly defined structure.
* Data can be set as part of a quote create request (can also be set and modified directly).
* Data can be retrieved as part of a quote or policy fetch request (can also be retrieved directly).
* Auxiliary data has none of these properties.

Configuration [#configuration]

You may configure up to ten fields of static data at the root element of any given product definition.

Configuration is the same as for regular extension data, but fields are defined within the `staticData` property of the <ApiLink name="ProductRef" />.

**Configuration Example**

```json
{
    "products": {
        "exampleProduct": {
            "displayName" : "Example Product",
            // other product configuration properties
            "data" : {"someExtensionDataConfig"},
            "staticData" : {
                "applicationNumber" : {
                        "displayName" : "Application Number",
                        "type" : "string",
                        "maxLength" : 20000,
                        "searchable" : true
                },
                "paidThroughDate" : {
                        "displayName" : "Paid Through Date",
                        "type" : "date"
                }
            }
        }
    }
}
```

Usage - Quotes [#usage---quotes]

Setting Static Data [#setting-static-data]

Static Data can be included when <ApiLink name="createQuote">creating a quote</ApiLink> via a <ApiLink name="QuoteCreateRequest" />:

**Example: Add Static Data at Quote Creation**

```
POST /policy/{tenantLocator}/quotes
```

```json
{
    "productName": "exampleProduct",
    "accountLocator": "abc123def456"
    "elements": [],
    "static": {
        "applicationNumber": "eAPP-0000001",
        "paidThroughDate": "2020-01-01"
    }
}
```

**Example: Add Static Data to a Validated Quote**

Static fields and values can be added or updated even after a quote has been validated and its structure and data have become immutable.

Adding Static Data to an existing quote after creation, including post-validation, can be done via the <ApiLink name="addStaticDataForQuote">addStaticDataForQuote</ApiLink> request.

```
POST /policy/{tenantLocator}/quotes/{locator}/static
```

```json
{
	"applicationNumber": "eAPP-0000005",
	"paidThroughDate": "2025-03-03"
}
```

**Example: Update Static Data on a Validated Quote**

To update the existing Static Data of a quote use the <ApiLink name="updateStaticDataForQuote">updateStaticDataForQuote</ApiLink> endpoint:

```
PATCH /policy/{tenantLocator}/quotes/{locator}/static
```

```json
{
    "removeData": {
        "applicationNumber": "eAPP-0000005",
    }
    "setData": {
        "paidThroughDate": "2027-04-17"
    }
}
```

**Example: Replace all Static Data on a Quote**

To replace all of the existing Static Data of a quote use the <ApiLink name="replaceAllStaticDataForQuote">replaceAllStaticDataForQuote</ApiLink> endpoint:

```
PUT /policy/{tenantLocator}/quotes/{locator}/static
```

```json
{
	"applicationNumber": "eAPP-0000005",
	"paidThroughDate": "2025-03-03"
}
```

Fetching Static Data [#fetching-static-data]

**Example: Fetch current Static Data values for a Quote**

To retrieve only the static data values on a quote use use the <ApiLink name="fetchStaticDataForQuote">fetchStaticDataForQuote</ApiLink> endpoint:

```
GET /policy/{tenantLocator}/quotes/{locator}/static
```

```json
{
	"applicationNumber": "eAPP-0000005",
	"paidThroughDate": "2025-03-03"
}
```

**Example: Fetch the history of Static Data for a Quote**

To retrieve the history of static data values on a quote use use the <ApiLink name="fetchStaticDataForQuote">fetchStaticDataForQuote</ApiLink> endpoint:

```
GET /policy/{tenantLocator}/quotes/{locator}/static/history/list
```

```json
{
    "listCompleted" : true,
    "items" : [
        {
            "historyLocator" :  "01JPR0S9H4D6R23387EGCWVXXX"
            "updatedAt" :  "2020-01-01T00:00:00Z"
            "updatedBy" :  "6ca2e546-613b-4212-845b-0b085e243XXX",
            "staticData" :      {
                "applicationNumber": "eAPP-0000001",
                "paidThroughDate": "2025-01-01"
            }
        },
        {
            "historyLocator" :  "01JPR0S9H4D6R23387EGCWVXXX"
            "updatedAt" :  "2020-01-02T00:00:00Z"
            "updatedBy" :  "6ca2e546-613b-4212-845b-0b085e243XXX",
            "staticData" :      {
                "applicationNumber": "eAPP-0000005",
                "paidThroughDate": "2025-03-03"
            }
        }
}
```

Usage - Policies [#usage---policies]

If present on the quote prior to issuance, the static data fields will be automatically carried forward to the static property of the subsequent policy.

Setting Static Data [#setting-static-data-1]

**Example: Add Static Data to an Issued Policy**

To add static data after policy creation use the <ApiLink name="addStaticDataForPolicy">addStaticDataForPolicy</ApiLink> endpoint:

```
POST /policy/{tenantLocator}/policies/{locator}/static
```

```json
{
	"applicationNumber": "eAPP-0000005",
	"paidThroughDate": "2025-03-03"
}
```

**Example: Update Static Data on an Issued Policy**

To update Static Data on a Policy use the <ApiLink name="updateStaticDataForPolicy">updateStaticDataForPolicy</ApiLink> endpoint:

```
PATCH /policy/{tenantLocator}/policies/{locator}/static
```

```json
{
    "removeData": {}
    "setData": {
        "applicationNumber": "eAPP-0000005",
        "paidThroughDate": "2025-03-03"
    }
}
```

**Example: Replace all Static Data on an Issued Policy**

To replace all static data on a policy use use the <ApiLink name="replaceAllStaticDataForPolicy">replaceAllStaticDataForPolicy</ApiLink> endpoint:

```
PUT /policy/{tenantLocator}/policies/{locator}/static
```

```json
{
	"applicationNumber": "eAPP-0000005",
	"paidThroughDate": "2025-03-03"
}
```

Fetching Static Data [#fetching-static-data-1]

**Example: Fetch current Static Data values for an Issued Policy**

To retrieve only the static data values on a policy use use the <ApiLink name="fetchStaticDataForPolicy">fetchStaticDataForPolicy</ApiLink> endpoint:

```
GET /policy/{tenantLocator}/policies/{locator}/static
```

```json
{
	"applicationNumber": "eAPP-0000005",
	"paidThroughDate": "2025-03-03"
}
```

**Example: Fetch the history of Static Data for an Issued Policy**

To retrieve the history of static data values on a policy use use the <ApiLink name="fetchStaticDataForPolicy">fetchStaticDataForPolicy</ApiLink> endpoint:

```
GET /policy/{tenantLocator}/policies/{locator}/static/history/list
```

```json
{
    "listCompleted" : true,
    "items" : [
        {
            "historyLocator" :  "01JPR0S9H4D6R23387EGCWVXXX"
            "updatedAt" :  "2020-01-01T00:00:00Z"
            "updatedBy" :  "6ca2e546-613b-4212-845b-0b085e243XXX",
            "staticData" :      {
                "applicationNumber": "eAPP-0000001",
                "paidThroughDate": "2025-01-01"
            }
        },
        {
            "historyLocator" :  "01JPR0S9H4D6R23387EGCWVXXX"
            "updatedAt" :  "2020-01-02T00:00:00Z"
            "updatedBy" :  "6ca2e546-613b-4212-845b-0b085e243XXX",
            "staticData" :      {
                "applicationNumber": "eAPP-0000005",
                "paidThroughDate": "2025-03-03"
            }
        }
    ]
}
```
