---
title: "TypeScript SDK"
description: "Guides and resource documentation for the Requiply TypeScript SDK."
canonical_url: "https://requiply.com/docs/en/developers/typescript-sdk"
---
# TypeScript SDK

> Guides and resource documentation for the Requiply TypeScript SDK.

The `@requiply/api-sdk` package exports `RequiplyClient`, `RequiplyError`, and all public TypeScript types from its root entry point.

## Get started

- [Installation](https://requiply.com/docs/en/developers/typescript-sdk/installation)
- [Quick Start](https://requiply.com/docs/en/developers/typescript-sdk/quick-start)
- [Browser and Server Usage](https://requiply.com/docs/en/developers/typescript-sdk/browser-and-server-usage)
- [Error Handling](https://requiply.com/docs/en/developers/typescript-sdk/error-handling)
- [Request Options](https://requiply.com/docs/en/developers/typescript-sdk/request-options)

## Resources

- [Inventory and Categories](https://requiply.com/docs/en/developers/typescript-sdk/inventory-and-categories), including bundles
- [Availability and Pricing](https://requiply.com/docs/en/developers/typescript-sdk/availability-and-pricing)
- [Bookings](https://requiply.com/docs/en/developers/typescript-sdk/bookings)
- [Clients](https://requiply.com/docs/en/developers/typescript-sdk/clients)
- [Sales and Goods for Sale](https://requiply.com/docs/en/developers/typescript-sdk/sales)
- [Organization](https://requiply.com/docs/en/developers/typescript-sdk/organization)
- [Reports](https://requiply.com/docs/en/developers/typescript-sdk/reports)

All requests are sent below:

```text
https://api.requiply.com/api/public/v1
```

## Upgrading from older versions

Version 0.2.0 brings the SDK in line with the public API. These changes can break code written for 0.1.x:

<table>
<thead>
  <tr>
    <th>
      Change
    </th>
    
    <th>
      What to do
    </th>
  </tr>
</thead>

<tbody>
  <tr>
    <td>
      <code>
        RequiplyError.code
      </code>
      
       is removed. It was never set.
    </td>
    
    <td>
      Read <code>
        error.reason
      </code>
      
       for the machine-readable reason, and <code>
        error.data
      </code>
      
       for the fields that come with it. See <a href="https://requiply.com/docs/en/developers/typescript-sdk/error-handling">
        Error Handling
      </a>
      
      .
    </td>
  </tr>
  
  <tr>
    <td>
      The <code>
        idempotencyKey
      </code>
      
       request option is removed. The API never deduplicated requests.
    </td>
    
    <td>
      Do not retry <code>
        bookings.create()
      </code>
      
       or <code>
        sales.create()
      </code>
      
       blindly: a retry can create a second booking or sale. See <a href="https://requiply.com/docs/en/developers/typescript-sdk/request-options#retries">
        Request Options
      </a>
      
      .
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        bookings.create()
      </code>
      
       returns either a created booking or a refused one.
    </td>
    
    <td>
      Check <code>
        result.success
      </code>
      
       before reading <code>
        reservationId
      </code>
      
      . See <a href="https://requiply.com/docs/en/developers/typescript-sdk/bookings#handling-the-response">
        Bookings
      </a>
      
      .
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        paymentType
      </code>
      
       is required unless <code>
        asRequest
      </code>
      
       is <code>
        true
      </code>
      
      .
    </td>
    
    <td>
      Pass a <code>
        paymentType
      </code>
      
       for regular bookings. The API already refused them without one.
    </td>
  </tr>
</tbody>
</table>

Version 0.2.0 also adds the [Sales](https://requiply.com/docs/en/developers/typescript-sdk/sales) resources, `saleLines` and `adjustment` on quotes and bookings, `workingHours` in `org.info()`, `saleItems` on booking details, `excludeFromDiscounts` on services, and `stillOutUnits` on overdue report entries. The full list is in the package [CHANGELOG](https://github.com/Requiply/RequiplyNPM/blob/main/packages/api-sdk/CHANGELOG.md).

Version 0.2.1 adds [bundles](https://requiply.com/docs/en/developers/typescript-sdk/inventory-and-categories#bundleslist): `bundles.list()` and `bundles.get()`, `bundles` on `pricing.quote()` and `bookings.create()`, `bundleDiscountAmount` and `lineBundles` in quotes, and `bundles` on item group details. Nothing breaks.


## Sitemap

See the full [sitemap](https://requiply.com/docs/sitemap.md) for all pages.
