openapi: 3.0.0 info: title: Momence Public auth member API description: '' version: '2.0' contact: {} servers: - url: https://api.momence.com description: Production API security: - OAuth2: [] OAuth2ApiClient: [] tags: - name: member paths: /api/v2/member/bought-memberships/active: get: operationId: ApiV2MemberBoughtMembershipsController_list summary: Get member active memberships parameters: - name: page required: true in: query description: Starts at 0 schema: minimum: 0 example: 0 type: integer - name: pageSize required: true in: query schema: minimum: 1 maximum: 200 example: 10 type: integer - name: includeFrozen required: false in: query schema: type: boolean responses: '200': content: application/json: schema: allOf: - $ref: '#/components/schemas/PaginatedResponseDto' - required: - payload properties: payload: type: array items: $ref: '#/components/schemas/MemberBoughtMembershipsDto' description: '' tags: - member security: - OAuth2: [] /api/v2/member/bought-memberships/{boughtMembershipId}/membership-freeze: put: operationId: ApiV2MemberBoughtMembershipsController_freezeMembership summary: Freeze bought membership immediately or schedule freeze/unfreeze parameters: - name: boughtMembershipId required: true in: path schema: type: number requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/ApiV2BoughtMembershipFreezeRequestDto' responses: '200': description: '' tags: - member security: - OAuth2: [] /api/v2/member/bought-memberships/{boughtMembershipId}/membership-schedule-freeze: put: operationId: ApiV2MemberBoughtMembershipsController_scheduleMembershipFreeze summary: Schedule bought membership freeze parameters: - name: boughtMembershipId required: true in: path schema: type: number requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/ApiV2BoughtMembershipScheduleFreezeRequestDto' responses: '200': description: '' tags: - member security: - OAuth2: [] delete: operationId: ApiV2MemberBoughtMembershipsController_removeMembershipFreeze summary: Unfreeze bought membership or remove scheduled freeze parameters: - name: boughtMembershipId required: true in: path schema: type: number responses: '200': description: '' tags: - member security: - OAuth2: [] /api/v2/member/bought-memberships/{boughtMembershipId}/membership-schedule-unfreeze: put: operationId: ApiV2MemberBoughtMembershipsController_scheduleMembershipUnfreeze summary: Schedule bought membership unfreeze parameters: - name: boughtMembershipId required: true in: path schema: type: number requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/ApiV2BoughtMembershipScheduleUnfreezeRequestDto' responses: '200': description: '' tags: - member security: - OAuth2: [] delete: operationId: ApiV2MemberBoughtMembershipsController_removeMembershipUnfreeze summary: Remove bought membership scheduled unfreeze parameters: - name: boughtMembershipId required: true in: path schema: type: number responses: '200': description: '' tags: - member security: - OAuth2: [] /api/v2/member: get: operationId: ApiV2MemberController_get summary: Get member info description: Returns general info for the current member parameters: [] responses: '200': content: application/json: schema: $ref: '#/components/schemas/MemberInfoDto' description: '' tags: - member security: - OAuth2: [] put: operationId: ApiV2MemberController_update summary: Update member info description: Changes some user detail, use `/email` endpoint to change email, use `/phone-number` endpoint to change phone number parameters: [] requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/ApiV2MemberUpdateRequestDto' responses: '200': description: '' tags: - member security: - OAuth2: [] /api/v2/member/visits: get: operationId: ApiV2MemberController_getVisits summary: Get member visits description: Returns visits counts for the current member parameters: [] responses: '200': content: application/json: schema: $ref: '#/components/schemas/MemberVisitsDto' description: '' tags: - member security: - OAuth2: [] /api/v2/member/email: put: operationId: ApiV2MemberController_updateEmail summary: Update member email description: Changes user email parameters: [] requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/ApiV2MemberUpdateEmailRequestDto' responses: '200': description: '' tags: - member security: - OAuth2: [] /api/v2/member/phone-number: put: operationId: ApiV2MemberController_updatePhoneNumber summary: Update member phone number description: Changes user phone number parameters: [] requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/ApiV2MemberUpdatePhoneNumberRequestDto' responses: '200': description: '' tags: - member security: - OAuth2: [] delete: operationId: ApiV2MemberController_deletePhoneNumber summary: Delete all phone number records for a member parameters: [] responses: '200': description: '' tags: - member security: - OAuth2: [] /api/v2/member/password-reset-email: post: operationId: ApiV2MemberController_requestPasswordResetEmail summary: Request member password reset description: Requests a new password reset email to be sent to the user parameters: [] responses: '201': description: '' tags: - member security: - OAuth2: [] /api/v2/member/saved-payment-methods: get: operationId: ApiV2MemberSavedPaymentMethodsController_get summary: Get saved member payment methods parameters: [] responses: '200': content: application/json: schema: $ref: '#/components/schemas/ApiV2MemberSavedPaymentMethodsResponseDto' description: '' tags: - member security: - OAuth2: [] post: operationId: ApiV2MemberSavedPaymentMethodsController_post summary: Add member saved payment method description: "This endpoint returns a temporary pre-authenticated URL that allows user to add a payment method. \nRedirect user to that URL, which will allow them to add a payment method using a Momence-hosted app. \nThe URL will be valid for 3600 seconds. \nAfter the user finishes adding the payment method, they will get redirected to the URL provided." parameters: [] requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/ApiV2MemberManagePaymentMethodsRequestDto' responses: '200': content: application/json: schema: $ref: '#/components/schemas/ApiV2MemberManagePaymentMethodsResponseDto' description: '' tags: - member security: - OAuth2: [] /api/v2/member/saved-payment-methods/{savedPaymentMethodId}: delete: operationId: ApiV2MemberSavedPaymentMethodsController_delete summary: Remove member saved payment method description: 'This endpoint allows members to remove their saved payment method. | Error | Description | | --- | --- | | err-active-non-cancellable-subscription | member has an active non-cancellable subscription which prevent the last payment method from being deleted | | err-no-payment-method-found | the specified payment method does not exist |' parameters: - name: savedPaymentMethodId required: true in: path schema: type: number responses: '200': description: '' '400': description: '' content: application/json: schema: $ref: '#/components/schemas/MemberDeleteSavedPaymentMethodErrorResponseDto' tags: - member security: - OAuth2: [] components: schemas: ApiV2BoughtMembershipFreezeRequestDto: type: object properties: freezeType: enum: - not_set - now - scheduled - before_renewal type: string x-enumNames: - NOT_SET - NOW - SCHEDULED - BEFORE_RENEWAL freezeAt: type: string nullable: true format: date-time unfreezeType: enum: - not_set - scheduled type: string x-enumNames: - NOT_SET - SCHEDULED unfreezeAt: type: string nullable: true format: date-time reason: type: string nullable: true required: - freezeType - freezeAt - unfreezeType - unfreezeAt MemberVisitsDto: type: object properties: appointments: type: integer description: All the appointments the customer has booked appointmentsVisits: type: integer description: All the appointments the customer has booked and checked into bookings: type: integer description: All the session bookings the customer has booked bookingsVisits: type: integer description: All the session bookings the customer has booked and checked into openAreaVisits: type: integer description: All visits of open areas for customer total: type: integer description: Combined count of appointments + bookings totalVisits: type: integer description: Combined count of appointmentsVisits + bookingsVisits required: - appointments - appointmentsVisits - bookings - bookingsVisits - openAreaVisits - total - totalVisits MemberInfoDto: type: object properties: id: type: integer firstName: type: string example: John lastName: type: string example: Doe email: type: string example: john.doe@example.com phoneNumber: type: string nullable: true example: '1234567890' pictureUrl: type: string nullable: true example: https://example.com/picture.jpg required: - id - firstName - lastName - email - phoneNumber - pictureUrl ApiV2MemberManagePaymentMethodsResponseDto: type: object properties: addPaymentMethodPageUrl: type: string description: URL to redirect for adding a payment method required: - addPaymentMethodPageUrl ApiV2MemberUpdateEmailRequestDto: type: object properties: email: type: string example: john.doe@example.com required: - email PaginatedResponseDataDto: type: object properties: page: type: integer example: 0 minimum: 0 pageSize: type: integer example: 10 minimum: 1 totalCount: type: integer example: 1 sortBy: type: string sortOrder: type: string enum: - ASC - DESC required: - page - pageSize - totalCount ApiV2MemberUpdateRequestDto: type: object properties: firstName: type: string example: John minLength: 1 maxLength: 100 lastName: type: string example: Doe minLength: 1 maxLength: 100 required: - firstName - lastName ApiV2BoughtMembershipScheduleUnfreezeRequestDto: type: object properties: unfreezeType: enum: - not_set - scheduled type: string x-enumNames: - NOT_SET - SCHEDULED unfreezeAt: type: string nullable: true format: date-time required: - unfreezeType - unfreezeAt ApiV2BoughtMembershipFreezeDto: type: object properties: freezedAt: type: string nullable: true format: date-time unfreezedScheduledAt: type: string nullable: true format: date-time unfrozenAt: type: string nullable: true format: date-time remainingFreezedMinutes: type: integer nullable: true scheduledFreezeAt: type: string nullable: true format: date-time required: - freezedAt - unfreezedScheduledAt - unfrozenAt - remainingFreezedMinutes - scheduledFreezeAt ApiV2MemberSavedPaymentMethodDto: type: object properties: id: type: integer example: 1 type: type: string enum: - card example: card x-enumNames: - CARD last4: type: string nullable: true description: Last 4 digits example: '4242' expiresAt: type: string nullable: true description: Expiration date in YYYY-MM-DD format example: '2022-12-31' required: - id - type - last4 - expiresAt ApiV2MemberManagePaymentMethodsRequestDto: type: object properties: redirectUrl: type: string description: URL to redirect after the add operation is completed redirectUrlOnCancel: type: string description: Optional URL to redirect on cancel required: - redirectUrl ApiV2MemberSavedPaymentMethodsResponseDto: type: object properties: paymentMethods: type: array items: $ref: '#/components/schemas/ApiV2MemberSavedPaymentMethodDto' required: - paymentMethods ApiV2BoughtMembershipDeclinedRenewalDto: type: object properties: declinedAt: type: string format: date-time cardLast4: type: string nullable: true required: - declinedAt - cardLast4 PaginatedResponseDto: type: object properties: pagination: $ref: '#/components/schemas/PaginatedResponseDataDto' required: - pagination MemberBoughtMembershipsDto: type: object properties: id: type: integer example: 1 type: enum: - subscription - on-demand-subscription - package-events - package-money - patron type: string example: subscription x-enumNames: - Subscription - OnDemandSubscription - PackageEvents - PackageMoney - Patron startDate: type: string nullable: true description: start date of the bought membership example: '2021-01-01T00:00:00Z' format: date-time endDate: type: string nullable: true description: expiration date of the bought membership example: '2021-02-01T00:00:00Z' format: date-time isFrozen: type: boolean eventCreditsLeft: type: number nullable: true description: number of event credits left, valid for PACKAGE_EVENTS example: null eventCreditsTotal: type: number nullable: true description: number of event credits originally included in the package, valid for PACKAGE_EVENTS example: null moneyCreditsLeft: type: number nullable: true description: number of money credits left, valid for PACKAGE_MONEY example: null moneyCreditsTotal: type: number nullable: true description: number of money credits originally included in the package, valid for PACKAGE_MONEY example: null usageLimitForSessions: type: number nullable: true description: Non-null value indicates the membership has limit to number of session bookings, only valid for SUBSCRIPTION example: 5 usageLimitForAppointments: type: number nullable: true description: Non-null value indicates the membership has limit to number of appointments booked, only valid for SUBSCRIPTION example: 3 combinedUsageLimit: type: number nullable: true description: Non-null value indicates the membership has combined limits for session and appointment bookings, only valid for SUBSCRIPTION example: null usedSessions: type: number nullable: true description: only valid for SUBSCRIPTION with session-only usage limits example: 1 usedAppointments: type: number nullable: true description: only valid for SUBSCRIPTION with appointment-only usage limits example: 2 combinedUsage: type: number nullable: true description: only valid for SUBSCRIPTION with combined usage limits example: null usageLimitStartDate: type: string nullable: true description: date range for which the current usage is calculated for, only valid for SUBSCRIPTION with usage limits example: null format: date-time usageLimitEndDate: type: string nullable: true description: date range for which the current usage is calculated for, only valid for SUBSCRIPTION with usage limits example: null format: date-time membership: nullable: true description: info about origin membership, it's possible the bought membership has no origin membership allOf: - $ref: '#/components/schemas/HostMembershipBasicDto' freeze: nullable: true description: freeze details, if the membership is frozen or scheduled to freeze/unfreeze allOf: - $ref: '#/components/schemas/ApiV2BoughtMembershipFreezeDto' declinedRenewal: nullable: true description: latest failed renewal payment details for this membership, if any allOf: - $ref: '#/components/schemas/ApiV2BoughtMembershipDeclinedRenewalDto' required: - id - type - startDate - endDate - isFrozen - eventCreditsLeft - eventCreditsTotal - moneyCreditsLeft - moneyCreditsTotal - usageLimitForSessions - usageLimitForAppointments - combinedUsageLimit - usedSessions - usedAppointments - combinedUsage - usageLimitStartDate - usageLimitEndDate - membership - freeze - declinedRenewal ApiV2BoughtMembershipScheduleFreezeRequestDto: type: object properties: freezeType: enum: - not_set - now - scheduled - before_renewal type: string x-enumNames: - NOT_SET - NOW - SCHEDULED - BEFORE_RENEWAL freezeAt: type: string nullable: true format: date-time required: - freezeType - freezeAt HostMembershipBasicDto: type: object properties: id: type: integer example: 5 name: type: string example: Monthly Membership description: type: string nullable: true example: Monthly membership with unlimited access to all classes. type: enum: - subscription - on-demand-subscription - package-events - package-money - patron type: string example: subscription x-enumNames: - Subscription - OnDemandSubscription - PackageEvents - PackageMoney - Patron locationId: type: integer nullable: true example: null disabled: type: boolean description: Indicates that the membership was disabled example: false autoRenewing: type: boolean description: Indicates that membership renews after specific interval example: true minimumAutoRenews: type: integer nullable: true description: How many times membership has to renew before user can cancel renewal example: null eventCredits: type: integer nullable: true description: For PACKAGE_EVENTS memberships, defines how many event credits are included example: null moneyCredits: type: number nullable: true description: For PACKAGE_MONEY memberships, defines how much money is included example: null duration: type: integer nullable: true description: For SUBSCRIPTION this is auto renew duration, for PACKAGE_* this is expiration time example: 1 durationUnit: nullable: true enum: - days - months - years type: string example: months x-enumNames: - DAYS - MONTHS - YEARS isActivatedOnFirstUse: type: boolean description: If set to false, membership is activated upon purchase. When set to true, membership is activated at the moment of the first purchase. When the purchase is for booking in the future, the activation date is set to the booking date. example: false activationDeadlineInDays: type: integer nullable: true description: Only applicable when isActivatedOnFirstUse=true. If set, the member must activate the membership within this many days of purchase or it expires automatically. example: 21 hasFreeTrial: type: boolean example: false freeTrialDurationInDays: type: integer example: 7 contractAgreement: type: string nullable: true example: Contract agreement text order: type: integer example: 1 isIntroOffer: type: boolean example: false usageLimitForSessions: type: number nullable: true description: Only applicable for SUBSCRIPTION. Maximum number of sessions customer can book with this membership during one renewal period, not used when combinedUsageLimitEnabled=true example: 5 usageLimitForAppointments: type: number nullable: true description: Only applicable for SUBSCRIPTION. Maximum number of appointments customer can book with this membership during one renewal period, not used when combinedUsageLimitEnabled=true example: 2 combinedUsageLimitEnabled: type: boolean description: Only applicable for SUBSCRIPTION. The usage limits of the memberships are applied to sum of both bookings and appointments. example: false combinedUsageLimit: type: number nullable: true description: Only applicable for SUBSCRIPTION. Combined maximum number of bookings and appointments customer can book with this membership during one renewal period, only used when combinedUsageLimitEnabled=true example: null usageLimitRenewalEnabled: type: boolean description: Only applicable for SUBSCRIPTION. Calculate usage limits differently to renewal duration. example: false usageLimitRenewalDuration: type: number nullable: true description: Only applicable for SUBSCRIPTION. Interval for which the usage limits are calculated, only used when usageLimitRenewalEnabled=true example: null usageLimitRenewalDurationUnit: nullable: true enum: - days - months - years type: string description: Only applicable for SUBSCRIPTION. Interval for which the usage limits are calculated, only used when usageLimitRenewalEnabled=true example: null x-enumNames: - DAYS - MONTHS - YEARS usageLimitRolloverEnabled: type: boolean description: Only applicable for SUBSCRIPTION. When true and customer doesn't use reach their usage limits, the rest is transferred to the customer according to usageLimitRolloverMode example: false usageLimitRolloverMode: nullable: true enum: - next-renewal - event-credits type: string description: Only applicable for SUBSCRIPTION. How should extra usage limits be transferred to customer, either as package or as addition to next renewal period. Only used when usageLimitRolloverEnabled=true example: null x-enumNames: - NEXT_RENEWAL - EVENT_CREDITS usageLimitRolloverExpirationDuration: type: number nullable: true description: Only applicable for SUBSCRIPTION. When should the extra limits / package expire after rolling over. Only used when usageLimitRolloverEnabled=true example: null usageLimitRolloverExpirationDurationUnit: nullable: true enum: - days - months - years type: string description: Only applicable for SUBSCRIPTION. When should the extra limits / package expire after rolling over. Only used when usageLimitRolloverEnabled=true example: null x-enumNames: - DAYS - MONTHS - YEARS required: - id - name - description - type - locationId - disabled - autoRenewing - minimumAutoRenews - eventCredits - moneyCredits - duration - durationUnit - isActivatedOnFirstUse - activationDeadlineInDays - hasFreeTrial - freeTrialDurationInDays - contractAgreement - order - isIntroOffer - usageLimitForSessions - usageLimitForAppointments - combinedUsageLimitEnabled - combinedUsageLimit - usageLimitRenewalEnabled - usageLimitRenewalDuration - usageLimitRenewalDurationUnit - usageLimitRolloverEnabled - usageLimitRolloverMode - usageLimitRolloverExpirationDuration - usageLimitRolloverExpirationDurationUnit ApiV2MemberUpdatePhoneNumberRequestDto: type: object properties: phoneNumber: type: string example: '1234567890' required: - phoneNumber MemberDeleteSavedPaymentMethodErrorResponseDto: type: object properties: type: enum: - err-active-non-cancellable-subscription - err-no-payment-method-found type: string x-enumNames: - ERR_ACTIVE_NON_CANCELLABLE_SUBSCRIPTION - ERR_NO_PAYMENT_METHOD_FOUND message: type: string required: - type - message securitySchemes: OAuth2: type: oauth2 flows: password: scopes: {} tokenUrl: /api/v2/auth/token authorizationCode: authorizationUrl: /api/v2/auth/authorize tokenUrl: /api/v2/auth/token scopes: {} OAuth2ApiClient: type: http scheme: basic description: Use your `client_id` as username and `client_secret` as password