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

User credit card

This API lets you assign credit card to a club user.

Assign credit card to a club user alt text

POST Users/CreditCard

Request assigns a credit card to existing club user and selects it as current payment method.

Parameters

Name Type Description
userId long Required. User identifier. Request assigns new credit card to user identified by userId.

Body parameters

Name Type Description
bankName string Name of credit card issuer
cardNumber string Credit card number.
expirationYear int Credit card expiration year.
expirationMonth int Credit card expiration month.
addressCity string Card holder city name.
addressLine string Card holder address.
addressZipCode string Card holder zip code.
cardHolderName string Card holder name.
cvcCvv string Card CVC / CVV.

Response

User details representing user credit card was assigned to.

Example request

In this example we assign credit card to a user with id = 236.


curl -X POST 
     -H "Authorization: Bearer $ACCESS_TOKEN" 
     -H "Content-Type: application/json" 
     -d '{
        "bankName": "Bank",
        "cardNumber": "5555555555554444",
        "expirationYear": 2016,
        "expirationMonth": 12,
        "addressCity": "Warsaw",
        "addressLine": "ul. Przyczolkowa 334",
        "addressZipCode": "02-962",
        "cardHolderName": "John Fibo",
        "cvcCvv": "000"    
    }' 
    http://yoursubdomain.perfectgym.com/Api/Users/CreditCard?userId=236

Example response

Status: 200 OK
{
  "elements": [
    {
      "id": 236,
      "timestamp": 448035,
      "personalId": "80010101234",
      "number": "2b7b02df-08ae-4720-a3ce-a594bfc46d47",
      "cardNumber": "",
      "firstName": "John",
      "lastName": "Fibo",
      "email": "john.fibo@perfectgym.pl",
      "emailAddressIsConfirmed": false,
      "phoneNumber": "0048123456789",
      "idCardName": "Passport",
      "idCardNumber": "ABC 123456",
      "legalGuardian": "",
      "photoUrl": "",
      "coverPhotoUrl": "",
      "birthDate": "1978-06-01T00:00:00",
      "isForeigner": false,
      "sex": "Male",
      "newsletterAgreement": false,
      "termsAndConditionsAgreement": false,
      "address": {
        "country": "Poland",
        "city": "Warszawa",
        "postalCode": "02-962",
        "line1": "ul. Przyczolkowa 334",
        "line2": ""
      },
      "directDebit": {
        "accountNumber": "",
        "ownerName": "",
        "street": "",
        "cityAndPostalCode": "",
        "documentUrl": ""
      },
      "homeClubId": 12,
      "registeredAtClubId": "",
      "isActive": true,
      "isDeleted": false,
      "contracts": [
        {
          "id": 10358,
          "timestamp": 350287,
          "signUpDate": "2016-01-26T00:00:00",
          "startDate": "2016-01-26T00:00:00",
          "cancelDate": "",
          "endDate": "",
          "isCurrent": true,
          "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
            }
          ],
          "documentUrl": "http://yoursubdomain.perfectgym.com/Api/Files/Files?fileId=120",
          "isActive": true,
          "isDeleted": false
        }
      ]
    }
  ]
}
Perfect Gym api