Deprecated - API v1 will be switched off on 01.07.2022. Please upgrade to API v2
Contract details
Contract details is detaild representation of single user contract.
- Contract details properties
- Retrieve detailed information about specific user contract
- Retrieve detailed information about all contracts
Contract details properties
Contract details holds the same data as Contract plus some detailed features of a contract. Only contract details specyfic properties are described here.
Name | Type | Description |
---|---|---|
isCurrent |
bool |
true if contract is user's current contract, false otherwise. |
status |
string |
Contract status. Possible values:
|
documentUrl |
string |
URL to contract agreement PDF file signed by user (for details see contract agreement signing). |
membership |
Membership | Contract's membership. |
paymentPlan |
Payment paln | Contract's payment plan. |
discounts |
array |
An array of discount objects representing discounts applied to contract. |
freezes |
array |
An array of freeze objects representing freezes applied to contract. |
Retrieve detailed information about specific user contract
GET Contracts/Contract
Returns detailed user contract informations.
Parameters
Name | Type | Description |
---|---|---|
contractId |
long |
Required. Contract identifier. |
Example request
In this example we fetch user contract with id
= 10358
detailed information.
curl -i -X GET -H "Authorization: Bearer $ACCESS_TOKEN" http://yoursubdomain.perfectgym.com/Api/Contracts/Contract?contractId=10358
Example response
Status: 200 OK
{
"elements": [
{
"id": 10358,
"timestamp": 350287,
"signUpDate": "2016-01-26T00:00:00",
"startDate": "2016-01-26T00:00:00",
"cancelDate": "",
"endDate": "",
"membership": {
"id": 1,
"timestamp": 349423,
"name": "Open",
"isActive": true,
"isDeleted": false
},
"paymentPlan": {
"id": 44,
"timestamp": 447623,
"name": "Open 24m",
"isActive": true,
"isAddOnPaymentPlan": false,
"isDeleted": false
},
"discounts": [
{
"id": 10,
"isActive": true,
"name": "50%",
"administartionFeeDiscountType": "ValueDiscount",
"joiningFeeDiscountType": "None",
"membershipFeeDiscountType": "PercentDiscount",
"administartionFeeDiscountValue": 0,
"joiningFeeDiscountValue": "",
"membershipFeeDiscountValue": 50
}
],
"freezes": [
],
"status": "Current",
"isCurrent": true,
"isActive": true,
"isDeleted": false
}
]
}
Retrieve detailed information about all contracts
GET Contracts/Contracts
Returns detailed contracts informations.
Parameters
Name | Type | Description |
---|---|---|
timestamp |
long |
Timestamp. Request returns contracts with timestamp grater then timestamp , defaults to 0 . |
page |
int |
The desired page number (1-based index). Page size is 100. Default to 1. |
Example request
In this example we fetch contracts with timestamp
greater then 454000
.
curl -i -X GET -H "Authorization: Bearer $ACCESS_TOKEN" http://yoursubdomain.perfectgym.com/Api/Contracts/Contracts?timestamp=454000