0.0.3 • Published 11 months ago

@babbiorsetto/ups-typescript-fetch-client v0.0.3

Weekly downloads
-
License
ISC
Repository
github
Last release
11 months ago

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
0.0.3

11 months ago

0.0.2

12 months ago

0.0.1

1 year ago