Repository navigation
feat: sync with the API spec (v2 transactions, v2 items, SCR, balance, model fields) - #112
Merged
Merged
Conversation
…rd metadata fields - getTransactionsV2 with TransactionsCursorSearchRequest and TransactionsCursorResponse (cursor helpers getNextCursor/hasNext). GET /transactions returns 410 for newer applications, so the v1 methods are now @deprecated. - getAccountBalance for GET /accounts/{id}/balance. - paymentType, billPostDate and transactionDateTime on TransactionCreditCardMetadata (closes #59). - @NoArgsConstructor/@AllArgsConstructor on @builder response classes so Jackson-based clients can deserialize them (closes #55). - Bump version to 1.15.0.
Member
Author
|
@cursor review this |
Cursor-paginated item listing with ItemsCursorSearchRequest and ItemsCursorResponse. Teams without the feature enabled get 403 LIST_ITEMS_FEATURE_NOT_ENABLED; ErrorResponse now exposes codeDescription so callers can tell that apart. The cursor parser moves to a shared Cursors util.
Adds the fields the API returns that the models were missing (Item,
CreditData, Transaction, Connector, Investment, Identity, Bill,
PaymentData) and GET /items/{id}/scr (opt-in, SCR feature required).
IdentityResponse.identityRelations is deprecated: the API sends the list
as relations, so it was never filled.
FranDisalvo90
approved these changes
Oct 5, 2026
cernadasjuan
approved these changes
Oct 5, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Closes #59, closes #55.
Important
getItems(GET /v2/items) is opt-in, paid plans only: disabled by default and only available to paid-plan teams that have requested it from Pluggy support. Teams without it get403 LIST_ITEMS_FEATURE_NOT_ENABLED. Stated in the javadoc of every new class/method and in the README.1.
GET /v2/transactions(cursor pagination).GET /transactionsnow returns410 This endpoint is deprecatedfor applications created after 2026-06-02, and the SDK had no way to call v2.getTransactionsV2(accountId)andgetTransactionsV2(accountId, TransactionsCursorSearchRequest).TransactionsCursorSearchRequestonly exposes the params v2 accepts (ids,dateFrom,dateTo,createdAtFrom,after): the API rejects unknown query params, sopage/pageSize/from/tocan't be sent by mistake.dateFrom+createdAtFromtogether throwsIllegalArgumentException(the API rejects that combination too).TransactionsCursorResponse(results,next) withgetNextCursor()/hasNext():nextis a query string, not a cursor, so the helper extracts and URL-decodesafter.getTransactionsoverloads are@Deprecatedwith a pointer to v2. Not removed.2.
GET /accounts/{id}/balance→getAccountBalance(accountId)returningAccountBalance(balance,currencyCode,updateDateTime). Open Finance connectors only.3. Credit card metadata (#59):
paymentType(CreditCardAccountPaymentType:SINGLE/INSTALLMENT),billPostDate(String,YYYY-MM-DD, nullable) andtransactionDateTime(String, ISO-8601). Strings likebillForecastDate, so a date-only value can't shift by timezone. Open Finance only, not retroactive.4. Jackson deserialization (#55):
@NoArgsConstructor+@AllArgsConstructoron every@Builderresponse class (49) andrequest/Options. Left alone:CreateItemRequest/CreateConnectTokenRequest(@Value, final fields, only ever serialized) andCredentialLabel(already has a hand-written no-args constructor).5.
GET /v2/items→getItems()/getItems(ItemsCursorSearchRequest)returningItemsCursorResponse(results,next,getNextCursor(),hasNext()). The request only sendsclientUserId,connectorIdandafter, and rejects aclientUserIdover 255 characters or a negativeconnectorIdup front.ErrorResponsegainscodeDescription, so callers can tellLIST_ITEMS_FEATURE_NOT_ENABLEDapart (the API sendscode: 403and the identifier incodeDescription). The cursor parser moves toai.pluggy.utils.Cursors;TransactionsCursorResponse.parseAfterCursorstill works.6. Sync with the API spec. Fields the API returns that the models were missing:
ItemResponse:consentExpiresAt,nextAutoSyncAt,userActionCreditData:additionalCards,isLimitFlexibleTransaction:orderConnector:productCoverage,supportsAutomaticPixInvestment:couponPayment,debtor,gracePeriodDate,priceFactor,taxExemptIdentityResponse:establishmentCode,establishmentName,relations,financialRelationships,qualificationsBill:paymentsPaymentData:authenticationCode,receiverReferenceIdIdentityResponse.identityRelationsis now@Deprecated: the API sends that list asrelations, so it was never filled.Investment.amountProfitstays aString(the API sends a number, Gson reads it into the String) so this release doesn't break callers. Enum-like values the spec lists (e.g.userAction.type) are typed asString, so an unknown value doesn't silently become null.7.
GET /items/{id}/scr→getItemScr(itemId)/getItemScr(itemId, from, to)returningScrResponse. Opt-in: requires the SCR feature (403SCR_FEATURE_NOT_ENABLEDotherwise) and only works for Open Finance items with a known CPF/CNPJ (422SCR_ITEM_NOT_SUPPORTED).8. README: v2 transactions and opt-in items pagination loops. Version bumped to 1.15.0 so the merge cuts a release.
Tests
New unit tests (no network):
TransactionsV2Test(v2 page parsing with the new card fields, last page, unknownpaymentType→ null, exact query params on the wire with a cursor containing+/=, thedateFrom/createdAtFromconflict, cursor parsing edge cases,getAccountBalancepath)BuilderNoArgsConstructorTestandItemsV2Test(page parsing, only the three params on the wire with the cursor intact, last page, the 403 parsed tocodeDescription, request validation). plusResponseFieldsTest(one sample per class with nested objects, null cases) andItemScrTest(path, query, payload, 403/422codeDescription).mvn -B test: 39/39.The existing integration tests (
GetTransactionsTest,TransactionHelper) still call/transactions; they will get the 410 if the CI application was created after the cutoff.After merge
Per the release flow,
release.ymltagsv1.15.0, then publishing needsgh workflow run maven-publish.yml -f tag_version=v1.15.0.