Skip to content

Transactions

upbankapi.models.Transaction #

Bases: ModelBase

Representation of a Transaction.

id: str class-attribute #

The unique identifier for this transaction.

status: TransactionStatus class-attribute #

The current processing status of this transaction.

raw_text: Optional[str] = None class-attribute #

The original, unprocessed text of the transaction.

description: str class-attribute #

A short description for this transaction. Usually the merchant name for purchases.

message: Optional[str] = None class-attribute #

Attached message for this transaction, such as a payment message, or a transfer note.

categorizable: bool class-attribute #

Boolean flag set to true on transactions that support the use of categories.

hold_info: Optional[HoldInfo] = None class-attribute #

The amount and foreign_amount of this transaction while it was/is in the HELD state.

round_up: Optional[RoundUp] = None class-attribute #

Details of how this transaction was rounded-up.

If no Round Up was applied this field will be null.

cashback: Optional[Cashback] = None class-attribute #

Provides details of the reimbursement if all or part of this transaction was instantly reimbursed in the form of cashback.

amount: float class-attribute #

The amount of this transaction in Australian dollars.

For transactions that were once HELD but are now SETTLED, refer to the hold_info field for the original amount the transaction was HELD at.

amount_in_base_units: int class-attribute #

The amount of money in the smallest denomination for the currency.

currency: str class-attribute #

The ISO 4217 currency code.

foreign_amount: Optional[MoneyObject] = None class-attribute #

The foreign currency amount of this transaction.

This field will be None for domestic transactions.

card_purchase_method: Optional[CardPurchaseMethod] = None class-attribute #

Information about the card used for this transaction, if applicable.

settled_at: Optional[datetime] = None class-attribute #

The datetime at which this transaction settled.

This field will be None for transactions that are currently in the HELD status.

created_at: datetime class-attribute #

The datetime at which this transaction was first encountered.

category: Optional[PartialCategoryParent] = None class-attribute #

The category assigned to this transaction.

tags: List[Tag] class-attribute #

The list of tags assigned to this transaction.

pending() property #

Returns true when the transaction is pending.

long_description() property #

Returns a longer description using the description and message properties.

categorize(category) #

Assign a category to this transaction.

Parameters:

Name Type Description Default
category Optional[Union[str, PartialCategory]]

The category to assign to the transaction. Setting this to None will de-categorize the transaction.

required

Returns:

Type Description
bool

True if successful, otherwise raises exception.

Raises:

Type Description
ValueError

If the transaction is not categorizable.

add_tags(*tags) #

Add tags to this transaction.

Parameters:

Name Type Description Default
*tags Union[str, Tag]

The tags or tag ids to add to the transaction.

()

Returns:

Type Description
bool

True if successful, otherwise raises exception.

remove_tags(*tags) #

Remove tags from this transaction.

Parameters:

Name Type Description Default
*tags Union[str, Tag]

The tags or tag ids to remove to the transaction.

()

Returns:

Type Description
bool

True if successful, otherwise raises exception.

__repr__() #

Return the representation of the transaction.

upbankapi.models.transactions.AsyncTransaction #

Bases: Transaction

categorize(category) async #

Assign a category to this transaction.

Parameters:

Name Type Description Default
category Optional[Union[str, PartialCategory]]

The category to assign to the transaction. Setting this to None will de-categorize the transaction.

required

Returns:

Type Description
bool

True if successful, otherwise raises exception.

Raises:

Type Description
ValueError

If the transaction is not categorizable.

add_tags(*tags) async #

Add tags to this transaction.

Parameters:

Name Type Description Default
*tags Union[str, Tag]

The tags or tag ids to add to the transaction.

()

Returns:

Type Description
bool

True if successful, otherwise raises exception.

remove_tags(*tags) async #

Remove tags from this transaction.

Parameters:

Name Type Description Default
*tags Union[str, Tag]

The tags or tag ids to remove to the transaction.

()

Returns:

Type Description
bool

True if successful, otherwise raises exception.

upbankapi.models.common.MoneyObject #

Representation of a MoneyObject.

value: float = float(data['value']) instance-attribute #

The amount of money.

value_in_base_units: int = data['valueInBaseUnits'] instance-attribute #

The amount of money in the smallest denomination for the currency.

currency: str = data['currencyCode'] instance-attribute #

The ISO 4217 currency code.

upbankapi.models.transactions.HoldInfo #

Representation of the HoldInfo object returned by a Transaction.

amount: MoneyObject = MoneyObject(data['amount']) instance-attribute #

The amount of this transaction while in the HELD status, in Australian dollars.

foreign_amount: Optional[MoneyObject] = None instance-attribute #

The foreign currency amount of this transaction while in the HELD status.

This field will be None for domestic transactions.

upbankapi.models.transactions.RoundUp #

Representation of the RoundUp object returned by a Transaction.

amount: MoneyObject = MoneyObject(data['amount']) instance-attribute #

The total amount of this Round Up, including any boosts, represented as a negative value.

boost_portion: Optional[MoneyObject] = None instance-attribute #

The portion of the Round Up amount owing to boosted Round Ups, represented as a negative value.

If no boost was added to the Round Up this field will be None.

upbankapi.models.transactions.Cashback #

Representation of the Cashback object returned by a Transaction.

amount: MoneyObject = MoneyObject(data['amount']) instance-attribute #

The total amount of cashback paid, represented as a positive value.

description: str = data['description'] instance-attribute #

A brief description of why this cashback was paid.