From c506998a342da8a4e62f277be854665695402229 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rapha=C3=ABl=20Cayouette?= Date: Wed, 22 Nov 2023 11:01:02 -0500 Subject: [PATCH] Update NuGet source code and JSON API for version 1.0.0-beta07 --- .../HttpClient/Models/Charge.cs | 47 +++++++++-- .../HttpClient/Models/Customer.cs | 21 +++-- .../HttpClient/Models/ReceivableCharges.cs | 29 ++++++- .../HttpClient/Models/Subscription.cs | 73 ++++++++++++++++- .../Models/SubscriptionCommitmentTerm.cs | 21 ++++- .../HttpClient/Models/SubscriptionFees.cs | 82 +++++++++++++++++++ .../SubscriptionRenewalConfiguration.cs | 14 +++- .../Sherweb.Apis.ServiceProvider.csproj | 2 +- Sherweb.Apis.ServiceProvider.OpenAPI.json | 2 +- 9 files changed, 264 insertions(+), 27 deletions(-) create mode 100644 NugetPackagesSourceCode/Sherweb.Apis.ServiceProvider/HttpClient/Models/SubscriptionFees.cs diff --git a/NugetPackagesSourceCode/Sherweb.Apis.ServiceProvider/HttpClient/Models/Charge.cs b/NugetPackagesSourceCode/Sherweb.Apis.ServiceProvider/HttpClient/Models/Charge.cs index 712ccac..131ab27 100644 --- a/NugetPackagesSourceCode/Sherweb.Apis.ServiceProvider/HttpClient/Models/Charge.cs +++ b/NugetPackagesSourceCode/Sherweb.Apis.ServiceProvider/HttpClient/Models/Charge.cs @@ -29,14 +29,14 @@ public Charge() /// /// Possible values include: 'Setup', /// 'Recurring', 'Usage', 'Unknown' - /// Possible values include: 'OneTime', - /// 'Monthly', 'Yearly' /// Price paid per unit. /// Prorated price paid per /// unit. /// Indicates whether or not the price of /// the charge is proratable. - public Charge(string productName = default(string), string sku = default(string), System.Guid? chargeId = default(System.Guid?), string chargeName = default(string), string chargeType = default(string), string billingCycleType = default(string), System.DateTime? periodFrom = default(System.DateTime?), System.DateTime? periodTo = default(System.DateTime?), double? quantity = default(double?), double? costPrice = default(double?), double? costPriceProrated = default(double?), string currency = default(string), bool? isProratable = default(bool?)) + /// Possible values include: 'OneTime', + /// 'Monthly', 'Yearly' + public Charge(string productName, string sku, string chargeName, string chargeType, System.DateTime periodFrom, System.DateTime periodTo, double quantity, double costPrice, double costPriceProrated, string currency, bool isProratable, System.Guid? chargeId = default(System.Guid?), string billingCycleType = default(string)) { ProductName = productName; Sku = sku; @@ -97,30 +97,30 @@ public Charge() /// [JsonConverter(typeof(DateJsonConverter))] [JsonProperty(PropertyName = "periodFrom")] - public System.DateTime? PeriodFrom { get; set; } + public System.DateTime PeriodFrom { get; set; } /// /// [JsonConverter(typeof(DateJsonConverter))] [JsonProperty(PropertyName = "periodTo")] - public System.DateTime? PeriodTo { get; set; } + public System.DateTime PeriodTo { get; set; } /// /// [JsonProperty(PropertyName = "quantity")] - public double? Quantity { get; set; } + public double Quantity { get; set; } /// /// Gets or sets price paid per unit. /// [JsonProperty(PropertyName = "costPrice")] - public double? CostPrice { get; set; } + public double CostPrice { get; set; } /// /// Gets or sets prorated price paid per unit. /// [JsonProperty(PropertyName = "costPriceProrated")] - public double? CostPriceProrated { get; set; } + public double CostPriceProrated { get; set; } /// /// @@ -132,7 +132,36 @@ public Charge() /// proratable. /// [JsonProperty(PropertyName = "isProratable")] - public bool? IsProratable { get; set; } + public bool IsProratable { get; set; } + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (ProductName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "ProductName"); + } + if (Sku == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "Sku"); + } + if (ChargeName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "ChargeName"); + } + if (ChargeType == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "ChargeType"); + } + if (Currency == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "Currency"); + } + } } } diff --git a/NugetPackagesSourceCode/Sherweb.Apis.ServiceProvider/HttpClient/Models/Customer.cs b/NugetPackagesSourceCode/Sherweb.Apis.ServiceProvider/HttpClient/Models/Customer.cs index 855750f..67192ac 100644 --- a/NugetPackagesSourceCode/Sherweb.Apis.ServiceProvider/HttpClient/Models/Customer.cs +++ b/NugetPackagesSourceCode/Sherweb.Apis.ServiceProvider/HttpClient/Models/Customer.cs @@ -26,7 +26,7 @@ public Customer() /// /// Format: yyyy-MM-ddTHH:mm:ss.fffffffK /// (UTC). Example : 2021-01-13T20:30:05.7613888 - public Customer(System.Guid? id = default(System.Guid?), string displayName = default(string), IList path = default(IList), System.DateTime? suspendedOn = default(System.DateTime?)) + public Customer(System.Guid id, string displayName, IList path, System.DateTime? suspendedOn = default(System.DateTime?)) { Id = id; DisplayName = displayName; @@ -43,24 +43,33 @@ public Customer() /// /// [JsonProperty(PropertyName = "id")] - public System.Guid? Id { get; set; } + public System.Guid Id { get; private set; } /// /// [JsonProperty(PropertyName = "displayName")] - public string DisplayName { get; set; } + public string DisplayName { get; private set; } /// /// [JsonProperty(PropertyName = "path")] - public IList Path { get; set; } + public IList Path { get; private set; } /// - /// Gets or sets format: yyyy-MM-ddTHH:mm:ss.fffffffK (UTC). Example : + /// Gets format: yyyy-MM-ddTHH:mm:ss.fffffffK (UTC). Example : /// 2021-01-13T20:30:05.7613888 /// [JsonProperty(PropertyName = "suspendedOn")] - public System.DateTime? SuspendedOn { get; set; } + public System.DateTime? SuspendedOn { get; private set; } + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + } } } diff --git a/NugetPackagesSourceCode/Sherweb.Apis.ServiceProvider/HttpClient/Models/ReceivableCharges.cs b/NugetPackagesSourceCode/Sherweb.Apis.ServiceProvider/HttpClient/Models/ReceivableCharges.cs index 3236374..3d6c6ae 100644 --- a/NugetPackagesSourceCode/Sherweb.Apis.ServiceProvider/HttpClient/Models/ReceivableCharges.cs +++ b/NugetPackagesSourceCode/Sherweb.Apis.ServiceProvider/HttpClient/Models/ReceivableCharges.cs @@ -29,7 +29,7 @@ public ReceivableCharges() /// /// Initializes a new instance of the ReceivableCharges class. /// - public ReceivableCharges(System.DateTime? periodFrom = default(System.DateTime?), System.DateTime? periodTo = default(System.DateTime?), IList charges = default(IList)) + public ReceivableCharges(System.DateTime periodFrom, System.DateTime periodTo, IList charges) { PeriodFrom = periodFrom; PeriodTo = periodTo; @@ -46,18 +46,41 @@ public ReceivableCharges() /// [JsonConverter(typeof(DateJsonConverter))] [JsonProperty(PropertyName = "periodFrom")] - public System.DateTime? PeriodFrom { get; set; } + public System.DateTime PeriodFrom { get; set; } /// /// [JsonConverter(typeof(DateJsonConverter))] [JsonProperty(PropertyName = "periodTo")] - public System.DateTime? PeriodTo { get; set; } + public System.DateTime PeriodTo { get; set; } /// /// [JsonProperty(PropertyName = "charges")] public IList Charges { get; set; } + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (Charges == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "Charges"); + } + if (Charges != null) + { + foreach (var element in Charges) + { + if (element != null) + { + element.Validate(); + } + } + } + } } } diff --git a/NugetPackagesSourceCode/Sherweb.Apis.ServiceProvider/HttpClient/Models/Subscription.cs b/NugetPackagesSourceCode/Sherweb.Apis.ServiceProvider/HttpClient/Models/Subscription.cs index 384162f..9e941fe 100644 --- a/NugetPackagesSourceCode/Sherweb.Apis.ServiceProvider/HttpClient/Models/Subscription.cs +++ b/NugetPackagesSourceCode/Sherweb.Apis.ServiceProvider/HttpClient/Models/Subscription.cs @@ -6,6 +6,7 @@ namespace Sherweb.Apis.ServiceProvider.Models { + using Microsoft.Rest; using Newtonsoft.Json; using System.Linq; @@ -22,13 +23,24 @@ public Subscription() /// /// Initializes a new instance of the Subscription class. /// - public Subscription(System.Guid? id = default(System.Guid?), string productName = default(string), string description = default(string), string sku = default(string), int? quantity = default(int?), SubscriptionCommitmentTerm commitmentTerm = default(SubscriptionCommitmentTerm)) + /// A billing cycle, also referred to as a + /// billing period, is the interval of time between billing statements + /// Although billing cycles are most often set at one month, or one + /// year, they may vary in length depending on the SKU + /// Possible values: none, daily, weekly, monthly, yearly and + /// unknown + /// Format: yyyy-MM-ddTHH:mm:ss.fffffffK + /// (UTC). Example : 2023-11-21T20:27:05.7613888 + public Subscription(System.Guid id, string productName, string description, string sku, int quantity, string billingCycle, System.DateTime purchaseDate, SubscriptionFees fees = default(SubscriptionFees), SubscriptionCommitmentTerm commitmentTerm = default(SubscriptionCommitmentTerm)) { Id = id; ProductName = productName; Description = description; Sku = sku; Quantity = quantity; + BillingCycle = billingCycle; + PurchaseDate = purchaseDate; + Fees = fees; CommitmentTerm = commitmentTerm; CustomInit(); } @@ -41,7 +53,7 @@ public Subscription() /// /// [JsonProperty(PropertyName = "id")] - public System.Guid? Id { get; set; } + public System.Guid Id { get; set; } /// /// @@ -61,12 +73,67 @@ public Subscription() /// /// [JsonProperty(PropertyName = "quantity")] - public int? Quantity { get; set; } + public int Quantity { get; set; } + + /// + /// Gets or sets a billing cycle, also referred to as a billing period, + /// is the interval of time between billing statements + /// Although billing cycles are most often set at one month, or one + /// year, they may vary in length depending on the SKU + /// Possible values: none, daily, weekly, monthly, yearly and unknown + /// + [JsonProperty(PropertyName = "billingCycle")] + public string BillingCycle { get; set; } + + /// + /// Gets or sets format: yyyy-MM-ddTHH:mm:ss.fffffffK (UTC). Example : + /// 2023-11-21T20:27:05.7613888 + /// + [JsonProperty(PropertyName = "purchaseDate")] + public System.DateTime PurchaseDate { get; set; } + + /// + /// + [JsonProperty(PropertyName = "fees")] + public SubscriptionFees Fees { get; set; } /// /// [JsonProperty(PropertyName = "commitmentTerm")] public SubscriptionCommitmentTerm CommitmentTerm { get; set; } + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (ProductName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "ProductName"); + } + if (Description == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "Description"); + } + if (Sku == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "Sku"); + } + if (BillingCycle == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "BillingCycle"); + } + if (Fees != null) + { + Fees.Validate(); + } + if (CommitmentTerm != null) + { + CommitmentTerm.Validate(); + } + } } } diff --git a/NugetPackagesSourceCode/Sherweb.Apis.ServiceProvider/HttpClient/Models/SubscriptionCommitmentTerm.cs b/NugetPackagesSourceCode/Sherweb.Apis.ServiceProvider/HttpClient/Models/SubscriptionCommitmentTerm.cs index f4dd612..8e6f84e 100644 --- a/NugetPackagesSourceCode/Sherweb.Apis.ServiceProvider/HttpClient/Models/SubscriptionCommitmentTerm.cs +++ b/NugetPackagesSourceCode/Sherweb.Apis.ServiceProvider/HttpClient/Models/SubscriptionCommitmentTerm.cs @@ -31,7 +31,7 @@ public SubscriptionCommitmentTerm() /// 'Biennial', 'Triennial' /// The last day of the commitment /// term - public SubscriptionCommitmentTerm(string type = default(string), System.DateTime? termEndDate = default(System.DateTime?), SubscriptionRenewalConfiguration renewalConfiguration = default(SubscriptionRenewalConfiguration)) + public SubscriptionCommitmentTerm(string type, System.DateTime termEndDate, SubscriptionRenewalConfiguration renewalConfiguration = default(SubscriptionRenewalConfiguration)) { Type = type; TermEndDate = termEndDate; @@ -56,12 +56,29 @@ public SubscriptionCommitmentTerm() /// [JsonConverter(typeof(DateJsonConverter))] [JsonProperty(PropertyName = "termEndDate")] - public System.DateTime? TermEndDate { get; set; } + public System.DateTime TermEndDate { get; set; } /// /// [JsonProperty(PropertyName = "renewalConfiguration")] public SubscriptionRenewalConfiguration RenewalConfiguration { get; set; } + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (Type == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "Type"); + } + if (RenewalConfiguration != null) + { + RenewalConfiguration.Validate(); + } + } } } diff --git a/NugetPackagesSourceCode/Sherweb.Apis.ServiceProvider/HttpClient/Models/SubscriptionFees.cs b/NugetPackagesSourceCode/Sherweb.Apis.ServiceProvider/HttpClient/Models/SubscriptionFees.cs new file mode 100644 index 0000000..a748c12 --- /dev/null +++ b/NugetPackagesSourceCode/Sherweb.Apis.ServiceProvider/HttpClient/Models/SubscriptionFees.cs @@ -0,0 +1,82 @@ +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Sherweb.Apis.ServiceProvider.Models +{ + using Microsoft.Rest; + using Newtonsoft.Json; + using System.Linq; + + /// + /// Null for subscriptions that have no corresponding catalog item + /// + public partial class SubscriptionFees + { + /// + /// Initializes a new instance of the SubscriptionFees class. + /// + public SubscriptionFees() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the SubscriptionFees class. + /// + /// The recurring amount charge every + /// cycle + /// The initial amount charge at the end of the + /// first cycle + /// Possible values include: 'Undefined', 'Cad', + /// 'Usd', 'Eur', 'Gbp' + public SubscriptionFees(double recurringFee, double setupFee, string currency) + { + RecurringFee = recurringFee; + SetupFee = setupFee; + Currency = currency; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets the recurring amount charge every cycle + /// + [JsonProperty(PropertyName = "recurringFee")] + public double RecurringFee { get; set; } + + /// + /// Gets or sets the initial amount charge at the end of the first + /// cycle + /// + [JsonProperty(PropertyName = "setupFee")] + public double SetupFee { get; set; } + + /// + /// Gets or sets possible values include: 'Undefined', 'Cad', 'Usd', + /// 'Eur', 'Gbp' + /// + [JsonProperty(PropertyName = "currency")] + public string Currency { get; set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (Currency == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "Currency"); + } + } + } +} diff --git a/NugetPackagesSourceCode/Sherweb.Apis.ServiceProvider/HttpClient/Models/SubscriptionRenewalConfiguration.cs b/NugetPackagesSourceCode/Sherweb.Apis.ServiceProvider/HttpClient/Models/SubscriptionRenewalConfiguration.cs index 5434efe..10f20d3 100644 --- a/NugetPackagesSourceCode/Sherweb.Apis.ServiceProvider/HttpClient/Models/SubscriptionRenewalConfiguration.cs +++ b/NugetPackagesSourceCode/Sherweb.Apis.ServiceProvider/HttpClient/Models/SubscriptionRenewalConfiguration.cs @@ -35,7 +35,7 @@ public SubscriptionRenewalConfiguration() /// In the absence of a /// ScheduledQuantity, the subscription will renew with the existing /// quantity - public SubscriptionRenewalConfiguration(System.DateTime? renewalDate = default(System.DateTime?), int? scheduledQuantity = default(int?)) + public SubscriptionRenewalConfiguration(System.DateTime renewalDate, int? scheduledQuantity = default(int?)) { RenewalDate = renewalDate; ScheduledQuantity = scheduledQuantity; @@ -52,7 +52,7 @@ public SubscriptionRenewalConfiguration() /// [JsonConverter(typeof(DateJsonConverter))] [JsonProperty(PropertyName = "renewalDate")] - public System.DateTime? RenewalDate { get; set; } + public System.DateTime RenewalDate { get; set; } /// /// Gets or sets in the absence of a ScheduledQuantity, the @@ -61,5 +61,15 @@ public SubscriptionRenewalConfiguration() [JsonProperty(PropertyName = "scheduledQuantity")] public int? ScheduledQuantity { get; set; } + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + //Nothing to validate + } } } diff --git a/NugetPackagesSourceCode/Sherweb.Apis.ServiceProvider/Sherweb.Apis.ServiceProvider.csproj b/NugetPackagesSourceCode/Sherweb.Apis.ServiceProvider/Sherweb.Apis.ServiceProvider.csproj index 0e8f6d2..0514b5c 100644 --- a/NugetPackagesSourceCode/Sherweb.Apis.ServiceProvider/Sherweb.Apis.ServiceProvider.csproj +++ b/NugetPackagesSourceCode/Sherweb.Apis.ServiceProvider/Sherweb.Apis.ServiceProvider.csproj @@ -6,7 +6,7 @@ Sherweb.Apis.ServiceProvider Sherweb API Client ServiceProvider Sherweb ServiceProvider API Client - 1.0.0-beta06 + 1.0.0-beta07 true diff --git a/Sherweb.Apis.ServiceProvider.OpenAPI.json b/Sherweb.Apis.ServiceProvider.OpenAPI.json index 52201e4..ed2a81c 100644 --- a/Sherweb.Apis.ServiceProvider.OpenAPI.json +++ b/Sherweb.Apis.ServiceProvider.OpenAPI.json @@ -1 +1 @@ -{"openapi":"3.0.1","info":{"title":"Service Provider API (Beta)","version":"1"},"paths":{"/customers":{"get":{"tags":["Customers"],"summary":"GetCustomers (beta)","description":"Get the list of all your customers.","operationId":"GetCustomers","parameters":[{"name":"Accept-Language","in":"header","description":"Specify language (and culture) following [RFC 7231, section 5.3.5: Accept-Language].","schema":{"type":"string"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Customers"}}}}}}},"/billing/receivable-charges":{"get":{"tags":["ReceivableCharges"],"summary":"GetReceivableCharges (beta)","description":"Get the amounts that one of your customers owe you for a specific billing period. There are three types of charges that are included in the data returned: recurring, usage, and setup.\r\n
For the time being, you cannot use the Service Provider API rebilling feature (GetReceivableCharges endpoint) while having a PSA integration enabled.
","operationId":"GetReceivableCharges","parameters":[{"name":"customerId","in":"query","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"date","in":"query","description":"Specify a date within the desired billing period. Format: yyyy-MM-dd (UTC). Default: Today. For example, if the date is March 17th and your billing period is from the 1st to the 31st of the month, it will return data from March 1st to March 31st.","schema":{"type":"string","format":"date"}},{"name":"Accept-Language","in":"header","description":"Specify language (and culture) following [RFC 7231, section 5.3.5: Accept-Language].","schema":{"type":"string"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReceivableCharges"}}}}}}},"/billing/subscriptions":{"get":{"tags":["Subscriptions"],"summary":"GetSubscriptions (beta)","description":"Get the list of subscriptions for one of your customers.","operationId":"GetCustomerSubscriptions","parameters":[{"name":"customerId","in":"query","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"Accept-Language","in":"header","description":"Specify language (and culture) following [RFC 7231, section 5.3.5: Accept-Language].","schema":{"type":"string"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Subscriptions"}}}}}}},"/billing/subscriptions/amendments":{"post":{"tags":["Subscriptions"],"summary":"CreateSubscriptionsAmendment (beta)","description":"Amend subscription quantities for one of your customers.","operationId":"CreateSubscriptionsAmendment","parameters":[{"name":"customerId","in":"query","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"Accept-Language","in":"header","description":"Specify language (and culture) following [RFC 7231, section 5.3.5: Accept-Language].","schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateSubscriptionsAmendmentParameters"}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SubscriptionsAmendment"}}}}}}},"/billing/subscriptions/amendments/{subscriptionsAmendmentId}/status":{"get":{"tags":["Subscriptions"],"summary":"GetSubscriptionsAmendmentStatus (beta)","description":"Get the status of a subscriptions amendment.","operationId":"GetSubscriptionsAmendmentStatus","parameters":[{"name":"subscriptionsAmendmentId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"Accept-Language","in":"header","description":"Specify language (and culture) following [RFC 7231, section 5.3.5: Accept-Language].","schema":{"type":"string"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SubscriptionsAmendmentStatus"}}}}}}}},"components":{"schemas":{"BillingCycleType":{"enum":["OneTime","Monthly","Yearly"],"type":"string","description":"OneTime (charged once, with no recurrence),\r\nMonthly (charged monthly),\r\nYearly (charged yearly)."},"Charge":{"required":["chargeName","chargeType","costPrice","costPriceProrated","currency","isProratable","periodFrom","periodTo","productName","quantity","sku"],"type":"object","properties":{"productName":{"minLength":1,"type":"string"},"sku":{"minLength":1,"type":"string"},"chargeId":{"type":"string","format":"uuid","nullable":true},"chargeName":{"minLength":1,"type":"string"},"chargeType":{"$ref":"#/components/schemas/ChargeType"},"billingCycleType":{"$ref":"#/components/schemas/BillingCycleType"},"periodFrom":{"type":"string","format":"date"},"periodTo":{"type":"string","format":"date"},"quantity":{"type":"number","format":"double"},"costPrice":{"type":"number","description":"Price paid per unit.","format":"double"},"costPriceProrated":{"type":"number","description":"Prorated price paid per unit.","format":"double"},"currency":{"minLength":1,"type":"string"},"isProratable":{"type":"boolean","description":"Indicates whether or not the price of the charge is proratable."}},"additionalProperties":false,"description":"A product is constituted of one or multiple charges."},"ChargeType":{"enum":["Setup","Recurring","Usage","Unknown"],"type":"string","description":"Setup (occurs only once and can be used for activation, cancellation or setup fees),\r\nRecurring (invoiced on a monthly or yearly basis),\r\nUsage (varies based on the quantity of the product or service consumed by the customer),\r\nUnknown (charge type not found. This may happen when querying data from older invoices)."},"CommitmentTermType":{"enum":["Monthly","Annual","Biennial","Triennial"],"type":"string"},"CreateSubscriptionsAmendmentParameters":{"type":"object","properties":{"subscriptionAmendmentParameters":{"type":"array","items":{"$ref":"#/components/schemas/SubscriptionsAmendmentParameter"},"nullable":true}},"additionalProperties":false},"Currency":{"enum":["Undefined","Cad","Usd","Eur","Gbp"],"type":"string","description":"Undefined,\r\nCad (Canadian Dollar),\r\nUsd (US Dollar),\r\nEur (Euro),\r\nGbp (British pound sterling)."},"Customer":{"required":["displayName","id","path"],"type":"object","properties":{"id":{"type":"string","format":"uuid","readOnly":true},"displayName":{"minLength":1,"type":"string","readOnly":true},"path":{"type":"array","items":{"type":"string"},"readOnly":true},"suspendedOn":{"type":"string","description":"Format: yyyy-MM-ddTHH:mm:ss.fffffffK (UTC). Example : 2021-01-13T20:30:05.7613888","format":"date-time","nullable":true,"readOnly":true}},"additionalProperties":false},"Customers":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/Customer"},"nullable":true}},"additionalProperties":false},"ReceivableCharges":{"required":["charges","periodFrom","periodTo"],"type":"object","properties":{"periodFrom":{"type":"string","format":"date"},"periodTo":{"type":"string","format":"date"},"charges":{"type":"array","items":{"$ref":"#/components/schemas/Charge"}}},"additionalProperties":false,"description":"All charges to pay for a billing period."},"Subscription":{"required":["billingCycle","description","id","productName","quantity","sku"],"type":"object","properties":{"id":{"type":"string","format":"uuid"},"productName":{"minLength":1,"type":"string"},"description":{"minLength":1,"type":"string"},"sku":{"minLength":1,"type":"string"},"quantity":{"type":"integer","format":"int32"},"billingCycle":{"minLength":1,"type":"string","description":"A billing cycle, also referred to as a billing period, is the interval of time between billing statements\r\nAlthough billing cycles are most often set at one month, or one year, they may vary in length depending on the SKU\r\nPossible values: none, daily, weekly, monthly, yearly and unknown"},"fees":{"$ref":"#/components/schemas/SubscriptionFees"},"commitmentTerm":{"$ref":"#/components/schemas/SubscriptionCommitmentTerm"}},"additionalProperties":false},"SubscriptionCommitmentTerm":{"required":["termEndDate","type"],"type":"object","properties":{"type":{"$ref":"#/components/schemas/CommitmentTermType"},"termEndDate":{"type":"string","description":"The last day of the commitment term","format":"date"},"renewalConfiguration":{"$ref":"#/components/schemas/SubscriptionRenewalConfiguration"}},"additionalProperties":false,"description":"Null for subscriptions that are not tied to a commitment","nullable":true},"SubscriptionFees":{"required":["currency","recurringFee","setupFee"],"type":"object","properties":{"recurringFee":{"type":"number","description":"The recurring amount charge every cycle","format":"double"},"setupFee":{"type":"number","description":"The initial amount charge at the end of the first cycle","format":"double"},"currency":{"$ref":"#/components/schemas/Currency"}},"additionalProperties":false,"description":"Null for subscriptions that have no corresponding catalog item","nullable":true},"SubscriptionRenewalConfiguration":{"required":["renewalDate"],"type":"object","properties":{"renewalDate":{"type":"string","description":"The first day of the next commitment term","format":"date"},"scheduledQuantity":{"type":"integer","description":"In the absence of a ScheduledQuantity, the subscription will renew with the existing quantity","format":"int32","nullable":true}},"additionalProperties":false,"description":"Null for subscriptions that will not auto-renew at the end of the commitment term","nullable":true},"Subscriptions":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/Subscription"},"nullable":true}},"additionalProperties":false},"SubscriptionsAmendment":{"type":"object","properties":{"subscriptionsAmendmentId":{"type":"string","format":"uuid"}},"additionalProperties":false},"SubscriptionsAmendmentParameter":{"required":["newQuantity","subscriptionId"],"type":"object","properties":{"subscriptionId":{"type":"string","format":"uuid"},"newQuantity":{"type":"integer","format":"int32"}},"additionalProperties":false,"description":"Subscription ID to amend, paired with its new intended quantity."},"SubscriptionsAmendmentStatus":{"enum":["Pending","Processing","Success","Failure","Canceled","PartialSuccess"],"type":"string"}}}} +{"openapi":"3.0.1","info":{"title":"Service Provider API (Beta)","version":"1"},"paths":{"/customers":{"get":{"tags":["Customers"],"summary":"GetCustomers (beta)","description":"Get the list of all your customers.","operationId":"GetCustomers","parameters":[{"name":"Accept-Language","in":"header","description":"Specify language (and culture) following [RFC 7231, section 5.3.5: Accept-Language].","schema":{"type":"string"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Customers"}}}}}}},"/billing/receivable-charges":{"get":{"tags":["ReceivableCharges"],"summary":"GetReceivableCharges (beta)","description":"Get the amounts that one of your customers owe you for a specific billing period. There are three types of charges that are included in the data returned: recurring, usage, and setup.\r\n\u003cdiv style=\u0022color:#FF9B00;background-color:#FCF8E3;padding:1rem;border-radius:5px;border:1px solid #FF9B00;display:inline-block\u0022\u003e\u003csvg width=\u002216\u0022 height=\u002216\u0022 fill=\u0022currentColor\u0022 viewBox=\u00220 0 16 16\u0022\u003e\u003cpath d=\u0022M8.982 1.566a1.13 1.13 0 0 0-1.96 0L.165 13.233c-.457.778.091 1.767.98 1.767h13.713c.889 0 1.438-.99.98-1.767L8.982 1.566zM8 5c.535 0 .954.462.9.995l-.35 3.507a.552.552 0 0 1-1.1 0L7.1 5.995A.905.905 0 0 1 8 5zm.002 6a1 1 0 1 1 0 2 1 1 0 0 1 0-2z\u0022 /\u003e\u003c/svg\u003e For the time being, you cannot use the Service Provider API rebilling feature (\u003ci\u003eGetReceivableCharges\u003c/i\u003e endpoint) while having a PSA integration enabled.\u003c/div\u003e","operationId":"GetReceivableCharges","parameters":[{"name":"customerId","in":"query","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"date","in":"query","description":"Specify a date within the desired billing period. Format: yyyy-MM-dd (UTC). Default: Today. For example, if the date is March 17th and your billing period is from the 1st to the 31st of the month, it will return data from March 1st to March 31st.","schema":{"type":"string","format":"date"}},{"name":"Accept-Language","in":"header","description":"Specify language (and culture) following [RFC 7231, section 5.3.5: Accept-Language].","schema":{"type":"string"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReceivableCharges"}}}}}}},"/billing/subscriptions":{"get":{"tags":["Subscriptions"],"summary":"GetSubscriptions (beta)","description":"Get the list of subscriptions for one of your customers.","operationId":"GetCustomerSubscriptions","parameters":[{"name":"customerId","in":"query","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"Accept-Language","in":"header","description":"Specify language (and culture) following [RFC 7231, section 5.3.5: Accept-Language].","schema":{"type":"string"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Subscriptions"}}}}}}},"/billing/subscriptions/amendments":{"post":{"tags":["Subscriptions"],"summary":"CreateSubscriptionsAmendment (beta)","description":"Amend subscription quantities for one of your customers.","operationId":"CreateSubscriptionsAmendment","parameters":[{"name":"customerId","in":"query","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"Accept-Language","in":"header","description":"Specify language (and culture) following [RFC 7231, section 5.3.5: Accept-Language].","schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateSubscriptionsAmendmentParameters"}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SubscriptionsAmendment"}}}}}}},"/billing/subscriptions/amendments/{subscriptionsAmendmentId}/status":{"get":{"tags":["Subscriptions"],"summary":"GetSubscriptionsAmendmentStatus (beta)","description":"Get the status of a subscriptions amendment.","operationId":"GetSubscriptionsAmendmentStatus","parameters":[{"name":"subscriptionsAmendmentId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"Accept-Language","in":"header","description":"Specify language (and culture) following [RFC 7231, section 5.3.5: Accept-Language].","schema":{"type":"string"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SubscriptionsAmendmentStatus"}}}}}}}},"components":{"schemas":{"BillingCycleType":{"enum":["OneTime","Monthly","Yearly"],"type":"string","description":"OneTime (charged once, with no recurrence),\r\nMonthly (charged monthly),\r\nYearly (charged yearly)."},"Charge":{"required":["chargeName","chargeType","costPrice","costPriceProrated","currency","isProratable","periodFrom","periodTo","productName","quantity","sku"],"type":"object","properties":{"productName":{"minLength":1,"type":"string"},"sku":{"minLength":1,"type":"string"},"chargeId":{"type":"string","format":"uuid","nullable":true},"chargeName":{"minLength":1,"type":"string"},"chargeType":{"$ref":"#/components/schemas/ChargeType"},"billingCycleType":{"$ref":"#/components/schemas/BillingCycleType"},"periodFrom":{"type":"string","format":"date"},"periodTo":{"type":"string","format":"date"},"quantity":{"type":"number","format":"double"},"costPrice":{"type":"number","description":"Price paid per unit.","format":"double"},"costPriceProrated":{"type":"number","description":"Prorated price paid per unit.","format":"double"},"currency":{"minLength":1,"type":"string"},"isProratable":{"type":"boolean","description":"Indicates whether or not the price of the charge is proratable."}},"additionalProperties":false,"description":"A product is constituted of one or multiple charges."},"ChargeType":{"enum":["Setup","Recurring","Usage","Unknown"],"type":"string","description":"Setup (occurs only once and can be used for activation, cancellation or setup fees),\r\nRecurring (invoiced on a monthly or yearly basis),\r\nUsage (varies based on the quantity of the product or service consumed by the customer),\r\nUnknown (charge type not found. This may happen when querying data from older invoices)."},"CommitmentTermType":{"enum":["Monthly","Annual","Biennial","Triennial"],"type":"string"},"CreateSubscriptionsAmendmentParameters":{"type":"object","properties":{"subscriptionAmendmentParameters":{"type":"array","items":{"$ref":"#/components/schemas/SubscriptionsAmendmentParameter"},"nullable":true}},"additionalProperties":false},"Currency":{"enum":["Undefined","Cad","Usd","Eur","Gbp"],"type":"string","description":"Undefined,\r\nCad (Canadian Dollar),\r\nUsd (US Dollar),\r\nEur (Euro),\r\nGbp (British pound sterling)."},"Customer":{"required":["displayName","id","path"],"type":"object","properties":{"id":{"type":"string","format":"uuid","readOnly":true},"displayName":{"minLength":1,"type":"string","readOnly":true},"path":{"type":"array","items":{"type":"string"},"readOnly":true},"suspendedOn":{"type":"string","description":"Format: yyyy-MM-ddTHH:mm:ss.fffffffK (UTC). Example : 2021-01-13T20:30:05.7613888","format":"date-time","nullable":true,"readOnly":true}},"additionalProperties":false},"Customers":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/Customer"},"nullable":true}},"additionalProperties":false},"ReceivableCharges":{"required":["charges","periodFrom","periodTo"],"type":"object","properties":{"periodFrom":{"type":"string","format":"date"},"periodTo":{"type":"string","format":"date"},"charges":{"type":"array","items":{"$ref":"#/components/schemas/Charge"}}},"additionalProperties":false,"description":"All charges to pay for a billing period."},"Subscription":{"required":["billingCycle","description","id","productName","purchaseDate","quantity","sku"],"type":"object","properties":{"id":{"type":"string","format":"uuid"},"productName":{"minLength":1,"type":"string"},"description":{"minLength":1,"type":"string"},"sku":{"minLength":1,"type":"string"},"quantity":{"type":"integer","format":"int32"},"billingCycle":{"minLength":1,"type":"string","description":"A billing cycle, also referred to as a billing period, is the interval of time between billing statements\r\nAlthough billing cycles are most often set at one month, or one year, they may vary in length depending on the SKU\r\nPossible values: none, daily, weekly, monthly, yearly and unknown"},"purchaseDate":{"type":"string","description":"Format: yyyy-MM-ddTHH:mm:ss.fffffffK (UTC). Example : 2023-11-21T20:27:05.7613888","format":"date-time"},"fees":{"$ref":"#/components/schemas/SubscriptionFees"},"commitmentTerm":{"$ref":"#/components/schemas/SubscriptionCommitmentTerm"}},"additionalProperties":false},"SubscriptionCommitmentTerm":{"required":["termEndDate","type"],"type":"object","properties":{"type":{"$ref":"#/components/schemas/CommitmentTermType"},"termEndDate":{"type":"string","description":"The last day of the commitment term","format":"date"},"renewalConfiguration":{"$ref":"#/components/schemas/SubscriptionRenewalConfiguration"}},"additionalProperties":false,"description":"Null for subscriptions that are not tied to a commitment","nullable":true},"SubscriptionFees":{"required":["currency","recurringFee","setupFee"],"type":"object","properties":{"recurringFee":{"type":"number","description":"The recurring amount charge every cycle","format":"double"},"setupFee":{"type":"number","description":"The initial amount charge at the end of the first cycle","format":"double"},"currency":{"$ref":"#/components/schemas/Currency"}},"additionalProperties":false,"description":"Null for subscriptions that have no corresponding catalog item","nullable":true},"SubscriptionRenewalConfiguration":{"required":["renewalDate"],"type":"object","properties":{"renewalDate":{"type":"string","description":"The first day of the next commitment term","format":"date"},"scheduledQuantity":{"type":"integer","description":"In the absence of a ScheduledQuantity, the subscription will renew with the existing quantity","format":"int32","nullable":true}},"additionalProperties":false,"description":"Null for subscriptions that will not auto-renew at the end of the commitment term","nullable":true},"Subscriptions":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/Subscription"},"nullable":true}},"additionalProperties":false},"SubscriptionsAmendment":{"type":"object","properties":{"subscriptionsAmendmentId":{"type":"string","format":"uuid"}},"additionalProperties":false},"SubscriptionsAmendmentParameter":{"required":["newQuantity","subscriptionId"],"type":"object","properties":{"subscriptionId":{"type":"string","format":"uuid"},"newQuantity":{"type":"integer","format":"int32"}},"additionalProperties":false,"description":"Subscription ID to amend, paired with its new intended quantity."},"SubscriptionsAmendmentStatus":{"enum":["Pending","Processing","Success","Failure","Canceled","PartialSuccess"],"type":"string"}}}} \ No newline at end of file