# Migrate an account Migrate membership from V1 API using old EGYM user id (if already migrated then just returns membership). Endpoint: POST /api/v2/migrate Version: 2.0.0 Security: mms ## Query parameters: - `legacyUserId` (integer, required) ## Response 200 fields (application/json): - `accountId` (string) The EGYM account ID for the Gym Member. - `email` (string, required) The Member email address. It should be unique within the gym chain. - `firstName` (string, required) The Member first name. Example: "John" - `lastName` (string, required) The Member last name. Example: "Wick" - `dateOfBirth` (string) The Member date of birth. format: yyyy-MM-dd - `gender` (string, required) The Member gender. Please note that NON_BINARY is not correctly supported yet, we send it as FEMALE for the usage of the machines. Enum: "MALE", "FEMALE", "NON_BINARY" - `contact` (object) The user's contact information - `contact.phone` (string) The Member telephone number. - `contact.street` (string) Street name in member's address. - `contact.streetNumber` (string) Street number in member's address. - `contact.zipCode` (string) Zip Code in member's address. - `contact.city` (string) City in member's address. - `contact.state` (string) State in member's address. - `contact.country` (string) Country of the member's address in ISO 3166-1 alpha-2. Example: "DE" - `membership` (object, required) The membership details. - `membership.membershipId` (string, required) Member ID in the gym software. It must be unique for exactly one member in the gym chain. - `membership.agreementNumber` (string) The agreement number is the number of the membership between the member and the gym chain. - `membership.membershipType` (string, required) Type of the member's membership to determine available features. Enum: "BASIC", "PREMIUM", "PROSPECT", "CORPORATE_FITNESS" - `membership.membershipSubType` (string) Extension of membershipStatus for further customization for this user. One membershipStatus can have multiple membershipSubType. - `membership.endOfContract` (string) Date when the member's contract ends. For gyms with automatic contract renewal, send the date when the contract would run out, if cancelled. Update the field when the contract was renewed (manually and automatically renewals). format: yyyy-MM-dd - `membership.startOfContract` (string, required) The date when the membership started. format: yyyy-MM-dd - `membership.referringMemberId` (string) MembershipId of the member who referred this member. - `membership.barcode` (string) Member's barcode to check-in in the gym. Can be visualised on the Branded Member App and used for lookup to verify membership. - `membership.verificationTAN` (string) Mandatory when creating new membership of type 'CORPORATE_FITNESS' or when updating membership to 'CORPORATE_FITNESS'. Member's verification TAN. Can be visualised on the Qualitrain Member App and used for Qualitrain Membership verification. - `membership.corporateFitness` (object) The corporate fitness details. These fields are returned only in case membershipType=CORPORATE_FITNESS - `membership.corporateFitness.startTimestamp` (string) The date (in ISO format) when the corporate fitness (Qualitrain/Wellpass) membership will start, in case that is in the future. This field will not be returned in case of an active or past corporate fitness membership. Example: "2021-03-08T18:26:47Z" - `membership.corporateFitness.endTimestamp` (string) The date (in ISO format) when the corporate fitness (Qualitrain/Wellpass) membership ends. This field is only returned in case there is a defined end timestamp for the corporate fitness membership. Example: "2021-03-08T18:26:47Z" ## Response 400 fields (application/json): - `timestamp` (string) The timestamp of the request. - `path` (string) The path requested. - `requestId` (string) The request ID. Example: "de625cf1-1" - `status` (integer) The http status code. - `error` (string) The error. - `errorCode` (string) The static error code. - `message` (string) The message to describe the error. - `fieldErrors` (array) The constraint violations. - `fieldErrors.name` (string) The field name. Example: "age" - `fieldErrors.message` (string) The error message. Example: "Must be greater than 10." - `fieldErrors.rejectedValue` (any) The rejected value. Example: 3 - `metadata` (object) Additional information of the error context ## Response 401 fields (application/json): - `timestamp` (string) The timestamp of the request. - `path` (string) The path requested. - `requestId` (string) The request ID. Example: "de625cf1-1" - `status` (integer) The http status code. - `error` (string) The error. - `errorCode` (string) The static error code. - `message` (string) The message to describe the error. - `fieldErrors` (array) The constraint violations. - `fieldErrors.name` (string) The field name. Example: "age" - `fieldErrors.message` (string) The error message. Example: "Must be greater than 10." - `fieldErrors.rejectedValue` (any) The rejected value. Example: 3 - `metadata` (object) Additional information of the error context ## Response 403 fields (application/json): - `timestamp` (string) The timestamp of the request. - `path` (string) The path requested. - `requestId` (string) The request ID. Example: "de625cf1-1" - `status` (integer) The http status code. - `error` (string) The error. - `errorCode` (string) The static error code. - `message` (string) The message to describe the error. - `fieldErrors` (array) The constraint violations. - `fieldErrors.name` (string) The field name. Example: "age" - `fieldErrors.message` (string) The error message. Example: "Must be greater than 10." - `fieldErrors.rejectedValue` (any) The rejected value. Example: 3 - `metadata` (object) Additional information of the error context ## Response 404 fields (application/json): - `timestamp` (string) The timestamp of the request. - `path` (string) The path requested. - `requestId` (string) The request ID. Example: "de625cf1-1" - `status` (integer) The http status code. - `error` (string) The error. - `errorCode` (string) The static error code. - `message` (string) The message to describe the error. - `fieldErrors` (array) The constraint violations. - `fieldErrors.name` (string) The field name. Example: "age" - `fieldErrors.message` (string) The error message. Example: "Must be greater than 10." - `fieldErrors.rejectedValue` (any) The rejected value. Example: 3 - `metadata` (object) Additional information of the error context ## Response 500 fields (application/json): - `timestamp` (string) The timestamp of the request. - `path` (string) The path requested. - `requestId` (string) The request ID. Example: "de625cf1-1" - `status` (integer) The http status code. - `error` (string) The error. - `errorCode` (string) The static error code. - `message` (string) The message to describe the error. - `fieldErrors` (array) The constraint violations. - `fieldErrors.name` (string) The field name. Example: "age" - `fieldErrors.message` (string) The error message. Example: "Must be greater than 10." - `fieldErrors.rejectedValue` (any) The rejected value. Example: 3 - `metadata` (object) Additional information of the error context