# Customers Get customers and contracts ## Get customers - [GET /v1/customers](https://redocly.sportalliance.com/apis/perfectgym/openapi/openapi/customers/getcustomers.md): Required Scopes: Returns all customers from studio in expected slices ## Get customer's checkin history - [GET /v1/customers/{customerId}/activities/checkins](https://redocly.sportalliance.com/apis/perfectgym/openapi/openapi/customers/getcustomerscheckinhistory.md): Required Scopes: Returns a list of studio checkins of the customer for a specific time span (default is one month from today) in expected slices ## Get customer by id - [GET /v1/customers/{customerId}](https://redocly.sportalliance.com/apis/perfectgym/openapi/openapi/customers/getcustomerbyid.md): Required Scopes: Returns customer by given id ## Get customer by - [GET /v1/customers/by](https://redocly.sportalliance.com/apis/perfectgym/openapi/openapi/customers/getcustomerby.md): Required Scopes: Returns customer by one of the given parameters ## Search customers - [POST /v1/customers/search](https://redocly.sportalliance.com/apis/perfectgym/openapi/openapi/customers/searchcustomers.md): Required Scopes: Returns all customers from studio by given criteria ## Get customer's contracts - [GET /v1/customers/{customerId}/contracts](https://redocly.sportalliance.com/apis/perfectgym/openapi/openapi/customers/getcustomerscontracts.md): Required Scopes(any of): , Returns customer's contracts ## Get customer's measurement - [GET /v1/customers/measurement/latest](https://redocly.sportalliance.com/apis/perfectgym/openapi/openapi/customers/getcustomermeasurement.md): Required Scopes(any of): , Returns customer's latest measurement for specified customer. ## Get customer's contracts by - [GET /v1/customers/contracts/by](https://redocly.sportalliance.com/apis/perfectgym/openapi/openapi/customers/getcustomercontractsby.md): Required Scopes(any of): , Returns customer's contracts by one of the given parameters ## Save weighing results - [POST /v1/customers/{customerId}/weighing](https://redocly.sportalliance.com/apis/perfectgym/openapi/openapi/customers/createcustomerweighing.md): Required Scopes(any of): , Saves weighing details for given customer ## Get customer's benefits - [GET /v1/customers/{customerId}/benefits](https://redocly.sportalliance.com/apis/perfectgym/openapi/openapi/customers/getbenefits.md): Required Scopes(any of): , Returns all customer's benefits ## Get customer's benefits by card number - [GET /v1/customers/benefits](https://redocly.sportalliance.com/apis/perfectgym/openapi/openapi/customers/getbenefitsbycardnumber.md): Required Scopes(any of): , Returns customer's benefits by card number ## Post customer's benefit usage - [POST /v1/customers/{customerId}/benefits/{benefitKey}/use](https://redocly.sportalliance.com/apis/perfectgym/openapi/openapi/customers/usebenefit.md): Required Scopes(any of): , ## Get customer's access code - [GET /v1/customers/{customerId}/access-code](https://redocly.sportalliance.com/apis/perfectgym/openapi/openapi/customers/getcustomeraccesscode.md): Required Scopes: Returns customer's access code ## Add a new access medium to a customer - [POST /v1/customers/{customerId}/access-mediums](https://redocly.sportalliance.com/apis/perfectgym/openapi/openapi/customers/addaccessmediums.md): Required Scopes: Returns the newly added access medium ## Update customer's access medium - [PUT /v1/customers/{customerId}/access-mediums/{accessMediumId}](https://redocly.sportalliance.com/apis/perfectgym/openapi/openapi/customers/updateaccessmediums.md): Required Scopes: Updates the customer's access medium. Only previously created mediums may be updated. ## Delete customer's access medium - [DELETE /v1/customers/{customerId}/access-mediums/{accessMediumId}](https://redocly.sportalliance.com/apis/perfectgym/openapi/openapi/customers/deleteaccessmediums.md): Required Scopes: Deletes the customer's access medium. Only previously created mediums may be deleted. ## Returns all documents for a customer - [GET /v1/customers/{customerId}/documents](https://redocly.sportalliance.com/apis/perfectgym/openapi/openapi/customers/getdocuments.md): Required Scopes: Returns all documents for a customer ## Upload new document to a customer - [POST /v1/customers/{customerId}/documents](https://redocly.sportalliance.com/apis/perfectgym/openapi/openapi/customers/uploaddocument.md): Required Scopes: Returns the newly uploaded document information ## Returns document for a customer - [GET /v1/customers/{customerId}/documents/{id}](https://redocly.sportalliance.com/apis/perfectgym/openapi/openapi/customers/getdocumentbyid.md): Required Scopes: Returns document for a customer ## Update customer profile image - [PUT /v1/customers/{customerId}/images](https://redocly.sportalliance.com/apis/perfectgym/openapi/openapi/customers/updateimage.md): Required Scopes: Updates customer profile image. The image will be rescaled(1200x1200) and converted to mime type . ## Set customer's access restriction - [PUT /v1/customers/{customerId}/access-restrictions](https://redocly.sportalliance.com/apis/perfectgym/openapi/openapi/customers/setaccessrestriction.md): Required Scopes: Creates or updates access restriction for the customer. If the customer already has an access restriction, it will be updated with the provided data. Only previously created restrictions may be updated. If no such restriction exists, it will be created. It is necessary to provide either both and or neither of them. ## Delete customer's access restriction - [DELETE /v1/customers/{customerId}/access-restrictions](https://redocly.sportalliance.com/apis/perfectgym/openapi/openapi/customers/deleteaccessrestriction.md): Required Scopes: Deletes the customer's access restriction. Only previously created restrictions may be deleted. ## Create customer - [POST /v1/customers/create](https://redocly.sportalliance.com/apis/perfectgym/openapi/openapi/customers/createcustomer.md): Required Scopes: Creates a new customer (prospect) with comprehensive data to allow for future conversion to a full member ## Get additional information fields - [GET /v1/customers/additional-information-fields](https://redocly.sportalliance.com/apis/perfectgym/openapi/openapi/customers/getadditionalinformationfields.md): Required Scopes: Returns additional information fields available for assignment to customers. ## Sets additional information field assignments - [PUT /v1/customers/{customerId}/additional-information-field-assignments](https://redocly.sportalliance.com/apis/perfectgym/openapi/openapi/customers/setadditionalinformationfieldassignments.md): Required Scopes: Sets additional information field assignments for a customer. We overwrite existing values, so you need to provide all field assignments that you want to set. If you want to remove a field assignment, don't add it. ## Switch studio - [POST /v1/customers/{customerId}/switch-studio](https://redocly.sportalliance.com/apis/perfectgym/openapi/openapi/customers/switchstudio.md): Required Scopes: Switches the studio of the given customer to the specified target studio. The API key of the customer's source studio must be used for this request. ## Add a new access medium to a customer (deprecated) - [PUT /v1/customers/{customerId}/access-medium](https://redocly.sportalliance.com/apis/perfectgym/openapi/openapi/customers/addaccessmedium.md): Required Scopes: Returns the newly added access medium