@@ -451,6 +451,47 @@ def mark_paid(
451451 cast_to = Invoice ,
452452 )
453453
454+ def pay (
455+ self ,
456+ invoice_id : str ,
457+ * ,
458+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
459+ # The extra values given here take precedence over values defined on the client or passed to this method.
460+ extra_headers : Headers | None = None ,
461+ extra_query : Query | None = None ,
462+ extra_body : Body | None = None ,
463+ timeout : float | httpx .Timeout | None | NotGiven = NOT_GIVEN ,
464+ idempotency_key : str | None = None ,
465+ ) -> Invoice :
466+ """
467+ This endpoint collects payment for an invoice using the customer's default
468+ payment method. This action can only be taken on invoices with status "issued".
469+
470+ Args:
471+ extra_headers: Send extra headers
472+
473+ extra_query: Add additional query parameters to the request
474+
475+ extra_body: Add additional JSON properties to the request
476+
477+ timeout: Override the client-level default timeout for this request, in seconds
478+
479+ idempotency_key: Specify a custom idempotency key for this request
480+ """
481+ if not invoice_id :
482+ raise ValueError (f"Expected a non-empty value for `invoice_id` but received { invoice_id !r} " )
483+ return self ._post (
484+ f"/invoices/{ invoice_id } /pay" ,
485+ options = make_request_options (
486+ extra_headers = extra_headers ,
487+ extra_query = extra_query ,
488+ extra_body = extra_body ,
489+ timeout = timeout ,
490+ idempotency_key = idempotency_key ,
491+ ),
492+ cast_to = Invoice ,
493+ )
494+
454495 def void (
455496 self ,
456497 invoice_id : str ,
@@ -917,6 +958,47 @@ async def mark_paid(
917958 cast_to = Invoice ,
918959 )
919960
961+ async def pay (
962+ self ,
963+ invoice_id : str ,
964+ * ,
965+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
966+ # The extra values given here take precedence over values defined on the client or passed to this method.
967+ extra_headers : Headers | None = None ,
968+ extra_query : Query | None = None ,
969+ extra_body : Body | None = None ,
970+ timeout : float | httpx .Timeout | None | NotGiven = NOT_GIVEN ,
971+ idempotency_key : str | None = None ,
972+ ) -> Invoice :
973+ """
974+ This endpoint collects payment for an invoice using the customer's default
975+ payment method. This action can only be taken on invoices with status "issued".
976+
977+ Args:
978+ extra_headers: Send extra headers
979+
980+ extra_query: Add additional query parameters to the request
981+
982+ extra_body: Add additional JSON properties to the request
983+
984+ timeout: Override the client-level default timeout for this request, in seconds
985+
986+ idempotency_key: Specify a custom idempotency key for this request
987+ """
988+ if not invoice_id :
989+ raise ValueError (f"Expected a non-empty value for `invoice_id` but received { invoice_id !r} " )
990+ return await self ._post (
991+ f"/invoices/{ invoice_id } /pay" ,
992+ options = make_request_options (
993+ extra_headers = extra_headers ,
994+ extra_query = extra_query ,
995+ extra_body = extra_body ,
996+ timeout = timeout ,
997+ idempotency_key = idempotency_key ,
998+ ),
999+ cast_to = Invoice ,
1000+ )
1001+
9201002 async def void (
9211003 self ,
9221004 invoice_id : str ,
@@ -990,6 +1072,9 @@ def __init__(self, invoices: Invoices) -> None:
9901072 self .mark_paid = _legacy_response .to_raw_response_wrapper (
9911073 invoices .mark_paid ,
9921074 )
1075+ self .pay = _legacy_response .to_raw_response_wrapper (
1076+ invoices .pay ,
1077+ )
9931078 self .void = _legacy_response .to_raw_response_wrapper (
9941079 invoices .void ,
9951080 )
@@ -1020,6 +1105,9 @@ def __init__(self, invoices: AsyncInvoices) -> None:
10201105 self .mark_paid = _legacy_response .async_to_raw_response_wrapper (
10211106 invoices .mark_paid ,
10221107 )
1108+ self .pay = _legacy_response .async_to_raw_response_wrapper (
1109+ invoices .pay ,
1110+ )
10231111 self .void = _legacy_response .async_to_raw_response_wrapper (
10241112 invoices .void ,
10251113 )
@@ -1050,6 +1138,9 @@ def __init__(self, invoices: Invoices) -> None:
10501138 self .mark_paid = to_streamed_response_wrapper (
10511139 invoices .mark_paid ,
10521140 )
1141+ self .pay = to_streamed_response_wrapper (
1142+ invoices .pay ,
1143+ )
10531144 self .void = to_streamed_response_wrapper (
10541145 invoices .void ,
10551146 )
@@ -1080,6 +1171,9 @@ def __init__(self, invoices: AsyncInvoices) -> None:
10801171 self .mark_paid = async_to_streamed_response_wrapper (
10811172 invoices .mark_paid ,
10821173 )
1174+ self .pay = async_to_streamed_response_wrapper (
1175+ invoices .pay ,
1176+ )
10831177 self .void = async_to_streamed_response_wrapper (
10841178 invoices .void ,
10851179 )
0 commit comments