Skip to content

A typescript SDK for accessing the Bolt-Public-API API.

License

Notifications You must be signed in to change notification settings

xwangbolt/Bolt-Public-API

Repository files navigation

Bolt-Public-API

SDK Installation

NPM

npm add https://github.com/speakeasy-sdks/Bolt-Public-API

Yarn

yarn add https://github.com/speakeasy-sdks/Bolt-Public-API

SDK Example Usage

import { BoltPublicAPI } from "Bolt-Public-API";
import { AccountAddPaymentMethodResponse, AccountAddPaymentMethodSecurity } from "Bolt-Public-API/dist/sdk/models/operations";
import {
  AddressReferenceExplicitTag,
  AddressReferenceIdTag,
  PaymentMethodCreditCardNetwork,
  PaymentMethodCreditCardTag,
} from "Bolt-Public-API/dist/sdk/models/shared";

const sdk = new BoltPublicAPI();
const operationSecurity: AccountAddPaymentMethodSecurity = {
  apiKey: "",
  oauth: "",
};

sdk.account.accountAddPaymentMethod({
  requestBody: {
    dotTag: PaymentMethodCreditCardTag.CreditCard,
    billingAddress: {
      dotTag: AddressReferenceExplicitTag.Explicit,
      company: "ACME Corporation",
      countryCode: "US",
      email: "[email protected]",
      firstName: "Alice",
      lastName: "Baker",
      locality: "San Francisco",
      phone: "+14155550199",
      postalCode: "94105",
      region: "CA",
      streetAddress1: "535 Mission St, Ste 1401",
      streetAddress2: "c/o Shipping Department",
    },
    bin: "411111",
    expiration: "2025-03",
    last4: "1004",
    network: PaymentMethodCreditCardNetwork.Visa,
    token: "a1B2c3D4e5F6G7H8i9J0k1L2m3N4o5P6Q7r8S9t0",
  },
  xPublishableKey: "Investment",
}, operationSecurity).then((res: AccountAddPaymentMethodResponse) => {
  if (res.statusCode == 200) {
    // handle response
  }
});

Available Resources and Operations

Pagination

Some of the endpoints in this SDK support pagination. To use pagination, you make your SDK calls as usual, but the returned response object will have a next method that can be called to pull down the next group of results. If the return value of next is null, then there are no more pages to be fetched.

Here's an example of one such pagination call:

Development

Maturity

This SDK is in beta, and there may be breaking changes between versions without a major version update. Therefore, we recommend pinning usage to a specific package version. This way, you can install the same version each time without breaking changes unless you are intentionally looking for the latest version.

Contributions

While we value open-source contributions to this SDK, this library is generated programmatically. Feel free to open a PR or a Github issue as a proof of concept and we'll do our best to include it in a future release!

SDK Created by Speakeasy

About

A typescript SDK for accessing the Bolt-Public-API API.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages