1717 async_to_streamed_response_wrapper ,
1818)
1919from ..._base_client import make_request_options
20- from ...types .simulations import inbound_check_deposit_create_params
20+ from ...types .simulations import inbound_check_deposit_create_params , inbound_check_deposit_adjustment_params
2121from ...types .inbound_check_deposit import InboundCheckDeposit
2222
2323__all__ = ["InboundCheckDepositsResource" , "AsyncInboundCheckDepositsResource" ]
@@ -115,6 +115,78 @@ def create(
115115 cast_to = InboundCheckDeposit ,
116116 )
117117
118+ def adjustment (
119+ self ,
120+ inbound_check_deposit_id : str ,
121+ * ,
122+ amount : int | Omit = omit ,
123+ reason : Literal ["late_return" , "wrong_payee_credit" , "adjusted_amount" , "non_conforming_item" , "paid" ]
124+ | Omit = omit ,
125+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
126+ # The extra values given here take precedence over values defined on the client or passed to this method.
127+ extra_headers : Headers | None = None ,
128+ extra_query : Query | None = None ,
129+ extra_body : Body | None = None ,
130+ timeout : float | httpx .Timeout | None | NotGiven = not_given ,
131+ idempotency_key : str | None = None ,
132+ ) -> InboundCheckDeposit :
133+ """Simulates an adjustment on an Inbound Check Deposit.
134+
135+ The Inbound Check Deposit
136+ must have a `status` of `accepted`.
137+
138+ Args:
139+ inbound_check_deposit_id: The identifier of the Inbound Check Deposit to adjust.
140+
141+ amount: The adjustment amount in cents. Defaults to the amount of the Inbound Check
142+ Deposit.
143+
144+ reason: The reason for the adjustment. Defaults to `wrong_payee_credit`.
145+
146+ - `late_return` - The return was initiated too late and the receiving
147+ institution has responded with a Late Return Claim.
148+ - `wrong_payee_credit` - The check was deposited to the wrong payee and the
149+ depositing institution has reimbursed the funds with a Wrong Payee Credit.
150+ - `adjusted_amount` - The check was deposited with a different amount than what
151+ was written on the check.
152+ - `non_conforming_item` - The recipient was not able to process the check. This
153+ usually happens for e.g., low quality images.
154+ - `paid` - The check has already been deposited elsewhere and so this is a
155+ duplicate.
156+
157+ extra_headers: Send extra headers
158+
159+ extra_query: Add additional query parameters to the request
160+
161+ extra_body: Add additional JSON properties to the request
162+
163+ timeout: Override the client-level default timeout for this request, in seconds
164+
165+ idempotency_key: Specify a custom idempotency key for this request
166+ """
167+ if not inbound_check_deposit_id :
168+ raise ValueError (
169+ f"Expected a non-empty value for `inbound_check_deposit_id` but received { inbound_check_deposit_id !r} "
170+ )
171+ return self ._post (
172+ f"/simulations/inbound_check_deposits/{ inbound_check_deposit_id } /adjustment" ,
173+ body = maybe_transform (
174+ {
175+ "amount" : amount ,
176+ "reason" : reason ,
177+ },
178+ inbound_check_deposit_adjustment_params .InboundCheckDepositAdjustmentParams ,
179+ ),
180+ options = make_request_options (
181+ extra_headers = extra_headers ,
182+ extra_query = extra_query ,
183+ extra_body = extra_body ,
184+ timeout = timeout ,
185+ idempotency_key = idempotency_key ,
186+ ),
187+ cast_to = InboundCheckDeposit ,
188+ )
189+
118190
119191class AsyncInboundCheckDepositsResource (AsyncAPIResource ):
120192 @cached_property
@@ -208,6 +280,78 @@ async def create(
208280 cast_to = InboundCheckDeposit ,
209281 )
210282
283+ async def adjustment (
284+ self ,
285+ inbound_check_deposit_id : str ,
286+ * ,
287+ amount : int | Omit = omit ,
288+ reason : Literal ["late_return" , "wrong_payee_credit" , "adjusted_amount" , "non_conforming_item" , "paid" ]
289+ | Omit = omit ,
290+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
291+ # The extra values given here take precedence over values defined on the client or passed to this method.
292+ extra_headers : Headers | None = None ,
293+ extra_query : Query | None = None ,
294+ extra_body : Body | None = None ,
295+ timeout : float | httpx .Timeout | None | NotGiven = not_given ,
296+ idempotency_key : str | None = None ,
297+ ) -> InboundCheckDeposit :
298+ """Simulates an adjustment on an Inbound Check Deposit.
299+
300+ The Inbound Check Deposit
301+ must have a `status` of `accepted`.
302+
303+ Args:
304+ inbound_check_deposit_id: The identifier of the Inbound Check Deposit to adjust.
305+
306+ amount: The adjustment amount in cents. Defaults to the amount of the Inbound Check
307+ Deposit.
308+
309+ reason: The reason for the adjustment. Defaults to `wrong_payee_credit`.
310+
311+ - `late_return` - The return was initiated too late and the receiving
312+ institution has responded with a Late Return Claim.
313+ - `wrong_payee_credit` - The check was deposited to the wrong payee and the
314+ depositing institution has reimbursed the funds with a Wrong Payee Credit.
315+ - `adjusted_amount` - The check was deposited with a different amount than what
316+ was written on the check.
317+ - `non_conforming_item` - The recipient was not able to process the check. This
318+ usually happens for e.g., low quality images.
319+ - `paid` - The check has already been deposited elsewhere and so this is a
320+ duplicate.
321+
322+ extra_headers: Send extra headers
323+
324+ extra_query: Add additional query parameters to the request
325+
326+ extra_body: Add additional JSON properties to the request
327+
328+ timeout: Override the client-level default timeout for this request, in seconds
329+
330+ idempotency_key: Specify a custom idempotency key for this request
331+ """
332+ if not inbound_check_deposit_id :
333+ raise ValueError (
334+ f"Expected a non-empty value for `inbound_check_deposit_id` but received { inbound_check_deposit_id !r} "
335+ )
336+ return await self ._post (
337+ f"/simulations/inbound_check_deposits/{ inbound_check_deposit_id } /adjustment" ,
338+ body = await async_maybe_transform (
339+ {
340+ "amount" : amount ,
341+ "reason" : reason ,
342+ },
343+ inbound_check_deposit_adjustment_params .InboundCheckDepositAdjustmentParams ,
344+ ),
345+ options = make_request_options (
346+ extra_headers = extra_headers ,
347+ extra_query = extra_query ,
348+ extra_body = extra_body ,
349+ timeout = timeout ,
350+ idempotency_key = idempotency_key ,
351+ ),
352+ cast_to = InboundCheckDeposit ,
353+ )
354+
211355
212356class InboundCheckDepositsResourceWithRawResponse :
213357 def __init__ (self , inbound_check_deposits : InboundCheckDepositsResource ) -> None :
@@ -216,6 +360,9 @@ def __init__(self, inbound_check_deposits: InboundCheckDepositsResource) -> None
216360 self .create = to_raw_response_wrapper (
217361 inbound_check_deposits .create ,
218362 )
363+ self .adjustment = to_raw_response_wrapper (
364+ inbound_check_deposits .adjustment ,
365+ )
219366
220367
221368class AsyncInboundCheckDepositsResourceWithRawResponse :
@@ -225,6 +372,9 @@ def __init__(self, inbound_check_deposits: AsyncInboundCheckDepositsResource) ->
225372 self .create = async_to_raw_response_wrapper (
226373 inbound_check_deposits .create ,
227374 )
375+ self .adjustment = async_to_raw_response_wrapper (
376+ inbound_check_deposits .adjustment ,
377+ )
228378
229379
230380class InboundCheckDepositsResourceWithStreamingResponse :
@@ -234,6 +384,9 @@ def __init__(self, inbound_check_deposits: InboundCheckDepositsResource) -> None
234384 self .create = to_streamed_response_wrapper (
235385 inbound_check_deposits .create ,
236386 )
387+ self .adjustment = to_streamed_response_wrapper (
388+ inbound_check_deposits .adjustment ,
389+ )
237390
238391
239392class AsyncInboundCheckDepositsResourceWithStreamingResponse :
@@ -243,3 +396,6 @@ def __init__(self, inbound_check_deposits: AsyncInboundCheckDepositsResource) ->
243396 self .create = async_to_streamed_response_wrapper (
244397 inbound_check_deposits .create ,
245398 )
399+ self .adjustment = async_to_streamed_response_wrapper (
400+ inbound_check_deposits .adjustment ,
401+ )
0 commit comments