From f6fcb427f17931c69969c0a3eb44c62485882294 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Mon, 23 Feb 2026 12:52:07 +0000 Subject: [PATCH 1/8] Initial plan From 1c88375886ab10e1c9d06830926f10a6b111ec14 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Mon, 23 Feb 2026 12:58:47 +0000 Subject: [PATCH 2/8] Add get bill endpoint with Bill type, Bills resource, and tests Co-authored-by: hassidtal <122451381+hassidtal@users.noreply.github.com> --- resources/bills.ts | 14 ++++++++ resources/index.ts | 1 + tests/bills.spec.ts | 47 +++++++++++++++++++++++++++ types/bill.ts | 78 +++++++++++++++++++++++++++++++++++++++++++++ types/index.ts | 3 +- unit.ts | 3 ++ 6 files changed, 145 insertions(+), 1 deletion(-) create mode 100644 resources/bills.ts create mode 100644 tests/bills.spec.ts create mode 100644 types/bill.ts diff --git a/resources/bills.ts b/resources/bills.ts new file mode 100644 index 00000000..1eae31a0 --- /dev/null +++ b/resources/bills.ts @@ -0,0 +1,14 @@ +import { UnitConfig, UnitResponse } from "../types/common" +import { Bill } from "../types/bill" +import { BaseResource } from "./baseResource" + +export class Bills extends BaseResource { + + constructor(token: string, basePath: string, config?: UnitConfig) { + super(token, basePath + "/bills", config) + } + + public async get(id: string): Promise> { + return await this.httpGet>(`/${id}`) + } +} diff --git a/resources/index.ts b/resources/index.ts index b53f092c..bbb9b326 100644 --- a/resources/index.ts +++ b/resources/index.ts @@ -31,3 +31,4 @@ export * from "./webhooks" export * from "./chargeback" export * from "./taxForms" export * from "./creditApplication" +export * from "./bills" diff --git a/tests/bills.spec.ts b/tests/bills.spec.ts new file mode 100644 index 00000000..eae5dfbb --- /dev/null +++ b/tests/bills.spec.ts @@ -0,0 +1,47 @@ +import { Bill, Unit } from "../unit" + +import dotenv from "dotenv" +dotenv.config() +const unit = new Unit(process.env.UNIT_TOKEN || "test", process.env.UNIT_API_URL || "test") + +describe("Test Bills", () => { + test("Test Bill Resource", () => { + const bill: Bill = { + "type": "bill", + "id": "1", + "attributes": { + "createdAt": "2023-01-01T00:00:00.000Z", + "status": "Pending", + "amount": 10000, + "description": "Electric bill payment" + }, + "relationships": { + "account": { + "data": { + "type": "depositAccount", + "id": "1001" + } + }, + "customer": { + "data": { + "type": "individualCustomer", + "id": "2001" + } + } + } + } + + expect(bill.type).toBe("bill") + expect(bill.attributes.status).toBe("Pending") + expect(bill.attributes.amount).toBe(10000) + }) + + test("Get Bill", async () => { + const billId = process.env.TEST_BILL_ID + if (billId) { + const res = await unit.bills.get(billId) + expect(res.data.type).toBe("bill") + expect(res.data.id).toBe(billId) + } + }) +}) diff --git a/types/bill.ts b/types/bill.ts new file mode 100644 index 00000000..1276de49 --- /dev/null +++ b/types/bill.ts @@ -0,0 +1,78 @@ +import { Relationship, RelationshipsArray, Tags } from "./common" + +export type BillStatus = "Pending" | "PendingReview" | "Clearing" | "Sent" | "Canceled" | "Returned" + +export interface Bill { + /** + * Identifier of the bill resource. + */ + id: string + + /** + * Type of the bill resource. The value is always bill. + */ + type: "bill" + + /** + * JSON object representing the bill data. + */ + attributes: { + /** + * Date only. The date the resource was created. + * RFC3339 format. For more information: https://en.wikipedia.org/wiki/ISO_8601#RFCs + */ + createdAt: string + + /** + * One of Pending, PendingReview, Clearing, Sent, Canceled, Returned. + */ + status: BillStatus + + /** + * The amount (cents) of the bill. + */ + amount: number + + /** + * The description of the bill. + */ + description: string + + /** + * Optional. More information about the status. + */ + reason?: string + + /** + * See [Tags](https://developers.unit.co/#tags). + */ + tags?: Tags + } + + /** + * Describes relationships between the bill resource and other resources. + */ + relationships: { + /** + * The Deposit Account of the customer. + */ + account: Relationship + + /** + * The Customer the deposit account belongs to. + * This relationship is only available if the account belongs to a single customer, business or individual. + */ + customer?: Relationship + + /** + * The list of Customers the deposit account belongs to. + * This relationship is only available if the account belongs to multiple individual customers. + */ + customers?: RelationshipsArray + + /** + * The Transaction generated by this bill. + */ + transaction?: Relationship + } +} diff --git a/types/index.ts b/types/index.ts index 6d603b87..66b0f48f 100644 --- a/types/index.ts +++ b/types/index.ts @@ -29,4 +29,5 @@ export * from "./webhooks" export * from "./chargeback" export * from "./taxForms" export * from "./creditApplication" -export * from "./threadApplication" \ No newline at end of file +export * from "./threadApplication" +export * from "./bill" \ No newline at end of file diff --git a/unit.ts b/unit.ts index 3117df83..f4112a38 100644 --- a/unit.ts +++ b/unit.ts @@ -34,6 +34,7 @@ import { CashDeposits } from "./resources/cashDeposits" import { CreditApplications } from "./resources/creditApplication" import { RecurringRepayments } from "./resources/recurringRepayments" import { Migrations } from "./resources/migrations" +import { Bills } from "./resources/bills" export class Unit { public applications: Applications @@ -73,6 +74,7 @@ export class Unit { public creditApplications: CreditApplications public recurringRepayments: RecurringRepayments public migrations: Migrations; + public bills: Bills constructor(token: string, basePath: string, config?: UnitConfig) { // remove all trailing slashes from user-provided basePath @@ -114,6 +116,7 @@ export class Unit { this.creditApplications = new CreditApplications(token, basePath, config) this.recurringRepayments = new RecurringRepayments(token, basePath, config) this.migrations = new Migrations(token, basePath, config) + this.bills = new Bills(token, basePath, config) this.helpers = helpers } From 4c81cd415745a0cfd72d6b8b7056959bd3f80160 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Mon, 23 Feb 2026 14:09:18 +0000 Subject: [PATCH 3/8] Align Bill type with payment schema: add direction field and Rejected status Co-authored-by: hassidtal <122451381+hassidtal@users.noreply.github.com> --- tests/bills.spec.ts | 1 + types/bill.ts | 11 ++++++++--- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/tests/bills.spec.ts b/tests/bills.spec.ts index eae5dfbb..20ce7311 100644 --- a/tests/bills.spec.ts +++ b/tests/bills.spec.ts @@ -12,6 +12,7 @@ describe("Test Bills", () => { "attributes": { "createdAt": "2023-01-01T00:00:00.000Z", "status": "Pending", + "direction": "Debit", "amount": 10000, "description": "Electric bill payment" }, diff --git a/types/bill.ts b/types/bill.ts index 1276de49..4b064d53 100644 --- a/types/bill.ts +++ b/types/bill.ts @@ -1,6 +1,6 @@ -import { Relationship, RelationshipsArray, Tags } from "./common" +import { Direction, Relationship, RelationshipsArray, Tags } from "./common" -export type BillStatus = "Pending" | "PendingReview" | "Clearing" | "Sent" | "Canceled" | "Returned" +export type BillStatus = "Pending" | "PendingReview" | "Rejected" | "Clearing" | "Sent" | "Canceled" | "Returned" export interface Bill { /** @@ -24,10 +24,15 @@ export interface Bill { createdAt: string /** - * One of Pending, PendingReview, Clearing, Sent, Canceled, Returned. + * One of Pending, PendingReview, Rejected, Clearing, Sent, Canceled, Returned. */ status: BillStatus + /** + * The direction in which the funds flow (either Debit or Credit). + */ + direction: Direction + /** * The amount (cents) of the bill. */ From 9c0c2c28acc8ef32f438945e80feab8035a8523b Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Mon, 23 Feb 2026 14:35:33 +0000 Subject: [PATCH 4/8] Add biller-specific attributes to Bill type to align with bills.json schema Co-authored-by: hassidtal <122451381+hassidtal@users.noreply.github.com> --- tests/bills.spec.ts | 2 ++ types/bill.ts | 12 +++++++++++- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/tests/bills.spec.ts b/tests/bills.spec.ts index 20ce7311..41344e0f 100644 --- a/tests/bills.spec.ts +++ b/tests/bills.spec.ts @@ -14,6 +14,8 @@ describe("Test Bills", () => { "status": "Pending", "direction": "Debit", "amount": 10000, + "billerName": "Electric Company", + "billAccountNumber": "ACC-12345", "description": "Electric bill payment" }, "relationships": { diff --git a/types/bill.ts b/types/bill.ts index 4b064d53..bb57b9a7 100644 --- a/types/bill.ts +++ b/types/bill.ts @@ -38,10 +38,20 @@ export interface Bill { */ amount: number + /** + * The name of the biller. + */ + billerName: string + + /** + * The account number with the biller. + */ + billAccountNumber: string + /** * The description of the bill. */ - description: string + description?: string /** * Optional. More information about the status. From 9235360172ee8ee30a96f1bed753ef643a0e3861 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Mon, 23 Feb 2026 16:04:01 +0000 Subject: [PATCH 5/8] Rewrite Bill type to match actual bills.json schema Co-authored-by: hassidtal <122451381+hassidtal@users.noreply.github.com> --- tests/bills.spec.ts | 24 ++-- types/bill.ts | 271 +++++++++++++++++++++++++++++++++++++++----- 2 files changed, 257 insertions(+), 38 deletions(-) diff --git a/tests/bills.spec.ts b/tests/bills.spec.ts index 41344e0f..ad246f58 100644 --- a/tests/bills.spec.ts +++ b/tests/bills.spec.ts @@ -10,25 +10,25 @@ describe("Test Bills", () => { "type": "bill", "id": "1", "attributes": { - "createdAt": "2023-01-01T00:00:00.000Z", "status": "Pending", - "direction": "Debit", - "amount": 10000, - "billerName": "Electric Company", - "billAccountNumber": "ACC-12345", + "version": 1, + "createdAt": "2023-01-01T00:00:00.000Z", + "updatedAt": "2023-01-01T00:00:00.000Z", + "currency": "USD", + "total": 10000, "description": "Electric bill payment" }, "relationships": { - "account": { + "org": { "data": { - "type": "depositAccount", - "id": "1001" + "type": "org", + "id": "1" } }, - "customer": { + "vendor": { "data": { - "type": "individualCustomer", - "id": "2001" + "type": "vendor", + "id": "100" } } } @@ -36,7 +36,7 @@ describe("Test Bills", () => { expect(bill.type).toBe("bill") expect(bill.attributes.status).toBe("Pending") - expect(bill.attributes.amount).toBe(10000) + expect(bill.attributes.total).toBe(10000) }) test("Get Bill", async () => { diff --git a/types/bill.ts b/types/bill.ts index bb57b9a7..111e623d 100644 --- a/types/bill.ts +++ b/types/bill.ts @@ -1,6 +1,178 @@ -import { Direction, Relationship, RelationshipsArray, Tags } from "./common" +import { Relationship, Tags } from "./common" -export type BillStatus = "Pending" | "PendingReview" | "Rejected" | "Clearing" | "Sent" | "Canceled" | "Returned" +export type BillStatus = + | "Draft" + | "Pending" + | "Scheduled" + | "Paid" + | "PaymentInProgress" + | "FundsPushed" + | "DeductionPaymentFailed" + | "VendorPaymentFailed" + | "RefundInitiated" + | "Refunded" + | "CancellationInitiated" + | "Canceled" + | "Archived" + +export type BillFailureReason = + | "InsufficientFunds" + | "AccountClosed" + | "AccountFrozen" + | "DacaActivated" + | "UnsupportedAccountType" + | "SuspectedFraud" + | "SuspectedEnumerationFraud" + | "DailyACHCreditLimitExceeded" + | "DailyACHDebitLimitExceeded" + | "MonthlyACHCreditLimitExceeded" + | "MonthlyACHDebitLimitExceeded" + | "UncollectedFunds" + | "NoAccount" + | "InvalidAccountNumberStructure" + | "UnauthorizedDebitToConsumer" + | "ReturnedPerOdfiRequest" + | "AuthorizationRevokedByCustomer" + | "PaymentStopped" + | "CustomerAdvisesNotAuthorized" + | "CustomerAdvisesEntryNotAuthorized" + | "BranchSoldToAnotherDfi" + | "RdfiNotQualifiedToParticipate" + | "RepresentativePayeeDeceasedOrUnableToContinue" + | "BeneficiaryOrAccountHolderDeceased" + | "FileRecordEditCriteria" + | "ImproperEffectiveEntryDate" + | "AmountFieldError" + | "NonTransactionAccount" + | "InvalidCompanyIdentification" + | "InvalidIndividualIdNumber" + | "CreditEntryRefusedByReceiver" + | "DuplicateEntry" + | "AddendaError" + | "MandatoryFieldError" + | "TraceNumberError" + | "RoutingNumberCheckDigitError" + | "CorporateCustomerAdvisesNotAuthorized" + | "RdfiNotParticipantInCheckTruncationProgram" + | "PermissibleReturnEntry" + | "RdfiNonSettlement" + | "ReturnOfXckEntry" + | "LimitedParticipationDfi" + | "ReturnOfImproperDebitEntry" + | "ReturnOfImproperCreditEntry" + | "SourceDocumentPresentedForPayment" + | "StopPaymentOnSourceDocument" + | "ImproperSourceDocument" + | "InvalidTransactionCode" + | "InvalidIndividualOrCompanyName" + | "StateLawAffectingRCKAcceptance" + | "ItemRelatedToRCKEntryIsIneligibleOrImproper" + | "StopPaymentOnItemRelatedToRCKEntry" + | "ItemAndRCKEntryPresentedForPayment" + | "MisroutedReturn" + | "ReturnOfErroneousOrReversingDebit" + | "DuplicateReturn" + | "UntimelyReturn" + | "FieldErrors" + | "PermissibleReturnEntryNotAccepted" + | "UntimelyDishonoredReturn" + | "TimelyOriginalReturn" + | "OriginalReturnNotADuplicate" + | "NoErrorsFound" + | "NonAcceptanceR62" + | "IncorrectlyCodedOutboundInternationalPayment" + | "UncollectedFundsHold" + | "UnableToLocateAccount" + | "StaleDated" + | "PostDated" + | "EndorsementMissing" + | "EndorsementIrregular" + | "SignatureMissing" + | "SignatureIrregular" + | "NonCashItem" + | "AlteredOrFictitiousItem" + | "UnableToProcess" + | "ItemExceedsDollarLimit" + | "NotAuthorized" + | "BranchOrAccountSold" + | "ReferToMaker" + | "ItemCannotBeRepresented" + | "UnusableImage" + | "CannotDetermineAmount" + | "ReferToImage" + | "DuplicatePresentment" + | "Forgery" + | "WarrantyBreach" + | "ROCWarrantyBreach" + | "ForgedAndCounterfeitWarrantyBreach" + | "RetiredOrIneligibleOrFailedInstitutionRoutingNumber" + | "CounterpartyAddressUndeliverable" + | "InvalidSendDate" + | "AddressLengthExceedsLimit" + | "InvalidMemoMaxLength" + | "InvalidPrimaryLine" + | "DuplicatedCheck" + +export interface BillLineItem { + /** + * Optional. Reference identifier for the line item. + */ + reference?: string + + /** + * Optional. Description of the line item. + */ + description?: string + + /** + * Optional. Category identifier for the line item. + */ + categoryId?: string + + /** + * Quantity of the line item. + */ + quantity: number + + /** + * Unit price of the line item in cents. + */ + unitPrice: number +} + +export interface PlatformPaymentMethod { + /** + * Date only. The deduction date. + * RFC3339 format. For more information: https://en.wikipedia.org/wiki/ISO_8601#RFCs + */ + deductionDate?: string + + /** + * Date only. The expected payment date. + * RFC3339 format. For more information: https://en.wikipedia.org/wiki/ISO_8601#RFCs + */ + expectedDate?: string + + /** + * Optional. Fee amount in cents. Positive values represent fees, negative values represent rebates. + */ + feeAmount?: number +} + +export interface ExternalPaymentMethod { + /** + * Date only. The date the payment was made. + * RFC3339 format. For more information: https://en.wikipedia.org/wiki/ISO_8601#RFCs + */ + paymentDate?: string +} + +export type BillPaymentMethod = + | { ach: PlatformPaymentMethod } + | { sameDayAch: PlatformPaymentMethod } + | { check: PlatformPaymentMethod } + | { wire: PlatformPaymentMethod } + | { external: ExternalPaymentMethod } export interface Bill { /** @@ -18,50 +190,84 @@ export interface Bill { */ attributes: { /** - * Date only. The date the resource was created. + * One of Draft, Pending, Scheduled, Paid, PaymentInProgress, FundsPushed, DeductionPaymentFailed, + * VendorPaymentFailed, RefundInitiated, Refunded, CancellationInitiated, Canceled, Archived. + */ + status: BillStatus + + /** + * Version of the bill resource. + */ + version: number + + /** + * The date and time the resource was created. * RFC3339 format. For more information: https://en.wikipedia.org/wiki/ISO_8601#RFCs */ createdAt: string /** - * One of Pending, PendingReview, Rejected, Clearing, Sent, Canceled, Returned. + * The date and time the resource was last updated. + * RFC3339 format. For more information: https://en.wikipedia.org/wiki/ISO_8601#RFCs + */ + updatedAt: string + + /** + * Optional. ISO 4217 currency code (e.g. "USD"). */ - status: BillStatus + currency?: string /** - * The direction in which the funds flow (either Debit or Credit). + * Optional. Line items that make up the bill. */ - direction: Direction + lineItems?: BillLineItem[] /** - * The amount (cents) of the bill. + * Date only. The date of the bill. + * RFC3339 format. For more information: https://en.wikipedia.org/wiki/ISO_8601#RFCs */ - amount: number + billDate?: string /** - * The name of the biller. + * Date only. The due date of the bill. + * RFC3339 format. For more information: https://en.wikipedia.org/wiki/ISO_8601#RFCs */ - billerName: string + dueDate?: string /** - * The account number with the biller. + * Optional. Invoice number for the bill. */ - billAccountNumber: string + invoiceNumber?: string /** - * The description of the bill. + * Optional. Description of the bill. */ description?: string /** - * Optional. More information about the status. + * Optional. Tax percentage applied to the bill (0-100). + */ + tax?: number + + /** + * Optional. Total amount of the bill in cents. + */ + total?: number + + /** + * Optional. The payment method used or scheduled for this bill. */ - reason?: string + paymentMethod?: BillPaymentMethod | null /** - * See [Tags](https://developers.unit.co/#tags). + * Optional. See [Tags](https://developers.unit.co/#tags). */ tags?: Tags + + /** + * Optional. Reason for payment failure, present when status is DeductionPaymentFailed or VendorPaymentFailed. + */ + failureReason?: BillFailureReason } /** @@ -69,25 +275,38 @@ export interface Bill { */ relationships: { /** - * The Deposit Account of the customer. + * The organization this bill belongs to. + */ + org: Relationship + + /** + * Optional. The vendor this bill is for. */ - account: Relationship + vendor?: Relationship /** - * The Customer the deposit account belongs to. - * This relationship is only available if the account belongs to a single customer, business or individual. + * Optional. The customer associated with this bill. */ customer?: Relationship /** - * The list of Customers the deposit account belongs to. - * This relationship is only available if the account belongs to multiple individual customers. + * Optional. The uploaded bill file. + */ + billFile?: Relationship + + /** + * Optional. The fee associated with this bill. + */ + fee?: Relationship + + /** + * Optional. The payment associated with this bill. */ - customers?: RelationshipsArray + payment?: Relationship /** - * The Transaction generated by this bill. + * Optional. The linked account for this bill. */ - transaction?: Relationship + linkedAccount?: Relationship } } From 66663ab59fc3a58720ab2f920ec431115cb8c4ee Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Tue, 24 Feb 2026 08:30:21 +0000 Subject: [PATCH 6/8] Remove BillFailureReason enum and strengthen bills endpoint test Co-authored-by: hassidtal <122451381+hassidtal@users.noreply.github.com> --- tests/bills.spec.ts | 6 +++ types/bill.ts | 100 +------------------------------------------- 2 files changed, 7 insertions(+), 99 deletions(-) diff --git a/tests/bills.spec.ts b/tests/bills.spec.ts index ad246f58..3881b14b 100644 --- a/tests/bills.spec.ts +++ b/tests/bills.spec.ts @@ -45,6 +45,12 @@ describe("Test Bills", () => { const res = await unit.bills.get(billId) expect(res.data.type).toBe("bill") expect(res.data.id).toBe(billId) + expect(typeof res.data.attributes.status).toBe("string") + expect(typeof res.data.attributes.version).toBe("number") + expect(typeof res.data.attributes.createdAt).toBe("string") + expect(typeof res.data.attributes.updatedAt).toBe("string") + expect(res.data.relationships.org.data.type).toBe("org") + expect(typeof res.data.relationships.org.data.id).toBe("string") } }) }) diff --git a/types/bill.ts b/types/bill.ts index 111e623d..a871d563 100644 --- a/types/bill.ts +++ b/types/bill.ts @@ -15,104 +15,6 @@ export type BillStatus = | "Canceled" | "Archived" -export type BillFailureReason = - | "InsufficientFunds" - | "AccountClosed" - | "AccountFrozen" - | "DacaActivated" - | "UnsupportedAccountType" - | "SuspectedFraud" - | "SuspectedEnumerationFraud" - | "DailyACHCreditLimitExceeded" - | "DailyACHDebitLimitExceeded" - | "MonthlyACHCreditLimitExceeded" - | "MonthlyACHDebitLimitExceeded" - | "UncollectedFunds" - | "NoAccount" - | "InvalidAccountNumberStructure" - | "UnauthorizedDebitToConsumer" - | "ReturnedPerOdfiRequest" - | "AuthorizationRevokedByCustomer" - | "PaymentStopped" - | "CustomerAdvisesNotAuthorized" - | "CustomerAdvisesEntryNotAuthorized" - | "BranchSoldToAnotherDfi" - | "RdfiNotQualifiedToParticipate" - | "RepresentativePayeeDeceasedOrUnableToContinue" - | "BeneficiaryOrAccountHolderDeceased" - | "FileRecordEditCriteria" - | "ImproperEffectiveEntryDate" - | "AmountFieldError" - | "NonTransactionAccount" - | "InvalidCompanyIdentification" - | "InvalidIndividualIdNumber" - | "CreditEntryRefusedByReceiver" - | "DuplicateEntry" - | "AddendaError" - | "MandatoryFieldError" - | "TraceNumberError" - | "RoutingNumberCheckDigitError" - | "CorporateCustomerAdvisesNotAuthorized" - | "RdfiNotParticipantInCheckTruncationProgram" - | "PermissibleReturnEntry" - | "RdfiNonSettlement" - | "ReturnOfXckEntry" - | "LimitedParticipationDfi" - | "ReturnOfImproperDebitEntry" - | "ReturnOfImproperCreditEntry" - | "SourceDocumentPresentedForPayment" - | "StopPaymentOnSourceDocument" - | "ImproperSourceDocument" - | "InvalidTransactionCode" - | "InvalidIndividualOrCompanyName" - | "StateLawAffectingRCKAcceptance" - | "ItemRelatedToRCKEntryIsIneligibleOrImproper" - | "StopPaymentOnItemRelatedToRCKEntry" - | "ItemAndRCKEntryPresentedForPayment" - | "MisroutedReturn" - | "ReturnOfErroneousOrReversingDebit" - | "DuplicateReturn" - | "UntimelyReturn" - | "FieldErrors" - | "PermissibleReturnEntryNotAccepted" - | "UntimelyDishonoredReturn" - | "TimelyOriginalReturn" - | "OriginalReturnNotADuplicate" - | "NoErrorsFound" - | "NonAcceptanceR62" - | "IncorrectlyCodedOutboundInternationalPayment" - | "UncollectedFundsHold" - | "UnableToLocateAccount" - | "StaleDated" - | "PostDated" - | "EndorsementMissing" - | "EndorsementIrregular" - | "SignatureMissing" - | "SignatureIrregular" - | "NonCashItem" - | "AlteredOrFictitiousItem" - | "UnableToProcess" - | "ItemExceedsDollarLimit" - | "NotAuthorized" - | "BranchOrAccountSold" - | "ReferToMaker" - | "ItemCannotBeRepresented" - | "UnusableImage" - | "CannotDetermineAmount" - | "ReferToImage" - | "DuplicatePresentment" - | "Forgery" - | "WarrantyBreach" - | "ROCWarrantyBreach" - | "ForgedAndCounterfeitWarrantyBreach" - | "RetiredOrIneligibleOrFailedInstitutionRoutingNumber" - | "CounterpartyAddressUndeliverable" - | "InvalidSendDate" - | "AddressLengthExceedsLimit" - | "InvalidMemoMaxLength" - | "InvalidPrimaryLine" - | "DuplicatedCheck" - export interface BillLineItem { /** * Optional. Reference identifier for the line item. @@ -267,7 +169,7 @@ export interface Bill { /** * Optional. Reason for payment failure, present when status is DeductionPaymentFailed or VendorPaymentFailed. */ - failureReason?: BillFailureReason + failureReason?: string } /** From feecb64a9d342fbbf20d339cbccfe260aeba0e2e Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Tue, 24 Feb 2026 09:44:06 +0000 Subject: [PATCH 7/8] Fix lint errors: add semicolons to BillPaymentMethod inline object types Co-authored-by: hassidtal <122451381+hassidtal@users.noreply.github.com> --- types/bill.ts | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/types/bill.ts b/types/bill.ts index a871d563..a0a9f6c2 100644 --- a/types/bill.ts +++ b/types/bill.ts @@ -70,11 +70,11 @@ export interface ExternalPaymentMethod { } export type BillPaymentMethod = - | { ach: PlatformPaymentMethod } - | { sameDayAch: PlatformPaymentMethod } - | { check: PlatformPaymentMethod } - | { wire: PlatformPaymentMethod } - | { external: ExternalPaymentMethod } + | { ach: PlatformPaymentMethod; } + | { sameDayAch: PlatformPaymentMethod; } + | { check: PlatformPaymentMethod; } + | { wire: PlatformPaymentMethod; } + | { external: ExternalPaymentMethod; } export interface Bill { /** From ea4b183aef0e57d8dd0e9c78c92257558c6e7e38 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Tue, 24 Feb 2026 11:10:02 +0000 Subject: [PATCH 8/8] Remove null from paymentMethod type in Bill attributes Co-authored-by: hassidtal <122451381+hassidtal@users.noreply.github.com> --- types/bill.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/bill.ts b/types/bill.ts index a0a9f6c2..76d2e058 100644 --- a/types/bill.ts +++ b/types/bill.ts @@ -159,7 +159,7 @@ export interface Bill { /** * Optional. The payment method used or scheduled for this bill. */ - paymentMethod?: BillPaymentMethod | null + paymentMethod?: BillPaymentMethod /** * Optional. See [Tags](https://developers.unit.co/#tags).