{"templateId":"markdown","sharedDataIds":{},"props":{"metadata":{"markdoc":{"tagList":["admonition"]},"type":"markdown"},"seo":{"title":"Pay with Wellpass: API reference","description":"Gateway to technical documentation for EGYM Platform."},"dynamicMarkdocComponents":[],"compilationErrors":[],"ast":{"$$mdtype":"Tag","name":"article","attributes":{},"children":[{"$$mdtype":"Tag","name":"Heading","attributes":{"level":1,"id":"pay-with-wellpass-api-reference","__idx":0},"children":["Pay with Wellpass: API reference"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["See the ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/wellpass/pay-with-wellpass/apis/pay-with-wellpass"},"children":["OpenAPI specification"]}," for request schemas, response payloads, and HTTP error responses. The guide below explains the integration flow and business error codes."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["This guide explains how to connect your booking website to ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Pay with Wellpass"]},", so Wellpass members can pay for classes and sessions on your platform using booking codes from their Wellpass app. It covers validating a code, confirming a booking, cancelling a booking, handling errors, and testing your integration in the sandbox."]},{"$$mdtype":"Tag","name":"Admonition","attributes":{"type":"warning","name":"Geographic availability"},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["This integration is currently only available in France and Belgium."]}]},{"$$mdtype":"Tag","name":"Admonition","attributes":{"type":"info","name":"Who is this guide for?"},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["This API reference is for ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["booking platform partners"]},". These are websites and apps where users book classes at gyms and studios. Use this API to let Wellpass users book directly on the partner platform."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["The main use cases are services that Wellpass class booking does not cover, for example tournaments and court booking."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["This payment flow is separate from ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/wellpass/admission/overview"},"children":["Wellpass Admission"]},". Wellpass Admission is for gym management system vendors."]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"what-is-pay-with-wellpass","__idx":1},"children":["What is Pay with Wellpass?"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Wellpass is a corporate fitness program that lets employees access a network of gyms and studios as part of their employer's health benefits. With ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Pay with Wellpass"]},", a member pays for a single class on your booking website using a ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["booking code"]},": a single-use code the member generates in their Wellpass app for a specific gym, paid with their Wellpass credits."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"key-concepts","__idx":2},"children":["Key concepts"]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Booking code:"]}," a single-use code generated by the member in the Wellpass app. It is tied to one gym and expires if not used."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["clubId"]},":"]}," the identifier of the gym location the class takes place at. You receive the ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["clubId"]}," values for your connected gyms during onboarding."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Dry run:"]}," the same endpoint both validates and redeems a code. With ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["dryRun: true"]}," the code is only ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"#validate-a-code"},"children":["validated"]},"; with ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["dryRun: false"]}," the code is ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"#confirm-a-booking"},"children":["redeemed and the booking is created"]},"."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Payout:"]}," the amount confirmed in the validation response. It reflects the accepted class price."]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"the-user-journey","__idx":3},"children":["The user journey"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["How the user interacts with your platform is up to you. This is the part of the journey that involves the Pay with Wellpass API:"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"header":{"controls":{"copy":{}}},"source":"User generates a booking code in the Wellpass app (for a specific gym)\n         ↓\nUser books a class on your platform, paying with the code\nand the email address they use with Wellpass\n         ↓\nYour system validates the code (validate, dryRun: true)\n         ↓\nYour system confirms the booking (validate, dryRun: false)\n         ↓\nThe code is redeemed and the member's credits are charged\n"},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"authentication","__idx":4},"children":["Authentication"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["All requests go through the ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["EGYM partner gateway"]},", the single entry point for partner integrations. The ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["{baseUrl}"]}," used throughout this guide is the gateway's address: the gateway authenticates your request first and then forwards it to the Pay with Wellpass service, so you never call that service directly."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Requests are authenticated with an API key sent in the ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["Authorization"]}," request header as a ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["Bearer"]}," token. API keys are issued per partner and can be retrieved through the EGYM Partner Integration Portal after onboarding. Keep your keys secure and never expose them in client-side code."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Only HTTPS is supported. Requests made over plain HTTP will fail."]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"bash","header":{"controls":{"copy":{}}},"source":"curl -X POST \"{baseUrl}/rest/paymentmethod/validate\" \\\n  -H \"Authorization: Bearer YOUR_API_KEY\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{ ... }'\n","lang":"bash"},"children":[]},{"$$mdtype":"Tag","name":"Admonition","attributes":{"type":"warning","name":"Base URL"},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["{baseUrl}"]}," is a placeholder. You will receive the base URLs during onboarding."]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"validate-a-code","__idx":5},"children":["Validate a code"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["The user needs to generate a code in the Wellpass app. Before creating a reservation, verify that the user's booking code is valid for the selected class. Call the validate endpoint with ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["dryRun: true"]},". This validates the code ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["without redeeming it"]}," (without creating a reservation/booking)."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["POST {baseUrl}/rest/paymentmethod/validate"]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"request-fields","__idx":6},"children":["Request fields"]},{"$$mdtype":"Tag","name":"div","attributes":{"className":"md-table-wrapper"},"children":[{"$$mdtype":"Tag","name":"table","attributes":{"className":"md"},"children":[{"$$mdtype":"Tag","name":"thead","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Field"},"children":["Field"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Type"},"children":["Type"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Required"},"children":["Required"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Description"},"children":["Description"]}]}]},{"$$mdtype":"Tag","name":"tbody","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["code"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["string"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["yes"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["The booking code the user generated in the Wellpass app."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["price"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["number"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["yes"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["The price of the class-session. Must be greater than ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["0"]},", e.g. ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["12.50"]},"."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["startDate"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["string (ISO 8601)"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["yes"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Start date and time of the class, e.g. ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["2030-07-15T10:00:00Z"]},". Must be in the future (a tolerance of 5 minutes in the past is allowed)."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["duration"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["integer"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["yes"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Duration of the class in minutes. Must be positive, e.g. ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["60"]},"."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["clubId"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["string"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["yes"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Identifier of the gym location where the class takes place."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["email"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["string"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["yes"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["The email address the user has registered with Wellpass."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["dryRun"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["boolean"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["yes"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["true"]}," to only validate the code. ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["false"]}," to redeem it and create the booking."]}]}]}]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"example-validate-a-code","__idx":7},"children":["Example: validate a code"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"bash","header":{"controls":{"copy":{}}},"source":"curl -X POST \"{baseUrl}/rest/paymentmethod/validate\" \\\n  -H \"Authorization: Bearer YOUR_API_KEY\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\n    \"code\": \"ABC123XYZ\",\n    \"price\": 12.50,\n    \"startDate\": \"2030-07-15T10:00:00Z\",\n    \"duration\": 60,\n    \"clubId\": \"your-club-id\",\n    \"email\": \"jane.doe@company.com\",\n    \"dryRun\": true\n  }'\n","lang":"bash"},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"successful-response-200-ok","__idx":8},"children":["Successful response: ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["200 OK"]}]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"json","header":{"controls":{"copy":{}}},"source":"{\n  \"data\": {\n    \"payout\": 12.5,\n    \"customer\": {\n      \"firstname\": \"Jane\",\n      \"lastname\": \"Doe\"\n    },\n    \"gym\": {\n      \"name\": \"Example Gym Berlin\"\n    }\n  }\n}\n","lang":"json"},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["You can use the returned customer name and gym name, for example, to let the user confirm the details before you complete the booking."]},{"$$mdtype":"Tag","name":"Admonition","attributes":{"type":"info","name":"What is validated?"},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["A successful dry run confirms that: the code exists, has not been redeemed or expired, and belongs to the given gym; the email matches the owner of the code; the price does not exceed the maximum allowed for the gym; and the user has no other bookings overlapping with the class time."]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"confirm-a-booking","__idx":9},"children":["Confirm a booking"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["To redeem the code and create the reservation, send the ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["same request"]}," as for ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"#validate-a-code"},"children":["validating a code"]}," with ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["dryRun: false"]},"."]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"bash","header":{"controls":{"copy":{}}},"source":"curl -X POST \"{baseUrl}/rest/paymentmethod/validate\" \\\n  -H \"Authorization: Bearer YOUR_API_KEY\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\n    \"code\": \"ABC123XYZ\",\n    \"price\": 12.50,\n    \"startDate\": \"2030-07-15T10:00:00Z\",\n    \"duration\": 60,\n    \"clubId\": \"your-club-id\",\n    \"email\": \"jane.doe@company.com\",\n    \"dryRun\": false\n  }'\n","lang":"bash"},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["On success the response has the same shape as the dry run (",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["200 OK"]}," with ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["payout"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["customer"]}," and ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["gym"]},"). At this point:"]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["The booking code is ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["redeemed"]}," and cannot be used again."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["The booking is created and the member's Wellpass credits are charged (if applicable)."]}]},{"$$mdtype":"Tag","name":"Admonition","attributes":{"type":"warning","name":"Always dry run first"},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["All validations are executed again when you confirm with ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["dryRun: false"]},", so a booking that passed the dry run can still fail on confirmation (for example, if the code was redeemed elsewhere in the meantime). Handle errors on both calls."]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"cancel-a-booking","__idx":10},"children":["Cancel a booking"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["If a class is cancelled (by the user or by the gym), let Wellpass know so the member gets their credits back."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["There are two scenarios that end in the same API call. How the user cancels on your platform is up to you:"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"header":{"controls":{"copy":{}}},"source":"User cancels his booking          Gym or studio cancels the class\n        ↓                                   ↓\n        └────────────┬──────────────────────┘\n                     ↓\nYour system cancels the booking (cancel)\n  • on time → the member gets their credits back\n  • after your cancellation deadline → send isLateCancel: true\n"},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["When the gym or studio calls off the class, cancel every affected Pay with Wellpass booking. The ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["reason"]}," field is the place to say why (e.g. \"Class cancelled by the studio\"). A class cancelled by the gym should not be flagged as a late cancel."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["POST {baseUrl}/rest/paymentmethod/cancel"]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"request-fields-1","__idx":11},"children":["Request fields"]},{"$$mdtype":"Tag","name":"div","attributes":{"className":"md-table-wrapper"},"children":[{"$$mdtype":"Tag","name":"table","attributes":{"className":"md"},"children":[{"$$mdtype":"Tag","name":"thead","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Field"},"children":["Field"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Type"},"children":["Type"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Required"},"children":["Required"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Description"},"children":["Description"]}]}]},{"$$mdtype":"Tag","name":"tbody","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["code"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["string"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["yes"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["The booking code used for the booking."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["clubId"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["string"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["yes"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Identifier of the gym location of the booking."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["isLateCancel"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["boolean"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["no"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Set to ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["true"]}," if the cancellation happened after your cancellation deadline."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["reason"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["string"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["no"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Free-text reason for the cancellation."]}]}]}]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"example-cancel-a-booking","__idx":12},"children":["Example: cancel a booking"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"bash","header":{"controls":{"copy":{}}},"source":"curl -X POST \"{baseUrl}/rest/paymentmethod/cancel\" \\\n  -H \"Authorization: Bearer YOUR_API_KEY\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\n    \"code\": \"ABC123XYZ\",\n    \"clubId\": \"your-club-id\",\n    \"isLateCancel\": false,\n    \"reason\": \"Class cancelled by the studio\"\n  }'\n","lang":"bash"},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"successful-response-204-no-content","__idx":13},"children":["Successful response: ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["204 No Content"]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["The response has no body. Cancellation semantics:"]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["An ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["on-time cancellation"]}," cancels the booking and the member's credits are returned."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["A cancellation flagged with ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["isLateCancel: true"]},", or one that happens after the booking's cancellation window, is recorded as a ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["late cancellation"]},"."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["The endpoint is ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["idempotent"]},": cancelling an already-cancelled booking returns ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["204"]}," without any further effect."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["A booking whose class has already ended cannot be cancelled (see ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"#cancellation-errors"},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["BookingInThePast"]}]},")."]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"error-handling","__idx":14},"children":["Error handling"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["There are two error formats."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Payload validation errors"]}," (",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["400 Bad Request"]},") are returned when required fields are missing or malformed:"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"json","header":{"controls":{"copy":{}}},"source":"{\n  \"statusCode\": 400,\n  \"error\": \"Bad Request\",\n  \"message\": [\n    \"code should not be empty\",\n    \"startDate must be in the future or present\"\n  ]\n}\n","lang":"json"},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Business errors"]}," are returned when the request is well-formed but the code, booking, or gym state prevents the operation:"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"json","header":{"controls":{"copy":{}}},"source":"{\n  \"type\": \"NoPassFoundWithProvidedCode\",\n  \"description\": \"No pass found with provided code\",\n  \"possibleExplanation\": \"The code provided is wrong, most likely a typo or it has the wrong status or the code has expired\",\n  \"data\": {\n    \"code\": \"ABC123XYZ\"\n  }\n}\n","lang":"json"},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Use the ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["type"]}," field to react programmatically and show the user a helpful message."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"validation-errors","__idx":15},"children":["Validation errors"]},{"$$mdtype":"Tag","name":"div","attributes":{"className":"md-table-wrapper"},"children":[{"$$mdtype":"Tag","name":"table","attributes":{"className":"md"},"children":[{"$$mdtype":"Tag","name":"thead","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"type"},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["type"]}]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"HTTP status"},"children":["HTTP status"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Meaning and what to do"},"children":["Meaning and what to do"]}]}]},{"$$mdtype":"Tag","name":"tbody","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["NoPassFoundWithProvidedCode"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["400"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["The code is wrong, already redeemed, or ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["expired"]},". Ask the user to re-check the code or generate a new one in the Wellpass app."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["EmailDoesNotMatchOwner"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["400"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["The email does not match the owner of the code. Ask the user to use the same email they registered with Wellpass."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["PassDoesNotBelongToGym"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["400"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["The code was generated for a different gym. Ask the user to generate a code for the correct gym."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["UserCannotBookClass"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["400"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["The user is not eligible to book this class (see ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"#what-can-cause-usercannotbookclass-"},"children":["the possible causes below"]},")."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["SessionPriceIsTooHigh"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["400"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["The submitted price exceeds the maximum allowed for this gym. The user likely selected the wrong offer."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["NoGymFoundWithProvidedClubId"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["400"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["The ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["clubId"]}," is not known. Verify your gym information and contact Wellpass if it persists."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["PayWithPassCodeDisabledOnGym"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["400"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Pay with Wellpass is not enabled for this gym. Contact Wellpass to enable it."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["NoPricingDataAssociatedOnGymError"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["400"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["The gym has no pricing data configured. Contact Wellpass."]}]}]}]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"what-can-cause-usercannotbookclass-","__idx":16},"children":["What can cause ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["UserCannotBookClass"]},"?"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["UserCannotBookClass"]}," is a generic \"user is not eligible\" error covering several situations:"]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Overlapping booking:"]}," the user already has a booking that overlaps with this class time."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["No active membership:"]}," the user's Wellpass membership is not active right now, or will not be active at the class start date (for example, the membership ends before the class takes place)."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Wrong membership type:"]}," the user's membership is not eligible for booking at this gym."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Insufficient credits:"]}," on confirmation (",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["dryRun: false"]},"), charging the member's credit wallet failed, for example because they don't have enough credits."]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["The error response does not distinguish between these causes, so show the user a generic message like ",{"$$mdtype":"Tag","name":"em","attributes":{},"children":["\"Your Wellpass membership doesn't allow this booking. Please check your membership and existing bookings in the Wellpass app.\""]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"cancellation-errors","__idx":17},"children":["Cancellation errors"]},{"$$mdtype":"Tag","name":"div","attributes":{"className":"md-table-wrapper"},"children":[{"$$mdtype":"Tag","name":"table","attributes":{"className":"md"},"children":[{"$$mdtype":"Tag","name":"thead","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"type"},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["type"]}]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"HTTP status"},"children":["HTTP status"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Meaning and what to do"},"children":["Meaning and what to do"]}]}]},{"$$mdtype":"Tag","name":"tbody","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["BookingNotFound"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["404"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["No booking exists for the given code/gym combination. Verify the ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["code"]}," and ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["clubId"]},"."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["BookingInThePast"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["400"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["The class has already ended and can no longer be cancelled."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["NotAPayWithWellpassBooking"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["400"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["The booking was not created through Pay with Wellpass."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["NoGymFoundWithProvidedClubId"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["400"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["The ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["clubId"]}," is not known. Verify your gym information."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["PayWithWellpassNotEnabledOnGym"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["400"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Pay with Wellpass is not (or no longer) enabled for this gym. Contact Wellpass."]}]}]}]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"example-expired-or-invalid-code","__idx":18},"children":["Example: expired or invalid code"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["A user enters a code they generated last month. The dry run fails with ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["400"]},":"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"json","header":{"controls":{"copy":{}}},"source":"{\n  \"type\": \"NoPassFoundWithProvidedCode\",\n  \"description\": \"No pass found with provided code\",\n  \"possibleExplanation\": \"The code provided is wrong, most likely a typo or it has the wrong status or the code has expired\",\n  \"data\": { \"code\": \"OLD123CODE\" }\n}\n","lang":"json"},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Show the user a message like ",{"$$mdtype":"Tag","name":"em","attributes":{},"children":["\"This code is invalid or has expired. Please generate a new code in your Wellpass app.\""]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"example-overlapping-booking","__idx":19},"children":["Example: overlapping booking"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["A user who already booked a class from 10:00 to 11:00 tries to book another class from 10:30. The request fails with ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["400"]},":"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"json","header":{"controls":{"copy":{}}},"source":"{\n  \"type\": \"UserCannotBookClass\",\n  \"description\": \"User cannot book this class\",\n  \"data\": { \"code\": \"ABC123XYZ\" }\n}\n","lang":"json"},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Note that the response is the same ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["UserCannotBookClass"]}," error the user would get for a membership problem. Your system cannot tell the causes apart, so prefer a message that covers all of them."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"testing-your-integration","__idx":20},"children":["Testing your integration"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["You can safely test the whole flow in the sandbox of the EGYM Partner Integration Portal (PIP), using ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["generated test codes"]}," instead of real Wellpass members."]},{"$$mdtype":"Tag","name":"Admonition","attributes":{"type":"info","name":"Access to EGYM Partner Integration Portal"},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Contact your Wellpass contact for portal access."]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["In the portal, open the ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Wellpass"]}," integration and start the ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Code Validation"]}," use case. It walks you through three chained test cases:"]},{"$$mdtype":"Tag","name":"ol","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Validate a code:"]}," after you select one of your sandbox locations, the portal ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["generates a test booking code"]}," for it and shows you the ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["code"]},", the ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["clubId"]}," (sandbox club IDs have the format ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["pip-<locationId>"]},"), and a ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["startDate"]},". Call the ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"#validate-a-code"},"children":["validate endpoint"]}," with this data and ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["dryRun: true"]},". Expected result: ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["200 OK"]},"."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Confirm the booking:"]}," call the ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"#confirm-a-booking"},"children":["validate endpoint"]}," again with the same code and ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["dryRun: false"]},", using a ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["startDate"]}," in the future. Expected result: ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["200 OK"]},"."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Cancel the booking:"]}," call the ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"#cancel-a-booking"},"children":["cancel endpoint"]}," with the same ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["code"]}," and ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["clubId"]},". Expected result: ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["204 No Content"]},"."]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["The portal inspects each request your system sends and verifies the fields before marking the test case as passed. All three test cases are mandatory for completing the use case."]},{"$$mdtype":"Tag","name":"Admonition","attributes":{"type":"info","name":"Test codes"},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Test codes are only issued as part of a sandbox test run in the Partner Integration Portal."]}]}]},"headings":[{"value":"Pay with Wellpass: API reference","id":"pay-with-wellpass-api-reference","depth":1},{"value":"What is Pay with Wellpass?","id":"what-is-pay-with-wellpass","depth":2},{"value":"Key concepts","id":"key-concepts","depth":3},{"value":"The user journey","id":"the-user-journey","depth":2},{"value":"Authentication","id":"authentication","depth":2},{"value":"Validate a code","id":"validate-a-code","depth":2},{"value":"Request fields","id":"request-fields","depth":3},{"value":"Example: validate a code","id":"example-validate-a-code","depth":3},{"value":"Successful response: 200 OK","id":"successful-response-200-ok","depth":3},{"value":"Confirm a booking","id":"confirm-a-booking","depth":2},{"value":"Cancel a booking","id":"cancel-a-booking","depth":2},{"value":"Request fields","id":"request-fields-1","depth":3},{"value":"Example: cancel a booking","id":"example-cancel-a-booking","depth":3},{"value":"Successful response: 204 No Content","id":"successful-response-204-no-content","depth":3},{"value":"Error handling","id":"error-handling","depth":2},{"value":"Validation errors","id":"validation-errors","depth":3},{"value":"What can cause UserCannotBookClass ?","id":"what-can-cause-usercannotbookclass-","depth":3},{"value":"Cancellation errors","id":"cancellation-errors","depth":3},{"value":"Example: expired or invalid code","id":"example-expired-or-invalid-code","depth":3},{"value":"Example: overlapping booking","id":"example-overlapping-booking","depth":3},{"value":"Testing your integration","id":"testing-your-integration","depth":2}],"frontmatter":{"seo":{"title":"Pay with Wellpass: API reference"}},"lastModified":"2026-11-02T09:07:54.000Z","pagePropGetterError":{"message":"","name":""}},"slug":"/wellpass/pay-with-wellpass/api-reference","userData":{"isAuthenticated":false,"teams":["anonymous"]},"isPublic":true}