Memberships

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

Schema

Attributes

  • The ID of the membership

  • The ID of the site this membership belongs to

  • 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.

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

  • Where the membership was created

    Possible values are self_signup, app, import and unknown

  • 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 date which the membership starts

  • The date which the membership ends

  • The datetime which the membership was created

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

  • An external reference for this membership.

  • 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.

  • 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

""
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": [
    {
      "id": "a0221328-1b36-e6a1-1fae-5692230d9df7",
      "site_id": "a4674aa4-91d3-c1bc-f2a4-70a5d56c42e4",
      "membership_number": "1234567890",
      "customer": {
        "id": "6028931b-0f36-2b7c-0734-cbd0642b6bae",
        "first_name": "Jane",
        "last_name": "Doe",
        "full_name": "Jane Doe",
        "phone": "+447900000000",
        "has_password": true,
        "dob": "1968-06-16",
        "brand_id": "bbc5c779-7468-e559-9f26-12397cd4aef4",
        "site_id": "39f67b72-2d9d-c01e-9268-fe22a5e16d9b",
        "stripe_id": "cus_1234567890",
        "express_stripe_id": "cus_1234567890",
        "email": "janedoe@example.com",
        "labels": [
          {
            "id": "426364f6-468a-03eb-465a-a1e4acb6527b",
            "name": "VIP",
            "color": "ff6634"
          },
          {
            "id": "7aea9a6a-6a52-f721-944b-63bf70a8dd55",
            "name": "VIP",
            "color": "ff6634"
          },
          {
            "id": "35eabf22-012b-7f48-640e-82858a719bff",
            "name": "VIP",
            "color": "ff6634"
          }
        ],
        "preferred_locale": "en",
        "locked_at": "1955-11-09T19:55:16.0Z",
        "created_at": "1953-05-14T07:16:52.0Z",
        "updated_at": "1962-07-17T15:28:27.0Z",
        "deleted_at": "1936-09-30T01:13:03.0Z",
        "last_active_at": "1950-07-16T12:53:22.0Z",
        "email_verified_at": "1900-03-17T01:02:54.0Z",
        "last_check_in": {
          "checked_in_at": "1957-01-26T20:04:31.0Z",
          "method": "Scanned"
        },
        "avatar_id": "000000-000000-000000-000000",
        "avatar": {
          "id": "e69eab9c-1beb-6de9-5922-eb992f16344d",
          "file_name": "super-cool-photo.jpg",
          "mime_type": "image/jpeg",
          "size": 84256,
          "url": "https://example.com/media/super-cool-photo.jpg"
        },
        "external_ref": "non exercitation eu veniam"
      },
      "members": [],
      "type": {
        "id": "77efe180-1772-fb92-88a2-a77247fb4ea4",
        "name": "Gold tier",
        "description": "Enjoy exclusive benefits as part of being a member in our Gold tier",
        "terms": "ex eiusmod",
        "brand_id": "06ee6362-c078-e4e8-36cc-08eeabe57e0b",
        "offline_payments": false,
        "disable_confirmation_email": true,
        "private": false,
        "visibility": "private",
        "minimum_start_date": "1926-03-01T01:37:54.0Z",
        "min_members": 2,
        "max_members": 4,
        "rates": [
          {
            "id": "d53f67bd-7f3d-70e0-d939-af417a1d2536",
            "membership_type_id": "7604251c-9463-87cf-98bf-1e607b98b52a",
            "name": "Standard rate",
            "currency": "GBP",
            "price": 5000,
            "joining_fee": 1000,
            "tax": 1250,
            "billing_frequency": "P1M",
            "default_duration": "P1Y",
            "private": true,
            "created_at": "1955-07-11T01:50:09.0Z",
            "updated_at": "1968-12-13T18:53:19.0Z"
          },
          {
            "id": "fe14c001-1fc5-f130-8b07-ce23dfe74b40",
            "membership_type_id": "11a68fad-4d05-e88b-d47c-27466f98a70e",
            "name": "Standard rate",
            "currency": "GBP",
            "joining_fee": 1000,
            "default_duration": "P1Y",
            "created_at": "1920-03-16T05:59:42.0Z"
          },
          {
            "membership_type_id": "b338271c-102e-97a3-7a05-dc5414c2b3f3",
            "name": "Standard rate",
            "currency": "GBP",
            "joining_fee": 1000,
            "tax": 1250,
            "default_duration": "P1Y",
            "private": true,
            "created_at": "1900-10-08T06:14:42.0Z",
            "updated_at": "1930-04-03T01:34:22.0Z"
          },
          {
            "id": "b7547fe4-9d8c-0652-752f-8323796ec693",
            "membership_type_id": "1991c5c9-3096-e49a-1828-e7998df7a3c9",
            "name": "Standard rate",
            "currency": "GBP",
            "price": 5000,
            "joining_fee": 1000,
            "tax": 1250,
            "billing_frequency": "P1M",
            "processors": [
              "nostrud dolore",
              "irure adipisicing fugiat dolor",
              "cupidatat culpa eu",
              "commodo ad nostrud",
              "ullamco ut minim"
            ],
            "default_duration": "P1Y",
            "private": true,
            "created_at": "1929-06-13T10:37:08.0Z",
            "updated_at": "1931-05-23T12:14:30.0Z"
          },
          {
            "id": "0c182c39-4291-7b87-158b-139909cbf2a4",
            "membership_type_id": "4cfd3c50-e5d9-eb9c-b0ea-4b21c11336b7",
            "name": "Standard rate",
            "currency": "GBP",
            "price": 5000,
            "joining_fee": 1000,
            "tax": 1250,
            "processors": [
              "nulla",
              "qui Lorem"
            ],
            "private": true
          }
        ],
        "revenue_schedule": "FREQ=WEEKLY",
        "created_at": "1926-07-23T03:16:21.0Z",
        "updated_at": "1963-07-19T18:10:39.0Z",
        "deleted_at": "1969-07-13T23:18:59.0Z"
      },
      "status": "expired",
      "source": "app",
      "payment_method": {
        "id": "incididunt aute voluptate ipsum",
        "type": "direct_debit",
        "last_4": "enim est amet commodo sunt",
        "card_brand": "amex"
      },
      "start_date": "1909-03-27T07:20:06.0Z",
      "end_date": "1917-07-11T18:07:47.0Z",
      "created_at": "1935-04-09T21:06:17.0Z",
      "external_ref": "tempor deserunt",
      "next_billing_date": "1937-03-03T23:33:11.0Z",
      "next_charge": {
        "id": "1e3bef2b-db4a-45e9-1853-4a7cbc0d3a5f",
        "amount": 3995,
        "currency": "GBP",
        "status": "awaiting_approval",
        "billing_period_from": "1911-07-09",
        "billing_period_to": "1907-01-27"
      }
    }
  ],
  "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": "abbfb5da-a774-8617-5d99-821f252c4421",
    "site_id": "837595fc-1470-361c-e068-75e88c3e75de",
    "membership_number": "1234567890",
    "customer": {
      "id": "a98322b4-6960-d25d-292e-212bb4a93c02",
      "first_name": "Jane",
      "last_name": "Doe",
      "full_name": "Jane Doe",
      "phone": "+447900000000",
      "has_password": true,
      "dob": "1915-05-25",
      "brand_id": "f1c56adc-2b15-89f8-413a-20384ec59c8f",
      "site_id": "95ca7659-b6a9-ba59-024a-b6659485de82",
      "stripe_id": "cus_1234567890",
      "express_stripe_id": "cus_1234567890",
      "email": "janedoe@example.com",
      "labels": [],
      "preferred_locale": "en",
      "locked_at": "1925-02-20T15:49:37.0Z",
      "created_at": "1944-04-30T18:17:50.0Z",
      "updated_at": "1912-03-17T19:06:17.0Z",
      "deleted_at": "1916-02-01T14:07:56.0Z",
      "last_active_at": "1896-01-28T01:13:15.0Z",
      "email_verified_at": "1959-04-06T22:59:12.0Z",
      "last_check_in": {
        "checked_in_at": "1950-03-23T22:20:20.0Z",
        "method": "Scanned"
      },
      "avatar_id": "000000-000000-000000-000000",
      "avatar": {
        "id": "3368f8f0-6f5d-e395-021a-63ff2c05ee67",
        "file_name": "super-cool-photo.jpg",
        "mime_type": "image/jpeg",
        "size": 84256,
        "url": "https://example.com/media/super-cool-photo.jpg"
      },
      "external_ref": "id sed ullamco"
    },
    "members": [
      {
        "customer_id": "acf9c1f9-6f0e-440a-9560-49fdfe65c686",
        "membership_number": "1234567890"
      }
    ],
    "type": {
      "id": "35da2da4-dcad-f5ca-9ad4-430e7494ddf9",
      "name": "Gold tier",
      "description": "Enjoy exclusive benefits as part of being a member in our Gold tier",
      "terms": "tempor esse",
      "brand_id": "beda083d-90b6-df20-ddf7-d62991b8413d",
      "offline_payments": false,
      "disable_confirmation_email": false,
      "private": false,
      "visibility": "private",
      "minimum_start_date": "1960-03-07T22:16:21.0Z",
      "min_members": 2,
      "max_members": 4,
      "rates": [
        {
          "id": "c7bf35da-8bbc-25c7-0d35-5799e949e333",
          "price": 5000,
          "tax": 1250,
          "billing_frequency": "P1M"
        },
        {
          "id": "2a2cd75e-99f2-84a8-4c6b-44b6b8e37048",
          "name": "Standard rate",
          "price": 5000,
          "joining_fee": 1000,
          "tax": 1250,
          "billing_frequency": "P1M",
          "processors": [
            "in",
            "proident eiusmod est",
            "Ut eiusmod dolore sint",
            "reprehenderit fugiat",
            "veniam cupidatat ea"
          ],
          "default_duration": "P1Y",
          "private": true,
          "created_at": "1893-09-07T05:14:58.0Z"
        },
        {
          "id": "4692412e-8204-2828-58c7-f52d19989d74",
          "membership_type_id": "d76313c3-24dc-e1cb-5ad5-4351ed91d0d2",
          "name": "Standard rate",
          "currency": "GBP",
          "price": 5000,
          "default_duration": "P1Y",
          "created_at": "1941-07-21T04:40:47.0Z"
        },
        {
          "id": "b20b21b1-22bd-e6aa-7fea-95b4476a3ea7",
          "membership_type_id": "2d14969e-48dd-43e4-9f24-92ccc02dafa1",
          "name": "Standard rate",
          "currency": "GBP",
          "price": 5000,
          "joining_fee": 1000,
          "tax": 1250
        }
      ],
      "revenue_schedule": "FREQ=WEEKLY",
      "created_at": "1959-10-09T21:39:27.0Z",
      "updated_at": "1956-09-14T17:19:55.0Z",
      "deleted_at": "1967-02-01T02:05:06.0Z"
    },
    "status": "expired",
    "source": "app",
    "payment_method": {
      "id": "voluptate laborum aliquip enim qui",
      "type": "direct_debit",
      "card_brand": "amex"
    },
    "start_date": "1959-10-25T14:44:15.0Z",
    "end_date": "1926-04-27T05:25:09.0Z",
    "basket_id": "691bd60b50291701570000cd",
    "next_billing_date": "1961-02-18T21:48:28.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
    Required

    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": "734a8618-116a-070b-63d5-0a80ea4375af",
    "membership": {
      "id": "f131b3d0-e016-042b-3585-6fbb65469daf",
      "membership_number": "00000014",
      "type_name": "Gold Membership",
      "customer_id": "a63ceca7-5cb6-d040-f710-60427775a601",
      "customer_name": "Jane Jones"
    },
    "processor": "adyen",
    "processor_data": {
      "last_4": 4001,
      "processor_type": "Cash"
    },
    "amount": 3995,
    "original_amount": 3995,
    "currency": "gbp",
    "tax": 1000,
    "status": "succeeded",
    "description": "pariatur",
    "can_download_receipt": false,
    "amount_refunded": "et laboris tempor",
    "refunded": "labore nisi Lorem sit",
    "refunds": [
      {
        "id": "9103ae45-1ef8-4ec4-17cd-c7b15f510328",
        "status": "succeeded",
        "amount": 995,
        "currency": "gbp",
        "notes": "Gesture of good will",
        "failure_reason": "invalid_details",
        "refunded_by": {
          "id": "4592b59a-e9eb-dc66-d48e-efd79cb0d4b4",
          "full_name": "Jane Jenkins"
        },
        "processor_data": {
          "processor": "adyen",
          "processor_id": "re_64301e0b2df9d11814010ea6"
        },
        "created_at": "1962-02-15T19:49:23.0Z",
        "updated_at": "1945-07-26T02:20:05.0Z"
      },
      {
        "id": "322e5ce1-4cf3-6e1c-5e98-116a21a7de54",
        "status": "succeeded",
        "amount": 995,
        "currency": "gbp",
        "notes": "Gesture of good will",
        "processor_data": {
          "processor": "adyen",
          "processor_id": "re_64301e0b2df9d11814010ea6"
        },
        "created_at": "1890-04-25T12:09:08.0Z",
        "updated_at": "1933-07-02T01:59:27.0Z"
      },
      {
        "id": "988a4508-d589-3bc7-8bdf-0399ce1e4a60",
        "status": "succeeded",
        "amount": 995,
        "currency": "gbp",
        "notes": "Gesture of good will",
        "failure_reason": "invalid_details",
        "refunded_by": {
          "id": "f1fc9d61-8d4e-f7ef-d7f9-8386986cf58b",
          "full_name": "Jane Jenkins"
        },
        "processor_data": {
          "processor": "adyen",
          "processor_id": "re_64301e0b2df9d11814010ea6"
        },
        "created_at": "1920-11-28T23:33:50.0Z",
        "updated_at": "1958-04-28T18:01:08.0Z"
      },
      {
        "id": "a2cf0b9a-d190-9619-811d-0eebcf0979b3",
        "status": "succeeded",
        "amount": 995,
        "currency": "gbp",
        "notes": "Gesture of good will",
        "refunded_by": {
          "id": "f836c3f2-0e6d-3d49-0973-0188ae7231c8",
          "full_name": "Jane Jenkins"
        },
        "processor_data": {
          "processor": "adyen",
          "processor_id": "re_64301e0b2df9d11814010ea6"
        },
        "created_at": "1968-07-24T15:53:54.0Z",
        "updated_at": "1948-11-09T19:39:07.0Z"
      },
      {
        "id": "ff025b55-a24d-a99f-d61d-9f477b838bf3",
        "status": "succeeded",
        "amount": 995,
        "currency": "gbp",
        "notes": "Gesture of good will",
        "failure_reason": "invalid_details",
        "refunded_by": {
          "id": "90d57c8a-ade2-f9f6-56cd-80e5d9ae9ace",
          "full_name": "Jane Jenkins"
        },
        "processor_data": {
          "processor": "adyen",
          "processor_id": "re_64301e0b2df9d11814010ea6"
        },
        "created_at": "1928-01-22T19:35:20.0Z",
        "updated_at": "1947-09-25T04:46:54.0Z"
      }
    ],
    "site_id": "0d4714be-f468-b3e0-9c64-3fd4c26c3d62",
    "billing_period_from": "1919-09-11",
    "billing_period_to": "1902-02-17",
    "processing_at": "1966-10-28T09:18:48.0Z",
    "created_at": "1931-06-15T06:50:55.0Z",
    "updated_at": "1966-11-28T02:01:15.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": "14e5826e-bfbb-8194-85b5-eac97b9547ce",
    "membership": {
      "id": "df107952-df63-178a-f7c9-481d85d819a6",
      "membership_number": "00000014",
      "type_name": "Gold Membership",
      "customer_id": "8551d0fc-b973-c021-9fb8-948c9d987def",
      "customer_name": "Jane Jones"
    },
    "processor": "adyen",
    "processor_data": {
      "cardholder_name": "Mrs J Jones",
      "last_4": 4001
    },
    "amount": 3995,
    "original_amount": 3995,
    "currency": "gbp",
    "tax": 1000,
    "status": "succeeded",
    "description": "in eu consectetur",
    "can_download_receipt": false,
    "amount_refunded": "ex",
    "refunded": "sint irure proident quis commodo",
    "refunds": [
      {
        "id": "e26704db-3abd-a824-1282-ba9405e86c6f",
        "status": "succeeded",
        "amount": 995,
        "currency": "gbp",
        "notes": "Gesture of good will",
        "failure_reason": "invalid_details",
        "refunded_by": {
          "id": "a1c8dd23-3580-f072-ba9f-eeea4d402142",
          "full_name": "Jane Jenkins"
        },
        "processor_data": {
          "processor": "adyen",
          "processor_id": "re_64301e0b2df9d11814010ea6"
        },
        "created_at": "1951-10-03T03:03:31.0Z",
        "updated_at": "1920-03-06T05:38:50.0Z"
      },
      {
        "id": "d0a342ed-ddb2-a62f-b609-9eb563785c07",
        "status": "succeeded",
        "amount": 995,
        "currency": "gbp",
        "notes": "Gesture of good will",
        "failure_reason": "invalid_details",
        "refunded_by": {
          "id": "7bc157ee-df5a-73ef-22c0-5922c9ee9e91",
          "full_name": "Jane Jenkins"
        },
        "processor_data": {
          "processor": "adyen",
          "processor_id": "re_64301e0b2df9d11814010ea6"
        },
        "created_at": "1950-06-07T14:17:44.0Z",
        "updated_at": "1915-05-12T01:56:32.0Z"
      },
      {
        "id": "9d5a323f-5d90-ba15-b0ad-466f0ed7d334",
        "status": "succeeded",
        "amount": 995,
        "currency": "gbp",
        "notes": "Gesture of good will",
        "failure_reason": "invalid_details",
        "refunded_by": {
          "id": "f3407869-0f5f-2c49-4563-cb457fa5278a",
          "full_name": "Jane Jenkins"
        },
        "processor_data": {
          "processor": "adyen",
          "processor_id": "re_64301e0b2df9d11814010ea6"
        },
        "created_at": "1967-10-19T11:56:26.0Z",
        "updated_at": "1928-12-26T14:15:16.0Z"
      }
    ],
    "site_id": "9611c181-dfc5-9559-532e-54f8076a885d",
    "billing_period_from": "1915-12-24",
    "billing_period_to": "1933-05-16",
    "processing_at": "1906-01-30T07:30:46.0Z",
    "created_at": "1921-02-16T05:08:58.0Z",
    "updated_at": "1892-12-31T18:17:22.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": "0828325d-37ee-08b1-e67c-46eca2bb2838",
    "membership": {
      "id": "d0774d4b-2ca4-3beb-d62b-703e3b635356",
      "membership_number": "00000014",
      "type_name": "Gold Membership",
      "customer_id": "95760056-b1a7-50ed-ef21-8d0cd3e7757f",
      "customer_name": "Jane Jones"
    },
    "processor": "adyen",
    "processor_data": {
      "cardholder_name": "Mrs J Jones",
      "last_4": 4001,
      "processor_type_id": "691bd60b50291701570000ce"
    },
    "amount": 3995,
    "original_amount": 3995,
    "currency": "gbp",
    "tax": 1000,
    "status": "succeeded",
    "description": "quis",
    "can_download_receipt": false,
    "amount_refunded": "ut irure tempor do sed",
    "refunded": "reprehenderit dolore adipisicing qui esse",
    "refunds": [
      {
        "id": "bafe5bc1-f9b6-f548-9feb-dbb438e19637",
        "status": "succeeded",
        "amount": 995,
        "currency": "gbp",
        "notes": "Gesture of good will",
        "failure_reason": "invalid_details",
        "refunded_by": {
          "id": "fcef1f0c-3833-c6db-954d-49250919879f",
          "full_name": "Jane Jenkins"
        },
        "processor_data": {
          "processor": "adyen",
          "processor_id": "re_64301e0b2df9d11814010ea6"
        },
        "created_at": "1905-04-17T02:43:34.0Z",
        "updated_at": "1968-07-28T07:32:51.0Z"
      },
      {
        "id": "ee18c57c-38a5-640a-f2d6-3b26a24d5697",
        "status": "succeeded",
        "amount": 995,
        "currency": "gbp",
        "notes": "Gesture of good will",
        "failure_reason": "invalid_details",
        "refunded_by": {
          "id": "09f9d025-66ec-e7ae-9932-88d2728186a4",
          "full_name": "Jane Jenkins"
        },
        "processor_data": {
          "processor": "adyen",
          "processor_id": "re_64301e0b2df9d11814010ea6"
        },
        "created_at": "1917-10-10T09:01:14.0Z",
        "updated_at": "1898-03-07T02:43:45.0Z"
      }
    ],
    "site_id": "f464c034-7764-e2ba-ec03-74d73566cba1",
    "billing_period_from": "1941-11-13",
    "billing_period_to": "1917-12-29",
    "processing_at": "1948-02-19T01:39:43.0Z",
    "created_at": "1929-08-07T18:08:37.0Z",
    "updated_at": "1939-09-30T08:40:26.0Z"
  }
}
404
example response
{
  "message": "The requested resource could not be found"
}