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 .fern/metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"standardwebhooks": ">=1.0.1,<2"
}
},
"originGitCommit": "249a5a944ff04ad376a53d90ea63934a3529a87c",
"originGitCommit": "7bb23dc34026150ec2e8dfdd7745e207f6550de0",
"originGitCommitIsDirty": false,
"invokedBy": "ci",
"requestedVersion": "2.8.1",
Expand Down
8 changes: 7 additions & 1 deletion .fern/replay.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

18 changes: 17 additions & 1 deletion reference.md
Original file line number Diff line number Diff line change
Expand Up @@ -28337,7 +28337,7 @@ client.invoices.mark_uncollectible(
<dl>
<dd>

Issues a draft and emails it to its recipients, with reminders after the due date. A draft with no `payment_method_id` needs `invoice:update`, `invoice:create`, or `payment:charge`, and is never charged. A draft with a `payment_method_id` needs `payment:charge`: with a `charge_at`, or when its `due_at` is still ahead, it is emailed now and charged to that method at that time (see `scheduled_charge_at`); otherwise it is charged right away instead of emailed. Voiding the invoice, marking it uncollectible, or paying it first cancels the scheduled charge, and its recipients get the payment link if a charge fails. Sending an open invoice needs `payment:charge` and emails it again, up to three emails a day including the first send. With `send_at`, the draft is sent at that time instead, and cannot be edited, except its recipients, until it is sent or unscheduled. Each email, reminders included, is sent separately to the customer email shown on the invoice and to each address in `recipient_emails`, so recipients never see each other's addresses.
Issues a draft and emails it to its recipients, with reminders after the due date. A draft with no `payment_method_id` needs `invoice:update`, `invoice:create`, or `payment:charge`, and is never charged. A draft with a `payment_method_id` needs `payment:charge`: with a `charge_at`, or when its `due_at` is still ahead, it is emailed now and charged to that method at that time (see `scheduled_charge_at`); otherwise it is charged right away instead of emailed. Voiding the invoice, marking it uncollectible, or paying it first cancels the scheduled charge, and its recipients get the payment link if a charge fails. Sending an open invoice needs `payment:charge` and emails it again, up to three emails a day including the first send. With `send_at`, the draft is sent at that time instead, and cannot be edited, except its recipients, until it is sent or unscheduled. Each email, reminders included, is sent separately to the customer email shown on the invoice and to each address in `recipient_emails`, so recipients never see each other's addresses. With `send_as` set to `quote`, the draft is emailed as a quote with a link to view it, and it stays a draft. It can still be edited, it cannot be paid, and nothing is charged. A draft sent as a quote is not issued automatically on its `due_at`. The link stops working when the invoice is paid, void, or deleted. Send the quote again after an edit. A draft can be sent as a quote up to five times a day. A quote cannot use `send_at`, `charge_at`, or `collection_method`.
</dd>
</dl>
</dd>
Expand Down Expand Up @@ -28402,6 +28402,22 @@ client.invoices.send(
<dl>
<dd>

**message:** `typing.Optional[str]` — A note to the customer in the quote email. It is not stored. Only with `send_as` set to `quote`. Defaults to "Please review and accept this quote" when it is blank or left out.

</dd>
</dl>

<dl>
<dd>

**send_as:** `typing.Optional[SendInvoicesRequestSendAs]` — How to send the draft. `invoice` issues it and emails it to be paid. `quote` emails it as a quote and keeps it a draft. Defaults to `invoice`.

</dd>
</dl>

<dl>
<dd>

**send_at:** `typing.Optional[datetime.datetime]` — When to send the draft, as an ISO 8601 timestamp in the future. Omit to send now.

</dd>
Expand Down
3 changes: 3 additions & 0 deletions src/whop_sdk/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2560,6 +2560,7 @@
PostInvoiceVoidedPayloadApiVersion,
PostInvoiceVoidedPayloadType,
SendInvoicesRequestCollectionMethod,
SendInvoicesRequestSendAs,
UpdateInvoicesRequestBillingAddress,
UpdateInvoicesRequestItemsItem,
UpdateInvoicesRequestItemsItemVariant,
Expand Down Expand Up @@ -6418,6 +6419,7 @@
"SearchResult": ".types",
"SearchResultMatchReason": ".types",
"SendInvoicesRequestCollectionMethod": ".invoices",
"SendInvoicesRequestSendAs": ".invoices",
"ServiceUnavailableError": ".errors",
"SetupIntent": ".types",
"SetupIntentLegacy": ".types",
Expand Down Expand Up @@ -9825,6 +9827,7 @@ def __dir__():
"SearchResult",
"SearchResultMatchReason",
"SendInvoicesRequestCollectionMethod",
"SendInvoicesRequestSendAs",
"ServiceUnavailableError",
"SetupIntent",
"SetupIntentLegacy",
Expand Down
3 changes: 3 additions & 0 deletions src/whop_sdk/invoices/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
PostInvoiceVoidedPayloadApiVersion,
PostInvoiceVoidedPayloadType,
SendInvoicesRequestCollectionMethod,
SendInvoicesRequestSendAs,
UpdateInvoicesRequestBillingAddress,
UpdateInvoicesRequestItemsItem,
UpdateInvoicesRequestItemsItemVariant,
Expand Down Expand Up @@ -94,6 +95,7 @@
"PostInvoiceVoidedPayloadApiVersion": ".types",
"PostInvoiceVoidedPayloadType": ".types",
"SendInvoicesRequestCollectionMethod": ".types",
"SendInvoicesRequestSendAs": ".types",
"UpdateInvoicesRequestBillingAddress": ".types",
"UpdateInvoicesRequestItemsItem": ".types",
"UpdateInvoicesRequestItemsItemVariant": ".types",
Expand Down Expand Up @@ -168,6 +170,7 @@ def __dir__():
"PostInvoiceVoidedPayloadApiVersion",
"PostInvoiceVoidedPayloadType",
"SendInvoicesRequestCollectionMethod",
"SendInvoicesRequestSendAs",
"UpdateInvoicesRequestBillingAddress",
"UpdateInvoicesRequestItemsItem",
"UpdateInvoicesRequestItemsItemVariant",
Expand Down
25 changes: 23 additions & 2 deletions src/whop_sdk/invoices/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
from .types.list_invoices_request_statuses_item import ListInvoicesRequestStatusesItem
from .types.list_invoices_response import ListInvoicesResponse
from .types.send_invoices_request_collection_method import SendInvoicesRequestCollectionMethod
from .types.send_invoices_request_send_as import SendInvoicesRequestSendAs
from .types.update_invoices_request_billing_address import UpdateInvoicesRequestBillingAddress
from .types.update_invoices_request_items_item import UpdateInvoicesRequestItemsItem
from .types.update_invoices_request_payment_method_configuration import UpdateInvoicesRequestPaymentMethodConfiguration
Expand Down Expand Up @@ -633,11 +634,13 @@ def send(
*,
charge_at: typing.Optional[dt.datetime] = OMIT,
collection_method: typing.Optional[SendInvoicesRequestCollectionMethod] = OMIT,
message: typing.Optional[str] = OMIT,
send_as: typing.Optional[SendInvoicesRequestSendAs] = OMIT,
send_at: typing.Optional[dt.datetime] = OMIT,
request_options: typing.Optional[RequestOptions] = None,
) -> Invoice:
"""
Issues a draft and emails it to its recipients, with reminders after the due date. A draft with no `payment_method_id` needs `invoice:update`, `invoice:create`, or `payment:charge`, and is never charged. A draft with a `payment_method_id` needs `payment:charge`: with a `charge_at`, or when its `due_at` is still ahead, it is emailed now and charged to that method at that time (see `scheduled_charge_at`); otherwise it is charged right away instead of emailed. Voiding the invoice, marking it uncollectible, or paying it first cancels the scheduled charge, and its recipients get the payment link if a charge fails. Sending an open invoice needs `payment:charge` and emails it again, up to three emails a day including the first send. With `send_at`, the draft is sent at that time instead, and cannot be edited, except its recipients, until it is sent or unscheduled. Each email, reminders included, is sent separately to the customer email shown on the invoice and to each address in `recipient_emails`, so recipients never see each other's addresses.
Issues a draft and emails it to its recipients, with reminders after the due date. A draft with no `payment_method_id` needs `invoice:update`, `invoice:create`, or `payment:charge`, and is never charged. A draft with a `payment_method_id` needs `payment:charge`: with a `charge_at`, or when its `due_at` is still ahead, it is emailed now and charged to that method at that time (see `scheduled_charge_at`); otherwise it is charged right away instead of emailed. Voiding the invoice, marking it uncollectible, or paying it first cancels the scheduled charge, and its recipients get the payment link if a charge fails. Sending an open invoice needs `payment:charge` and emails it again, up to three emails a day including the first send. With `send_at`, the draft is sent at that time instead, and cannot be edited, except its recipients, until it is sent or unscheduled. Each email, reminders included, is sent separately to the customer email shown on the invoice and to each address in `recipient_emails`, so recipients never see each other's addresses. With `send_as` set to `quote`, the draft is emailed as a quote with a link to view it, and it stays a draft. It can still be edited, it cannot be paid, and nothing is charged. A draft sent as a quote is not issued automatically on its `due_at`. The link stops working when the invoice is paid, void, or deleted. Send the quote again after an edit. A draft can be sent as a quote up to five times a day. A quote cannot use `send_at`, `charge_at`, or `collection_method`.

Parameters
----------
Expand All @@ -650,6 +653,12 @@ def send(
collection_method : typing.Optional[SendInvoicesRequestCollectionMethod]
How the subscription this invoice starts collects each renewal. `charge_automatically` charges the payment method that paid the invoice each period: the draft's `payment_method_id`, or the one the customer pays the invoice link with. `send_invoice` issues a numbered invoice each period, due on the renewal date and emailed with its payment link to the latest invoice's `recipient_emails`, so it needs at least one recipient and isn't available for invoices billed to a business. Defaults to `charge_automatically`. Only for a draft with a recurring item. A scheduled send applies it when it fires (see `scheduled_collection_method`).

message : typing.Optional[str]
A note to the customer in the quote email. It is not stored. Only with `send_as` set to `quote`. Defaults to "Please review and accept this quote" when it is blank or left out.

send_as : typing.Optional[SendInvoicesRequestSendAs]
How to send the draft. `invoice` issues it and emails it to be paid. `quote` emails it as a quote and keeps it a draft. Defaults to `invoice`.

send_at : typing.Optional[dt.datetime]
When to send the draft, as an ISO 8601 timestamp in the future. Omit to send now.

Expand Down Expand Up @@ -678,6 +687,8 @@ def send(
id,
charge_at=charge_at,
collection_method=collection_method,
message=message,
send_as=send_as,
send_at=send_at,
request_options=request_options,
)
Expand Down Expand Up @@ -1436,11 +1447,13 @@ async def send(
*,
charge_at: typing.Optional[dt.datetime] = OMIT,
collection_method: typing.Optional[SendInvoicesRequestCollectionMethod] = OMIT,
message: typing.Optional[str] = OMIT,
send_as: typing.Optional[SendInvoicesRequestSendAs] = OMIT,
send_at: typing.Optional[dt.datetime] = OMIT,
request_options: typing.Optional[RequestOptions] = None,
) -> Invoice:
"""
Issues a draft and emails it to its recipients, with reminders after the due date. A draft with no `payment_method_id` needs `invoice:update`, `invoice:create`, or `payment:charge`, and is never charged. A draft with a `payment_method_id` needs `payment:charge`: with a `charge_at`, or when its `due_at` is still ahead, it is emailed now and charged to that method at that time (see `scheduled_charge_at`); otherwise it is charged right away instead of emailed. Voiding the invoice, marking it uncollectible, or paying it first cancels the scheduled charge, and its recipients get the payment link if a charge fails. Sending an open invoice needs `payment:charge` and emails it again, up to three emails a day including the first send. With `send_at`, the draft is sent at that time instead, and cannot be edited, except its recipients, until it is sent or unscheduled. Each email, reminders included, is sent separately to the customer email shown on the invoice and to each address in `recipient_emails`, so recipients never see each other's addresses.
Issues a draft and emails it to its recipients, with reminders after the due date. A draft with no `payment_method_id` needs `invoice:update`, `invoice:create`, or `payment:charge`, and is never charged. A draft with a `payment_method_id` needs `payment:charge`: with a `charge_at`, or when its `due_at` is still ahead, it is emailed now and charged to that method at that time (see `scheduled_charge_at`); otherwise it is charged right away instead of emailed. Voiding the invoice, marking it uncollectible, or paying it first cancels the scheduled charge, and its recipients get the payment link if a charge fails. Sending an open invoice needs `payment:charge` and emails it again, up to three emails a day including the first send. With `send_at`, the draft is sent at that time instead, and cannot be edited, except its recipients, until it is sent or unscheduled. Each email, reminders included, is sent separately to the customer email shown on the invoice and to each address in `recipient_emails`, so recipients never see each other's addresses. With `send_as` set to `quote`, the draft is emailed as a quote with a link to view it, and it stays a draft. It can still be edited, it cannot be paid, and nothing is charged. A draft sent as a quote is not issued automatically on its `due_at`. The link stops working when the invoice is paid, void, or deleted. Send the quote again after an edit. A draft can be sent as a quote up to five times a day. A quote cannot use `send_at`, `charge_at`, or `collection_method`.

Parameters
----------
Expand All @@ -1453,6 +1466,12 @@ async def send(
collection_method : typing.Optional[SendInvoicesRequestCollectionMethod]
How the subscription this invoice starts collects each renewal. `charge_automatically` charges the payment method that paid the invoice each period: the draft's `payment_method_id`, or the one the customer pays the invoice link with. `send_invoice` issues a numbered invoice each period, due on the renewal date and emailed with its payment link to the latest invoice's `recipient_emails`, so it needs at least one recipient and isn't available for invoices billed to a business. Defaults to `charge_automatically`. Only for a draft with a recurring item. A scheduled send applies it when it fires (see `scheduled_collection_method`).

message : typing.Optional[str]
A note to the customer in the quote email. It is not stored. Only with `send_as` set to `quote`. Defaults to "Please review and accept this quote" when it is blank or left out.

send_as : typing.Optional[SendInvoicesRequestSendAs]
How to send the draft. `invoice` issues it and emails it to be paid. `quote` emails it as a quote and keeps it a draft. Defaults to `invoice`.

send_at : typing.Optional[dt.datetime]
When to send the draft, as an ISO 8601 timestamp in the future. Omit to send now.

Expand Down Expand Up @@ -1489,6 +1508,8 @@ async def main() -> None:
id,
charge_at=charge_at,
collection_method=collection_method,
message=message,
send_as=send_as,
send_at=send_at,
request_options=request_options,
)
Expand Down
Loading
Loading