Skip to content

feat: sync with the API spec (card metadata, SCR, merchants, category rules, pix-qr, boletos) - #183

Merged
Gabrielpanga merged 2 commits into
masterfrom
feat/cc-metadata-bill-post-date
Oct 5, 2026
Merged

Gabrielpanga merged 2 commits into
masterfrom
feat/cc-metadata-bill-post-date

Conversation

@Gabrielpanga

@Gabrielpanga Gabrielpanga commented Oct 4, 2026 •

Copy link
Copy Markdown
Member

What

Adds the three credit card metadata fields the API now returns for Open Finance connectors:

Field Type Meaning
paymentType 'SINGLE' | 'INSTALLMENT' Charged in full on one bill, or split into installments
billPostDate string | null (YYYY-MM-DD) Date the institution posted the transaction to a bill, as reported and never adjusted. null while not posted yet
transactionDateTime Date | string Transaction timestamp as the institution reports it, ISO-8601

Also exports CREDIT_CARD_ACCOUNT_PAYMENT_TYPES / CreditCardAccountPaymentType, following the existing fee-type pattern.

Why Date | string for transactionDateTime

The value is passed through as the institution sends it. deserializeJSONWithDates only revives the exact YYYY-MM-DDTHH:mm:ss.sssZ shape, so a value with an offset or without milliseconds stays a string. Typing it Date would lie for those. billPostDate is date-only and never matches the reviver, so it is always a string and cannot shift by timezone.

None of the three is retroactive: transactions synced before the fields existed don't carry the key.

Also: sync with the API spec

Fields the API returns that the types were missing:

  • Connector.productCoverage
  • CreditData.additionalCards (new AdditionalCard)
  • TransactionPaymentData.authenticationCode
  • Transaction.order
  • Investment: couponPayment (new InvestmentCouponPayment), gracePeriodDate, priceFactor, taxExempt

New methods:

  • PluggyClient.fetchItemScr(itemId, { from, to }) → GET /items/{id}/scr. Opt-in: requires the SCR feature (403 SCR_FEATURE_NOT_ENABLED otherwise) and only works for Open Finance items with a known CPF/CNPJ (422 SCR_ITEM_NOT_SUPPORTED).
  • PluggyClient.fetchMerchants(cnpjs) → GET /merchants
  • PluggyClient.fetchCategoryRules(), createCategoryRule(rule), deleteCategoryRule(id) → /categories/rules
  • PluggyPaymentsClient.createPixQrPaymentRequest(payload) → POST /payments/requests/pix-qr
  • PluggyPaymentsClient.fetchSmartTransferPreauthorizationPayments(id, filters) → GET /smart-transfers/preauthorizations/{id}/payments
  • Boletos (beta): createBoletoConnection, createBoletoConnectionFromItem, createBoleto, fetchBoleto, cancelBoleto

Bug fix in baseApi: mutation requests (POST/PUT/PATCH/DELETE) only accepted status 200, so any 201/204 was rejected with undefined. They now accept any 2xx, like createGetRequest already did. DELETE /categories/rules/{id} answers 204, which is how this surfaced; the test for it fails without the change.

Note

Stack: this PR → #184 → #185. Merge in that order.

Tests

New unit test in tests/transactions.test.ts covering both transactionDateTime shapes, billPostDate as string and null, and paymentType. Plus new suites for SCR (incl. the 403), merchants, category rules (incl. the 204 delete), boletos, pix-qr and preauthorization payments. pnpm test: 76/76.

…ime to creditCardMetadata

The API returns three more credit card metadata fields for Open Finance
connectors. transactionDateTime is passed through as the institution
sends it, so it is typed Date | string: the JSON reviver only turns the
exact YYYY-MM-DDTHH:mm:ss.sssZ shape into a Date.
@Gabrielpanga

Copy link
Copy Markdown
Member Author

@cursor review this

… boletos, model fields)

Adds the fields the API returns that the types were missing, plus
fetchItemScr (opt-in, SCR feature required), fetchMerchants, category
rules (list/create/delete), createPixQrPaymentRequest,
fetchSmartTransferPreauthorizationPayments and the beta boleto
endpoints. Mutation requests now accept any 2xx: DELETE
/categories/rules/{id} answers 204, which was treated as a failure.
@Gabrielpanga Gabrielpanga changed the title feat(transaction): add paymentType, billPostDate and transactionDateTime to creditCardMetadata feat: sync with the API spec (card metadata, SCR, merchants, category rules, pix-qr, boletos) Oct 5, 2026
@Gabrielpanga
Gabrielpanga merged commit d0f0c86 into master Oct 5, 2026
2 of 3 checks passed
@Gabrielpanga
Gabrielpanga deleted the feat/cc-metadata-bill-post-date branch October 5, 2026 13:08
pluggy-github-app Bot pushed a commit that referenced this pull request Oct 8, 2026
# [0.92.0](v0.91.0...v0.92.0) (2026-10-08)

### Bug Fixes

* **api:** URL-encode query string values ([#184](#184)) ([16f0596](16f0596))
* **deps:** patch handlebars, http-cache-semantics and brace-expansion advisories ([#187](#187)) ([0ef8d00](0ef8d00))

### Features

* add Smart Transfer linkedJourney, data consent and source account balance ([#186](#186)) ([c77e1c3](c77e1c3))
* **item:** add fetchItemsCursor and fetchAllItems for GET /v2/items ([#185](#185)) ([7a82811](7a82811))
* sync with the API spec (card metadata, SCR, merchants, category rules, pix-qr, boletos) ([#183](#183)) ([d0f0c86](d0f0c86))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants