Skip to content

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
Download OpenAPI description
Languages
Servers
Demo tenant

https://open-api-demo.open-api.magicline.com/

Mock server

https://redocly.sportalliance.com/_mock/apis/magicline/openapi/openapi/

Appointments

Appointment, bookable appointment and slots operations

Operations

Checkin vouchers

Redeem checkin vouchers

Operations
Operations

Cross Studio

Cross studio operations

Operations

Customers

Get customers and contracts

Operations

Customers Account

Retrieve customer accounting details

Operations

Customers Communication

Retrieve customer communication details

Operations
Operations

Customers Transactions

Retrieve customer transaction details

Operations
Operations
Operations
Operations
Operations
Operations

Membership Self-service

Manage membership contracts

Operations

Preview an additional module contract purchase

Request

Required Scopes: MEMBERSHIP_SELF_SERVICE_ADDITIONAL_MODULE_CONTRACT_WRITE

Preview the charges for an additional module contract purchase, including validation of the purchase request

Security
ApiKeyAuth
Path
contractIdinteger(int64)required

Unique ID of the main contract

Bodyapplication/jsonrequired
additionalModuleIdinteger(int64)required

Unique ID of the additional module

Example: 203
paymentFrequencyIdinteger(int64)required

Unique ID of the payment frequency of the additional module

Example: 203
bookTrialPeriodbooleanrequired

Describes whether a trial period should be booked. The additional module must contain a valid trial period configuration, if set to true

Example: true
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
  }'

Responses

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.

Bodyapplication/json
dueNowArray of objects(AccountPreviewItem)

Immediately due preview charges

followUpScheduleArray of objects(AccountPreviewItem)

The following recurring preview charges

validationStatusstringrequired

Whether the additional module can be purchased

Enum ValueDescription
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.

Example: "ADDITIONAL_MODULE_CONTRACT_ALREADY_PURCHASED"
fixedScheduleReferenceDateTypestring

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

Enum"STATIC_DATE""MAIN_CONTRACT_SCHEDULE"
mainContractScheduleFallbackReasonstring

Reason why the requested main-contract schedule alignment could not be applied

Enum"MAIN_CONTRACT_PAYMENT_FREQUENCY_UNAVAILABLE""MAIN_CONTRACT_PAYMENT_FREQUENCY_NOT_RECURRING""MAIN_CONTRACT_SCHEDULE_UNAVAILABLE""UNSUPPORTED_MAIN_CONTRACT_FIRST_BOOKING_TYPE""UNSUPPORTED_MAIN_CONTRACT_CALCULATION_TYPE""INCOMPATIBLE_PAYMENT_FREQUENCIES"
Response
application/json

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 }

Purchase an additional module contract

Request

Required Scopes: MEMBERSHIP_SELF_SERVICE_ADDITIONAL_MODULE_CONTRACT_WRITE

Purchase an additional module contract

Security
ApiKeyAuth
Path
contractIdinteger(int64)required

Unique ID of the main contract

Bodyapplication/jsonrequired
additionalModuleIdinteger(int64)required

Unique ID of the additional module

Example: 203
paymentFrequencyIdinteger(int64)required

Unique ID of the payment frequency of the additional module

Example: 203
bookTrialPeriodbooleanrequired

Describes whether a trial period should be booked. The additional module must contain a valid trial period configuration, if set to true

Example: true
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
  }'

Responses

OK

Bodyapplication/json
idinteger(int64)

Unique ID of the additional module contract

Example: 1001
Response
application/json
{ "id": 1001 }

Request

Required Scopes: MEMBERSHIP_SELF_SERVICE_ADDITIONAL_MODULE_CONTRACT_READ

Get an additional module contract via additional module contract id

Security
ApiKeyAuth
Path
contractIdinteger(int64)required

Unique ID of the main contract

additionalModuleContractIdinteger(int64)required

Unique ID of the additional module contract

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'

Responses

OK

Bodyapplication/json
namestringrequired

Name of the additional module contract

Example: "drink flat"
priceobject(Money)required

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

price.​amountnumberrequired

Amount of the finance data tuple

Example: 20
price.​currencystring(ISO 4217)required

Currency of the finance data tuple

Example: "EUR"
startDatestring(date)required

Start date of the additional module contract

Example: "2022-01-15"
endDatestring(date)

End date of the additional module contract

Example: "2022-01-15"
cancelationDatestring(date)

Cancelation date of the additional module contract

Example: "2022-01-15"
lastPossibleCancelationDatestring(date)

Last possible cancelation date of the additional module contract. Not set for RECEIPT_DATE cancelation strategy when the contract has more than one term.

Example: "2022-01-15"
cancelationReasonstring

Represents the reason of a contract cancelation

Example: "Illness"
contractCancelationStatusstring

Cancelation status of the contract cancelation

Enum ValueDescription
PENDING_WITHDRAWAL_VERIFICATION

The cancelation withdrawal is pending verification.

CANCELED

The contract was canceled by the customer.

PENDING_VERIFICATION

The cancelation is pending verification.

Example: "PENDING_VERIFICATION"
contractCancelationCanBeWithdrawnbooleanrequired

Whether a contract cancelation for the additional module contract can be withdrawn

Example: true
trialPeriodobject(AdditionalModuleContractTrialPeriod)

Represents the trial period of an additional module

rateCodesArray of objects(RateCode)

Rate codes of this contract

cancelationStrategystringrequired

Cancelation strategy of the contract

Enum ValueDescription
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.

Example: "TERM"
fixedScheduleReferenceDateTypestring

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

Enum"STATIC_DATE""MAIN_CONTRACT_SCHEDULE"
mainContractScheduleFallbackReasonstring

Reason why the requested main-contract schedule alignment could not be applied

Enum"MAIN_CONTRACT_PAYMENT_FREQUENCY_UNAVAILABLE""MAIN_CONTRACT_PAYMENT_FREQUENCY_NOT_RECURRING""MAIN_CONTRACT_SCHEDULE_UNAVAILABLE""UNSUPPORTED_MAIN_CONTRACT_FIRST_BOOKING_TYPE""UNSUPPORTED_MAIN_CONTRACT_CALCULATION_TYPE""INCOMPATIBLE_PAYMENT_FREQUENCIES"
availableCancelationDatesArray of strings(date)
Response
application/json
{ "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" ] }
Operations

Online offers

Online offer operations

Operations
Operations
Operations

Trial Offers

Get trial offers information

Operations