Skip to content

Rewards + Bug Fixes#127

Open
dragonprevost wants to merge 231 commits intounit-finance:masterfrom
Truss-pmts:master
Open

Rewards + Bug Fixes#127
dragonprevost wants to merge 231 commits intounit-finance:masterfrom
Truss-pmts:master

Conversation

@dragonprevost
Copy link
Copy Markdown
Contributor

Hey, this PR has a bunch of adjustments to the SDK we have made while using it. Most of the changes are small bug fixes, but we also added Rewards to the package. Figured Unit may be interested in cherry picking some of the commits on here.

avesk and others added 30 commits October 22, 2025 13:01
…ort-request-to-verify-if-an-address

Adds `applications/check-registered-agent-address` resource
Handle absent merchants in adjustment transactions
Co-authored-by: Julia Park <julia@mazumago.com>
Co-authored-by: Julia Park <julia@mazumago.com>
* feat: add date filters to the list events endpoint

* fix: offset type
Python 3.9.1 has been removed from GitHub-hosted runners.
Use 3.9 (latest patch) and update checkout/setup-python actions.

Co-authored-by: Cursor <cursoragent@cursor.com>
Adds Literal types for all new v2 enums needed by sole prop and business
applications: AccountPurposeBusinessSoleProp (18 values),
SourceOfFundsBusinessSoleProp (15 values), TransactionVolumeBusiness (6),
TransactionVolumeSoleProp (6), BusinessIndustry (~60 values with category
groupings), EntityTypeV2 (12 values, expanded from v1), and UsNexus (5).

Individual-only enums (profession, individual sourceOfFunds/accountPurpose/
transactionVolume) are out of scope — Truss only supports sole prop and
business application types.

Co-authored-by: Cursor <cursoragent@cursor.com>
Adds Literal types for all new v2 enums needed by sole prop and business
applications: AccountPurposeBusinessSoleProp (18 values),
SourceOfFundsBusinessSoleProp (15 values), TransactionVolumeBusiness (6),
TransactionVolumeSoleProp (6), BusinessIndustry (~60 values with category
groupings), EntityTypeV2 (12 values, expanded from v1), and UsNexus (5).

Individual-only enums (profession, individual sourceOfFunds/accountPurpose/
transactionVolume) are out of scope — Truss only supports sole prop and
business application types.

Co-authored-by: Cursor <cursoragent@cursor.com>
Adds CreateSolePropApplicationRequestV2 and CreateBusinessApplicationRequestV2
alongside existing v1 classes for clean separation.

Sole prop class: uses individualApplication type with soleProprietorship=True,
includes all new v2 required fields (accountPurpose, sourceOfFunds,
transactionVolume, businessIndustry, isIncorporated, countriesOfOperation,
usNexus, website) plus conditional fields (stateOfIncorporation,
yearOfIncorporation, accountPurposeDetail, transactionVolumeDescription,
sourceOfFundsDescription). Does not include 'profession' (individual-only).

Business class: includes all new v2 required fields (sourceOfFunds,
businessIndustry, businessDescription, isRegulated, usNexus, accountPurpose,
transactionVolume, countriesOfOperation, website) plus conditional fields
(regulatorName, stockExchangeName, stockSymbol, etc.).

Both classes use to_json_api() to produce correct v2 JSON API payloads.
Conditional fields are omitted from the payload when None.
V1 request classes remain unchanged.

Co-authored-by: Cursor <cursoragent@cursor.com>
- Add DeprecationWarning to CreateIndividualApplicationRequest (use
  CreateSolePropApplicationRequestV2 instead)
- Add DeprecationWarning to CreateBusinessApplicationRequest (use
  CreateBusinessApplicationRequestV2 instead)
- Update ApplicationResource.create() type hint to accept v2 request types
  (CreateSolePropApplicationRequestV2, CreateBusinessApplicationRequestV2)
- Update README example to use CreateBusinessApplicationRequestV2

Co-authored-by: Avery Kushner <avesk@users.noreply.github.com>
[v2 unit application docs](https://www.unit.co/docs/applications-v2/applications/)  
  
Adds CreateSolePropApplicationRequestV2 and CreateBusinessApplicationRequestV2
alongside existing v1 classes for clean separation.

Sole prop class: uses individualApplication type with soleProprietorship=True,
includes all new v2 required fields (accountPurpose, sourceOfFunds,
transactionVolume, businessIndustry, isIncorporated, countriesOfOperation,
usNexus, website) plus conditional fields (stateOfIncorporation,
yearOfIncorporation, accountPurposeDetail, transactionVolumeDescription,
sourceOfFundsDescription). Does not include 'profession' (individual-only).

Business class: includes all new v2 required fields (sourceOfFunds,
businessIndustry, businessDescription, isRegulated, usNexus, accountPurpose,
transactionVolume, countriesOfOperation, website) plus conditional fields
(regulatorName, stockExchangeName, stockSymbol, etc.).

Both classes use to_json_api() to produce correct v2 JSON API payloads.
Conditional fields are omitted from the payload when None.
V1 request classes remain unchanged.

Co-authored-by: Cursor [cursoragent@cursor.com](mailto:cursoragent@cursor.com)
IndividualApplicationDTO: adds v2 fields (accountPurpose, sourceOfFunds,
transactionVolume, businessIndustry, isIncorporated, website,
countriesOfOperation) to from_json_api(). Gracefully handles missing fields
for backward compatibility with v1 responses.

BusinessApplicationDTO: adds v2 fields (accountPurpose, sourceOfFunds,
transactionVolume, businessIndustry, businessDescription, isRegulated).

BUG FIX: BusinessApplicationDTO.from_json_api() was using snake_case keys
(year_of_incorporation, business_vertical, etc.) instead of camelCase
(yearOfIncorporation, businessVertical, etc.) to read from JSON API
attributes. This caused those fields to always be None. Also fixes
operating_address parsing — was passing raw dict, now properly uses
Address.from_json_api().

Co-authored-by: Cursor <cursoragent@cursor.com>
…ug (#63)

IndividualApplicationDTO: adds v2 fields (accountPurpose, sourceOfFunds,
transactionVolume, businessIndustry, isIncorporated, website,
countriesOfOperation) to from_json_api(). Gracefully handles missing fields
for backward compatibility with v1 responses.

BusinessApplicationDTO: adds v2 fields (accountPurpose, sourceOfFunds,
transactionVolume, businessIndustry, businessDescription, isRegulated).

BUG FIX: BusinessApplicationDTO.from_json_api() was using snake_case keys
(year_of_incorporation, business_vertical, etc.) instead of camelCase
(yearOfIncorporation, businessVertical, etc.) to read from JSON API
attributes. This caused those fields to always be None. Also fixes
operating_address parsing — was passing raw dict, now properly uses
Address.from_json_api().

Co-authored-by: Cursor <cursoragent@cursor.com>
Add optional business_description param to __init__ and conditional
businessDescription output in to_json_api(), matching the pattern used
for other optional v2 fields (stateOfIncorporation, yearOfIncorporation, etc.)
* Add interest earned resource
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.

10 participants