2.0 is generated from YooKassa's official OpenAPI specification instead of the one this package wrote by hand. Type names now match the documentation you read while debugging, the surface grows from 11 operations to 24, and three correctness bugs that the hand-written spec caused are gone.
This is a breaking release. Every breaking change is a compile error, and most renames carry renamed: deprecation aliases so the compiler names the replacement for you. Work through the migration guide top to bottom.
Upgrade now if you issue receipts under 54-FZ
1.x caps vat_code at 10 and cannot fiscalize a receipt at the current Russian base VAT rate through the typed API at all. The rate rose from 20% to 22% on 2026-01-01 (Federal Law 425-FZ of 2025-11-28) and YooKassa added codes 11 (22%) and 12 (22/122). The ceiling of 10 was invented by 1.x's hand-authored spec, not by YooKassa. vatCode is now a plain Int32 — pass the number.
Breaking changes
idempotenceKeyis now required on tenPOSToperations. 1.x invented the key fromoperationID + body.hashValue, which collided across genuinely distinct payments of the same amount (silently deduplicating the second into the first) and, becausehashValueis seeded per process, produced a different key for the same retry after a relaunch. Generate one key per logical operation and persist it next to the order.ConfirmationandReceiptItemsplit by direction. Request sites now useConfirmationDataandReceiptDataItem; reading these off a response is unchanged.Outputswitch cases changed.forbidden(403) andinternalServerError(500) are new on nearly every operation;tooManyRequests(429) is gone from most. A 1.x switch written withdefault:keeps compiling while folding new failure modes into one branch — write the cases out explicitly.- Six payment methods removed —
.alfabank,.applePay,.googlePay,.installments,.qiwi,.webmoneyare absent from the official spec and have no replacement. Four are new:.alfaPay,.electronicCertificate,.sberBnpl,.sberLoan. - Platform floor raised: macOS 11 → 13, iOS 14 → 16, tvOS 14 → 16, watchOS 7 → 9.
swift-tools-versionis now 6.1. - Sample fixtures left the library.
Client+samples.swiftand the.example*static properties embedded a real person's email address and INN in the binary of every app that linked this package. Equivalents now live in the test target.
Fixes
bodyLoggingConfigurationis honoured. 1.x accepted the parameter and then ignored it, hardcoding.upTo(maxBytes: 2048)— request and response bodies carry payment data. It now defaults to.never.Credentials.fromEnvironmentcalledfatalErrorwhenAPP_USERNAMEorAPP_PASSWORDwas unset, crashing test hosts without credentials. Replaced by the optionalCredentials.environment.ValidationErrordescriptions now resolve throughBundle.module. The string catalog was never bundled in 1.x, so localization never loaded.currencyis now theCurrencyCodeenum andlocaletheLocaleenum, so a value the API would reject is unrepresentable rather than a 400 at runtime.
New operations
activatePosLink, createDeal, createInvoice, createPaymentMethod, createPosLink, deactivatePosLink, getDeal, getDealsList, getInvoice, getMe, getPaymentMethod, getPosLink, setPosLinkRecipient.
All 11 method names from 1.x survive unchanged; only their inputs and outputs changed.
Full changelog: 1.0.6...2.0.0