Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .release-please-manifest.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
".": "0.0.36"
".": "0.0.37"
}
8 changes: 4 additions & 4 deletions .stats.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
configured_endpoints: 193
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/frostedinc%2Fwhopsdk-e284f164f530a4ebe56001acedd17b184c1886a923699ab4084c7a41ebb73d5a.yml
openapi_spec_hash: 20f5bb8d4625bd9695845a77279926ea
config_hash: fee5c8b2e5f00cef705ad48c3f3b5b5a
configured_endpoints: 195
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/frostedinc%2Fwhopsdk-58749e1928f402cc3e236d38b53bce3b10530bfaccbe426181bba9b1bfc42498.yml
openapi_spec_hash: ecea6e6c4b93665aee5554839a26ded8
config_hash: 2ceaf6cd488db626c181a1ca9460ace6
14 changes: 14 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,19 @@
# Changelog

## 0.0.37 (2026-04-10)

Full Changelog: [v0.0.36...v0.0.37](https://github.com/whopio/whopsdk-typescript/compare/v0.0.36...v0.0.37)

### Features

* **api:** api update ([8a21bdb](https://github.com/whopio/whopsdk-typescript/commit/8a21bdbf1781f0648dab879d60525264a14cb1f2))
* **api:** manual updates ([415a345](https://github.com/whopio/whopsdk-typescript/commit/415a34513f334fb848a16c306d48c5806b8ef80e))


### Chores

* **internal:** show error causes in MCP servers when running in local mode ([b6e0e4d](https://github.com/whopio/whopsdk-typescript/commit/b6e0e4d1ab23a07baed3f8c738871f29c844836d))

## 0.0.36 (2026-04-08)

Full Changelog: [v0.0.35...v0.0.36](https://github.com/whopio/whopsdk-typescript/compare/v0.0.35...v0.0.36)
Expand Down
5 changes: 5 additions & 0 deletions api.md
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ Methods:
Types:

- <code><a href="./src/resources/invoices.ts">TaxIdentifierType</a></code>
- <code><a href="./src/resources/invoices.ts">InvoiceDeleteResponse</a></code>
- <code><a href="./src/resources/invoices.ts">InvoiceMarkPaidResponse</a></code>
- <code><a href="./src/resources/invoices.ts">InvoiceMarkUncollectibleResponse</a></code>
- <code><a href="./src/resources/invoices.ts">InvoiceVoidResponse</a></code>
Expand All @@ -88,7 +89,9 @@ Methods:

- <code title="post /invoices">client.invoices.<a href="./src/resources/invoices.ts">create</a>({ ...params }) -> Invoice</code>
- <code title="get /invoices/{id}">client.invoices.<a href="./src/resources/invoices.ts">retrieve</a>(id) -> Invoice</code>
- <code title="patch /invoices/{id}">client.invoices.<a href="./src/resources/invoices.ts">update</a>(id, { ...params }) -> Invoice</code>
- <code title="get /invoices">client.invoices.<a href="./src/resources/invoices.ts">list</a>({ ...params }) -> InvoiceListItemsCursorPage</code>
- <code title="delete /invoices/{id}">client.invoices.<a href="./src/resources/invoices.ts">delete</a>(id) -> InvoiceDeleteResponse</code>
- <code title="post /invoices/{id}/mark_paid">client.invoices.<a href="./src/resources/invoices.ts">markPaid</a>(id) -> InvoiceMarkPaidResponse</code>
- <code title="post /invoices/{id}/mark_uncollectible">client.invoices.<a href="./src/resources/invoices.ts">markUncollectible</a>(id) -> InvoiceMarkUncollectibleResponse</code>
- <code title="post /invoices/{id}/void">client.invoices.<a href="./src/resources/invoices.ts">void</a>(id) -> InvoiceVoidResponse</code>
Expand Down Expand Up @@ -186,6 +189,8 @@ Methods:

Types:

- <code><a href="./src/resources/plans.ts">CheckoutFont</a></code>
- <code><a href="./src/resources/plans.ts">CheckoutShape</a></code>
- <code><a href="./src/resources/plans.ts">PlanListResponse</a></code>
- <code><a href="./src/resources/plans.ts">PlanDeleteResponse</a></code>

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@whop/sdk",
"version": "0.0.36",
"version": "0.0.37",
"description": "The official TypeScript library for the Whop API",
"author": "Whop <>",
"types": "dist/index.d.ts",
Expand Down
2 changes: 1 addition & 1 deletion packages/mcp-server/manifest.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"dxt_version": "0.2",
"name": "@whop/mcp",
"version": "0.0.36",
"version": "0.0.37",
"description": "The official MCP Server for the Whop API",
"author": {
"name": "Whop"
Expand Down
2 changes: 1 addition & 1 deletion packages/mcp-server/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@whop/mcp",
"version": "0.0.36",
"version": "0.0.37",
"description": "The official MCP Server for the Whop API",
"author": "Whop <>",
"types": "dist/index.d.ts",
Expand Down
5 changes: 4 additions & 1 deletion packages/mcp-server/src/code-tool-worker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -113,10 +113,12 @@ const fuse = new Fuse(
'client.apps.retrieve',
'client.apps.update',
'client.invoices.create',
'client.invoices.delete',
'client.invoices.list',
'client.invoices.markPaid',
'client.invoices.markUncollectible',
'client.invoices.retrieve',
'client.invoices.update',
'client.invoices.void',
'client.courseLessonInteractions.list',
'client.courseLessonInteractions.retrieve',
Expand Down Expand Up @@ -378,7 +380,8 @@ function makeSdkProxy<T extends object>(obj: T, { path, isBelievedBad = false }:

function parseError(code: string, error: unknown): string | undefined {
if (!(error instanceof Error)) return;
const message = error.name ? `${error.name}: ${error.message}` : error.message;
const cause = error.cause instanceof Error ? `: ${error.cause.message}` : '';
const message = error.name ? `${error.name}: ${error.message}${cause}` : `${error.message}${cause}`;
try {
// Deno uses V8; the first "<anonymous>:LINE:COLUMN" is the top of stack.
const lineNumber = error.stack?.match(/<anonymous>:([0-9]+):[0-9]+/)?.[1];
Expand Down
83 changes: 83 additions & 0 deletions packages/mcp-server/src/local-docs-search.ts
Original file line number Diff line number Diff line change
Expand Up @@ -452,6 +452,89 @@ const EMBEDDED_METHODS: MethodEntry[] = [
},
},
},
{
name: 'update',
endpoint: '/invoices/{id}',
httpMethod: 'patch',
summary: 'Update invoice',
description: "Update a draft invoice's details.\n\nRequired permissions:\n - `invoice:update`",
stainlessPath: '(resource) invoices > (method) update',
qualified: 'client.invoices.update',
params: [
'id: string;',
'automatically_finalizes_at?: string;',
'billing_address?: { city?: string; country?: string; line1?: string; line2?: string; name?: string; phone?: string; postal_code?: string; state?: string; tax_id_type?: string; tax_id_value?: string; };',
'charge_buyer_fee?: boolean;',
"collection_method?: 'send_invoice' | 'charge_automatically';",
'customer_name?: string;',
'due_date?: string;',
'email_address?: string;',
'line_items?: { label: string; unit_price: number; quantity?: number; }[];',
'mailing_address_id?: string;',
'member_id?: string;',
'payment_method_id?: string;',
"plan?: { billing_period?: number; custom_fields?: { field_type: 'text'; name: string; id?: string; order?: number; placeholder?: string; required?: boolean; }[]; description?: string; expiration_days?: number; initial_price?: number; internal_notes?: string; legacy_payment_method_controls?: boolean; payment_method_configuration?: { disabled: string[]; enabled: string[]; include_platform_defaults: boolean; }; plan_type?: 'renewal' | 'one_time'; release_method?: 'buy_now' | 'waitlist'; renewal_price?: number; stock?: number; trial_period_days?: number; unlimited_stock?: boolean; visibility?: 'visible' | 'hidden' | 'archived' | 'quick_link'; };",
],
response:
"{ id: string; created_at: string; current_plan: { id: string; currency: string; formatted_price: string; }; due_date: string; email_address: string; fetch_invoice_token: string; number: string; status: 'draft' | 'open' | 'paid' | 'past_due' | 'uncollectible' | 'void'; user: { id: string; name: string; username: string; }; }",
markdown:
"## update\n\n`client.invoices.update(id: string, automatically_finalizes_at?: string, billing_address?: { city?: string; country?: string; line1?: string; line2?: string; name?: string; phone?: string; postal_code?: string; state?: string; tax_id_type?: string; tax_id_value?: string; }, charge_buyer_fee?: boolean, collection_method?: 'send_invoice' | 'charge_automatically', customer_name?: string, due_date?: string, email_address?: string, line_items?: { label: string; unit_price: number; quantity?: number; }[], mailing_address_id?: string, member_id?: string, payment_method_id?: string, plan?: { billing_period?: number; custom_fields?: { field_type: 'text'; name: string; id?: string; order?: number; placeholder?: string; required?: boolean; }[]; description?: string; expiration_days?: number; initial_price?: number; internal_notes?: string; legacy_payment_method_controls?: boolean; payment_method_configuration?: { disabled: payment_method_types[]; enabled: payment_method_types[]; include_platform_defaults: boolean; }; plan_type?: 'renewal' | 'one_time'; release_method?: 'buy_now' | 'waitlist'; renewal_price?: number; stock?: number; trial_period_days?: number; unlimited_stock?: boolean; visibility?: 'visible' | 'hidden' | 'archived' | 'quick_link'; }): { id: string; created_at: string; current_plan: object; due_date: string; email_address: string; fetch_invoice_token: string; number: string; status: invoice_status; user: object; }`\n\n**patch** `/invoices/{id}`\n\nUpdate a draft invoice's details.\n\nRequired permissions:\n - `invoice:update`\n\n### Parameters\n\n- `id: string`\n\n- `automatically_finalizes_at?: string`\n The date and time when the invoice will be automatically finalized and charged.\n\n- `billing_address?: { city?: string; country?: string; line1?: string; line2?: string; name?: string; phone?: string; postal_code?: string; state?: string; tax_id_type?: string; tax_id_value?: string; }`\n Inline billing address to create or update a mailing address for this invoice.\n - `city?: string`\n The city of the address.\n - `country?: string`\n The country of the address.\n - `line1?: string`\n The line 1 of the address.\n - `line2?: string`\n The line 2 of the address.\n - `name?: string`\n The name of the customer.\n - `phone?: string`\n The phone number of the customer.\n - `postal_code?: string`\n The postal code of the address.\n - `state?: string`\n The state of the address.\n - `tax_id_type?: string`\n The type of tax identifier\n - `tax_id_value?: string`\n The value of the tax identifier.\n\n- `charge_buyer_fee?: boolean`\n Whether to charge the customer a buyer fee on this invoice.\n\n- `collection_method?: 'send_invoice' | 'charge_automatically'`\n The method of collection for an invoice.\n\n- `customer_name?: string`\n The name of the customer.\n\n- `due_date?: string`\n The date by which the invoice must be paid.\n\n- `email_address?: string`\n The email address of the customer.\n\n- `line_items?: { label: string; unit_price: number; quantity?: number; }[]`\n Line items that break down the invoice total.\n\n- `mailing_address_id?: string`\n The unique identifier of an existing mailing address to attach.\n\n- `member_id?: string`\n The unique identifier of a member to assign as the customer.\n\n- `payment_method_id?: string`\n The unique identifier of the payment method to charge.\n\n- `plan?: { billing_period?: number; custom_fields?: { field_type: 'text'; name: string; id?: string; order?: number; placeholder?: string; required?: boolean; }[]; description?: string; expiration_days?: number; initial_price?: number; internal_notes?: string; legacy_payment_method_controls?: boolean; payment_method_configuration?: { disabled: string[]; enabled: string[]; include_platform_defaults: boolean; }; plan_type?: 'renewal' | 'one_time'; release_method?: 'buy_now' | 'waitlist'; renewal_price?: number; stock?: number; trial_period_days?: number; unlimited_stock?: boolean; visibility?: 'visible' | 'hidden' | 'archived' | 'quick_link'; }`\n Updated plan attributes.\n - `billing_period?: number`\n The interval in days at which the plan charges (renewal plans).\n - `custom_fields?: { field_type: 'text'; name: string; id?: string; order?: number; placeholder?: string; required?: boolean; }[]`\n An array of custom field objects.\n - `description?: string`\n The description of the plan.\n - `expiration_days?: number`\n The number of days until the membership expires and revokes access (expiration plans). For example, 365 for a one-year access period.\n - `initial_price?: number`\n An additional amount charged upon first purchase. Use only if a one time payment OR you want to charge an additional amount on top of the renewal price. Provided as a number in the specified currency. Eg: 10.43 for $10.43\n - `internal_notes?: string`\n A personal description or notes section for the business.\n - `legacy_payment_method_controls?: boolean`\n Whether this plan uses legacy payment method controls\n - `payment_method_configuration?: { disabled: string[]; enabled: string[]; include_platform_defaults: boolean; }`\n The explicit payment method configuration for the plan. If not provided, the platform or company's defaults will apply.\n - `plan_type?: 'renewal' | 'one_time'`\n The type of plan that can be attached to a product\n - `release_method?: 'buy_now' | 'waitlist'`\n The methods of how a plan can be released.\n - `renewal_price?: number`\n The amount the customer is charged every billing period. Use only if a recurring payment. Provided as a number in the specified currency. Eg: 10.43 for $10.43\n - `stock?: number`\n The number of units available for purchase.\n - `trial_period_days?: number`\n The number of free trial days added before a renewal plan.\n - `unlimited_stock?: boolean`\n When true, the plan has unlimited stock (stock field is ignored). When false, purchases are limited by the stock field.\n - `visibility?: 'visible' | 'hidden' | 'archived' | 'quick_link'`\n Visibility of a resource\n\n### Returns\n\n- `{ id: string; created_at: string; current_plan: { id: string; currency: string; formatted_price: string; }; due_date: string; email_address: string; fetch_invoice_token: string; number: string; status: 'draft' | 'open' | 'paid' | 'past_due' | 'uncollectible' | 'void'; user: { id: string; name: string; username: string; }; }`\n An invoice represents an itemized bill sent by a company to a customer for a specific product and plan, tracking the amount owed, due date, and payment status.\n\n - `id: string`\n - `created_at: string`\n - `current_plan: { id: string; currency: string; formatted_price: string; }`\n - `due_date: string`\n - `email_address: string`\n - `fetch_invoice_token: string`\n - `number: string`\n - `status: 'draft' | 'open' | 'paid' | 'past_due' | 'uncollectible' | 'void'`\n - `user: { id: string; name: string; username: string; }`\n\n### Example\n\n```typescript\nimport Whop from '@whop/sdk';\n\nconst client = new Whop();\n\nconst invoice = await client.invoices.update('inv_xxxxxxxxxxxxxx');\n\nconsole.log(invoice);\n```",
perLanguage: {
http: {
example:
'curl https://api.whop.com/api/v1/invoices/$ID \\\n -X PATCH \\\n -H "Authorization: Bearer $WHOP_API_KEY"',
},
python: {
method: 'invoices.update',
example:
'import os\nfrom whop_sdk import Whop\n\nclient = Whop(\n api_key=os.environ.get("WHOP_API_KEY"), # This is the default and can be omitted\n)\ninvoice = client.invoices.update(\n id="inv_xxxxxxxxxxxxxx",\n)\nprint(invoice.id)',
},
ruby: {
method: 'invoices.update',
example:
'require "whop_sdk"\n\nwhop = WhopSDK::Client.new(api_key: "My API Key")\n\ninvoice = whop.invoices.update("inv_xxxxxxxxxxxxxx")\n\nputs(invoice)',
},
typescript: {
method: 'client.invoices.update',
example:
"import Whop from '@whop/sdk';\n\nconst client = new Whop({\n apiKey: process.env['WHOP_API_KEY'], // This is the default and can be omitted\n});\n\nconst invoice = await client.invoices.update('inv_xxxxxxxxxxxxxx');\n\nconsole.log(invoice.id);",
},
},
},
{
name: 'delete',
endpoint: '/invoices/{id}',
httpMethod: 'delete',
summary: 'Delete invoice',
description: 'Delete a draft invoice.\n\nRequired permissions:\n - `invoice:update`',
stainlessPath: '(resource) invoices > (method) delete',
qualified: 'client.invoices.delete',
params: ['id: string;'],
response: 'boolean',
markdown:
"## delete\n\n`client.invoices.delete(id: string): boolean`\n\n**delete** `/invoices/{id}`\n\nDelete a draft invoice.\n\nRequired permissions:\n - `invoice:update`\n\n### Parameters\n\n- `id: string`\n\n### Returns\n\n- `boolean`\n Represents `true` or `false` values.\n\n### Example\n\n```typescript\nimport Whop from '@whop/sdk';\n\nconst client = new Whop();\n\nconst invoice = await client.invoices.delete('inv_xxxxxxxxxxxxxx');\n\nconsole.log(invoice);\n```",
perLanguage: {
http: {
example:
'curl https://api.whop.com/api/v1/invoices/$ID \\\n -X DELETE \\\n -H "Authorization: Bearer $WHOP_API_KEY"',
},
python: {
method: 'invoices.delete',
example:
'import os\nfrom whop_sdk import Whop\n\nclient = Whop(\n api_key=os.environ.get("WHOP_API_KEY"), # This is the default and can be omitted\n)\ninvoice = client.invoices.delete(\n "inv_xxxxxxxxxxxxxx",\n)\nprint(invoice)',
},
ruby: {
method: 'invoices.delete',
example:
'require "whop_sdk"\n\nwhop = WhopSDK::Client.new(api_key: "My API Key")\n\ninvoice = whop.invoices.delete("inv_xxxxxxxxxxxxxx")\n\nputs(invoice)',
},
typescript: {
method: 'client.invoices.delete',
example:
"import Whop from '@whop/sdk';\n\nconst client = new Whop({\n apiKey: process.env['WHOP_API_KEY'], // This is the default and can be omitted\n});\n\nconst invoice = await client.invoices.delete('inv_xxxxxxxxxxxxxx');\n\nconsole.log(invoice);",
},
},
},
{
name: 'list',
endpoint: '/course_lesson_interactions',
Expand Down
12 changes: 12 additions & 0 deletions packages/mcp-server/src/methods.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,12 +46,24 @@ export const sdkMethods: SdkMethod[] = [
httpMethod: 'get',
httpPath: '/invoices/{id}',
},
{
clientCallName: 'client.invoices.update',
fullyQualifiedName: 'invoices.update',
httpMethod: 'patch',
httpPath: '/invoices/{id}',
},
{
clientCallName: 'client.invoices.list',
fullyQualifiedName: 'invoices.list',
httpMethod: 'get',
httpPath: '/invoices',
},
{
clientCallName: 'client.invoices.delete',
fullyQualifiedName: 'invoices.delete',
httpMethod: 'delete',
httpPath: '/invoices/{id}',
},
{
clientCallName: 'client.invoices.markPaid',
fullyQualifiedName: 'invoices.markPaid',
Expand Down
2 changes: 1 addition & 1 deletion packages/mcp-server/src/server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ export const newMcpServer = async ({
new McpServer(
{
name: 'whop_sdk_api',
version: '0.0.36',
version: '0.0.37',
},
{
instructions: await getInstructions({ stainlessApiKey, customInstructionsPath }),
Expand Down
8 changes: 8 additions & 0 deletions src/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -235,9 +235,11 @@ import {
} from './resources/forums';
import {
InvoiceCreateParams,
InvoiceDeleteResponse,
InvoiceListParams,
InvoiceMarkPaidResponse,
InvoiceMarkUncollectibleResponse,
InvoiceUpdateParams,
InvoiceVoidResponse,
Invoices,
TaxIdentifierType,
Expand Down Expand Up @@ -321,6 +323,8 @@ import {
PayoutMethods,
} from './resources/payout-methods';
import {
CheckoutFont,
CheckoutShape,
PlanCreateParams,
PlanDeleteResponse,
PlanListParams,
Expand Down Expand Up @@ -1538,10 +1542,12 @@ export declare namespace Whop {
export {
Invoices as Invoices,
type TaxIdentifierType as TaxIdentifierType,
type InvoiceDeleteResponse as InvoiceDeleteResponse,
type InvoiceMarkPaidResponse as InvoiceMarkPaidResponse,
type InvoiceMarkUncollectibleResponse as InvoiceMarkUncollectibleResponse,
type InvoiceVoidResponse as InvoiceVoidResponse,
type InvoiceCreateParams as InvoiceCreateParams,
type InvoiceUpdateParams as InvoiceUpdateParams,
type InvoiceListParams as InvoiceListParams,
};

Expand Down Expand Up @@ -1618,6 +1624,8 @@ export declare namespace Whop {

export {
Plans as Plans,
type CheckoutFont as CheckoutFont,
type CheckoutShape as CheckoutShape,
type PlanListResponse as PlanListResponse,
type PlanDeleteResponse as PlanDeleteResponse,
type PlanListResponsesCursorPage as PlanListResponsesCursorPage,
Expand Down
Loading
Loading