Methods#

Command-pattern objects representing API endpoints.

PlategaMethod#

class aioplatega.methods.base.PlategaMethod[source]#

Bases: PlategaObject, Generic

Base class for all Platega API methods (command pattern).

Subclasses must specify:
  • __api_method__: URL path (may contain {field_name} placeholders).

  • __http_method__: "GET" or "POST".

  • __returning__: response model class.

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].

CreateTransaction#

class aioplatega.methods.create_transaction.CreateTransaction[source]#

Bases: CreateTransactionRequest, PlategaMethod[CreateTransactionResponse]

POST /transaction/process.

The request body is defined once, by CreateTransactionRequest; this class only binds it to an endpoint. Field declarations (and the __init__ stub that gives type checkers a signature) are inherited, so the two cannot drift apart.

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].

GetTransactionStatus#

class aioplatega.methods.get_transaction_status.GetTransactionStatus[source]#

Bases: PlategaMethod[TransactionStatusResponse]

GET /transaction/{id} – status and details of a transaction.

transaction_id: UUID#
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].

GetRate#

class aioplatega.methods.get_rate.GetRate[source]#

Bases: PlategaMethod[RateResponse]

GET /rates/payment_method_rate – exchange rate for a method.

Note

Documented in the older GitBook, not at https://docs.platega.io, which does not list this endpoint at all.

merchant_id: str#
payment_method: int#
currency_from: str#
currency_to: 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].

GetConversions#

class aioplatega.methods.get_conversions.GetConversions[source]#

Bases: PlategaMethod[ConversionsResponse]

GET /transaction/balance-unlock-operations – balance unlocks.

from_date: str | None#
to_date: str | None#
page: int#
size: int#
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].

GetH2HQr#

class aioplatega.methods.get_h2h_qr.GetH2HQr[source]#

Bases: PlategaMethod[H2HQrResponse]

GET /h2h/{id} — QR code or payment link for a host-to-host payment.

transaction_id: UUID#
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].

GetBalances#

class aioplatega.methods.get_balances.GetBalances[source]#

Bases: PlategaMethod[BalancesResponse]

GET /balance/all — merchant balances, one entry per 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].

CheckCancelSupported#

class aioplatega.methods.check_cancel_supported.CheckCancelSupported[source]#

Bases: PlategaMethod[CancelSupportedResponse]

GET /transaction/{id}/cancel-supported.

Worth calling before CancelTransaction: it reports both whether cancellation is possible and what it will cost.

transaction_id: UUID#
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].

CancelTransaction#

class aioplatega.methods.cancel_transaction.CancelTransaction[source]#

Bases: PlategaMethod[CancelTransactionResponse]

POST /transaction/{id}/cancel — refund the payer.

transaction_id: UUID#
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 exports#

The three transaction exports, which differ only in output format.

class aioplatega.methods.export_transactions.ExportTransactionsCsv[source]#

Bases: TransactionExportRequest, PlategaMethod[ExportUrlResponse]

POST /transaction/export/csv — returns a link to the 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].

class aioplatega.methods.export_transactions.ExportTransactionsExcel[source]#

Bases: TransactionExportRequest, PlategaMethod[ExportUrlResponse]

POST /transaction/export/excel — returns a link to the 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].

class aioplatega.methods.export_transactions.ExportTransactionsJson[source]#

Bases: TransactionExportRequest, PlategaMethod[TransactionExportResponse]

POST /transaction/export/json.

The odd one out: it returns the rows inline rather than a download link.

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].

Subscriptions#

Recurring SBP subscriptions.

aioplatega.methods.subscriptions.SUBSCRIPTION_PAYMENT_METHOD = 6#

The method id that turns /transaction/process into a subscription.

Deliberately not a PaymentMethodInt member: the published enum does not contain 6, it is documented only as “always 6” for this one endpoint.

class aioplatega.methods.subscriptions.CreateSubscription[source]#

Bases: PlategaMethod[CreateSubscriptionResponse]

POST /transaction/process with the subscription payment method.

The transaction_id in the response is the subscription id.

Note

Takes SubscriptionPaymentDetails rather than PaymentDetails: the charge period is part of the payment details here, and is required.

payment_method: int#
payment_details: SubscriptionPaymentDetails#
description: str | 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].

class aioplatega.methods.subscriptions.GetSubscription[source]#

Bases: PlategaMethod[Subscription]

GET /subscription/{subscriptionId}.

subscription_id: UUID#
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.methods.subscriptions.ListSubscriptions[source]#

Bases: PlategaMethod[SubscriptionListResponse]

GET /subscription — a filtered, paginated list.

status: str | None#
from_date: str | None#
to_date: str | None#
page: int | None#
size: int | 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].

class aioplatega.methods.subscriptions.CancelSubscription[source]#

Bases: PlategaMethod[CancelSubscriptionResponse]

POST /subscription/{subscriptionId}/cancel. Idempotent.

Sent without a body, which the OpenAPI specification confirms: the operation declares path and header parameters only. The rendered documentation page shows a create-transaction body because the operation carries operationId: createTransaction, a copy-paste in the vendor’s own spec.

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_id: UUID#