diff --git a/types/recurringPayment.ts b/types/recurringPayment.ts index b21b0c3f..5a1fbe0c 100644 --- a/types/recurringPayment.ts +++ b/types/recurringPayment.ts @@ -5,7 +5,7 @@ export type RecurringPaymentStatus = "Active" | "Completed" | "Disabled" export type Interval = "Monthly" -export type RecurringPayment = RecurringCreditAchPayment +export type RecurringPayment = RecurringCreditAchPayment | RecurringCreditBookPayment interface RecurringPaymentAttributes { /** @@ -115,11 +115,6 @@ export interface RecurringCreditBookPayment { * JSON object representing the recurring payment resource. */ attributes: { - /** - * Represents the number of payments that were created by this recurring payment. - */ - numberOfPayments: number - /** * If this field is populated, its contents will be returned as the bookTransaction’s summary field (maximum of 100 characters). */ @@ -160,6 +155,11 @@ interface BaseSchedule { * Interval of the schedule. Can be Monthly. */ interval?: Interval + + /** + * Optional. Total number of payment repetitions. Positive integers only. + */ + totalNumberOfPayments?: number } export type CreateSchedule = BaseSchedule @@ -169,7 +169,7 @@ export interface Schedule extends BaseSchedule { * RFC3339 format. For more information: https://en.wikipedia.org/wiki/ISO_8601#RFCs * The next scheduled date of the action. */ - nextScheduledAction?: string + nextScheduledAction: string } export type CreateRecurringPaymentRequest = CreateRecurringCreditAchPaymentRequest | CreateRecurringCreditBookPaymentRequest @@ -190,6 +190,11 @@ interface CreateRecurringRequestAttributes { */ schedule: CreateSchedule + /** + * See [Idempotency](https://docs.unit.co/#intro-idempotency). + */ + idempotencyKey?: string + /** * See [Tags](https://developers.unit.co/#tags). */