# Sales tax

> Sales tax rates for goods (FBR) and services (PRA, SRB, KPRA, BRA, ICT) on any date since July 2019, with the law behind each rate and exact paisa amounts.

Source: https://pakdatakit.dev/docs/salestax/

`import { getSalesTaxRate, calculateSalesTax, splitInclusive } from 'pakdatakit/salestax'`

Sales tax on goods is federal (FBR). Sales tax on services is provincial: PRA in Punjab, SRB in Sindh, KPRA in Khyber Pakhtunkhwa, BRA in Balochistan, and the federal ICT tax in Islamabad. Each rate carries the law and source it comes from.

## Examples

**TypeScript**

```ts
import { getSalesTaxRate, calculateSalesTax, splitInclusive } from 'pakdatakit';

getSalesTaxRate({ kind: 'services', province: 'Punjab', date: '2026-11-18' });
// → {
//     "kind": "services",
//     "authority": "PRA",
//     "province": "Punjab",
//     "rate": 16,
//     "from": "2019-07-01",
//     "to": null,
//     "law": "Punjab Sales Tax on Services Act 2012, s. 2(41A) and Second Schedule",
//     "source": "https://pra.punjab.gov.pk/Downloads/THE-PUNJAB-SALES-TAX-ON-SERVICES-ACT-2012-17th-Edition-2026-2027.pdf"
//   }

calculateSalesTax(1000, { kind: 'goods', date: '2026-11-18' });
// → {
//     "net": 1000,
//     "tax": 180,
//     "gross": 1180,
//     "rate": 18
//   }

calculateSalesTax(1150, { province: 'Sindh', kind: 'services', date: '2026-11-18', inclusive: true });
// → {
//     "net": 1000,
//     "tax": 150,
//     "gross": 1150,
//     "rate": 15
//   }

splitInclusive(1180, 18);
// → {
//     "net": 1000,
//     "tax": 180,
//     "gross": 1180,
//     "rate": 18
//   }
```

**Python**

```python
from pakdatakit import get_sales_tax_rate, calculate_sales_tax, split_inclusive

get_sales_tax_rate(kind='services', province='Punjab', date='2026-11-18')
# → {
#     "kind": "services",
#     "authority": "PRA",
#     "province": "Punjab",
#     "rate": 16,
#     "from": "2019-07-01",
#     "to": None,
#     "law": "Punjab Sales Tax on Services Act 2012, s. 2(41A) and Second Schedule",
#     "source": "https://pra.punjab.gov.pk/Downloads/THE-PUNJAB-SALES-TAX-ON-SERVICES-ACT-2012-17th-Edition-2026-2027.pdf"
#   }

calculate_sales_tax(1000, kind='goods', date='2026-11-18')
# → {
#     "net": 1000,
#     "tax": 180,
#     "gross": 1180,
#     "rate": 18
#   }

calculate_sales_tax(1150, province='Sindh', kind='services', date='2026-11-18', inclusive=True)
# → {
#     "net": 1000,
#     "tax": 150,
#     "gross": 1150,
#     "rate": 15
#   }

split_inclusive(1180, 18)
# → {
#     "net": 1000,
#     "tax": 180,
#     "gross": 1180,
#     "rate": 18
#   }
```

**Dart**

```dart
import 'package:pakdatakit/pakdatakit.dart';

getSalesTaxRate(kind: SalesTaxKind.services, province: 'Punjab', date: '2026-11-18');
// → {
//     "kind": "services",
//     "authority": "PRA",
//     "province": "Punjab",
//     "rate": 16,
//     "from": "2019-07-01",
//     "to": null,
//     "law": "Punjab Sales Tax on Services Act 2012, s. 2(41A) and Second Schedule",
//     "source": "https://pra.punjab.gov.pk/Downloads/THE-PUNJAB-SALES-TAX-ON-SERVICES-ACT-2012-17th-Edition-2026-2027.pdf"
//   }

calculateSalesTax(1000, kind: SalesTaxKind.goods, date: '2026-11-18');
// → {
//     "net": 1000,
//     "tax": 180,
//     "gross": 1180,
//     "rate": 18
//   }

calculateSalesTax(1150, province: 'Sindh', kind: SalesTaxKind.services, date: '2026-11-18', inclusive: true);
// → {
//     "net": 1000,
//     "tax": 150,
//     "gross": 1150,
//     "rate": 15
//   }

splitInclusive(1180, 18);
// → {
//     "net": 1000,
//     "tax": 180,
//     "gross": 1180,
//     "rate": 18
//   }
```

**C#**

```csharp
using PakDataKit;

SalesTax.GetRate(new SalesTaxRateQuery { Kind = SalesTaxKind.Services, Province = "Punjab", Date = "2026-11-18" });
// → {
//     "kind": "services",
//     "authority": "PRA",
//     "province": "Punjab",
//     "rate": 16,
//     "from": "2019-07-01",
//     "to": null,
//     "law": "Punjab Sales Tax on Services Act 2012, s. 2(41A) and Second Schedule",
//     "source": "https://pra.punjab.gov.pk/Downloads/THE-PUNJAB-SALES-TAX-ON-SERVICES-ACT-2012-17th-Edition-2026-2027.pdf"
//   }

SalesTax.Calculate(1000, new SalesTaxOptions { Kind = SalesTaxKind.Goods, Date = "2026-11-18" });
// → {
//     "net": 1000,
//     "tax": 180,
//     "gross": 1180,
//     "rate": 18
//   }

SalesTax.Calculate(1150, new SalesTaxOptions { Province = "Sindh", Kind = SalesTaxKind.Services, Date = "2026-11-18", Inclusive = true });
// → {
//     "net": 1000,
//     "tax": 150,
//     "gross": 1150,
//     "rate": 15
//   }

SalesTax.SplitInclusive(1180, 18);
// → {
//     "net": 1000,
//     "tax": 180,
//     "gross": 1180,
//     "rate": 18
//   }
```

**PHP**

```php
use PakDataKit\SalesTax;

SalesTax::getRate(['kind' => 'services', 'province' => 'Punjab', 'date' => '2026-11-18']);
// → {
//     "kind": "services",
//     "authority": "PRA",
//     "province": "Punjab",
//     "rate": 16,
//     "from": "2019-07-01",
//     "to": null,
//     "law": "Punjab Sales Tax on Services Act 2012, s. 2(41A) and Second Schedule",
//     "source": "https://pra.punjab.gov.pk/Downloads/THE-PUNJAB-SALES-TAX-ON-SERVICES-ACT-2012-17th-Edition-2026-2027.pdf"
//   }

SalesTax::calculate(1000, ['kind' => 'goods', 'date' => '2026-11-18']);
// → {
//     "net": 1000,
//     "tax": 180,
//     "gross": 1180,
//     "rate": 18
//   }

SalesTax::calculate(1150, ['province' => 'Sindh', 'kind' => 'services', 'date' => '2026-11-18', 'inclusive' => true]);
// → {
//     "net": 1000,
//     "tax": 150,
//     "gross": 1150,
//     "rate": 15
//   }

SalesTax::splitInclusive(1180, 18);
// → {
//     "net": 1000,
//     "tax": 180,
//     "gross": 1180,
//     "rate": 18
//   }
```

## Reference

### getSalesTaxRate()

```ts
function getSalesTaxRate(query: {
  kind: 'goods' | 'services';
  province?: string; // required for services
  date?: string | Date; // default: today
}): SalesTaxRate | null;
```

**Returns** the standard rate in force on that date, with `authority`, `rate`, `from`, `to`, `law` and `source`.

**Caveats.** Returns `null` for dates before 1 July 2019, unknown provinces, services without a province, or goods in Azad Jammu and Kashmir or Gilgit-Baltistan. Standard rates only: reduced rates, exemptions, the Third Schedule and further tax are not covered.

### calculateSalesTax()

```ts
function calculateSalesTax(
  amount: number,
  options: {
    rate?: number;
    province?: string;
    kind?: 'goods' | 'services';
    date?: string | Date;
    inclusive?: boolean;
  },
): SalesTaxAmounts | null; // { net, tax, gross, rate }
```

**Returns** the net amount, tax and gross amount in whole paisa. With `inclusive: true`, `amount` already includes tax and is split.

### splitInclusive()

```ts
function splitInclusive(gross: number, rate: number): SalesTaxAmounts | null;
```

**Returns** the net and tax parts of a tax-inclusive amount at a given rate.

**Related:** the [sales tax calculator](https://pakdatakit.dev/tools/sales-tax/), [FBR digital invoicing](https://pakdatakit.dev/api/typescript/fbr-invoice/).
