Types#
All Pydantic models are immutable (frozen=True) and support extra fields.
Base#
- class aioplatega.types.base.PlategaObject[source]#
Bases:
BaseModelBase model for all Platega API objects.
Frozen, so assignment to a field is rejected rather than validated, and tolerant of unknown fields, so an attribute added server-side does not break existing callers.
- model_config: ClassVar[ConfigDict] = {'arbitrary_types_allowed': True, 'defer_build': True, 'extra': 'allow', 'frozen': True, 'populate_by_name': True, 'use_enum_values': True, 'validate_by_alias': True, 'validate_by_name': True}#
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class aioplatega.types.base.SequenceResponse[source]#
Bases:
objectSequence access for responses whose JSON body is a bare array.
Mixed into a
RootModelso callers can iterate the response directly instead of reaching for.root. Deliberately not a generic base class: a parametrised generic keeps the__module__of the base, which makes autodoc emit it once per parametrisation.
PaymentDetails#
- class aioplatega.types.payment_details.PaymentDetails[source]#
Bases:
PlategaObjectAmount and currency of a payment.
- model_config: ClassVar[ConfigDict] = {'arbitrary_types_allowed': True, 'defer_build': True, 'extra': 'allow', 'frozen': True, 'populate_by_name': True, 'use_enum_values': True, 'validate_by_alias': True, 'validate_by_name': True}#
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
CreateTransactionRequest#
- class aioplatega.types.create_transaction_request.CreateTransactionRequest[source]#
Bases:
PlategaObjectBody for creating a transaction.
Note
Do not supply an
id. The API generates the transaction id.metadatacarries the payer identifier. Shops in certain categories are required to sendmetadata.userId; where that requirement applies, omitting it disables antifraud protection and can get the shop suspended. Ask your Platega manager whether it applies to yours.payment_methodaccepts any integer, not only aPaymentMethodIntmember. The enum names the documented methods, but the GitBook records that ids 1 through 9 are P2P and a merchant is enabled for whichever their contract covers, so a closed set would lock those merchants out.- payment_method: PaymentMethodInt | int#
- payment_details: PaymentDetails#
- model_config: ClassVar[ConfigDict] = {'arbitrary_types_allowed': True, 'defer_build': True, 'extra': 'allow', 'frozen': True, 'populate_by_name': True, 'use_enum_values': True, 'validate_by_alias': True, 'validate_by_name': True}#
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
CreateTransactionResponse#
- class aioplatega.types.create_transaction_response.CreateTransactionResponse[source]#
Bases:
PlategaObjectA created transaction, including the URL to send the payer to.
- payment_details: str | PaymentDetails | None#
- status: PaymentStatus | str#
- model_config: ClassVar[ConfigDict] = {'arbitrary_types_allowed': True, 'defer_build': True, 'extra': 'allow', 'frozen': True, 'populate_by_name': True, 'use_enum_values': True, 'validate_by_alias': True, 'validate_by_name': True}#
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
TransactionStatusResponse#
- class aioplatega.types.transaction_status_response.TransactionStatusResponse[source]#
Bases:
PlategaObjectFull state of a transaction.
Note
merchant_idaccepts bothmechantIdandmerchantId. The API spells itmechantIdin the published schema and in its own example; the correct spelling is accepted as well, should the typo ever be fixed server-side.Several other fields keep the API’s spelling in their aliases for the same reason:
comission,comissionUsdt,comissionType.- status: PaymentStatus | str | None#
- payment_details: PaymentDetails | None#
- model_config: ClassVar[ConfigDict] = {'arbitrary_types_allowed': True, 'defer_build': True, 'extra': 'allow', 'frozen': True, 'populate_by_name': True, 'use_enum_values': True, 'validate_by_alias': True, 'validate_by_name': True}#
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
RateResponse#
- class aioplatega.types.rate_response.RateResponse[source]#
Bases:
PlategaObjectAn exchange rate between two currencies for a payment method.
Note
updated_atappears in the GitBook example but not in live responses, so it is optional. Rates are directional: a pair the API answers in one direction may return 404 in the other.- model_config: ClassVar[ConfigDict] = {'arbitrary_types_allowed': True, 'defer_build': True, 'extra': 'allow', 'frozen': True, 'populate_by_name': True, 'use_enum_values': True, 'validate_by_alias': True, 'validate_by_name': True}#
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
ConversionItem#
- class aioplatega.types.conversion_item.ConversionItem[source]#
Bases:
PlategaObjectOne balance-unlock operation: a conversion between two currencies.
Note
Built from live responses. The published example for this endpoint is an empty object, so the specification describes none of these fields.
- model_config: ClassVar[ConfigDict] = {'arbitrary_types_allowed': True, 'defer_build': True, 'extra': 'allow', 'frozen': True, 'populate_by_name': True, 'use_enum_values': True, 'validate_by_alias': True, 'validate_by_name': True}#
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
ConversionsResponse#
- class aioplatega.types.conversions_response.ConversionsResponse[source]#
Bases:
PlategaObjectA page of balance-unlock operations.
Iterating the response yields the operations directly.
Note
The API answers with
operationsandpagination. Earlier releases modelledcontent/totalElements, which no live response has ever contained, so the operations were silently dropped and the list always came back empty.- operations: list[ConversionItem]#
- model_config: ClassVar[ConfigDict] = {'arbitrary_types_allowed': True, 'defer_build': True, 'extra': 'allow', 'frozen': True, 'populate_by_name': True, 'use_enum_values': True, 'validate_by_alias': True, 'validate_by_name': True}#
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
CallbackPayload#
- class aioplatega.types.callback_payload.CallbackPayload[source]#
Bases:
PlategaObjectBody of the transaction-status callback.
Delivered to the callback URL configured in the dashboard, with the
X-MerchantIdandX-Secretheaders for verification. Platega expects a response within 60 seconds and retries up to three times at five-minute intervals.Note
statusis typed as a plain string rather thanPaymentStatus. The published schema lists onlyCONFIRMEDandCANCELED, while the same page’s prose addsCHARGEBACKEDfor refunds, so the field has to admit values the schema does not name.- model_config: ClassVar[ConfigDict] = {'arbitrary_types_allowed': True, 'defer_build': True, 'extra': 'allow', 'frozen': True, 'populate_by_name': True, 'use_enum_values': True, 'validate_by_alias': True, 'validate_by_name': True}#
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
PaymentMetadata#
- class aioplatega.types.payment_metadata.PaymentMetadata[source]#
Bases:
PlategaObjectPayer identification sent alongside a payment.
Shops in certain categories are required to send this. Where the requirement applies, omitting
user_iddisables antifraud protection and can get the shop suspended. Ask your Platega manager whether it applies to yours.Note
The schema marks both fields required, but they are optional here so that a shop holding only one of them can still send it. Extra keys are preserved, so anything your shop additionally needs can be passed.
- model_config: ClassVar[ConfigDict] = {'arbitrary_types_allowed': True, 'defer_build': True, 'extra': 'allow', 'frozen': True, 'populate_by_name': True, 'use_enum_values': True, 'validate_by_alias': True, 'validate_by_name': True}#
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
PaymentLinkResponse#
- class aioplatega.types.payment_link_response.PaymentLinkResponse[source]#
Bases:
PlategaObjectResponse of
POST v2/transaction/process(payer picks the method).- model_config: ClassVar[ConfigDict] = {'arbitrary_types_allowed': True, 'defer_build': True, 'extra': 'allow', 'frozen': True, 'populate_by_name': True, 'use_enum_values': True, 'validate_by_alias': True, 'validate_by_name': True}#
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
H2HQrResponse#
- class aioplatega.types.h2h_qr_response.H2HQrResponse[source]#
Bases:
PlategaObjectPayment details for a host-to-host transaction.
Note
The shape depends on the method. The Apidog docs show an SBP QR (
amountandqr); the older GitBook shows P2P bank requisites (account_number,account_name,method). Every field is optional so either answer parses.- model_config: ClassVar[ConfigDict] = {'arbitrary_types_allowed': True, 'defer_build': True, 'extra': 'allow', 'frozen': True, 'populate_by_name': True, 'use_enum_values': True, 'validate_by_alias': True, 'validate_by_name': True}#
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
Balances#
- class aioplatega.types.balance_item.BalanceItem[source]#
Bases:
PlategaObjectMerchant balance in a single currency.
- model_config: ClassVar[ConfigDict] = {'arbitrary_types_allowed': True, 'defer_build': True, 'extra': 'allow', 'frozen': True, 'populate_by_name': True, 'use_enum_values': True, 'validate_by_alias': True, 'validate_by_name': True}#
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
GET /balance/all returns a bare array. BalancesResponse is
RootModel[list[BalanceItem]] — iterate it directly.
Transaction exports#
- class aioplatega.types.transaction_export_request.TransactionExportRequest[source]#
Bases:
PlategaObjectFilters shared by the CSV, Excel and JSON transaction exports.
- model_config: ClassVar[ConfigDict] = {'arbitrary_types_allowed': True, 'defer_build': True, 'extra': 'allow', 'frozen': True, 'populate_by_name': True, 'use_enum_values': True, 'validate_by_alias': True, 'validate_by_name': True}#
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
Transaction export rows#
- class aioplatega.types.transaction_export_item.TransactionExportItem[source]#
Bases:
PlategaObjectOne transaction row from the JSON export.
- model_config: ClassVar[ConfigDict] = {'arbitrary_types_allowed': True, 'defer_build': True, 'extra': 'allow', 'frozen': True, 'populate_by_name': True, 'use_enum_values': True, 'validate_by_alias': True, 'validate_by_name': True}#
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
The JSON export returns a bare array. TransactionExportResponse is
RootModel[list[TransactionExportItem]] — iterate it directly.
ExportUrlResponse#
- class aioplatega.types.export_url_response.ExportUrlResponse[source]#
Bases:
PlategaObjectA link to the generated export file.
- model_config: ClassVar[ConfigDict] = {'arbitrary_types_allowed': True, 'defer_build': True, 'extra': 'allow', 'frozen': True, 'populate_by_name': True, 'use_enum_values': True, 'validate_by_alias': True, 'validate_by_name': True}#
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
Cancellation#
- class aioplatega.types.cancel_supported_response.CancelSupportedResponse[source]#
Bases:
PlategaObjectWhether a transaction can be cancelled, and what it would cost.
A
supportedofFalseis a normal answer, not an error: readblock_reasonfor why.- model_config: ClassVar[ConfigDict] = {'arbitrary_types_allowed': True, 'defer_build': True, 'extra': 'allow', 'frozen': True, 'populate_by_name': True, 'use_enum_values': True, 'validate_by_alias': True, 'validate_by_name': True}#
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
CancelTransactionResponse#
- class aioplatega.types.cancel_transaction_response.CancelTransactionResponse[source]#
Bases:
PlategaObjectOutcome of a cancellation request.
accepted=Falsewithmanual_control_required=Truemeans the refund could not be automated and a human has to pick it up.- model_config: ClassVar[ConfigDict] = {'arbitrary_types_allowed': True, 'defer_build': True, 'extra': 'allow', 'frozen': True, 'populate_by_name': True, 'use_enum_values': True, 'validate_by_alias': True, 'validate_by_name': True}#
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
Subscription#
- class aioplatega.types.subscription.Subscription[source]#
Bases:
PlategaObjectA recurring SBP subscription.
statusandinterval_unitare deliberately loose. The vendor’s own examples return each of them as a number in the list response and as a word in the single-subscription response (status: 4versusstatus: "Active"), so pinning either to one type would reject half the real payloads. SeeSubscriptionStatusandSubscriptionInterval.- charge_metrics: SubscriptionChargeMetrics | None#
- model_config: ClassVar[ConfigDict] = {'arbitrary_types_allowed': True, 'defer_build': True, 'extra': 'allow', 'frozen': True, 'populate_by_name': True, 'use_enum_values': True, 'validate_by_alias': True, 'validate_by_name': True}#
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
SubscriptionPaymentDetails#
- class aioplatega.types.subscription_payment_details.SubscriptionPaymentDetails[source]#
Bases:
PlategaObjectAmount, currency and charge period of a subscription.
Distinct from
PaymentDetails: a subscription charges repeatedly, so the period is part of the payment details and is required.Note
amountis an integer here. The subscription create schema types it that way, unlike the one-off payment schema, which takes a number.- interval: SubscriptionInterval#
- model_config: ClassVar[ConfigDict] = {'arbitrary_types_allowed': True, 'defer_build': True, 'extra': 'allow', 'frozen': True, 'populate_by_name': True, 'use_enum_values': True, 'validate_by_alias': True, 'validate_by_name': True}#
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
SubscriptionChargeMetrics#
- class aioplatega.types.subscription_charge_metrics.SubscriptionChargeMetrics[source]#
Bases:
PlategaObjectCharge history of a subscription, as reported alongside it.
- model_config: ClassVar[ConfigDict] = {'arbitrary_types_allowed': True, 'defer_build': True, 'extra': 'allow', 'frozen': True, 'populate_by_name': True, 'use_enum_values': True, 'validate_by_alias': True, 'validate_by_name': True}#
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
SubscriptionListResponse#
- class aioplatega.types.subscription_list_response.SubscriptionListResponse[source]#
Bases:
PlategaObjectA page of subscriptions.
- items: list[Subscription]#
- model_config: ClassVar[ConfigDict] = {'arbitrary_types_allowed': True, 'defer_build': True, 'extra': 'allow', 'frozen': True, 'populate_by_name': True, 'use_enum_values': True, 'validate_by_alias': True, 'validate_by_name': True}#
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
CreateSubscriptionResponse#
- class aioplatega.types.create_subscription_response.CreateSubscriptionResponse[source]#
Bases:
PlategaObjectResponse to creating a subscription.
transaction_idis the subscription id — keep it, it is what every later subscription call takes.- model_config: ClassVar[ConfigDict] = {'arbitrary_types_allowed': True, 'defer_build': True, 'extra': 'allow', 'frozen': True, 'populate_by_name': True, 'use_enum_values': True, 'validate_by_alias': True, 'validate_by_name': True}#
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
CancelSubscriptionResponse#
- class aioplatega.types.cancel_subscription_response.CancelSubscriptionResponse[source]#
Bases:
PlategaObjectResult of cancelling a subscription. The endpoint is idempotent.
- model_config: ClassVar[ConfigDict] = {'arbitrary_types_allowed': True, 'defer_build': True, 'extra': 'allow', 'frozen': True, 'populate_by_name': True, 'use_enum_values': True, 'validate_by_alias': True, 'validate_by_name': True}#
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
Subscription callbacks#
- class aioplatega.types.subscription_callbacks.SubscriptionChargeCallback[source]#
Bases:
PlategaObjectCallback delivered on every subscription charge, successful or not.
Field names arrive PascalCase here, unlike the camelCase used by the plain transaction callback.
- model_config: ClassVar[ConfigDict] = {'arbitrary_types_allowed': True, 'defer_build': True, 'extra': 'allow', 'frozen': True, 'populate_by_name': True, 'use_enum_values': True, 'validate_by_alias': True, 'validate_by_name': True}#
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class aioplatega.types.subscription_callbacks.SubscriptionStatusCallback[source]#
Bases:
PlategaObjectCallback delivered when a subscription changes state.
Here
idis the subscription id, not a transaction id.- model_config: ClassVar[ConfigDict] = {'arbitrary_types_allowed': True, 'defer_build': True, 'extra': 'allow', 'frozen': True, 'populate_by_name': True, 'use_enum_values': True, 'validate_by_alias': True, 'validate_by_name': True}#
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
Saved cards#
- class aioplatega.types.saved_card.SavedCard[source]#
Bases:
PlategaObjectA payout card saved by the merchant.
- model_config: ClassVar[ConfigDict] = {'arbitrary_types_allowed': True, 'defer_build': True, 'extra': 'allow', 'frozen': True, 'populate_by_name': True, 'use_enum_values': True, 'validate_by_alias': True, 'validate_by_name': True}#
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
GET /api/v1/cards returns a bare array. SavedCardsResponse is
RootModel[list[SavedCard]] — iterate it directly.
Payouts#
- class aioplatega.types.payout.CardPayoutRequest[source]#
Bases:
PlategaObjectBody of
POST /api/v1/payouts/card-rub.Supply either
card_idorcard_number, not both.- model_config: ClassVar[ConfigDict] = {'arbitrary_types_allowed': True, 'defer_build': True, 'extra': 'allow', 'frozen': True, 'populate_by_name': True, 'use_enum_values': True, 'validate_by_alias': True, 'validate_by_name': True}#
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class aioplatega.types.payout.CardPayoutResponse[source]#
Bases:
PlategaObjectA created payout. Status is
CREATEDimmediately after creation.- model_config: ClassVar[ConfigDict] = {'arbitrary_types_allowed': True, 'defer_build': True, 'extra': 'allow', 'frozen': True, 'populate_by_name': True, 'use_enum_values': True, 'validate_by_alias': True, 'validate_by_name': True}#
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].