# getPostOffice

Source: https://pakdatakit.dev/api/typescript/postal/functions/getpostoffice/

```ts
function getPostOffice(code): PostOffice | null;
```

Defined in: [post-offices.ts:48](https://github.com/chmuzamil/pakdatakit/blob/a6eeaa47381308c4e4fcda45b29642fe4fbfb1fc/src/post-offices.ts#L48)

Returns the delivery post office for a post code, from Pakistan Post's
directory of about 2,560 offices.

Unlike `getCityByPostalCode`, which only answers for codes in the cities
pakdatakit lists, this knows every delivery office, including those in
towns and villages.

## Parameters

| Parameter | Type | Description |
| :------ | :------ | :------ |
| `code` | `string` | Post code (whitespace is ignored) |

## Returns

[`PostOffice`](https://pakdatakit.dev/api/typescript/postal/interfaces/postoffice/) \| `null`

The post office, or `null` if the code is not in the directory

## Example

```ts
getPostOffice('48330');
// { code: '48330', office: 'Dulmial', town: 'Dulmial', district: null, province: 'Punjab' }
```
