Metadata { get; set; }
+
+ ///
+ /// Name of the month on which to charge a customer. Must be lowercase.
+ /// Only applies
+ /// when the interval_unit is `yearly`.
+ ///
+ ///
+ [JsonProperty("month")]
+ public BillingRequestSubscriptionRequestMonth? Month { get; set; }
+
+ ///
+ /// Optional name for the subscription. This will be set as the
+ /// description on each payment created. Must not exceed 255 characters.
+ ///
+ [JsonProperty("name")]
+ public string Name { get; set; }
+
+ ///
+ /// An optional payment reference. This will be set as the reference on
+ /// each payment
+ /// created and will appear on your customer's bank statement. See the
+ /// documentation for
+ /// the [create payment endpoint](#payments-create-a-payment) for more
+ /// details.
+ ///
+ ///
+ [JsonProperty("payment_reference")]
+ public string PaymentReference { get; set; }
+
+ ///
+ /// On failure, automatically retry payments using [intelligent
+ /// retries](#success-intelligent-retries). Default is `false`. Important: To be able to use
+ /// intelligent retries, Success+ needs to be enabled in [GoCardless
+ /// dashboard](https://manage.gocardless.com/success-plus).
+ ///
+ [JsonProperty("retry_if_possible")]
+ public bool? RetryIfPossible { get; set; }
+
+ ///
+ /// The date on which the first payment should be charged. If fulfilled
+ /// after this date, this will be set as the mandate's
+ /// `next_possible_charge_date`.
+ /// When left blank and `month` or `day_of_month` are provided, this
+ /// will be set to the date of the first payment.
+ /// If created without `month` or `day_of_month` this will be set as the
+ /// mandate's `next_possible_charge_date`.
+ ///
+ ///
+ [JsonProperty("start_date")]
+ public string StartDate { get; set; }
+ }
+
+ ///
+ /// The unit of time between customer charge dates. One of `weekly`, `monthly` or `yearly`.
+ ///
+ [JsonConverter(typeof(GcStringEnumConverter), (int)Unknown)]
+ public enum BillingRequestSubscriptionRequestIntervalUnit {
+ /// Unknown status
+ [EnumMember(Value = "unknown")]
+ Unknown = 0,
+
+ /// `interval_unit` with a value of "weekly"
+ [EnumMember(Value = "weekly")]
+ Weekly,
+ /// `interval_unit` with a value of "monthly"
+ [EnumMember(Value = "monthly")]
+ Monthly,
+ /// `interval_unit` with a value of "yearly"
+ [EnumMember(Value = "yearly")]
+ Yearly,
+ }
+
+ ///
+ /// Resources linked to this BillingRequestSubscriptionRequest
+ ///
+ public class BillingRequestSubscriptionRequestLinks
+ {
+ ///
+ /// (Optional) ID of the [subscription](#core-endpoints-subscriptions)
+ /// that was created from this subscription request.
+ ///
+ ///
+ [JsonProperty("subscription")]
+ public string Subscription { get; set; }
+ }
+
+ ///
+ /// Name of the month on which to charge a customer. Must be lowercase. Only applies
+ /// when the interval_unit is `yearly`.
+ ///
+ ///
+ [JsonConverter(typeof(GcStringEnumConverter), (int)Unknown)]
+ public enum BillingRequestSubscriptionRequestMonth {
+ /// Unknown status
+ [EnumMember(Value = "unknown")]
+ Unknown = 0,
+
+ /// `month` with a value of "january"
+ [EnumMember(Value = "january")]
+ January,
+ /// `month` with a value of "february"
+ [EnumMember(Value = "february")]
+ February,
+ /// `month` with a value of "march"
+ [EnumMember(Value = "march")]
+ March,
+ /// `month` with a value of "april"
+ [EnumMember(Value = "april")]
+ April,
+ /// `month` with a value of "may"
+ [EnumMember(Value = "may")]
+ May,
+ /// `month` with a value of "june"
+ [EnumMember(Value = "june")]
+ June,
+ /// `month` with a value of "july"
+ [EnumMember(Value = "july")]
+ July,
+ /// `month` with a value of "august"
+ [EnumMember(Value = "august")]
+ August,
+ /// `month` with a value of "september"
+ [EnumMember(Value = "september")]
+ September,
+ /// `month` with a value of "october"
+ [EnumMember(Value = "october")]
+ October,
+ /// `month` with a value of "november"
+ [EnumMember(Value = "november")]
+ November,
+ /// `month` with a value of "december"
+ [EnumMember(Value = "december")]
+ December,
+ }
+
}
diff --git a/GoCardless/Services/BillingRequestService.cs b/GoCardless/Services/BillingRequestService.cs
index 59b6bf1..08a1561 100644
--- a/GoCardless/Services/BillingRequestService.cs
+++ b/GoCardless/Services/BillingRequestService.cs
@@ -16,17 +16,17 @@ namespace GoCardless.Services
///
/// Service class for working with billing request resources.
///
- /// Billing Requests help create resources that require input or action from
- /// a
- /// customer. An example of required input might be additional customer
- /// billing
- /// details, while an action would be asking a customer to authorise a
- /// payment
- /// using their mobile banking app.
+ /// Billing Requests help create resources that require input or action
+ /// from a customer. An example of required input might be additional
+ /// customer billing details, while an action would be asking a customer to
+ /// authorise a payment using their mobile banking app.
///
/// See [Billing Requests:
/// Overview](https://developer.gocardless.com/getting-started/billing-requests/overview/)
- /// for how-to's, explanations and tutorials.
+ /// for how-to's, explanations and tutorials. Important: All properties associated
+ /// with `subscription_request` and `instalment_schedule_request` are only
+ /// supported for ACH and PAD schemes.
///
public class BillingRequestService
@@ -43,7 +43,10 @@ public BillingRequestService(GoCardlessClient goCardlessClient)
}
///
- ///
+ /// Important: All properties
+ /// associated with `subscription_request` and
+ /// `instalment_schedule_request` are only supported for ACH and PAD
+ /// schemes.
///
/// An optional `BillingRequestCreateRequest` representing the body for this create request.
/// An optional `RequestSettings` allowing you to configure the request
@@ -376,7 +379,9 @@ public Task SelectInstitutionAsync(string identity, Bill
///
- ///
+ /// Important: All properties associated
+ /// with `subscription_request` and `instalment_schedule_request` are only
+ /// supported for ACH and PAD schemes.
///
public class BillingRequestCreateRequest : IHasIdempotencyKey
{
@@ -394,6 +399,125 @@ public class BillingRequestCreateRequest : IHasIdempotencyKey
[JsonProperty("fallback_enabled")]
public bool? FallbackEnabled { get; set; }
+ [JsonProperty("instalment_schedule_request")]
+ public BillingRequestInstalmentScheduleRequest InstalmentScheduleRequest { get; set; }
+ ///
+ ///
+ ///
+ public class BillingRequestInstalmentScheduleRequest
+ {
+
+ ///
+ /// The amount to be deducted from each payment as an app fee, to be
+ /// paid to the partner integration which created the subscription,
+ /// in the lowest denomination for the currency (e.g. pence in GBP,
+ /// cents in EUR).
+ ///
+ [JsonProperty("app_fee")]
+ public int? AppFee { get; set; }
+
+ ///
+ /// [ISO 4217](http://en.wikipedia.org/wiki/ISO_4217#Active_codes)
+ /// currency code. Currently "AUD", "CAD", "DKK", "EUR", "GBP",
+ /// "NZD", "SEK" and "USD" are supported.
+ ///
+ [JsonProperty("currency")]
+ public BillingRequestCurrency? Currency { get; set; }
+ ///
+ /// [ISO 4217](http://en.wikipedia.org/wiki/ISO_4217#Active_codes)
+ /// currency code. Currently "AUD", "CAD", "DKK", "EUR", "GBP", "NZD",
+ /// "SEK" and "USD" are supported.
+ ///
+ [JsonConverter(typeof(StringEnumConverter))]
+ public enum BillingRequestCurrency
+ {
+
+ /// `currency` with a value of "AUD"
+ [EnumMember(Value = "AUD")]
+ AUD,
+ /// `currency` with a value of "CAD"
+ [EnumMember(Value = "CAD")]
+ CAD,
+ /// `currency` with a value of "DKK"
+ [EnumMember(Value = "DKK")]
+ DKK,
+ /// `currency` with a value of "EUR"
+ [EnumMember(Value = "EUR")]
+ EUR,
+ /// `currency` with a value of "GBP"
+ [EnumMember(Value = "GBP")]
+ GBP,
+ /// `currency` with a value of "NZD"
+ [EnumMember(Value = "NZD")]
+ NZD,
+ /// `currency` with a value of "SEK"
+ [EnumMember(Value = "SEK")]
+ SEK,
+ /// `currency` with a value of "USD"
+ [EnumMember(Value = "USD")]
+ USD,
+ }
+
+ ///
+ /// instalments to be created. See [create (with
+ /// dates)](#instalment-schedules-create-with-dates) and [create
+ /// (with schedule)](#instalment-schedules-create-with-schedule) for
+ /// more information on how to specify instalments.
+ ///
+ [JsonProperty("instalments")]
+ public string[] Instalments { get; set; }
+
+ ///
+ /// Key-value store of custom data. Up to 3 keys are permitted, with
+ /// key names up to 50 characters and values up to 500 characters.
+ ///
+ [JsonProperty("metadata")]
+ public IDictionary Metadata { get; set; }
+
+ ///
+ /// Name of the instalment schedule, up to 100 chars. This name will
+ /// also be
+ /// copied to the payments of the instalment schedule if you use
+ /// schedule-based creation.
+ ///
+ [JsonProperty("name")]
+ public string Name { get; set; }
+
+ ///
+ /// An optional payment reference. This will be set as the reference
+ /// on each payment
+ /// created and will appear on your customer's bank statement. See
+ /// the documentation for
+ /// the [create payment endpoint](#payments-create-a-payment) for
+ /// more details.
+ ///
+ ///
+ [JsonProperty("payment_reference")]
+ public string PaymentReference { get; set; }
+
+ ///
+ /// On failure, automatically retry payments using [intelligent
+ /// retries](#success-intelligent-retries). Default is `false`. Important: To be able to use
+ /// intelligent retries, Success+ needs to be enabled in [GoCardless
+ /// dashboard](https://manage.gocardless.com/success-plus).
+ ///
+ [JsonProperty("retry_if_possible")]
+ public bool? RetryIfPossible { get; set; }
+
+ ///
+ /// The total amount of the instalment schedule, defined as the sum
+ /// of all individual
+ /// payments, in the lowest denomination for the currency (e.g.
+ /// pence in GBP, cents in
+ /// EUR). If the requested payment amounts do not sum up correctly,
+ /// a validation error
+ /// will be returned.
+ ///
+ [JsonProperty("total_amount")]
+ public int? TotalAmount { get; set; }
+ }
+
///
/// Linked resources.
///
@@ -515,6 +639,15 @@ public class BillingRequestConstraints
[JsonProperty("max_amount_per_payment")]
public int? MaxAmountPerPayment { get; set; }
+ ///
+ /// A constraint where you can specify info (free text string) about
+ /// how payments are calculated. _Note:_ This is only supported for
+ /// ACH and PAD schemes.
+ ///
+ ///
+ [JsonProperty("payment_method")]
+ public string PaymentMethod { get; set; }
+
///
/// List of periodic limits and constraints which apply to them
///
@@ -928,6 +1061,192 @@ public enum BillingRequestPurposeCode
Other,
}
+ [JsonProperty("subscription_request")]
+ public BillingRequestSubscriptionRequest SubscriptionRequest { get; set; }
+ ///
+ ///
+ ///
+ public class BillingRequestSubscriptionRequest
+ {
+
+ ///
+ /// Amount in the lowest denomination for the currency (e.g. pence
+ /// in GBP, cents in EUR).
+ ///
+ [JsonProperty("amount")]
+ public int? Amount { get; set; }
+
+ ///
+ /// The amount to be deducted from each payment as an app fee, to be
+ /// paid to the partner integration which created the subscription,
+ /// in the lowest denomination for the currency (e.g. pence in GBP,
+ /// cents in EUR).
+ ///
+ [JsonProperty("app_fee")]
+ public int? AppFee { get; set; }
+
+ ///
+ /// The total number of payments that should be taken by this
+ /// subscription.
+ ///
+ [JsonProperty("count")]
+ public int? Count { get; set; }
+
+ ///
+ /// [ISO 4217](http://en.wikipedia.org/wiki/ISO_4217#Active_codes)
+ /// currency code. Currently "AUD", "CAD", "DKK", "EUR", "GBP",
+ /// "NZD", "SEK" and "USD" are supported.
+ ///
+ [JsonProperty("currency")]
+ public string Currency { get; set; }
+
+ ///
+ /// As per RFC 2445. The day of the month to charge customers on.
+ /// `1`-`28` or `-1` to indicate the last day of the month.
+ ///
+ [JsonProperty("day_of_month")]
+ public int? DayOfMonth { get; set; }
+
+ ///
+ /// Number of `interval_units` between customer charge dates. Must
+ /// be greater than or equal to `1`. Must result in at least one
+ /// charge date per year. Defaults to `1`.
+ ///
+ [JsonProperty("interval")]
+ public int? Interval { get; set; }
+
+ ///
+ /// The unit of time between customer charge dates. One of `weekly`,
+ /// `monthly` or `yearly`.
+ ///
+ [JsonProperty("interval_unit")]
+ public BillingRequestIntervalUnit? IntervalUnit { get; set; }
+ ///
+ /// The unit of time between customer charge dates. One of `weekly`,
+ /// `monthly` or `yearly`.
+ ///
+ [JsonConverter(typeof(StringEnumConverter))]
+ public enum BillingRequestIntervalUnit
+ {
+
+ /// `interval_unit` with a value of "weekly"
+ [EnumMember(Value = "weekly")]
+ Weekly,
+ /// `interval_unit` with a value of "monthly"
+ [EnumMember(Value = "monthly")]
+ Monthly,
+ /// `interval_unit` with a value of "yearly"
+ [EnumMember(Value = "yearly")]
+ Yearly,
+ }
+
+ ///
+ /// Key-value store of custom data. Up to 3 keys are permitted, with
+ /// key names up to 50 characters and values up to 500 characters.
+ ///
+ [JsonProperty("metadata")]
+ public IDictionary Metadata { get; set; }
+
+ ///
+ /// Name of the month on which to charge a customer. Must be
+ /// lowercase. Only applies
+ /// when the interval_unit is `yearly`.
+ ///
+ ///
+ [JsonProperty("month")]
+ public BillingRequestMonth? Month { get; set; }
+ ///
+ /// Name of the month on which to charge a customer. Must be lowercase.
+ /// Only applies
+ /// when the interval_unit is `yearly`.
+ ///
+ ///
+ [JsonConverter(typeof(StringEnumConverter))]
+ public enum BillingRequestMonth
+ {
+
+ /// `month` with a value of "january"
+ [EnumMember(Value = "january")]
+ January,
+ /// `month` with a value of "february"
+ [EnumMember(Value = "february")]
+ February,
+ /// `month` with a value of "march"
+ [EnumMember(Value = "march")]
+ March,
+ /// `month` with a value of "april"
+ [EnumMember(Value = "april")]
+ April,
+ /// `month` with a value of "may"
+ [EnumMember(Value = "may")]
+ May,
+ /// `month` with a value of "june"
+ [EnumMember(Value = "june")]
+ June,
+ /// `month` with a value of "july"
+ [EnumMember(Value = "july")]
+ July,
+ /// `month` with a value of "august"
+ [EnumMember(Value = "august")]
+ August,
+ /// `month` with a value of "september"
+ [EnumMember(Value = "september")]
+ September,
+ /// `month` with a value of "october"
+ [EnumMember(Value = "october")]
+ October,
+ /// `month` with a value of "november"
+ [EnumMember(Value = "november")]
+ November,
+ /// `month` with a value of "december"
+ [EnumMember(Value = "december")]
+ December,
+ }
+
+ ///
+ /// Optional name for the subscription. This will be set as the
+ /// description on each payment created. Must not exceed 255
+ /// characters.
+ ///
+ [JsonProperty("name")]
+ public string Name { get; set; }
+
+ ///
+ /// An optional payment reference. This will be set as the reference
+ /// on each payment
+ /// created and will appear on your customer's bank statement. See
+ /// the documentation for
+ /// the [create payment endpoint](#payments-create-a-payment) for
+ /// more details.
+ ///
+ ///
+ [JsonProperty("payment_reference")]
+ public string PaymentReference { get; set; }
+
+ ///
+ /// On failure, automatically retry payments using [intelligent
+ /// retries](#success-intelligent-retries). Default is `false`. Important: To be able to use
+ /// intelligent retries, Success+ needs to be enabled in [GoCardless
+ /// dashboard](https://manage.gocardless.com/success-plus).
+ ///
+ [JsonProperty("retry_if_possible")]
+ public bool? RetryIfPossible { get; set; }
+
+ ///
+ /// The date on which the first payment should be charged. If
+ /// fulfilled after this date, this will be set as the mandate's
+ /// `next_possible_charge_date`.
+ /// When left blank and `month` or `day_of_month` are provided, this
+ /// will be set to the date of the first payment.
+ /// If created without `month` or `day_of_month` this will be set as
+ /// the mandate's `next_possible_charge_date`.
+ ///
+ ///
+ [JsonProperty("start_date")]
+ public string StartDate { get; set; }
+ }
+
///
/// A unique key to ensure that this request only succeeds once, allowing you to safely retry request errors such as network failures.
/// Any requests, where supported, to create a resource with a key that has previously been used will not succeed.