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": "74b16389-50ed-ad21-bd7c-ce1ac03ea429",
      "site_id": "c4bba1a3-f497-c291-013e-1202ca88ed94",
      "membership_number": "1234567890",
      "customer": {
        "id": "2c8aa741-1e18-d935-4ca6-d3c4485268b3",
        "first_name": "Jane",
        "last_name": "Doe",
        "full_name": "Jane Doe",
        "phone": "+447900000000",
        "has_password": true,
        "dob": "1968-11-22",
        "brand_id": "9ce9bfaa-5382-c75b-a957-4707775363dd",
        "site_id": "a8485e88-b3d7-4936-4542-b5145d08c997",
        "stripe_id": "cus_1234567890",
        "express_stripe_id": "cus_1234567890",
        "email": "janedoe@example.com",
        "labels": [
          {
            "id": "4a68c9e5-5fd5-8971-559d-b66d9079484f",
            "name": "VIP",
            "color": "ff6634"
          },
          {
            "id": "38434be0-fc36-f7d4-9ff3-c4260af89480",
            "name": "VIP",
            "color": "ff6634"
          }
        ],
        "preferred_locale": "en",
        "locked_at": "1966-12-17T16:34:44.0Z",
        "created_at": "1903-02-08T19:06:46.0Z",
        "updated_at": "1903-04-08T09:01:24.0Z",
        "deleted_at": "1938-06-18T03:23:41.0Z",
        "last_active_at": "1939-01-29T14:23:39.0Z",
        "email_verified_at": "1922-01-23T15:59:39.0Z",
        "last_check_in": {
          "checked_in_at": "1931-07-09T19:37:16.0Z",
          "method": "Scanned"
        },
        "avatar_id": "000000-000000-000000-000000",
        "avatar": {
          "id": "176647c5-9e4a-6185-45b3-5dba7fa628b5",
          "file_name": "super-cool-photo.jpg",
          "mime_type": "image/jpeg",
          "size": 84256,
          "url": "https://example.com/media/super-cool-photo.jpg"
        },
        "external_ref": "mollit occaecat cillum incididunt"
      },
      "members": [
        {
          "customer_id": "a0771a98-9499-626f-0090-b764d8fcacf5",
          "is_lead": false
        },
        {
          "customer_id": "e2fd48f3-8a65-ad89-438d-4ef007bb165c",
          "membership_number": "1234567890",
          "is_lead": false
        }
      ],
      "type": {
        "id": "da3e422a-bdd5-ec87-cdc1-d0d21719b1f7",
        "name": "Gold tier",
        "description": "Enjoy exclusive benefits as part of being a member in our Gold tier",
        "terms": "laborum esse amet nulla non",
        "brand_id": "97e89073-9a9b-a20e-311c-65a99e040707",
        "offline_payments": false,
        "disable_confirmation_email": false,
        "private": false,
        "visibility": "link_only",
        "minimum_start_date": "1905-01-30T08:58:55.0Z",
        "min_members": 2,
        "max_members": 4,
        "rates": [],
        "revenue_schedule": "FREQ=WEEKLY",
        "created_at": "1951-07-01T17:01:50.0Z",
        "updated_at": "1926-07-30T13:33:43.0Z",
        "deleted_at": "1896-07-26T10:22:04.0Z"
      },
      "rate": {
        "id": "505d3c37-08fd-16f8-f8ff-610852381607",
        "membership_type_id": "b128b139-8234-6488-8ba0-a3f4c6cdd8ce",
        "name": "Standard rate",
        "currency": "GBP",
        "price": 5000,
        "tax": 1250,
        "default_duration": "P1Y",
        "private": true,
        "created_at": "1929-05-05T16:21:42.0Z",
        "updated_at": "1948-11-17T14:41:39.0Z"
      },
      "status": "expired",
      "source": "self_signup",
      "payment_method": {
        "last_4": "do culpa irure dolor"
      },
      "start_date": "1906-05-03T06:24:45.0Z",
      "end_date": "1945-03-19T13:34:39.0Z",
      "created_at": "1895-11-04T21:20:47.0Z",
      "basket_id": "6927080f7676cc012b0000d4",
      "external_ref": "laborum enim veniam ut",
      "next_billing_date": "1930-11-15T14:26:53.0Z"
    },
    {
      "id": "079636c9-129f-b371-bdff-5c075f7e487d",
      "customer": {
        "id": "b1e2d32f-2a54-7016-c606-1945a60becc7",
        "first_name": "Jane",
        "last_name": "Doe",
        "full_name": "Jane Doe",
        "phone": "+447900000000",
        "has_password": true,
        "dob": "1908-09-08",
        "brand_id": "1a52c516-ab3a-24ed-6041-b5e7977379eb",
        "site_id": "c716fdad-f040-1111-dd88-806685c02596",
        "stripe_id": "cus_1234567890",
        "express_stripe_id": "cus_1234567890",
        "email": "janedoe@example.com",
        "labels": [
          {
            "id": "5c8a4e83-991b-451a-f5d0-7f53135e0e58",
            "name": "VIP",
            "color": "ff6634"
          },
          {
            "id": "31093dae-e9ea-f610-f3e8-6ae049afb114",
            "name": "VIP",
            "color": "ff6634"
          },
          {
            "id": "8262be3b-affd-1c32-e707-43b5c27fb249",
            "name": "VIP",
            "color": "ff6634"
          },
          {
            "id": "16ffc2de-677a-88cd-2969-88ce667f1a73",
            "name": "VIP",
            "color": "ff6634"
          }
        ],
        "preferred_locale": "en",
        "locked_at": "1933-03-29T05:35:17.0Z",
        "created_at": "1916-10-30T06:29:07.0Z",
        "updated_at": "1914-09-25T07:57:03.0Z",
        "deleted_at": "1892-03-21T02:38:35.0Z",
        "last_active_at": "1941-05-04T10:42:52.0Z",
        "email_verified_at": "1938-05-20T04:19:15.0Z",
        "last_check_in": {
          "checked_in_at": "1948-12-01T03:10:23.0Z",
          "method": "Scanned"
        },
        "avatar_id": "000000-000000-000000-000000",
        "avatar": {
          "id": "6024ece3-1964-1566-3898-2fd8acc759c6",
          "file_name": "super-cool-photo.jpg",
          "mime_type": "image/jpeg",
          "size": 84256,
          "url": "https://example.com/media/super-cool-photo.jpg"
        },
        "external_ref": "nulla adipisicing veniam"
      },
      "members": [],
      "type": {
        "id": "7e778671-6d14-b59c-b387-673884540a45",
        "name": "Gold tier",
        "description": "Enjoy exclusive benefits as part of being a member in our Gold tier",
        "terms": "sed dolor",
        "brand_id": "997f06c7-8c1b-3701-dd05-ff7f43bff207",
        "offline_payments": false,
        "disable_confirmation_email": true,
        "private": true,
        "visibility": "public",
        "minimum_start_date": "1932-01-26T10:43:54.0Z",
        "min_members": 2,
        "max_members": 4,
        "rates": [
          {
            "id": "1a3a060e-c325-91b0-8c78-a75db6eb173e",
            "membership_type_id": "dd5e7cf7-b6ea-f3ce-ec34-069556fc729a",
            "name": "Standard rate",
            "currency": "GBP",
            "price": 5000,
            "joining_fee": 1000,
            "tax": 1250,
            "billing_frequency": "P1M",
            "processors": [
              "pariatur officia",
              "nulla et"
            ],
            "default_duration": "P1Y",
            "private": true,
            "created_at": "1932-05-07T19:51:45.0Z"
          },
          {
            "name": "Standard rate",
            "tax": 1250,
            "processors": [
              "amet cillum",
              "laboris non",
              "Excepteur labore amet",
              "non Lorem",
              "dolore sed occaecat"
            ],
            "default_duration": "P1Y",
            "updated_at": "1903-04-13T16:37:18.0Z"
          }
        ],
        "revenue_schedule": "FREQ=WEEKLY",
        "created_at": "1924-12-28T15:41:04.0Z",
        "updated_at": "1895-04-14T06:17:48.0Z",
        "deleted_at": "1897-07-27T07:10:41.0Z"
      },
      "status": "inactive",
      "source": "unknown",
      "start_date": "1942-02-12T16:33:32.0Z",
      "end_date": "1921-06-08T05:28:10.0Z",
      "basket_id": "6927080f7676cc012b0000d5",
      "external_ref": "pariatur voluptate veniam ad",
      "next_billing_date": "1919-05-26T21:50:05.0Z",
      "next_charge": {
        "id": "efb3b32a-09ce-730a-6e8c-5d7501b59265",
        "amount": 3995,
        "currency": "GBP",
        "status": "awaiting_approval",
        "billing_period_from": "1966-06-13",
        "billing_period_to": "1953-10-20"
      },
      "attention_reason": "payment_disputed"
    }
  ],
  "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": {
    "customer": {
      "id": "ada1410f-61f2-f38f-bf68-71ca298388cb",
      "first_name": "Jane",
      "last_name": "Doe",
      "full_name": "Jane Doe",
      "phone": "+447900000000",
      "has_password": true,
      "dob": "1949-01-05",
      "brand_id": "727620fa-e932-129e-029f-9a4b33ba4ad3",
      "site_id": "d914313c-7cd5-9bfe-2432-1e478b20f1a8",
      "stripe_id": "cus_1234567890",
      "express_stripe_id": "cus_1234567890",
      "email": "janedoe@example.com",
      "labels": [
        {
          "id": "52e4ccfd-fad5-3268-f5bb-29467222329d",
          "name": "VIP",
          "color": "ff6634"
        },
        {
          "id": "587867de-37c3-0eef-3936-301b15ef9ce0",
          "name": "VIP",
          "color": "ff6634"
        }
      ],
      "preferred_locale": "en",
      "locked_at": "1926-05-01T23:28:39.0Z",
      "created_at": "1896-09-05T03:37:22.0Z",
      "updated_at": "1961-12-23T19:49:14.0Z",
      "deleted_at": "1952-02-06T02:58:07.0Z",
      "last_active_at": "1961-07-22T12:44:06.0Z",
      "email_verified_at": "1937-10-07T12:48:24.0Z",
      "last_check_in": {
        "checked_in_at": "1911-07-12T03:51:37.0Z",
        "method": "Scanned"
      },
      "avatar_id": "000000-000000-000000-000000",
      "avatar": {
        "id": "5b85bff7-0322-dc27-f72c-0400401e1726",
        "file_name": "super-cool-photo.jpg",
        "mime_type": "image/jpeg",
        "size": 84256,
        "url": "https://example.com/media/super-cool-photo.jpg"
      },
      "external_ref": "ea deserunt"
    },
    "members": [
      {
        "customer_id": "d9f62d8e-a88a-bff0-eb35-e46af3430758"
      },
      {
        "customer_id": "40ba39e4-e5b3-d02e-2365-156330506d67"
      },
      {
        "customer_id": "e5377844-c65c-c039-bd3b-d0bad374b564",
        "membership_number": "1234567890",
        "is_lead": false
      },
      {
        "customer_id": "f7b6ff02-b386-cf55-4362-790c480b5d45",
        "membership_number": "1234567890",
        "is_lead": false
      }
    ],
    "status": "active",
    "external_ref": "ut fugiat",
    "next_billing_date": "1938-03-28T06:33:38.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": "4027bfdb-fdad-b063-49a8-6bbea61a7950",
    "membership": {
      "id": "c3c5f450-9b66-ebaa-5039-bf4055956256",
      "membership_number": "00000014",
      "type_name": "Gold Membership",
      "customer_id": "8cd737f4-6c42-c936-088c-b0c12e67c749",
      "customer_name": "Jane Jones"
    },
    "processor": "adyen",
    "processor_data": {
      "cardholder_name": "Mrs J Jones",
      "last_4": 4001,
      "processor_type": "Cash",
      "processor_type_id": "6927080f7676cc012b0000d6"
    },
    "amount": 3995,
    "original_amount": 3995,
    "currency": "gbp",
    "tax": 1000,
    "status": "succeeded",
    "description": "consequat",
    "can_download_receipt": false,
    "amount_refunded": "Ut qui Lorem culpa id",
    "refunded": "aute in voluptate laboris officia",
    "refunds": [
      {
        "id": "37a76ca9-02b7-a8a5-143d-e7fa85dab0d5",
        "status": "succeeded",
        "amount": 995,
        "currency": "gbp",
        "notes": "Gesture of good will",
        "failure_reason": "invalid_details",
        "refunded_by": {
          "id": "2278f79d-4fb2-fe2e-01a6-ccae0f3831fc",
          "full_name": "Jane Jenkins"
        },
        "processor_data": {
          "processor": "adyen",
          "processor_id": "re_64301e0b2df9d11814010ea6"
        },
        "created_at": "1966-05-08T22:16:39.0Z",
        "updated_at": "1938-02-14T01:41:06.0Z"
      },
      {
        "id": "e6af39f3-1ad6-09ff-738f-8581ff335d22",
        "status": "succeeded",
        "amount": 995,
        "currency": "gbp",
        "notes": "Gesture of good will",
        "failure_reason": "invalid_details",
        "refunded_by": {
          "id": "e4da2287-8b10-c356-1a5f-ced185451e4f",
          "full_name": "Jane Jenkins"
        },
        "processor_data": {
          "processor": "adyen",
          "processor_id": "re_64301e0b2df9d11814010ea6"
        },
        "created_at": "1918-05-01T05:46:01.0Z",
        "updated_at": "1941-08-19T21:05:15.0Z"
      },
      {
        "id": "f21f2d41-e98f-2dfb-d2ed-a6e6e21f4357",
        "status": "succeeded",
        "amount": 995,
        "currency": "gbp",
        "notes": "Gesture of good will",
        "failure_reason": "invalid_details",
        "refunded_by": {
          "id": "b1f8fdf4-110d-d1dc-e85f-ef8077d55efd",
          "full_name": "Jane Jenkins"
        },
        "processor_data": {
          "processor": "adyen",
          "processor_id": "re_64301e0b2df9d11814010ea6"
        },
        "created_at": "1910-05-02T23:55:28.0Z",
        "updated_at": "1903-03-27T12:39:57.0Z"
      },
      {
        "id": "36ca8cc0-1405-e259-6139-51e747711930",
        "status": "succeeded",
        "amount": 995,
        "currency": "gbp",
        "notes": "Gesture of good will",
        "failure_reason": "invalid_details",
        "refunded_by": {
          "id": "27b67262-5be3-4dd2-e7a0-7a36b9b7f24f",
          "full_name": "Jane Jenkins"
        },
        "processor_data": {
          "processor": "adyen",
          "processor_id": "re_64301e0b2df9d11814010ea6"
        },
        "created_at": "1967-12-14T22:32:09.0Z",
        "updated_at": "1908-03-21T04:36:56.0Z"
      },
      {
        "id": "47efe1ec-9e30-e809-3578-0e09820ddc2e",
        "status": "succeeded",
        "amount": 995,
        "currency": "gbp",
        "notes": "Gesture of good will",
        "refunded_by": {
          "id": "dd69e540-07b6-77af-032b-bc2086b65385",
          "full_name": "Jane Jenkins"
        },
        "processor_data": {
          "processor": "adyen",
          "processor_id": "re_64301e0b2df9d11814010ea6"
        },
        "created_at": "1946-04-03T18:03:40.0Z",
        "updated_at": "1969-08-04T07:40:25.0Z"
      }
    ],
    "site_id": "6059b44b-4b47-58f4-7ee3-aa73633dd492",
    "billing_period_from": "1966-12-19",
    "billing_period_to": "1951-05-08",
    "processing_at": "1926-02-16T14:56:42.0Z",
    "created_at": "1950-01-10T23:23:01.0Z",
    "updated_at": "1933-05-15T18:30:12.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": "abf70bf7-d248-7f64-237a-fda2ddbef35a",
    "membership": {
      "id": "97398284-e9fd-166a-06bc-12458669e404",
      "membership_number": "00000014",
      "type_name": "Gold Membership",
      "customer_id": "8674705b-8de5-4b23-7875-884759307db1",
      "customer_name": "Jane Jones"
    },
    "processor": "adyen",
    "processor_data": {
      "cardholder_name": "Mrs J Jones",
      "processor_type": "Cash",
      "processor_type_id": "6927080f7676cc012b0000d7"
    },
    "amount": 3995,
    "original_amount": 3995,
    "currency": "gbp",
    "tax": 1000,
    "status": "succeeded",
    "description": "incididunt",
    "can_download_receipt": false,
    "amount_refunded": "adipisicing",
    "refunded": "irure veniam Excepteur in adipisicing",
    "refunds": [
      {
        "id": "5f84cbc4-3d16-cff2-35e7-f00b23b4ebdd",
        "status": "succeeded",
        "amount": 995,
        "currency": "gbp",
        "notes": "Gesture of good will",
        "failure_reason": "invalid_details",
        "refunded_by": {
          "id": "d6ceff6d-667e-5115-1d0e-88748d076316",
          "full_name": "Jane Jenkins"
        },
        "processor_data": {
          "processor": "adyen",
          "processor_id": "re_64301e0b2df9d11814010ea6"
        },
        "created_at": "1895-04-25T11:24:36.0Z",
        "updated_at": "1926-12-28T17:48:06.0Z"
      },
      {
        "id": "df4c7077-6e44-d23e-ce3c-712469c307be",
        "status": "succeeded",
        "amount": 995,
        "currency": "gbp",
        "notes": "Gesture of good will",
        "failure_reason": "invalid_details",
        "refunded_by": {
          "id": "ab504e60-371c-3205-f484-2e370eb1b2fb",
          "full_name": "Jane Jenkins"
        },
        "processor_data": {
          "processor": "adyen",
          "processor_id": "re_64301e0b2df9d11814010ea6"
        },
        "created_at": "1938-05-07T17:45:30.0Z",
        "updated_at": "1891-03-29T05:55:38.0Z"
      },
      {
        "id": "386a3532-274b-4112-0fd1-5770aac6e281",
        "status": "succeeded",
        "amount": 995,
        "currency": "gbp",
        "notes": "Gesture of good will",
        "failure_reason": "invalid_details",
        "refunded_by": {
          "id": "133aa41b-4ed3-9c91-173d-310db65c10fe",
          "full_name": "Jane Jenkins"
        },
        "processor_data": {
          "processor": "adyen",
          "processor_id": "re_64301e0b2df9d11814010ea6"
        },
        "created_at": "1942-05-10T23:02:24.0Z",
        "updated_at": "1949-10-01T19:22:20.0Z"
      },
      {
        "id": "53ebca3a-2096-c549-3953-927c5fb384f2",
        "status": "succeeded",
        "amount": 995,
        "currency": "gbp",
        "notes": "Gesture of good will",
        "failure_reason": "invalid_details",
        "refunded_by": {
          "id": "d8603f67-214b-4634-02ec-e8779eda2c9a",
          "full_name": "Jane Jenkins"
        },
        "processor_data": {
          "processor": "adyen",
          "processor_id": "re_64301e0b2df9d11814010ea6"
        },
        "created_at": "1910-01-24T20:46:40.0Z",
        "updated_at": "1949-03-07T01:53:43.0Z"
      }
    ],
    "site_id": "6dc921fe-948f-e9ce-c398-27c6f9f743b9",
    "billing_period_from": "1899-11-08",
    "billing_period_to": "1902-03-13",
    "processing_at": "1904-08-29T22:33:40.0Z",
    "created_at": "1909-08-04T01:44:34.0Z",
    "updated_at": "1958-01-31T16:55:30.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": "87cd2701-db20-3707-491f-3111d9478afa",
    "membership": {
      "id": "853aac53-c839-c1af-078a-9b0fcc6b3903",
      "membership_number": "00000014",
      "type_name": "Gold Membership",
      "customer_id": "c843c953-ccd2-755d-05e7-840646456868",
      "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": "pariatur dolore",
    "can_download_receipt": true,
    "amount_refunded": "voluptate sed occaecat ad fugiat",
    "refunded": "cillum officia fugiat ut",
    "refunds": [],
    "site_id": "783f5857-83e7-2de7-c228-4e50b80d6a1b",
    "billing_period_from": "1947-06-11",
    "billing_period_to": "1911-06-06",
    "processing_at": "1958-06-01T07:54:34.0Z",
    "created_at": "1969-11-29T13:08:22.0Z",
    "updated_at": "1904-01-30T09:50:30.0Z"
  }
}
404
example response
{
  "message": "The requested resource could not be found"
}