@usethrottle/api-client
v1.1.0
Published
Typed REST client for the Throttle API (auto-generated from OpenAPI 3.1)
Readme
@usethrottle/api-client
Typed REST client for advanced Throttle API endpoints that are not covered by
one of the focused storefront SDKs. Auto-generated from the OpenAPI 3.1 spec at
https://api.usethrottle.dev/docs/json via
openapi-typescript-codegen.
Install
npm install @usethrottle/api-clientUsage
import { ApiKeysService, MerchantsService, OpenAPI } from '@usethrottle/api-client';
OpenAPI.BASE = 'https://api.usethrottle.dev';
OpenAPI.HEADERS = { 'X-API-Key': 'sk_xxx' };
const me = await MerchantsService.getMerchantsMe();
const keys = await ApiKeysService.getApiKeys();Customer Payment Terms
The customer endpoints expose the nullable net_n payment-terms override. Set
it to a whole number from 1 to 365, or null to use the merchant default.
import { CustomersService } from '@usethrottle/api-client';
const customer = await CustomersService.patchApiV1Customers('cus_123', {
net_n: 45,
});For the latest service / type names, see src/generated/index.ts after pnpm generate.
Versioning
Pinned to a specific OpenAPI revision per release. Major bumps for breaking changes; minor for additive endpoints.
