Customers

Signup Tokens

A SignupToken permits a customer to sign up for a private MembershipType or non-default MembershipRate. Tokens cap how many signups they can be used for and can pre-populate customer details (name and email).

The SignupToken object

Attributes

  • idstringrequired

    The ID of the signup token.

  • membership_type_idstringrequired

    The MembershipType this token allows signups as

  • membership_rate_idstringrequirednullable

    The MembershipRate this token allows signups as. If omitted, the default rate of the given type will be used.

  • start_datedaterequirednullable

    The date which the membership should start

  • end_datedaterequirednullable

    The date which the membership should end

  • durationstringoptional

    The duration of the membership as an ISO8601 string. See https://en.wikipedia.org/wiki/ISO_8601#Durations

  • max_usesintegerrequirednullable

    The maximum number of times this signup token can be used. If null, it can be used an unlimited number of times. When the number of uses reaches the max_uses, it is soft-deleted.

  • usesintegerrequired

    The number of times this signup token has been used.

  • first_namestringoptionalnullable

    The first name of the customer this token allows signups as. If omitted, the customer can set a first name.

  • last_namestringoptionalnullable

    The last name of the customer this token allows signups as. If omitted, the customer can set a last name.

  • emailstringoptionalnullable

    The email of the customer this token allows signups as. If omitted, the customer can set an email.

{
  "id": "000000-000000-000000-000000",
  "membership_type_id": "000000-000000-000000-000000",
  "membership_rate_id": "000000-000000-000000-000000",
  "start_date": "2021-02-21",
  "end_date": "2022-02-21",
  "duration": "P1M",
  "max_uses": 1,
  "uses": 1,
  "first_name": "Dan",
  "last_name": "Morgan",
  "email": "dan@try.be"
}
get/customers/signup-tokens

List SignupTokens

listSignupTokens

Lists every SignupToken you are authorised to see. Tokens are used to permit a customer to sign up to a private MembershipType or non-default MembershipRate.

Responses

  • 200

    The signup tokens were successfully retrieved.

  • 401

    The user is unauthenticated

post/customers/signup-tokens

Create a SignupToken

createSignupToken

Use this endpoint to create a new SignupToken. The token is bound to a MembershipType and optionally to a non-default MembershipRate. You can pre-populate the customer's name and email, and cap how many times the token can be used.

Request body

  • membership_type_idstringrequired

    The MembershipType this token allows signups as

  • membership_rate_idstringoptional

    The MembershipRate this token allows signups as. This must belong to the same MembershipType as the one provided. If omitted, the default rate of the given type will be used.

  • start_datedateoptional

    Optionally, you can specify the date which the membership should start. This should not be specified if a duration is given.

  • end_datedateoptionalnullable

    Optionally, you can specify the date which the membership should end. This should not be specified if a duration is given.

  • durationstringoptional

    Optionally, you can specify the duration of the membership as an ISO8601 string. See https://en.wikipedia.org/wiki/ISO_8601#Durations. This should not be specified if either a start_date or end_date is given.

  • max_usesintegeroptionalnullable

    The maximum number of times this signup token can be used. If null, it can be used an unlimited number of times. When the number of uses reaches the max_uses, it is soft-deleted.

  • first_namestringoptional

    The first name of the customer this token allows signups as.

  • last_namestringoptional

    The last name of the customer this token allows signups as.

  • emailstringoptionalnullable

    The email of the customer this token allows signups as.

Responses

  • 201

    The signup token was successfully retrieved or updated.

  • 401

    The user is unauthenticated

  • 403

    The authenticated user does not have permission.

  • 422

    The request didn't pass validation

get/customers/signup-tokens/{signupTokenId}

Retrieve a SignupToken

getSignupToken

Use this endpoint to retrieve a single SignupToken by its ID.

Path parameters

Responses

  • 200

    The signup token was successfully retrieved or updated.

  • 401

    The user is unauthenticated

  • 404

    The resource couldn't be found

put/customers/signup-tokens/{signupTokenId}

Update a SignupToken

updateSignupToken

Update an existing SignupToken. Only fields included in the request body will be changed.

Path parameters

Request body

  • membership_type_idstringoptional

    The MembershipType this token allows signups as

  • membership_rate_idstringoptional

    The MembershipRate this token allows signups as. This must belong to the same MembershipType as the one provided. If omitted, the default rate of the given type will be used.

  • start_datedateoptional

    Optionally, you can specify the date which the membership should start.

  • end_datedateoptionalnullable

    Optionally, you can specify the date which the membership should end.

  • durationstringoptional

    Optionally, you can specify the duration of the membership as an ISO8601 string. See https://en.wikipedia.org/wiki/ISO_8601#Durations

  • max_usesintegeroptionalnullable

    The maximum number of times this signup token can be used. If null, it can be used an unlimited number of times.

  • first_namestringoptional

    The first name of the customer this token allows signups as.

  • last_namestringoptional

    The last name of the customer this token allows signups as.

  • emailstringoptionalnullable

    The email of the customer this token allows signups as.

Responses

  • 200

    The signup token was successfully retrieved or updated.

  • 401

    The user is unauthenticated

  • 403

    The authenticated user does not have permission.

  • 404

    The resource couldn't be found

  • 422

    The request didn't pass validation

delete/customers/signup-tokens/{signupTokenId}

Delete a SignupToken

deleteSignupToken

Soft-deletes a SignupToken so that it can no longer be used. The token can be restored with the restoreSignupToken endpoint.

Path parameters

Responses

  • 200

    The signup token was successfully retrieved or updated.

  • 401

    The user is unauthenticated

  • 403

    The authenticated user does not have permission.

  • 404

    The resource couldn't be found

post/customers/signup-tokens/{signupTokenId}/restore

Restore a deleted SignupToken

restoreSignupToken

Restores a soft-deleted SignupToken so that it can be used again.

Path parameters

Responses

  • 200

    The signup token was successfully retrieved or updated.

  • 401

    The user is unauthenticated

  • 403

    The authenticated user does not have permission.

  • 404

    The resource couldn't be found