Methods#
Command-pattern objects representing API endpoints.
PlategaMethod#
- class aioplatega.methods.base.PlategaMethod[source]#
Bases:
PlategaObject,GenericBase 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.- 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.
- 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.- 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].
CreatePaymentLink#
- class aioplatega.methods.create_payment_link.CreatePaymentLink[source]#
Bases:
PlategaMethod[PaymentLinkResponse]POST
/v2/transaction/process— payer chooses the method themselves.Unlike
CreateTransaction, no payment method is fixed up front; the payer picks one on the hosted page.Note
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_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].
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.- 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.- 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.- 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/processinto a subscription.Deliberately not a
PaymentMethodIntmember: 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/processwith the subscription payment method.The
transaction_idin the response is the subscription id.Note
Takes
SubscriptionPaymentDetailsrather thanPaymentDetails: the charge period is part of the payment details here, and is required.- payment_details: SubscriptionPaymentDetails#
- 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}.- 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.- 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].