Appointment, bookable appointment and slots operations
- Purchase an additional module contract
Magicline API (1.31.0)
- Appointment, bookable appointment and slots operations
- Redeem checkin vouchers
- Class and slots operations
- Cross studio operations
- Get customers and contracts
- Retrieve customer accounting details
- Retrieve customer communication details
- Retrieve customer transaction details
- Get device information
- Employee operations
- Debt collection operations
- Leads operations
- Get member lists
- Manage membership contracts
- Membership operations
- Online offer operations
- Payment operations
- Get studio information
- Get trial offers information
https://open-api-demo.open-api.magicline.com/
https://redocly.sportalliance.com/_mock/apis/magicline/openapi/openapi/
Unique ID of the payment frequency of the additional module
- Demo tenant
https://open-api-demo.open-api.magicline.com/v1/memberships/{contractId}/self-service/additional-modules/purchase/preview
- Mock server
https://redocly.sportalliance.com/_mock/apis/magicline/openapi/openapi/v1/memberships/{contractId}/self-service/additional-modules/purchase/preview
- curl
- JavaScript
- Node.js
- Python
- Java
- C#
- PHP
- Go
- Ruby
- R
- Payload
curl -i -X POST \
'https://open-api-demo.open-api.magicline.com/v1/memberships/{contractId}/self-service/additional-modules/purchase/preview' \
-H 'Content-Type: application/json' \
-H 'X-API-KEY: YOUR_API_KEY_HERE' \
-d '{
"additionalModuleId": 203,
"paymentFrequencyId": 203,
"bookTrialPeriod": true
}'Preview validation completed. Charges are calculated only for validationStatus ADDITIONAL_MODULE_PURCHASABLE. Rejections represented by validationStatus are HTTP 200, including ADDITIONAL_MODULE_CONTRACT_ALREADY_PURCHASED, ADDITIONAL_MODULE_CONTRACT_INVALID_STATUS, ADDITIONAL_MODULE_NOT_FOUND, ADDITIONAL_MODULE_NOT_ONLINE_PURCHASABLE, ADDITIONAL_MODULE_TRIAL_PERIOD_NOT_BOOKABLE, and ADDITIONAL_MODULE_CONTRACT_MISSING_BOOKING_ANCHOR (the imported main contract lacks a required booking anchor). A booking anchor is the reference date needed to align the module's recurring payments with the imported main contract. The system uses the earliest non-reversed main-contract charge with a booking date strictly after today in the studio's time zone, or, if none exists, the day after the period recorded on the main contract's non-reversed customer debit balance. That recorded period does not necessarily mean the customer has paid. This status is returned only when alignment requires the reference date and neither source is available. The purchase request cannot supply this date. Do not automatically retry the unchanged purchase. Contact the studio administrator or support with the main contract ID to investigate the imported billing data and payment schedule; this status alone does not identify the appropriate repair. For a rejection, dueNow, followUpSchedule, fixedScheduleReferenceDateType, and mainContractScheduleFallbackReason are not populated. A missing main contract is HTTP 404 with errorCode errormessage.entity.not.found. Scheduling and pre-use exceptions during preflight or preview creation, and request-format errors, can also return HTTP 400.
Whether the additional module can be purchased
| Enum Value | Description |
|---|---|
| ADDITIONAL_MODULE_NOT_FOUND | The additional module could not be found. |
| ADDITIONAL_MODULE_CONTRACT_MISSING_BOOKING_ANCHOR | The reference date required to align the additional module's recurring payments with the imported main contract is unavailable. The system uses the earliest non-reversed main-contract charge with a booking date strictly after today in the studio's time zone, or, if none exists, the day after the period recorded on the main contract's non-reversed customer debit balance. That recorded period does not necessarily mean the customer has paid. This status is returned only when alignment requires the reference date and neither source is available. The purchase request cannot supply this date. Do not automatically retry the unchanged purchase. Contact the studio administrator or support with the main contract ID to investigate the imported billing data and payment schedule; this status alone does not identify the appropriate repair. |
| ADDITIONAL_MODULE_CONTRACT_INVALID_STATUS | The main contract is reversed or canceled, or the customer's payment method is invalid. |
| ADDITIONAL_MODULE_NOT_ONLINE_PURCHASABLE | The additional module is not purchasable online. |
| ADDITIONAL_MODULE_CONTRACT_ALREADY_PURCHASED | The additional module contract has already been purchased. |
| ADDITIONAL_MODULE_PURCHASABLE | The additional module is purchasable. |
| ADDITIONAL_MODULE_TRIAL_PERIOD_NOT_BOOKABLE | The additional module trial period cannot be booked. |
Determines the fixed payment schedule for the additional module: STATIC_DATE uses the rate's configured anchor date; MAIN_CONTRACT_SCHEDULE uses the main contract's payment schedule
Reason why the requested main-contract schedule alignment could not be applied
The module/payment frequency combination is unavailable in the studio; no charges are calculated.
{ "validationStatus": "ADDITIONAL_MODULE_NOT_FOUND", "dueNow": null, "followUpSchedule": null, "fixedScheduleReferenceDateType": null, "mainContractScheduleFallbackReason": null }
Unique ID of the payment frequency of the additional module
- Demo tenant
https://open-api-demo.open-api.magicline.com/v1/memberships/{contractId}/self-service/additional-modules/purchase
- Mock server
https://redocly.sportalliance.com/_mock/apis/magicline/openapi/openapi/v1/memberships/{contractId}/self-service/additional-modules/purchase
- curl
- JavaScript
- Node.js
- Python
- Java
- C#
- PHP
- Go
- Ruby
- R
- Payload
curl -i -X POST \
'https://open-api-demo.open-api.magicline.com/v1/memberships/{contractId}/self-service/additional-modules/purchase' \
-H 'Content-Type: application/json' \
-H 'X-API-KEY: YOUR_API_KEY_HERE' \
-d '{
"additionalModuleId": 203,
"paymentFrequencyId": 203,
"bookTrialPeriod": true
}'{ "id": 1001 }
- Demo tenant
https://open-api-demo.open-api.magicline.com/v1/memberships/{contractId}/self-service/additional-module-contracts/{additionalModuleContractId}
- Mock server
https://redocly.sportalliance.com/_mock/apis/magicline/openapi/openapi/v1/memberships/{contractId}/self-service/additional-module-contracts/{additionalModuleContractId}
- curl
- JavaScript
- Node.js
- Python
- Java
- C#
- PHP
- Go
- Ruby
- R
- Payload
curl -i -X GET \
'https://open-api-demo.open-api.magicline.com/v1/memberships/{contractId}/self-service/additional-module-contracts/{additionalModuleContractId}' \
-H 'X-API-KEY: YOUR_API_KEY_HERE'OK
Payment amount of the additional module contract for today, or the next or last applicable payment amount when no price applies today, in the studio's currency
Last possible cancelation date of the additional module contract. Not set for RECEIPT_DATE cancelation strategy when the contract has more than one term.
Cancelation status of the contract cancelation
| Enum Value | Description |
|---|---|
| PENDING_WITHDRAWAL_VERIFICATION | The cancelation withdrawal is pending verification. |
| CANCELED | The contract was canceled by the customer. |
| PENDING_VERIFICATION | The cancelation is pending verification. |
Whether a contract cancelation for the additional module contract can be withdrawn
Represents the trial period of an additional module
Cancelation strategy of the contract
| Enum Value | Description |
|---|---|
| RECEIPT_DATE | Contract can be canceled at any time with a notice period. availableCancelationDates[0] is the earliest possible cancelation date (today + notice period). lastPossibleCancelationDate is not set for this strategy when the contract has more than one term. |
| TERM | Contract can only be canceled to the end of a contract term. lastPossibleCancelationDate indicates the deadline by which notice must be given. availableCancelationDates lists the possible term-end dates. |
Determines the fixed payment schedule for the additional module: STATIC_DATE uses the rate's configured anchor date; MAIN_CONTRACT_SCHEDULE uses the main contract's payment schedule
Reason why the requested main-contract schedule alignment could not be applied
{ "name": "drink flat", "price": { "amount": 20, "currency": "EUR" }, "startDate": "2022-01-15", "endDate": "2022-01-15", "cancelationDate": "2022-01-15", "lastPossibleCancelationDate": "2022-01-15", "cancelationReason": "Illness", "contractCancelationStatus": "PENDING_VERIFICATION", "contractCancelationCanBeWithdrawn": true, "trialPeriod": { "term": { … }, "startDate": "2022-01-15", "endDate": "2022-01-28" }, "rateCodes": [ { … } ], "cancelationStrategy": "TERM", "fixedScheduleReferenceDateType": "STATIC_DATE", "mainContractScheduleFallbackReason": "MAIN_CONTRACT_PAYMENT_FREQUENCY_UNAVAILABLE", "availableCancelationDates": [ "2019-08-24" ] }