### OpenAPI Definition Example Source: https://dev.totalpass.com/reference/get_partner-plans This is an example of an OpenAPI definition. ```json { "value": { "statusCode": 401, "message": "Unauthorized" } } ``` -------------------------------- ### Unauthorized Response Example Source: https://dev.totalpass.com/reference/post_partner-app-v1-validate This example demonstrates the structure of an unauthorized response (401). It includes an error code, a descriptive message, and a URL to relevant documentation. ```json { "error": "Unauthorized", "message": "No valid API key provided", "documentation_url": "https://dev.totalpass.com/v1.0.0/reference/post_partner-app-v1-validate" } ``` -------------------------------- ### Seat Map Example Source: https://dev.totalpass.com/reference/put_partner-seat-maps-seatmapid-1 Provides an example of a seat map for a bike room, demonstrating the expected structure for categories and positions. Use this as a reference for creating new seat maps. ```json { "name": "Bike Room 1", "size": [ 3, 3 ], "categories": [ { "name": "bike", "bookable": true, "icon": "bike", "positions": [ { "name": "Bike2", "externalReference": "B2", "position": [3, 3] } ] }, { "bookable": false, "name": "Temporarily Unavailable Bikes", "icon": "bike", "positions": [ { "name": "Bike1", "externalReference": "B1", "position": [3 ,2] } ] }, { "bookable": false, "name": "Air Conditioner", "icon": "ac", "positions": [ { "name": "AC", "externalReference": "C1", "position": [1, 5] } ] } ] } ``` -------------------------------- ### Webhook Payload Example Source: https://dev.totalpass.com/reference/post_partner-webhook-subscribe This is an example of the JSON payload that will be sent to your registered webhook URL when an event occurs. ```APIDOC ## Subscribe Register a webhook URL, where you going to receive a payload like the example below: ```json { "event": { "id": "231fd985-d3a3-40b3-99a8-c363fc26aaaa", "title": "Yoga", "plan_code": "XXXXXX", }, "place": { "place": "ac04cf8a-8643-41d5-a0c9-efee02f9aaaa", "name": "Bio Ritmo Paulista" }, "user": { "name": "Cisne", "email": "cisne@totalpass.com.br", "phone": "xxxxxxxxx", "document_number": "12345678900", "document_type": "cpf", "code": "ABCDEF" }, "slot": { "id": "64c1ad93a879333d436da6e8", "status": "active", "date": "2023-07-31T00:00:00.000Z", "seat": { "externalReference": "123", "name": "A1", "identifier": "5e701467-4d80-40a4-b78a-00490a6faaaa", "position": "[1,1]" }, "confirmation_url": "booking-api.totalpass.com/partner/slot/confirmSlot/64c1ad93a879333d436da6e8" } } ``` ``` -------------------------------- ### Partner Events API Response Example Source: https://dev.totalpass.com/reference/get_partner-events-1 This example shows the structure of a successful response when retrieving partner events. It includes event details and their occurrences. ```json { "createdAt": "2023-10-19T18:59:19.198Z", "updatedAt": "2023-10-19T18:59:19.198Z", "deletedAt": null }, "EventOccurrences": [ { "id": 3, "eventId": 2, "startTime": "03:00 PM", "occurrenceUuid": "b32cddca-b673-4571-b213-b9853b0dd04a", "endTime": "03:45 PM", "eventDate": "2023-09-07T03:00:00.000Z", "responsible": "Cisne", "duration": 45, "status": "ACTIVE", "slots": 1, "createdAt": "2023-10-19T19:02:01.807Z", "updatedAt": "2023-10-19T19:02:01.807Z", "deletedAt": null }, { "id": 4, "eventId": 2, "startTime": "03:00 PM", "occurrenceUuid": "487de753-da93-41da-8a28-3b4e475b55b8", "endTime": "03:45 PM", "eventDate": "2023-09-06T03:00:00.000Z", "responsible": "Cisne", "duration": 45, "status": "ACTIVE", "slots": 1, "createdAt": "2023-10-19T19:02:01.807Z", "updatedAt": "2023-10-19T19:02:01.807Z", "deletedAt": null } ] } ``` -------------------------------- ### Example 404 Response for Not Found Event Source: https://dev.totalpass.com/reference/get_partner-events-occurrenceuuid-1 This example demonstrates the response structure when an event occurrence is not found. It includes a 'message' field indicating the error. ```json { "message": "Events not found" } ``` -------------------------------- ### Retrieve All Partner Plans Source: https://dev.totalpass.com/reference/get_partner-plans Use this example when no specific plan identifier is provided to fetch all associated plans for a partner. ```json { "name": "Plance Name", "identifier": "71b6ab00-3340-42d9-baaf-d84ff94f40ce", "placeApiKey": "78347c63-99d4-4d05-9abb-0ac474033df6", "Plans": [ { "id": 305, "name": "Plan Example 1", "code": "B0KR5QWH", "createdAt": "2024-11-01T11:09:11.030Z", "updatedAt": "2024-11-01T11:09:11.030Z", "deletedAt": null, "placeId": 12, "externalReference": "2000-0000-0002-0000" }, { "id": 843, "name": "Plan Example 2", "code": "FQSRCRUZ", "createdAt": "2025-04-14T19:29:04.420Z", "updatedAt": "2025-04-14T19:29:04.420Z", "deletedAt": null, "placeId": 12, "externalReference": "1000-0000-0001-test" }, { "id": 325, "name": "Plan Example 3", "code": "7B8ZUZFO", "createdAt": "2024-11-01T15:13:15.679Z", "updatedAt": "2024-11-01T15:13:15.679Z", "deletedAt": null, "placeId": 12, "externalReference": "2000-0000-0002-0000" } ] } ``` -------------------------------- ### Partner Seat Maps API - Successful Response Example Source: https://dev.totalpass.com/reference/get_partner-seat-maps-1 This example demonstrates a successful response from the Partner Seat Maps API, detailing seat availability and properties. ```json { "data": [ { "id": "64c7a1f1-372e-471e-807a-000000000001", "name": "Economy Class", "bookable": true, "icon": "seat_economy", "positions": [ { "name": "B1", "position": [ 2, 1 ], "identifier": "a46b2132-de04-4ce6-8574-9dd3d1a2e1e8", "externalReference": "B1" }, { "name": "B2", "position": [ 2, 2 ], "identifier": "67bc0529-d5f7-4b7b-bd25-48e2489a226b", "externalReference": "B2" } ] }, { "name": "air conditioning", "bookable": false, "icon": null, "positions": [ { "name": "A1", "position": [ 1, 1 ], "identifier": "ca7454c6-84c1-401a-b9e1-ef5b7501df06", "externalReference": "A1" }, { "name": "A3", "position": [ 1, 3 ], "identifier": "234bde4e-e754-429e-a254-c88014b4e23f", "externalReference": "A3" } ] } ], "createdAt": "2024-06-26T21:19:47.849Z", "updatedAt": "2024-06-26T21:19:47.849Z" } ``` -------------------------------- ### Retrieve Partner Plan by Code Source: https://dev.totalpass.com/reference/get_partner-plans Use this example to fetch a specific partner plan when its unique code is known. ```json [ { "id": 305, "name": "Plan Example 1", "code": "B0KR5QWH", "createdAt": "2024-11-01T11:09:11.030Z", "updatedAt": "2024-11-01T11:09:11.030Z", "deletedAt": null, "placeId": 12, "externalReference": "2000-0000-0002-0000" } ] ``` -------------------------------- ### Example Confirmation Address JSON Source: https://dev.totalpass.com/reference/put_partner-places-update-configs-1 This JSON structure represents an example of a confirmation address sent to a partner when a booking is made through the app. It includes details about the event, place, user, and slot. ```json { "event": { "id": "40dc2acc-f418-4447-9d78-7b1c76fc8399", "title": "Yoga" }, "place": { "place": "9c83d967-d783-4e74-9e11-4ebe462ab7d9", "name": "TUDO JEANS" }, "user": { "name": "Pedro Santos", "email": "pedrosantos@outlook.com", "phone": "(11) 98222-4623", "document_number": "23312388894", "document_type": "cpf", "code": "S2MXBABC" }, "slot": { "id": "677fc3d14bc7797787a4e8c7", "status": "active", "date": "2025-01-10T20:30:00.000Z", "seat": null, "confirmation_url": "https://booking-api.totalpass.com/partner/slot/confirmSlot/677fc3d14bc7797787a4e8c7" } } ``` -------------------------------- ### Partner Seat Maps API - Unauthorized Response Example Source: https://dev.totalpass.com/reference/get_partner-seat-maps-1 This example shows the response when the API request is unauthorized due to invalid credentials. ```json { "statusCode": 401, "message": "Unauthorized" } ``` -------------------------------- ### Handle No Plan Found Error Source: https://dev.totalpass.com/reference/get_partner-plans This example shows the response when a plan cannot be found using the provided code or external reference. ```json { "message": "No plan found with code or externalReference 'TEST1234'" } ``` -------------------------------- ### Cancel Slot By slotId - Success Example Source: https://dev.totalpass.com/reference/delete_partner-slot-slotid This example shows the expected response when a slot is successfully canceled. It includes the slot ID and a confirmation message. ```json { "slotId": "657a1c812244207e106c7b2c", "message": "Slot removed successfully" } ``` -------------------------------- ### Invalid Company Response Example Source: https://dev.totalpass.com/reference/post_partner-app-v1-validate This example shows the structure of a response when a company is invalid or lacks the necessary permissions (422). The 'errors' field contains a list of specific error messages. ```json { "errors": [ "A empresa fornecida não pode acessar o recurso solicitado." ] } ``` -------------------------------- ### Track Usages API Request Body Examples Source: https://dev.totalpass.com/reference/post_track-usages Examples of request bodies for the track usages endpoint, demonstrating different identifier types (CPF, CURP, token, code). ```json { "data": { "type": "string", "attributes": { "type": "cpf", "identifier": "30658264972", "service_provider_code": "59TADO9F" } } } ``` ```json { "data": { "type": "string", "attributes": { "type": "curp", "identifier": "JUMM941106HSRNGR09", "service_provider_code": "59TADO9F" } } } ``` ```json { "data": { "type": "string", "attributes": { "type": "token", "identifier": "K2A5X6", "service_provider_code": "59TADO9F", "service_provider_plan_code": "V01F5Q15" } } } ``` ```json { "data": { "type": "string", "attributes": { "type": "code", "identifier": "AA1122AA", "service_provider_code": "59TADO9F", "service_provider_plan_code": "V01F5Q15" } } } ``` -------------------------------- ### Unauthorized Access: Invalid Credentials Source: https://dev.totalpass.com/reference/post_partner-auth-1 This example demonstrates an 'Unauthorized' response when the provided API keys or credentials are invalid. ```json { "message": "Invalid credentials" } ``` -------------------------------- ### Get All Events Source: https://dev.totalpass.com/reference/get_partner-events-1 This endpoint returns a list of all events from the authenticated gym. ```APIDOC ## GET /events ### Description Endpoint that returns a list of all events from the authenticated gym. ### Method GET ### Endpoint /events ### Parameters #### Query Parameters - **gym_id** (string) - Required - The ID of the gym to retrieve events for. ### Response #### Success Response (200) - **events** (array) - A list of event objects. - **event_id** (string) - The unique identifier for the event. - **name** (string) - The name of the event. - **description** (string) - A detailed description of the event. - **start_time** (string) - The start date and time of the event in ISO 8601 format. - **end_time** (string) - The end date and time of the event in ISO 8601 format. - **location** (string) - The location where the event will take place. - **created_at** (string) - The date and time when the event was created in ISO 8601 format. - **updated_at** (string) - The date and time when the event was last updated in ISO 8601 format. #### Response Example ```json { "events": [ { "event_id": "evt_12345", "name": "Yoga Session", "description": "A relaxing yoga session for all levels.", "start_time": "2024-08-15T10:00:00Z", "end_time": "2024-08-15T11:00:00Z", "location": "Studio A", "created_at": "2024-07-20T09:00:00Z", "updated_at": "2024-07-20T09:00:00Z" } ] } ``` ``` -------------------------------- ### Example Event Occurrence Payload Source: https://dev.totalpass.com/reference/put_partner-event-occurrence-occurrenceuuid-1 This JSON object represents a sample event occurrence, detailing its properties such as start and end times, status, and associated metadata. It's useful for understanding the data structure when an event occurrence is found. ```json { "example-0": { "summary": "when event occurrence is found", "value": { "id": 1, "eventId": 1, "startTime": "03:00 PM", "startTimeId": "8e2205a2-470c-4429-b0f0-37d684c6cb86", "endTime": "03:45 PM", "eventDate": "2023-09-06T03:00:00.000Z", "minTimeToBook": "2023-09-06T03:00:00.000Z", "maxTimeToBook": "2023-09-07T13:00:00.000Z", "maxTimeToCancel": "2023-09-07T10:00:00.000Z", "responsible": "Cisne", "duration": 45, "status": "ACTIVE", "slotsInUse": 0, "availableSeats": [], "slots": 1, "createdAt": "2023-10-19T19:01:52.479Z", "updatedAt": "2023-10-19T19:01:52.479Z", "deletedAt": null, "eventColor": "#EBDCFF", "externalReference": "event-test-123" } } } ``` -------------------------------- ### Retrieve Partner Plan by External Reference Source: https://dev.totalpass.com/reference/get_partner-plans Use this example to fetch a specific partner plan when its external reference identifier is known. ```json [ { "id": 305, "name": "Plan Example 1", "code": "B0KR5QWH", "createdAt": "2024-11-01T11:09:11.030Z", "updatedAt": "2024-11-01T11:09:11.030Z", "deletedAt": null, "placeId": 12, "externalReference": "2000-0000-0002-0000" }, { "id": 325, "name": "Plan Example 3", "code": "7B8ZUZFO", "createdAt": "2024-11-01T15:13:15.679Z", "updatedAt": "2024-11-01T15:13:15.679Z", "deletedAt": null, "placeId": 12, "externalReference": "2000-0000-0002-0000" } ] ``` -------------------------------- ### Bad Request: Blank Parameters Source: https://dev.totalpass.com/reference/post_partner-auth-1 This example illustrates a 'Bad Request' response when required parameters like partner_api_key or place_api_key are left empty. ```json { "statusCode": 400, "message": [ "partner_api_key should not be empty", "partner_api_key must be a string", "place_api_key should not be empty", "place_api_key must be a string" ], "error": "Bad Request" } ``` -------------------------------- ### Successful Response: Slots Found Source: https://dev.totalpass.com/reference/get_partner-slot This example shows the structure of a successful response when available slots are found. It includes details about the user, event, and slot. ```json { "_id": "657a1c812244207e106c7b2c", "userId": 907412, "status": "expired", "user": { "id": "663bcaeefdd6c425cc1def15", "name": "Jose da Silva", "email": "email@email.com", "phone": "(00) 00000-0000", "document_number": "62422254098", "document_type": "cpf", "code": "AA1122AA" }, "eventId": 5, "weekday": 4, "weekdayName": "thursday", "startTimeId": "e60b9193-44fd-4c9a-9eb7-9e79ad494a0f", "startTime": "18:00", "endTime": "18:45", "slotDate": "2023-12-14T21:00:00.000Z", "timezone": "pt-BR", "version": "2.8.0", "event": { "id": 5, "title": "Yoga A", "responsible": "Cisne", "description": "A Yoga melhora o funcionamento do coração, pois regula a circulação sanguínea e o sistema nervoso, além de equilibrar o sistema endócrino, controlando os níveis de hormônios do estresse.", "duration": 45, "slots": 4, "plan_code": "XXXXXX" }, "place": { "id": 1, "identifier": "a9ff272a-fc4f-45fa-ae37-48049fbebee6" }, "createdAt": "2023-12-12T20:04:05.721Z" } ``` -------------------------------- ### Update SeatMap Configuration Example Source: https://dev.totalpass.com/reference/put_partner-seat-maps-seatmapid-1 This JSON structure demonstrates how to configure a seat map, including categories and spot properties. Use this to update existing seat maps via the API. ```json { "name": "Seatmap Exemple", "size": [6, 6], "categories": [ { "bookable": true, "name": "Standard", "spots": [ { "id": "1", "category": "Standard", "position": [0, 0], "externalReference": "1" } ] }, { "bookable": false, "name": "Temporarily Unavailable Bikes", "spots": [ { "id": "2", "category": "Temporarily Unavailable Bikes", "position": [1, 1], "externalReference": "2" } ] } ] } ``` -------------------------------- ### Cancel Slot By slotId - Slot Expired Example Source: https://dev.totalpass.com/reference/delete_partner-slot-slotid This example shows the response when trying to cancel a slot that has expired. The API will indicate that the slot cannot be canceled due to expiration. ```json { "title": "slot_expired", "message": "Slot expired, you cannot cancel this slot" } ``` -------------------------------- ### Get All Webhooks OpenAPI Definition Source: https://dev.totalpass.com/reference/get_partner-webhook-get This is the OpenAPI definition for the 'Get All Webhooks' endpoint. It specifies the request method, parameters, and expected responses, including success and error scenarios. ```json { "openapi": "3.0.2", "info": { "title": "Webhook - Checkin", "description": "This documentation aims to assist Totalpass partners in efficiently consuming the TotalPass Checkin API.\ The API provides a comprehensive solution for partners who want to interact with the Totalpass checkin system.\ Below, we detail the available endpoints in the API, the events associated with each of them, as well as configurable variables for customization.\ With your API keys ('partner_api_key' and 'place_api_key'), you can authenticate using the 'auth' endpoint, which will return a JWT token with user login information.", "version": "1.0.0" }, "servers": [ { "url": "https://{gym_server}", "variables": { "gym_server": { "default": "gym-service-api.totalpass.com", "enum": [ "gym-service-api.totalpass.com", "gym-service-api.staging.totalpass.com" ] } } }, { "url": "https://{admin_server}/api/v1/webhook_confirmations/{TOKEN}", "description": "The admin_server is responsible for validating checkins.", "variables": { "admin_server": { "default": "admin.staging.totalpass.com" } } } ], "paths": { "/partner/webhook/get": { "get": { "security": [ { "bearerAuth": [] } ], "tags": [ "Partner::Webhook" ], "summary": "Get All Webhooks", "parameters": [ { "name": "Authorization", "in": "header", "required": true, "schema": { "type": "string" }, "example": "Bearer ", "description": "JWT used for authentication" } ], "description": "This endpoint retrieves all webhook URLs associated with the logged-in partner.\n", "responses": { "200": { "description": "Webhook URLs retrieved successfully", "content": { "application/json": { "schema": { "type": "object" }, "example": { "webhooks": [ { "webhook_url": "https://webhook.site/0ab7d5ab-81fd-4c68-9984-099b0887ef8b", "webhook_type": "CHECKIN" }, { "webhook_url": "https://webhook.site/6f6cbfe3-8ff8-4750-83c7-e609650023ac", "webhook_type": "CHECKIN" } ] } } } }, "401": { "description": "Unauthorized", "headers": { "$ref": "#/paths/~1partner~1webhook~1update/put/responses/200/headers" }, "content": { "application/json": { "schema": { "type": "object" }, "examples": { "UnauthorizedResponseExample": { "summary": "when credentials are invalid", "value": { "statusCode": 401, "message": "Unauthorized" } } } } } } } } } }, "x-readme": { "explorer-enabled": true, "proxy-enabled": true } } ``` -------------------------------- ### Successful Partner Authentication Response Source: https://dev.totalpass.com/reference/post_partner-auth-1 This example shows a successful response after authenticating a partner. It includes the partner's place details and an authentication token. ```json { "place": { "name": "Prosacco - Yundt", "placeApiKey": "c8f928a1-302c-4776-91d9-84063a38b68b" }, "token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJwYXJ0bmVyX2FwaV9rZXkiOiIwYzMxYTY4Ny00MDU2LTQzY2MtYjkxZi0yZmI4OTI4ZTc0ODkiLCJwbGFjZV9hcGlfa2V5IjoiYzhmOTI4YTEtMzAyYy00Nzc2LTkxZDktODQwNjNhMzhiNjhiIiwiaWF0IjoxNjk3NzQyMDg1LCJleHAiOjE2OTc4Mjg0ODV9.OS7bg0EsaTEgUi2KJ43jMwF_vCkirmJAqAGBbAHOTqM" } ``` -------------------------------- ### Cancel Slot By slotId - Slot Not Found Example Source: https://dev.totalpass.com/reference/delete_partner-slot-slotid This example illustrates the response when the specified slot ID does not exist in the system. It returns a title and message indicating that the slot was not found. ```json { "title": "slot_not_found", "message": "Slot not found" } ``` -------------------------------- ### Cancel Slot By slotId - Already Canceled Example Source: https://dev.totalpass.com/reference/delete_partner-slot-slotid This example demonstrates the response when attempting to cancel a slot that has already been canceled. It returns a specific title and message indicating the status. ```json { "title": "already_canceled", "message": "Already canceled" } ``` -------------------------------- ### Bad Request: Non-String Parameters Source: https://dev.totalpass.com/reference/post_partner-auth-1 This example shows a 'Bad Request' response when the provided partner_api_key or place_api_key are not of the string type. ```json { "statusCode": 400, "message": [ "partner_api_key must be a string", "place_api_key must be a string" ], "error": "Bad Request" } ``` -------------------------------- ### Webhook Event Payload Example Source: https://dev.totalpass.com/reference/post_partner-webhook-subscribe This is an example of the JSON payload structure that will be sent to your registered webhook URL when an event occurs. It includes details about the event, the place, the user, and the specific slot. ```json { "event": { "id": "231fd985-d3a3-40b3-99a8-c363fc26aaaa", "title": "Yoga", "plan_code": "XXXXXX" }, "place": { "place": "ac04cf8a-8643-41d5-a0c9-efee02f9aaaa", "name": "Bio Ritmo Paulista" }, "user": { "name": "Cisne", "email": "cisne@totalpass.com.br", "phone": "xxxxxxxxx", "document_number": "12345678900", "document_type": "cpf", "code": "ABCDEF" }, "slot": { "id": "64c1ad93a879333d436da6e8", "status": "active", "date": "2023-07-31T00:00:00.000Z", "seat": { "externalReference": "123", "name": "A1", "identifier": "5e701467-4d80-40a4-b78a-00490a6faaaa", "position": "[1,1]" }, "confirmation_url": "booking-api.totalpass.com/partner/slot/confirmSlot/64c1ad93a879333d436da6e8" } } ``` -------------------------------- ### Create Booking Source: https://dev.totalpass.com/reference/post_bookings This endpoint allows you to create a new booking for an employee at a specific gym. You need to provide employee identification and the desired schedule time. ```APIDOC ## POST /bookings ### Description Creates a new booking for an employee at a gym. ### Method POST ### Endpoint /bookings ### Parameters #### Query Parameters - **locale** (string) - Optional - Language of the response message. Example: "en", "pt-BR", "es", "es-MX". The default is "pt-BR" #### Request Body - **gym_acronym** (string) - Required - The acronym of the gym. - **document_type** (string) - Required - The type of document for the employee. - **document_number** (string) - Required - The number of the employee's document. - **scheduled_at** (string) - Required - The desired date and time for the booking. #### Headers - **SINGLE-ACCESS-TOKEN** (string) - Required - Token used for authentication. ### Request Example ```json { "gym_acronym": "ACMEGYM", "document_type": "CPF", "document_number": "12345678900", "scheduled_at": "2024-08-15T10:00:00Z" } ``` ### Response #### Success Response (201) - **booking_id** (integer) - The ID of the created booking. - **message** (string) - A confirmation message. #### Response Example ```json { "booking_id": 12345, "message": "Booking created successfully." } ``` #### Error Response (404) - **error** (string) - Description of the error (e.g., "employee or gym not found"). #### Error Response (422) - **error** (string) - Description of the error (e.g., "fail to create a new booking"). ```