@@ -63,6 +63,7 @@ def create(
6363 description : str | Omit = omit ,
6464 digital_wallet : card_create_params .DigitalWallet | Omit = omit ,
6565 entity_id : str | Omit = omit ,
66+ replacement_for : card_create_params .ReplacementFor | Omit = omit ,
6667 # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
6768 # The extra values given here take precedence over values defined on the client or passed to this method.
6869 extra_headers : Headers | None = None ,
@@ -95,6 +96,9 @@ def create(
9596 entity_id: The Entity the card belongs to. You only need to supply this in rare situations
9697 when the card is not for the Account holder.
9798
99+ replacement_for: Details about the Card this Card replaces. Supply this when issuing a new Card
100+ to take over from an existing one. The replaced Card is not canceled.
101+
98102 extra_headers: Send extra headers
99103
100104 extra_query: Add additional query parameters to the request
@@ -116,6 +120,7 @@ def create(
116120 "description" : description ,
117121 "digital_wallet" : digital_wallet ,
118122 "entity_id" : entity_id ,
123+ "replacement_for" : replacement_for ,
119124 },
120125 card_create_params .CardCreateParams ,
121126 ),
@@ -440,6 +445,53 @@ def details(
440445 cast_to = CardDetails ,
441446 )
442447
448+ def renew (
449+ self ,
450+ card_id : str ,
451+ * ,
452+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
453+ # The extra values given here take precedence over values defined on the client or passed to this method.
454+ extra_headers : Headers | None = None ,
455+ extra_query : Query | None = None ,
456+ extra_body : Body | None = None ,
457+ timeout : float | httpx .Timeout | None | NotGiven = not_given ,
458+ idempotency_key : str | None = None ,
459+ ) -> Card :
460+ """Renew a Card in place.
461+
462+ The Card keeps its identifier, card number, PIN, and
463+ Physical Cards, and receives a new expiration date in the current month four
464+ years from now along with a new verification code, which the Card's details will
465+ return afterwards. Physical Cards that have already shipped keep working until
466+ they are canceled.
467+
468+ Args:
469+ card_id: The identifier of the Card to renew.
470+
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 card_id :
482+ raise ValueError (f"Expected a non-empty value for `card_id` but received { card_id !r} " )
483+ return self ._post (
484+ path_template ("/cards/{card_id}/renew" , card_id = card_id ),
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 = Card ,
493+ )
494+
443495 def update_pin (
444496 self ,
445497 card_id : str ,
@@ -517,6 +569,7 @@ async def create(
517569 description : str | Omit = omit ,
518570 digital_wallet : card_create_params .DigitalWallet | Omit = omit ,
519571 entity_id : str | Omit = omit ,
572+ replacement_for : card_create_params .ReplacementFor | Omit = omit ,
520573 # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
521574 # The extra values given here take precedence over values defined on the client or passed to this method.
522575 extra_headers : Headers | None = None ,
@@ -549,6 +602,9 @@ async def create(
549602 entity_id: The Entity the card belongs to. You only need to supply this in rare situations
550603 when the card is not for the Account holder.
551604
605+ replacement_for: Details about the Card this Card replaces. Supply this when issuing a new Card
606+ to take over from an existing one. The replaced Card is not canceled.
607+
552608 extra_headers: Send extra headers
553609
554610 extra_query: Add additional query parameters to the request
@@ -570,6 +626,7 @@ async def create(
570626 "description" : description ,
571627 "digital_wallet" : digital_wallet ,
572628 "entity_id" : entity_id ,
629+ "replacement_for" : replacement_for ,
573630 },
574631 card_create_params .CardCreateParams ,
575632 ),
@@ -894,6 +951,53 @@ async def details(
894951 cast_to = CardDetails ,
895952 )
896953
954+ async def renew (
955+ self ,
956+ card_id : str ,
957+ * ,
958+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
959+ # The extra values given here take precedence over values defined on the client or passed to this method.
960+ extra_headers : Headers | None = None ,
961+ extra_query : Query | None = None ,
962+ extra_body : Body | None = None ,
963+ timeout : float | httpx .Timeout | None | NotGiven = not_given ,
964+ idempotency_key : str | None = None ,
965+ ) -> Card :
966+ """Renew a Card in place.
967+
968+ The Card keeps its identifier, card number, PIN, and
969+ Physical Cards, and receives a new expiration date in the current month four
970+ years from now along with a new verification code, which the Card's details will
971+ return afterwards. Physical Cards that have already shipped keep working until
972+ they are canceled.
973+
974+ Args:
975+ card_id: The identifier of the Card to renew.
976+
977+ extra_headers: Send extra headers
978+
979+ extra_query: Add additional query parameters to the request
980+
981+ extra_body: Add additional JSON properties to the request
982+
983+ timeout: Override the client-level default timeout for this request, in seconds
984+
985+ idempotency_key: Specify a custom idempotency key for this request
986+ """
987+ if not card_id :
988+ raise ValueError (f"Expected a non-empty value for `card_id` but received { card_id !r} " )
989+ return await self ._post (
990+ path_template ("/cards/{card_id}/renew" , card_id = card_id ),
991+ options = make_request_options (
992+ extra_headers = extra_headers ,
993+ extra_query = extra_query ,
994+ extra_body = extra_body ,
995+ timeout = timeout ,
996+ idempotency_key = idempotency_key ,
997+ ),
998+ cast_to = Card ,
999+ )
1000+
8971001 async def update_pin (
8981002 self ,
8991003 card_id : str ,
@@ -966,6 +1070,9 @@ def __init__(self, cards: CardsResource) -> None:
9661070 self .details = to_raw_response_wrapper (
9671071 cards .details ,
9681072 )
1073+ self .renew = to_raw_response_wrapper (
1074+ cards .renew ,
1075+ )
9691076 self .update_pin = to_raw_response_wrapper (
9701077 cards .update_pin ,
9711078 )
@@ -996,6 +1103,9 @@ def __init__(self, cards: AsyncCardsResource) -> None:
9961103 self .details = async_to_raw_response_wrapper (
9971104 cards .details ,
9981105 )
1106+ self .renew = async_to_raw_response_wrapper (
1107+ cards .renew ,
1108+ )
9991109 self .update_pin = async_to_raw_response_wrapper (
10001110 cards .update_pin ,
10011111 )
@@ -1026,6 +1136,9 @@ def __init__(self, cards: CardsResource) -> None:
10261136 self .details = to_streamed_response_wrapper (
10271137 cards .details ,
10281138 )
1139+ self .renew = to_streamed_response_wrapper (
1140+ cards .renew ,
1141+ )
10291142 self .update_pin = to_streamed_response_wrapper (
10301143 cards .update_pin ,
10311144 )
@@ -1056,6 +1169,9 @@ def __init__(self, cards: AsyncCardsResource) -> None:
10561169 self .details = async_to_streamed_response_wrapper (
10571170 cards .details ,
10581171 )
1172+ self .renew = async_to_streamed_response_wrapper (
1173+ cards .renew ,
1174+ )
10591175 self .update_pin = async_to_streamed_response_wrapper (
10601176 cards .update_pin ,
10611177 )
0 commit comments