Generate a Client SDK from the OpenAPI Definition File

Pitney Bowes provides an OpenAPI definition file you can use to generate client SDKs for accessing the Shipping APIs. The definition file follows the OpenAPI Specification and uses the YAML format.

The file supports all the operations of the Shipping APIs except the operations that govern merchant-account management. Specifically, the file supports all the operations on the API Resources and Operations page except those in the Merchants table.

To generate a client SDK, follow the steps here.

1. Set up a Developer Account

If you have not already done so, set up your developer account by following steps 1-6 on the Getting Started page.

2. Download the OpenAPI Definition File

To download the OpenAPI definition file, click the following link:

Download ShippingAPI_OAS.yaml

3. Download an SDK generator

To generate an SDK client, you need an SDK generator that handles the OpenAPI format. Pitney Bowes recommends the open-sourced OpenAPI Generator tool. For full documentation on OpenAPI Generator, including installation, see the following OpenAPI Generator sites:

4. Generate the Client SDK

Use the instructions specific to your SDK generator. If you use OpenAPI Generator, use one of the following sets of instructions:

5. Use the SDK

In the generated SDK folder, see the file for instructions and dependencies for using the SDK.

When using the SDK, remember to update the OAuth Token every 10 hours. If the token expires, the APIs throw error code PB-APIM-ERR-1003.