
    Ch                         S SK Jr  S SKJr  S SKJr  S SKJr  S SKJ	r	J
r
Jr  S SKJrJr  \(       a  S SKJr  S SKJr  S S	KJr   " S
 S\S   5      rg)    )APIResource)Customer)ExpandableField)sanitize_id)ClassVarDictOptional)LiteralTYPE_CHECKING)
CreditNote)Invoice)Sessionc                   B   \ rS rSr% SrSr\\S      \S'   \	\S'    \
\S      \S'    \	\S'    \
\S	      \S
'    \\S'    \S   \S'    \
\   \S'    \	\S'    \\S'    \
\S      \S'    \\S'    \
\\\4      \S'    \S   \S'    \S   \S'    S r\SS j5       rSrg)CustomerBalanceTransaction   a  
Each customer has a [Balance](https://stripe.com/docs/api/customers/object#customer_object-balance) value,
which denotes a debit or credit that's automatically applied to their next invoice upon finalization.
You may modify the value directly by using the [update customer API](https://stripe.com/docs/api/customers/update),
or by creating a Customer Balance Transaction, which increments or decrements the customer's `balance` by the specified `amount`.

Related guide: [Customer balance](https://stripe.com/docs/billing/customer/balance)
customer_balance_transactionOBJECT_NAMEamountr   checkout_sessioncreatedr   credit_notecurrencyr   customerdescriptionending_balanceidr   invoicelivemodemetadataobject)
adjustmentapplied_to_invoice%checkout_session_subscription_payment.checkout_session_subscription_payment_canceledr   initialinvoice_overpaidinvoice_too_largeinvoice_too_small	migrationunapplied_from_invoiceunspent_receiver_credittypec                     U R                   nU R                  n[        U[        5      (       a  UR                   n[        R                  " 5       n[        U5      n[        U5      nU< SU< SU< 3$ )N/z/balance_transactions/)r   r   
isinstancer   	class_urlr   )selftokenr   base	cust_extnextns         g/home/kali/devsecops-assessor/venv/lib/python3.13/site-packages/stripe/_customer_balance_transaction.pyinstance_url'CustomerBalanceTransaction.instance_urlc   sY    ==h)){{H!!#)	5!26	4HH    c                     [        S5      e)NzCan't retrieve a Customer Balance Transaction without a Customer ID. Use Customer.retrieve_customer_balance_transaction('cus_123', 'cbtxn_123'))NotImplementedError)clsr   paramss      r6   retrieve#CustomerBalanceTransaction.retrievem   s    !Y
 	
r9    N)returnr   )__name__
__module____qualname____firstlineno____doc__r   r   r
   __annotations__intr	   r   strboolr   r7   classmethodr>   __static_attributes__r@   r9   r6   r   r      s4    	' '"@AB  K y9:: L /,788 M j)) #  	G oi011 N tCH~&& 233 	# I 
 
r9   r   N)stripe._api_resourcer   stripe._customerr   stripe._expandable_fieldr   stripe._utilr   typingr   r   r	   typing_extensionsr
   r   stripe._credit_noter   stripe._invoicer   stripe.checkout._sessionr   r   r@   r9   r6   <module>rV      s<    - % 4 $ + + 4.'0b
-I!J b
r9   