npm add https://github.com/speakeasy-sdks/Bolt-Public-API
yarn add https://github.com/speakeasy-sdks/Bolt-Public-API
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
}
});
- accountAddPaymentMethod - Add a payment method to a shopper's Bolt account Wallet.
- accountAddressCreate - Add an address
- accountAddressDelete - Delete an existing address
- accountAddressEdit - Edit an existing address
- accountExists - Determine the existence of a Bolt account
- accountGet - Retrieve account details
- accountPaymentMethodDelete - Delete an existing payment method
- merchantCallbacksGet - Retrieve callback URLs for the merchant
- merchantCallbacksUpdate - Update callback URLs for the merchant
- merchantIdentifiersGet - Retrieve identifiers for the merchant
- guestPaymentsInitialize - Initialize a Bolt payment for guest shoppers
- paymentsInitialize - Initialize a Bolt payment for logged in shoppers
- testingAccountCreate - Create a test account
- testingCreditCardGet - Retrieve a test credit card, including its token
- testingShipmentTrackingCreate - Simulate a shipment tracking update
- webhooksCreate - Create a webhook to subscribe to certain events
- webhooksDelete - Delete an existing webhook
- webhooksGet - Retrieve information for a specific webhook
- webhooksGetAll - Retrieve information about all existing webhooks
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:
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.
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!