Skip to content

Entities

ExpenseCategoryId module-attribute

ExpenseCategoryId = NewType('ExpenseCategoryId', UUID)

LineOfCreditId module-attribute

LineOfCreditId = NewType('LineOfCreditId', UUID)

ExpenseCategory dataclass

ExpenseCategory(id, code, name, description, reference)

An Expense Category is a high level concept to categorize expenses (or payments), as its name implies. A given payment can match several categories, for example food expenses, grocery stores, payments made abroad, payments made on Sunday, etc.

Expense Limits are typically in limited number for a given application. They are not linked to a specific card, account, or payment method.

Each payment must belong to at least one Expense Category to be authorized.

code instance-attribute

code

Machine-readable code of the category, unique within the system.

description instance-attribute

description

Description of the category.

id instance-attribute

id

name instance-attribute

name

Human-readable name of the category.

reference instance-attribute

reference

Application-specific reference to the category.

LineOfCredit dataclass

LineOfCredit(
    id,
    expense_category_id,
    owner_type,
    owner_ref,
    credits_limit,
    expensed_credits,
    available_credits,
)

A Line of Credit is a high level concept to manage expenses made by a given owner. Each Line of Credit belongs to an Expense Category.

For each Expense Category a payment belongs to, there must be a matching Line of Credit with sufficient credits to cover the payment.

available_credits instance-attribute

available_credits

Available credits for the Line of Credit (in minor units).

credits_limit instance-attribute

credits_limit

Credits limit for the Line of Credit (in minor units).

expense_category_id instance-attribute

expense_category_id

Category of expenses covered by the line of credit

expensed_credits instance-attribute

expensed_credits

Expensed credits for the Line of Credit (in minor units).

id instance-attribute

id

owner_ref instance-attribute

owner_ref

Application-specific reference to the owner of the line of credit.

owner_type instance-attribute

owner_type

Application-specific type of owner for the line of credit.

PendingTransaction dataclass

PendingTransaction(
    amount,
    currency,
    card_id,
    merchant_info,
    provider,
    external_id,
)

Information about a transaction to be authorized.

amount instance-attribute

amount

Transaction amount (positive for debit, in minor units).

card_id instance-attribute

card_id

Card used for the transaction.

currency instance-attribute

currency

Currency used for the transaction.

external_id instance-attribute

external_id

ID used by the external payment service provider to identify the transaction.

merchant_info instance-attribute

merchant_info

Merchant information.

provider instance-attribute

provider

Payment service provider that is processing the transaction.

PendingTransactionMerchantInfo dataclass

PendingTransactionMerchantInfo(
    merchant_id,
    acquirer_id,
    mcc,
    name,
    country,
    postal_code=None,
    city=None,
)

Merchant information for a pending transaction.

Note

All fields are always present during authorization, those which are None might simply be irrelevant for the merchant (e.g. e-commerce platforms may not have a postal code)

acquirer_id instance-attribute

acquirer_id

city class-attribute instance-attribute

city = None

country instance-attribute

country

ISO 3166-1 alpha-3 country code of the merchant.

mcc instance-attribute

mcc

merchant_id instance-attribute

merchant_id

name instance-attribute

name

postal_code class-attribute instance-attribute

postal_code = None