Payment plans
Payment plan represents information about membership fees and payment schedule. Each user to complete club joining process must select membarship type and accompanying payment plan. Each payment plan is asigned to exactly one membership type. Payment plan may be limited to:
- Employee role
- Clubs
Payment plan is a summary representation of single payment plan in your company.
- Payment plan properties
- List payment plan with timestamp
- List payment plans available in a given club
- Pro rata payment calculation
Payment plan properties
Payment plan is described by the following properties
Name | Type | Description |
---|---|---|
id |
long |
Unique identifier of payment plan. |
timestamp |
long |
Timestamp. Indicates when resource was last modified. |
name |
string |
payment plan name. |
isActive |
bool |
Indicates if payment plan is marked as active. |
isAddOnPaymentPlan |
bool |
Indicates if payment plan is marked as add on payment plan. |
isDeleted |
bool |
Indicates if resource is deleted. |
List payment plan with timestamp
GET PaymentPlans/PaymentPlans
Returns paginated payment plans list.
Parameters
Name | Type | Description |
---|---|---|
timestamp |
long |
Timestamp. Request returns payment plans with timestamp grater then timestamp , defaults to 0 . |
isActive |
bool |
Indictes if payment plan is marked as active, defaults to false . |
startDate |
datetime |
Request returns payment plans with start date grater then startDate , defaults to 1753-1-1 . |
endDate |
datetime |
Request returns payment plans with end date lower then endDate , defaults to 9999-12-13 . |
Example request
In this example we fetch list of all payment plans (timestamp
parameter defaults to 0
)
available in a company.
curl -i -X GET -H "Authorization: Bearer $ACCESS_TOKEN" http://yoursubdomain.perfectgym.com/Api/PaymentPlans/PaymentPlans?timestamp=0
Example response
Status: 200 OK
{
"elements": [
{
"id": 41,
"timestamp": 447620,
"name": "Open 3m",
"isActive": true,
"isAddOnPaymentPlan": false,
"isDeleted": false
},
{
"id": 42,
"timestamp": 447621,
"name": "Open 6m",
"isActive": true,
"isAddOnPaymentPlan": false,
"isDeleted": false
},
{
"id": 43,
"timestamp": 447622,
"name": "Open 12m",
"isActive": true,
"isAddOnPaymentPlan": false,
"isDeleted": false
},
{
"id": 44,
"timestamp": 447623,
"name": "Open 24m",
"isActive": true,
"isAddOnPaymentPlan": false,
"isDeleted": false
}
]
}
List payment plans available in a given club
GET PaymentPlans/PaymentPlans
Returns paginated payment plans list available in given club.
Parameters
Name | Type | Description |
---|---|---|
clubId |
long |
Required. Club identifier. |
addOnPaymentPlans |
bool |
If true requests returns only add on payment plans, if false request returns only payment plans that are not marked as add on plans. Parameter defaults to false . |
channel |
string |
Payment plan availability channel. Request will return only payment plans that are available via given channel. |
page |
int |
Page number, defaults to 1 . |
startDate |
datetime |
Request returns payment plans with start date grater then startDate , defaults to 1753-1-1 . |
endDate |
datetime |
Request returns payment plans with end date lower then endDate , defaults to 9999-12-13 . |
Example request
In this example we fetch list of all payment plans available in club identified with clubId
= 16
.
curl -i -X GET -H "Authorization: Bearer $ACCESS_TOKEN" http://yoursubdomain.perfectgym.com/Api/PaymentPlans/PaymentPlans ?clubId=16
Example response
Status: 200 OK
{
"elements": [
{
"id": 41,
"timestamp": 447620,
"name": "Open 3m",
"isActive": true,
"isAddOnPaymentPlan": false,
"isDeleted": false
},
{
"id": 42,
"timestamp": 447621,
"name": "Open 6m",
"isActive": true,
"isAddOnPaymentPlan": false,
"isDeleted": false
},
{
"id": 43,
"timestamp": 447622,
"name": "Open 12m",
"isActive": true,
"isAddOnPaymentPlan": false,
"isDeleted": false
},
{
"id": 44,
"timestamp": 447623,
"name": "Open 24m",
"isActive": true,
"isAddOnPaymentPlan": false,
"isDeleted": false
}
]
}
Pro rata payment calculation
GET PaymentPlans/ProrataCalculation
Returns calculation of pro rata payment.
Parameters
Name | Type | Description |
---|---|---|
paymentPlanId |
long |
Required. Payment plan identifier. |
startDate |
datetime |
Required. Calculation start date. |
paymentSource |
string |
Required. Payment source (DirectDebit, CreditCard, Cash). |
discountIds |
array |
An array of discounts idenifiers to applay. |
Example request
curl -i -X GET -H "Authorization: Bearer $ACCESS_TOKEN" http://yoursubdomain.perfectgym.com/Api/PaymentPlans/ProrataCalculation ?paymentPlanId=1&startDate=2016-01-01&paymentSource=Cash
Example response
Status: 200 OK
{
"elements": [
{
"amountTotal": "125",
"daysProratedCountTotal": "30",
"firstInstallmentDate": "2016-06-23T00:00:00",
"firstMonthAmount": "0",
"firstMonthDaysProratedCount": "0",
"isDiscounted": "False",
"nextMonthsAmount": "125",
"nextMonthsDaysProratedCount": "30",
"recurringFeeStartDate": "2016-07-01T00:00:00"
}
]
}