Memberships

A Membership represents a membership belonging to one or more Customers.

Schema

Attributes

  • The ID of the membership

  • A string describing what kind of action needs to take place

    Possible values are no_mandate, setup_unpaid, mandate_revoked, payment_failed, payment_disputed, payment_outstanding and site_id

  • The basket ID which was used to purchase this membership, if applicable.

  • end_date
    Nullable

    The date which the membership ends

  • An external reference for this membership.

  • The unique membership number of the lead member. This is always a 10 digit numeric string. Since this field only relates to the lead member, this is now deprecated. Instead, find the membership for the relevant customer in the members array.

  • The date which the membership will next be billed

  • next_charge
    Nullable

    A summary of the next charge that's due for this membership.

    This property is only populated when the membership was retrieved using the `getCustomerMemberships endpoint.

  • Details about the payment method attached to this membership. This payment method is used to take payment on the monthly billing period. If a payment method hasn't been set up, this will be null.

  • The ID of the site this membership belongs to

  • Where the membership was created

    Possible values are self_signup, app, import and unknown

  • The date which the membership starts

  • Possible values are active, needs_dd_mandate, needs_attention, reserved, inactive, expired and upcoming

  • A URL to a page where the member can provide their payment details.

  • The datetime which the membership was created

""
listMemberships

List Memberships

This endpoint lists the Memberships which are associated to the provided site.

Query parameters

  • Filters memberships belonging to the specified customer

  • page
    Optional

    The page to retrieve results from

  • per_page
    Optional

    The number of results to return per page

Responses

  • 200

    The Memberships were successfully retrieved

GET/customers/memberships
200
example response
{
  "data": [],
  "meta": {
    "from": 1,
    "to": 2,
    "total": 2,
    "current_page": 1,
    "last_page": 2,
    "per_page": 15,
    "path": "http://example.com/api"
  },
  "links": {
    "first": "http://example.com?page=1",
    "next": "https://example.com?page=3",
    "prev": "https://example.com?page=1",
    "last": "https://example.com?page=4"
  }
}
getMembership

Show a membership

Use this endpoint to retrieve a Membership by its ID.

Path parameters

Responses

  • 200

    The Membership was successfully retrieved

  • 404

    The resource couldn't be found

GET/customers/memberships/{membershipId}
200
example response
{
  "data": {
    "id": "00501e41-2765-c2fb-d95b-8e34a3949eec",
    "attention_reason": "payment_disputed",
    "basket_id": "69e534f07bcdf701440000e2",
    "customer": {
      "id": "f9ef484e-6642-c460-7bb4-67749b7285c1",
      "first_name": "Jane",
      "last_name": "Doe",
      "full_name": "Jane Doe",
      "phone": "+447900000000",
      "has_password": true,
      "dob": "1913-08-10",
      "brand_id": "e32139d2-6cd2-6949-0011-b654c685048e",
      "site_id": "78c5cdc2-5292-3ece-32cf-5fae6db46124",
      "stripe_id": "cus_1234567890",
      "express_stripe_id": "cus_1234567890",
      "email": "janedoe@example.com",
      "labels": [],
      "preferred_locale": "en",
      "locked_at": "1930-01-18T14:15:04.0Z",
      "created_at": "1962-06-02T04:02:07.0Z",
      "updated_at": "1892-04-29T07:09:17.0Z",
      "deleted_at": "1906-09-22T08:16:15.0Z",
      "last_active_at": "1902-07-28T01:46:50.0Z",
      "email_verified_at": "1952-12-25T03:44:58.0Z",
      "last_check_in": {
        "checked_in_at": "1896-03-24T08:40:37.0Z",
        "method": "Scanned"
      },
      "avatar_id": "000000-000000-000000-000000",
      "avatar": {
        "id": "3f0eccd8-66ad-7128-f187-bc99adb99c41",
        "file_name": "super-cool-photo.jpg",
        "mime_type": "image/jpeg",
        "original_url": "https://example.com/media/super-cool-photo.jpg",
        "size": 84256,
        "url": "https://example.com/media/super-cool-photo-thumbnail@2x.jpg"
      },
      "external_ref": "ex"
    },
    "end_date": "1933-12-17T17:47:02.0Z",
    "external_ref": "enim",
    "members": [],
    "membership_number": "1234567890",
    "next_billing_date": "1890-07-14T20:45:15.0Z",
    "next_charge": {
      "id": "0188b282-80e0-e2b6-9024-357e31a71102",
      "amount": 3995,
      "currency": "GBP",
      "status": "succeeded",
      "billing_period_from": "1908-07-27",
      "billing_period_to": "1920-12-04"
    },
    "payment_method": {
      "id": "cillum incididunt",
      "type": "card",
      "status": "revoked"
    },
    "rate": {
      "id": "7e967af5-9d6a-8b72-e5b7-6ace18a3e420",
      "membership_type_id": "babb4c91-1457-ea98-28d7-2a6ac8807785",
      "name": "Standard rate",
      "currency": "GBP",
      "price": 5000,
      "joining_fee": 1000,
      "billing_frequency": "P1M",
      "processors": [
        "cillum culpa",
        "consequat",
        "aliqua laborum reprehenderit eu dolor"
      ],
      "default_duration": "P1Y",
      "private": true,
      "created_at": "1897-07-26T13:04:08.0Z",
      "updated_at": "1968-09-20T02:59:31.0Z"
    },
    "site_id": "b39132c0-9fbd-4f4a-6f2d-a4ac9f15046b",
    "source": "app",
    "start_date": "1965-11-17T18:01:38.0Z",
    "status": "active",
    "status_updated_at": "1908-12-29T07:31:06.0Z",
    "type": {
      "id": "19a9875c-e9f3-4cbb-c17f-0bfb7b0257a7",
      "name": "Gold tier",
      "description": "Enjoy exclusive benefits as part of being a member in our Gold tier",
      "terms": "amet aliqua mollit id",
      "brand_id": "993c6fb6-7faa-a565-7f0d-8dfdc7bb04c7",
      "offline_payments": false,
      "disable_confirmation_email": false,
      "private": false,
      "visibility": "private",
      "minimum_start_date": "1909-05-14T12:21:34.0Z",
      "min_members": 2,
      "max_members": 4,
      "rates": [
        {
          "id": "175e80c8-da02-481a-711a-05ef7d387953",
          "membership_type_id": "4c17b7af-be14-1dab-09b2-075559332f12",
          "name": "Standard rate",
          "currency": "GBP",
          "price": 5000,
          "joining_fee": 1000,
          "billing_frequency": "P1M",
          "processors": [
            "eiusmod elit",
            "deserunt sed"
          ],
          "default_duration": "P1Y",
          "private": true,
          "created_at": "1892-08-12T02:15:13.0Z",
          "updated_at": "1947-04-11T19:37:34.0Z"
        },
        {
          "id": "6aaba0a0-79ab-773a-6bda-d6686123e761",
          "membership_type_id": "5e26a753-1089-7f5b-6f9a-f9a7d984e02b",
          "name": "Standard rate",
          "currency": "GBP",
          "price": 5000,
          "joining_fee": 1000,
          "billing_frequency": "P1M",
          "processors": [
            "ad sunt pariatur et",
            "aute quis sint Duis",
            "enim dolor reprehenderit",
            "cupidatat"
          ],
          "default_duration": "P1Y",
          "private": true,
          "created_at": "1942-06-06T03:18:20.0Z",
          "updated_at": "1945-02-26T01:04:06.0Z"
        },
        {
          "id": "e60201e0-144a-e0f5-32e5-814f0cc8d781",
          "membership_type_id": "8f33f2b1-612c-548f-970e-859eaf4b1410",
          "name": "Standard rate",
          "currency": "GBP",
          "price": 5000,
          "joining_fee": 1000,
          "billing_frequency": "P1M",
          "processors": [
            "nulla"
          ],
          "default_duration": "P1Y",
          "private": true,
          "created_at": "1940-09-22T20:19:21.0Z",
          "updated_at": "1890-08-17T12:14:43.0Z"
        },
        {
          "id": "bd69891d-d654-083d-9818-a3078688644e",
          "membership_type_id": "dc3a7457-0734-14be-a4c5-169a60528485",
          "name": "Standard rate",
          "currency": "GBP",
          "price": 5000,
          "joining_fee": 1000,
          "billing_frequency": "P1M",
          "processors": [
            "ullamco veniam ut deserunt qui",
            "enim"
          ],
          "default_duration": "P1Y",
          "private": true,
          "created_at": "1960-01-26T01:41:14.0Z",
          "updated_at": "1956-08-01T15:17:41.0Z"
        },
        {
          "id": "2660e61c-03e5-636f-a45a-b5fb79e63c89",
          "membership_type_id": "a04c3a90-9628-87c4-ffa9-6df1d477e528",
          "name": "Standard rate",
          "currency": "GBP",
          "price": 5000,
          "joining_fee": 1000,
          "billing_frequency": "P1M",
          "processors": [
            "deserunt ut Duis incididunt",
            "minim ad consectetur tempor anim",
            "aliquip est exercitation",
            "aliquip",
            "consectetur Lorem velit"
          ],
          "default_duration": "P1Y",
          "private": true,
          "created_at": "1896-11-26T16:40:57.0Z",
          "updated_at": "1933-07-24T10:23:30.0Z"
        }
      ],
      "revenue_schedule": "FREQ=WEEKLY",
      "created_at": "1935-02-26T05:49:47.0Z",
      "updated_at": "1939-03-16T16:15:07.0Z",
      "deleted_at": "1963-10-31T03:42:01.0Z"
    },
    "payment_details_url": "qui",
    "created_at": "1893-08-09T14:30:18.0Z"
  }
}
404
example response
{
  "message": "The requested resource could not be found"
}
actionAddMembershipChargePayment

Record a manual payment against a charge

This endpoint allows a manual (off-Trybe) payment to be recorded against a membership charge.

Path parameters

Request body

  • The ID of the custom payment type this payment should be recorded as

  • amount
    Nullable

    The amount of the payment

Responses

  • 200

    A charge against a membership.

  • 404

    The resource couldn't be found

POST/shop/membership-charges/{chargeId}/payment
200
example response
{
  "data": {
    "id": "83a07bc5-280d-9593-33f8-a6f21017fe9d",
    "membership": {
      "id": "2156737d-398a-f2e4-c8e8-797c92e37ebc",
      "membership_number": "00000014",
      "type_name": "Gold Membership",
      "customer_id": "2a4c8c38-023d-2905-a291-bffa0d087973",
      "customer_name": "Jane Jones"
    },
    "processor": "adyen",
    "processor_data": {
      "cardholder_name": "Mrs J Jones",
      "processor_type": "Cash",
      "processor_type_id": "69e534f17bcdf7014400032e"
    },
    "amount": 3995,
    "original_amount": 3995,
    "currency": "gbp",
    "tax": 1000,
    "status": "succeeded",
    "description": "nulla Excepteur sint",
    "can_download_receipt": false,
    "amount_refunded": 36768922,
    "refunded": true,
    "refunds": [],
    "site_id": "eabc304b-0bcf-093c-1ae2-6b884025deaf",
    "billing_period_from": "1935-06-25",
    "billing_period_to": "1891-07-26",
    "processing_at": "1948-12-12T11:20:33.0Z",
    "created_at": "1958-10-21T15:27:12.0Z",
    "updated_at": "1939-10-29T02:20:11.0Z"
  }
}
404
example response
{
  "message": "The requested resource could not be found"
}
actionProcessMembershipCharge

Manually process a charge for a membership

This endpoint allows a membership charge to be processed manually.

Path parameters

Responses

  • 200

    A charge against a membership.

  • 404

    The resource couldn't be found

POST/shop/membership-charges/{chargeId}/process
200
example response
{
  "data": {
    "id": "01481c1d-11d1-7ea2-67bc-ef8daf936e87",
    "membership": {
      "id": "4b3797e9-b928-89ed-928b-a28932c32e8e",
      "membership_number": "00000014",
      "type_name": "Gold Membership",
      "customer_id": "de21edc0-a79c-9b44-896e-0132a4b4ec00",
      "customer_name": "Jane Jones"
    },
    "processor": "adyen",
    "processor_data": {
      "cardholder_name": "Mrs J Jones",
      "last_4": 4001,
      "processor_type": "Cash"
    },
    "amount": 3995,
    "original_amount": 3995,
    "currency": "gbp",
    "tax": 1000,
    "status": "succeeded",
    "description": "fugiat sunt dolore",
    "can_download_receipt": false,
    "amount_refunded": 35527622,
    "refunded": true,
    "refunds": [
      {
        "id": "12c654cc-10ff-760e-c129-0f3658b406f1",
        "status": "succeeded",
        "amount": 995,
        "currency": "gbp",
        "notes": "Gesture of good will",
        "failure_reason": "invalid_details",
        "refunded_by": {
          "id": "d352b961-0e63-cba2-6645-bbc0079e625e",
          "full_name": "Jane Jenkins"
        },
        "processor_data": {
          "processor": "adyen",
          "processor_id": "re_64301e0b2df9d11814010ea6"
        },
        "created_at": "1890-01-31T11:57:56.0Z",
        "updated_at": "1914-10-07T17:46:55.0Z"
      }
    ],
    "site_id": "5af58c06-b024-c26f-ccb0-1d8fe1e52368",
    "billing_period_from": "1965-02-20",
    "billing_period_to": "1937-09-26",
    "processing_at": "1936-03-24T10:06:30.0Z",
    "created_at": "1943-03-16T11:03:52.0Z",
    "updated_at": "1966-11-23T14:41:11.0Z"
  }
}
404
example response
{
  "message": "The requested resource could not be found"
}
actionRetryMembershipCharge

Manually retry a charge for a membership

This endpoint allows a membership charge to be retried manually.

Path parameters

Responses

  • 200

    A charge against a membership.

  • 404

    The resource couldn't be found

POST/shop/membership-charges/{chargeId}/retry
200
example response
{
  "data": {
    "id": "293ee173-9736-3dde-ac1e-28563d0ec771",
    "membership": {
      "id": "452ecf80-ac4e-a3e0-7980-0bb461928cc4",
      "membership_number": "00000014",
      "type_name": "Gold Membership",
      "customer_id": "8e48e7da-8bd3-22f8-f61f-ea7288290056",
      "customer_name": "Jane Jones"
    },
    "processor": "adyen",
    "processor_data": {
      "processor_type": "Cash",
      "processor_type_id": "69e534f07bcdf701440000e3"
    },
    "amount": 3995,
    "original_amount": 3995,
    "currency": "gbp",
    "tax": 1000,
    "status": "succeeded",
    "description": "commodo ex",
    "can_download_receipt": true,
    "amount_refunded": -73494381,
    "refunded": false,
    "refunds": [
      {
        "id": "814580e1-2ad6-0cf3-01b5-6bcd2eda412e",
        "status": "succeeded",
        "amount": 995,
        "currency": "gbp",
        "notes": "Gesture of good will",
        "failure_reason": "invalid_details",
        "refunded_by": {
          "id": "135ddbfe-c020-5883-1b5c-91db607ce491",
          "full_name": "Jane Jenkins"
        },
        "processor_data": {
          "processor": "adyen",
          "processor_id": "re_64301e0b2df9d11814010ea6"
        },
        "created_at": "1903-10-04T10:03:23.0Z",
        "updated_at": "1919-02-14T04:26:12.0Z"
      }
    ],
    "site_id": "2c9c8299-833c-38e4-f661-77c2b2174ab1",
    "billing_period_from": "1905-03-26",
    "billing_period_to": "1898-06-26",
    "processing_at": "1914-11-21T03:43:50.0Z",
    "created_at": "1893-09-16T01:29:43.0Z",
    "updated_at": "1930-05-18T02:01:23.0Z"
  }
}
404
example response
{
  "message": "The requested resource could not be found"
}
createMembershipSms

Send an SMS message for a membership

This endpoint sends an SMS message to a membership's lead member. Currently supports sending billing details request messages.

Path parameters

Request body

  • message_type
    Required

    The type of message to send.

    Possible values are billing_details_request

  • If true, send the SMS even if the membership already has a payment method. Defaults to false.

Responses

  • 200

    The SMS message was successfully sent

  • 404

    The resource couldn't be found

  • 422

    The request didn't pass validation

POST/shop/memberships/{membershipId}/sms
200
example response
{
  "data": {
    "id": "69e534f17bcdf7014400032f",
    "organisation_id": "693f9262-5e9b-a4e9-662c-ad3f71892283",
    "site_id": "6a987f2c-d1eb-5eaa-5ca9-dd663e7040b4",
    "customer_id": "260410bf-e542-5dc0-36f4-075e4df416ef",
    "membership_id": "d330ffcf-cc53-9f91-98b5-eacb35d508df",
    "from": "Trybe",
    "to": "+447123456789",
    "message": "Excepteur esse aliqua",
    "message_type": "billing_details_request",
    "message_delivered": true,
    "created_at": "2024-02-02T12:01:01.0Z",
    "sent_at": "2024-02-02T12:01:01.0Z"
  }
}
404
example response
{
  "message": "The requested resource could not be found"
}
422
example response
{
  "errors": {
    "anim852": [
      "cupidatat",
      "in"
    ]
  },
  "message": "The request didn't pass validation"
}
createMembershipSmsPreview

Preview an SMS message for a membership

This endpoint previews an SMS message for a membership.

Path parameters

Request body

  • message_type
    Required

    The type of the SMS message.

    Possible values are billing_details_request

  • If true, preview the SMS even if the membership already has a payment method. Defaults to false.

Responses

  • 200

    The preview of the SMS message was successfully retrieved

  • 404

    The resource couldn't be found

POST/shop/memberships/{membershipId}/sms/preview
200
example response
{
  "data": {
    "message": "Your Premium Membership membership is almost ready! Please provide payment details for your membership payments. Set up here: https://example.com/confirm\n",
    "site_id": "424373f0-3471-ec74-3492-7e6c7de1d215",
    "organisation_id": "4cd0f5d5-9a51-2c96-a4ac-7d99b91a7754"
  }
}
404
example response
{
  "message": "The requested resource could not be found"
}