New API available - faster and more powerful!

Check it out!
Perfect Gym api
Deprecated - API v1 will be switched off on 01.07.2022. Please upgrade to API v2

Discounts

Each user to complete club joining process must select membarship type and accompanying payment plan. User may also be eligible for discount. Discounts are applied to payment plan fees and may be limited to:

Discount is a summary representation of single discount in your company.

Discount properties

Payment plan is described by the following properties

Name Type Description
id long Unique identifier of discount.
isActive bool Indicates if discount is marked as active.
name string Discount name.
administartionFeeDiscountType string Administration fee discount type. Possible unit values :
  • PercentDiscount - discount by percentage
  • ValueDiscount - discount by value
  • FixedValueDiscount - fixed value
  • None - no discount
  • Unknown - unknown discount type
joiningFeeDiscountType string Joining fee discount type. Possible unit values :
  • PercentDiscount - discount by percentage
  • ValueDiscount - discount by value
  • FixedValueDiscount - fixed value
  • None - no discount
  • Unknown - unknown discount type
membershipFeeDiscountType string Membership fee discount type. Possible unit values :
  • PercentDiscount - discount by percentage
  • ValueDiscount - discount by value
  • FixedValueDiscount - fixed value
  • None - no discount
  • Unknown - unknown discount type
administartionFeeDiscountValue string Administration fee discount value.
joiningFeeDiscountValue string Joining fee discount value.
membershipFeeDiscountValue string Membership fee discount value.
combineDiscounts array An array of [Discount] objects.

List available discounts for a given payment plan alt text

GET Discounts/Discounts

Returns paginated discounts list available for a given payment plan.

Parameters

Name Type Description
paymentPlanId long Required. Payment plan identifier.
clubId long Required. Club id. Request returns discounts available in club identified by clubId.
date datetime Request returns discounts available in a given day. Defaults to now.
channel string Discount availability channel. Request will return only discounts that are available via given channel.
page int Page number, defaults to 1.

Example request

In this example we fetch list of discounts available for payment plan with paymentPlanId = 39 and for club with clubId = 16. All discounts are available for today (no date parameter provided)

curl -i 
     -X GET 
     -H "Authorization: Bearer  $ACCESS_TOKEN"  
     http://yoursubdomain.perfectgym.com/Api/Discounts/Discounts
        ?paymentPlanId=39
        &clubId=16

Example response

Status: 200 OK
{
  "elements": [
    {
      "id": 10,
      "isActive": true,
      "name": "50%",
      "administartionFeeDiscountType": "ValueDiscount",
      "joiningFeeDiscountType": "None",
      "membershipFeeDiscountType": "PercentDiscount",
      "administartionFeeDiscountValue": 0,
      "joiningFeeDiscountValue": "",
      "membershipFeeDiscountValue": 50,
      "combineDiscounts": [
        {
          "id": 1,
          "isActive": true,
          "name": "50%",
          "administartionFeeDiscountType": "ValueDiscount",
          "joiningFeeDiscountType": "None",
          "membershipFeeDiscountType": "PercentDiscount",
          "administartionFeeDiscountValue": 0,
          "joiningFeeDiscountValue": "",
          "membershipFeeDiscountValue": 30
        }
      ]
    }
  ]
}

Retrive discounted fees for given payment plan alt text

GET Discounts/DiscountedFees

Returns discounted fees for given payment plan.

Parameters

Name Type Description
paymentPlanId long Required. Payment plan identifier.
discountIds array Required. An array of discounts idenifiers to applay. Request returns payment plan fees with cumulative discounts identified with discountIds applied.
date datetime Request returns discounts available in a given day. Defaults to now.

Example request

In this example we fetch payment plan fees with discount with id = 10 applied.

curl -i 
     -X GET 
     -H "Authorization: Bearer  $ACCESS_TOKEN"  
     http://yoursubdomain.perfectgym.com/Api/Discounts/DiscountedFees
        ?paymentPlanId=39
        &discountIds=10

Example response

Status: 200 OK
{
  "elements": [
    {
      "joiningFee": {
        "net": 0,
        "tax": 0,
        "taxRate": 23,
        "gross": 0
      },
      "administarationFee": {
        "net": 15.45,
        "tax": 3.55,
        "taxRate": 23,
        "gross": 19
      },
      "membershipFee": {
        "net": 8.09,
        "tax": 1.86,
        "taxRate": 23,
        "gross": 9.95
      },
      "freezFee": {
        "net": 0,
        "tax": 0,
        "taxRate": 23,
        "gross": 0
      }
    }
  ]
}
Perfect Gym api