# Template

This class defines a Template.

A Template is a pre-configured setup for [[Books]] and associated Google Sheets that provides users with a starting point for specific accounting or financial management needs.

## Extends

- `Resource`\<`bkper.Template`\>

### Constructor

```ts
new Template(json?, config?): Template;
```

#### Parameters

| Parameter | Type |
| :------ | :------ |
| `json?` | `Template` |
| `config?` | [`Config`](https://bkper.com/docs/api/bkper-js/interfaces/config.md) |

#### Returns

`Template`

#### Overrides

```ts
Resource<bkper.Template>.constructor
```

### payload

```ts
payload: Template;
```

The underlying payload data for this resource

#### Inherited from

```ts
Resource.payload
```

### getBookId()

```ts
getBookId(): string | undefined;
```

Gets the bookId of the [[Book]] associated with the Template.

#### Returns

`string` \| `undefined`

The bookId of the Book associated with the Template

***

### getBookLink()

```ts
getBookLink(): string | undefined;
```

Gets the link of the [[Book]] associated with the Template.

#### Returns

`string` \| `undefined`

The link of the Book associated with the Template

***

### getCategory()

```ts
getCategory(): string | undefined;
```

Gets the category of the Template.

#### Returns

`string` \| `undefined`

The Template's category. Example: "PERSONAL", "BUSINESS", etc

***

### getDescription()

```ts
getDescription(): string | undefined;
```

Gets the description of the Template.

#### Returns

`string` \| `undefined`

The Template's description

***

### getImageUrl()

```ts
getImageUrl(): string | undefined;
```

Gets the url of the image of the Template.

#### Returns

`string` \| `undefined`

The url of the Template's image

***

### getName()

```ts
getName(): string | undefined;
```

Gets the name of the Template.

#### Returns

`string` \| `undefined`

The Template's name

***

### getSheetsLink()

```ts
getSheetsLink(): string | undefined;
```

Gets the link of the Google Sheets spreadsheet associated with the Template.

#### Returns

`string` \| `undefined`

The link of the Google Sheets spreadsheet associated with the Template

***

### getTimesUsed()

```ts
getTimesUsed(): number;
```

Gets the times the Template has been used.

#### Returns

`number`

The number of times the Template has been used

***

### json()

```ts
json(): Template;
```

Gets an immutable copy of the JSON payload for this resource.

#### Returns

`Template`

An immutable copy of the json payload

#### Inherited from

```ts
Resource.json
```
