@babbiorsetto/ups-typescript-fetch-client
TypeScript icon, indicating that this package has built-in type declarations

0.0.3 • Public • Published

Usage

import {
    UPSApi,
    ClientCredentialsConfigurationParams,
} from "@babbiorsetto/ups-typescript-fetch-client";

const config: ClientCredentialsConfigurationParams = {
    client_id: "abc",
    client_secret: "secret",
};
const api = new UPSApi(config, "https://wwwcie.ups.com/api");

const rating = api.rating();

try {
    const resp = await rating.rate(/*All required info*/);
    console.log(JSON.stringify(resp.RateResponse.RatedShipment));
} catch (err) {
    console.log(err);
    // The body of the error message
    const errBody = await err.json();
    console.log(errBody.response.errors);
}

Full description of the API in the official documentation

Changelog

v0.0.3

  • Add Paperless document api

v0.0.2

  • Add Time in transit api

Readme

Keywords

none

Package Sidebar

Install

npm i @babbiorsetto/ups-typescript-fetch-client

Weekly Downloads

2

Version

0.0.3

License

ISC

Unpacked Size

811 kB

Total Files

22

Last publish

Collaborators

  • babbiorsetto