Skip to content

schemas

Monzo API 'webhooks' related schemas.

MonzoWebhook

Bases: BaseModel

API schema for a 'webhook' object.

Note

Monzo API docs: https://docs.monzo.com/#webhooks

Attributes:

Name Type Description
id str

The ID of the webhook.

account_id str

The account to receive notifications for.

url str

The URL we will send notifications to.

Source code in pymonzo/webhooks/schemas.py
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
class MonzoWebhook(BaseModel):
    """API schema for a 'webhook' object.

    Note:
        Monzo API docs: https://docs.monzo.com/#webhooks

    Attributes:
        id: The ID of the webhook.
        account_id: The account to receive notifications for.
        url: The URL we will send notifications to.
    """

    model_config = ConfigDict(extra="allow")

    id: str
    account_id: str
    url: str

MonzoWebhookEvent

Bases: BaseModel

API schema for a 'webhook event' object.

Note

Monzo API docs: https://docs.monzo.com/#transaction-created

Attributes:

Name Type Description
type str

Webhook event type.

data MonzoWebhookTransactionEvent

Webhook event data.

Source code in pymonzo/webhooks/schemas.py
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
class MonzoWebhookEvent(BaseModel):
    """API schema for a 'webhook event' object.

    Note:
        Monzo API docs: https://docs.monzo.com/#transaction-created

    Attributes:
        type: Webhook event type.
        data: Webhook event data.
    """

    model_config = ConfigDict(extra="allow")

    type: str
    data: MonzoWebhookTransactionEvent

MonzoWebhookTransactionEvent

Bases: BaseModel

API schema for a 'webhook event' object.

For some reason it seems slight different from pymonzo.transactions.MonzoTransaction.

Note

Monzo API docs: https://docs.monzo.com/#transaction-created

Attributes:

Name Type Description
account_id str

The ID of the account.

amount int

The amount of the transaction in minor units of currency. For example pennies in the case of GBP. A negative amount indicates a debit (most card transactions will have a negative amount)

created str

Transaction creation date.

currency str

Transaction currency

description str

Transaction description.

id str

The ID of the transaction.

category str

The category can be set for each transaction by the user.

is_load bool

Top-ups to an account are represented as transactions with a positive amount and is_load = true. Other transactions such as refunds, reversals or chargebacks may have a positive amount but is_load = false.

settled str

The timestamp at which the transaction settled. In most cases, this happens 24-48 hours after created. If this field is an empty string, the transaction is authorised but not yet "complete."

merchant MonzoTransactionMerchant

Merchant information.

Source code in pymonzo/webhooks/schemas.py
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
class MonzoWebhookTransactionEvent(BaseModel):
    """API schema for a 'webhook event' object.

    For some reason it seems slight different from
    [`pymonzo.transactions.MonzoTransaction`][].

    Note:
        Monzo API docs: https://docs.monzo.com/#transaction-created

    Attributes:
        account_id: The ID of the account.
        amount: The amount of the transaction in minor units of currency. For example
            pennies in the case of GBP. A negative amount indicates a debit (most
            card transactions will have a negative amount)
        created: Transaction creation date.
        currency: Transaction currency
        description: Transaction description.
        id: The ID of the transaction.
        category: The category can be set for each transaction by the user.
        is_load: Top-ups to an account are represented as transactions with a positive
            amount and `is_load = true`. Other transactions such as refunds, reversals
            or chargebacks may have a positive amount but `is_load = false`.
        settled: The timestamp at which the transaction settled. In most cases, this
            happens 24-48 hours after created. If this field is an empty string,
            the transaction is authorised but not yet "complete."
        merchant: Merchant information.
    """

    model_config = ConfigDict(extra="allow")

    account_id: str
    amount: int
    created: str
    currency: str
    description: str
    id: str
    category: str
    is_load: bool
    settled: str
    merchant: MonzoTransactionMerchant