ClubReady Api

<back to all web services

CalculatePaymentPlanRequest

The following routes are available for this service:
GET/sales/packages/{PackageId}/installments/calculate/{InstallmentPlanId}Get customer's billing status
Imports System
Imports System.Collections
Imports System.Collections.Generic
Imports System.Runtime.Serialization
Imports ServiceStack
Imports ServiceStack.DataAnnotations
Imports ClubReady.Web.Api.Sales.Model
Imports ClubReady.Core.Api.Models
Imports ClubReady.Web.Api

Namespace Global

    Namespace ClubReady.Core.Api.Models

        Public Partial Class ApiDtoBase
            Public Overridable Property ApiKey As String
            Public Overridable Property StoreId As Nullable(Of Integer)
            Public Overridable Property ChainId As Nullable(Of Integer)
        End Class

        Public Partial Class CalculatePaymentPlanRequestDto
            Inherits ApiDtoBase
            Public Overridable Property InstallmentPlanId As Integer
            Public Overridable Property PackageId As Integer
            Public Overridable Property StartDate As Nullable(Of Date)
            Public Overridable Property PromoCode As String
        End Class

        Public Partial Class CalculatePaymentPlanResultDto
            Public Sub New()
                Payments = New List(Of PaymentPlanInstallment)
                Fees = New List(Of PaymentPlanInstallment)
            End Sub

            Public Overridable Property PlanTotal As String
            Public Overridable Property SubTotal As String
            Public Overridable Property TaxRate As Nullable(Of Single)
            Public Overridable Property EnhancementFee As String
            Public Overridable Property EnhancementFeeTaxAmount As String
            Public Overridable Property TaxEnhFee As Boolean
            Public Overridable Property Tax As String
            Public Overridable Property TotalDueToday As String
            Public Overridable Property Payments As List(Of PaymentPlanInstallment)
            Public Overridable Property Fees As List(Of PaymentPlanInstallment)
            Public Overridable Property IsEvergreen As Boolean
            Public Overridable Property RequirePaymentProfile As Boolean
        End Class

        Public Partial Class PaymentPlanInstallment
            Public Overridable Property PayToday As Boolean
            Public Overridable Property Amount As Decimal
            Public Overridable Property Taxed As Boolean
            Public Overridable Property TaxRate As Nullable(Of Single)
            Public Overridable Property TaxAmount As Nullable(Of Decimal)
            Public Overridable Property FeeName As String
            Public Overridable Property DueDate As Date
            Public Overridable Property Total As String
            Public Overridable Property SetupFeeId As Nullable(Of Integer)
        End Class
    End Namespace

    Namespace ClubReady.Web.Api

        Public Enum RestrictedResourceType
            Store
            Chain
            User
            Undefined
        End Enum
    End Namespace

    Namespace ClubReady.Web.Api.Sales.Model

        Public Partial Class CalculatePaymentPlanRequest
            Inherits CalculatePaymentPlanRequestDto
            Implements IRestrictedApiRequest
            '''<Summary>
            '''Api Key - grants access to resources
            '''</Summary>
            <ApiMember(DataType:="string", Description:="Api Key - grants access to resources", IsRequired:=true, Name:="ApiKey", ParameterType:="query")>
            Public Overridable Property ApiKey As String

            '''<Summary>
            '''ID # of store to calculate plan for
            '''</Summary>
            <ApiMember(DataType:="integer", Description:="ID # of store to calculate plan for", IsRequired:=true, Name:="StoreId", ParameterType:="query")>
            Public Overridable Property StoreId As Nullable(Of Integer)

            '''<Summary>
            '''Installment Plan to calculate a scheduel for
            '''</Summary>
            <ApiMember(DataType:="integer", Description:="Installment Plan to calculate a scheduel for", IsRequired:=true, Name:="InstallmentPlanId", ParameterType:="path")>
            Public Overridable Property InstallmentPlanId As Integer

            '''<Summary>
            '''The package to calculate for
            '''</Summary>
            <ApiMember(DataType:="integer", Description:="The package to calculate for", IsRequired:=true, Name:="PackageId", ParameterType:="path")>
            Public Overridable Property PackageId As Integer

            '''<Summary>
            '''Date to calculate schedule from. If not provided, will use today.
            '''</Summary>
            <ApiMember(DataType:="datetime", Description:="Date to calculate schedule from. If not provided, will use today.", Name:="StartDate", ParameterType:="query")>
            Public Overridable Property StartDate As Nullable(Of Date)

            '''<Summary>
            '''Promo code to apply a discount.
            '''</Summary>
            <ApiMember(DataType:="string", Description:="Promo code to apply a discount.", Name:="PromoCode", ParameterType:="query")>
            Public Overridable Property PromoCode As String

            Public Overridable Property RestrictedId As Nullable(Of Integer)
            Public Overridable Property RestrictedResourceType As RestrictedResourceType
        End Class
    End Namespace
End Namespace

VB.NET CalculatePaymentPlanRequest DTOs

To override the Content-type in your clients, use the HTTP Accept Header, append the .xml suffix or ?format=xml

HTTP + XML

The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.

GET /sales/packages/{PackageId}/installments/calculate/{InstallmentPlanId} HTTP/1.1 
Host: www.clubready.com 
Accept: application/xml
HTTP/1.1 200 OK
Content-Type: application/xml
Content-Length: length

<CalculatePaymentPlanResultDto xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/ClubReady.Core.Api.Models">
  <EnhancementFee>String</EnhancementFee>
  <Fees>
    <PaymentPlanInstallment>
      <Amount>0</Amount>
      <DueDate>0001-01-01T00:00:00</DueDate>
      <FeeName>String</FeeName>
      <PayToday>false</PayToday>
      <SetupFeeId>0</SetupFeeId>
      <TaxRate>0</TaxRate>
      <Taxed>false</Taxed>
    </PaymentPlanInstallment>
  </Fees>
  <IsEvergreen>false</IsEvergreen>
  <Payments>
    <PaymentPlanInstallment>
      <Amount>0</Amount>
      <DueDate>0001-01-01T00:00:00</DueDate>
      <FeeName>String</FeeName>
      <PayToday>false</PayToday>
      <SetupFeeId>0</SetupFeeId>
      <TaxRate>0</TaxRate>
      <Taxed>false</Taxed>
    </PaymentPlanInstallment>
  </Payments>
  <TaxEnhFee>false</TaxEnhFee>
  <TaxRate>0</TaxRate>
</CalculatePaymentPlanResultDto>