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": "8ad93346-da3d-4df8-a66c-56dd0557d653",
    "attention_reason": "payment_outstanding",
    "basket_id": "6a158fe81de4ab01720000a8",
    "customer": {
      "id": "c728da2d-4dfa-6028-ed88-5b7e6bfc804d",
      "first_name": "Jane",
      "last_name": "Doe",
      "full_name": "Jane Doe",
      "phone": "+447900000000",
      "has_password": true,
      "dob": "1925-04-26",
      "brand_id": "eb0a483b-4cc7-920c-01a0-7d5008df13b9",
      "site_id": "300dbb98-0143-f7e4-395c-0f6a3362c0ca",
      "stripe_id": "cus_1234567890",
      "express_stripe_id": "cus_1234567890",
      "email": "janedoe@example.com",
      "labels": [
        {
          "id": "d15bcfcc-6467-441b-db3f-7edc6af3dc6c",
          "value": "VIP",
          "colour": "ff6634"
        },
        {
          "id": "ac0171e5-c271-a97e-843d-7c8a06778205",
          "value": "VIP",
          "colour": "ff6634"
        }
      ],
      "preferred_locale": "en",
      "locked_at": "1965-12-23T10:01:54.0Z",
      "created_at": "1944-05-05T14:35:43.0Z",
      "updated_at": "1969-12-29T05:50:32.0Z",
      "deleted_at": "1897-08-07T22:13:20.0Z",
      "last_active_at": "1929-10-16T01:10:32.0Z",
      "email_verified_at": "1940-11-24T03:08:40.0Z",
      "last_check_in": {
        "checked_in_at": "1893-11-08T23:33:58.0Z",
        "method": "Scanned"
      },
      "avatar_id": "000000-000000-000000-000000",
      "avatar": {
        "id": "116b1c87-d411-dced-502e-91fb59585abf",
        "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": "dolor laborum minim"
    },
    "end_date": "1931-09-24T16:45:03.0Z",
    "external_ref": "aute",
    "members": [
      {
        "customer_id": "39d6b181-9e8f-ee0e-4434-bed5b04efaca",
        "is_lead": false,
        "membership_number": "1234567890"
      },
      {
        "customer_id": "629a92bd-2bc3-8940-8faa-5e8ace7e177a",
        "is_lead": false,
        "membership_number": "1234567890"
      },
      {
        "customer_id": "f758a092-1633-2e7d-a24d-11666ff659a8",
        "is_lead": true,
        "membership_number": "1234567890"
      }
    ],
    "membership_number": "1234567890",
    "next_billing_date": "1917-06-06T06:27:19.0Z",
    "next_charge": {
      "id": "4369dfee-38d8-a787-d82b-83d03179bd5c",
      "amount": 3995,
      "currency": "GBP",
      "status": "awaiting_approval",
      "billing_period_from": "1969-09-15",
      "billing_period_to": "1962-05-31"
    },
    "payment_method": {
      "id": "anim",
      "type": "direct_debit",
      "last_4": "laborum eu",
      "status": "revoked",
      "card_brand": "amex"
    },
    "rate": {
      "id": "2344a605-ea75-2091-b935-692489597e8f",
      "membership_type_id": "eab890ad-a8e5-26f5-c3b7-82dc10d91e73",
      "name": "Standard rate",
      "currency": "GBP",
      "price": 5000,
      "joining_fee": 1000,
      "billing_frequency": "P1M",
      "processors": [
        "Duis Ut do Excepteur"
      ],
      "default_duration": "P1Y",
      "private": true,
      "created_at": "1965-03-15T19:06:02.0Z",
      "updated_at": "1952-05-03T06:53:20.0Z"
    },
    "site_id": "5b4bde77-99b1-3500-6c9c-e9fab30053f4",
    "source": "app",
    "start_date": "1966-03-21T18:01:17.0Z",
    "status": "reserved",
    "status_updated_at": "1924-11-18T08:21:46.0Z",
    "type": {
      "id": "b3fdd82f-56e5-cc2b-88c8-7110ae5e1def",
      "name": "Gold tier",
      "description": "Enjoy exclusive benefits as part of being a member in our Gold tier",
      "terms": "dolore sint",
      "brand_id": "46c54e28-f53c-fec8-402d-cfb01a54abb6",
      "offline_payments": false,
      "disable_confirmation_email": false,
      "private": true,
      "visibility": "link_only",
      "minimum_start_date": "1927-06-16T05:55:48.0Z",
      "min_members": 2,
      "max_members": 4,
      "rates": [
        {
          "id": "3229b06a-fc93-6756-26d2-71dec07db2a6",
          "membership_type_id": "44df298e-e5b7-6c23-7291-fc181999eb1a",
          "name": "Standard rate",
          "currency": "GBP",
          "price": 5000,
          "joining_fee": 1000,
          "billing_frequency": "P1M",
          "processors": [
            "consequat qui",
            "officia Excepteur dolore",
            "pariatur",
            "ex",
            "ad"
          ],
          "default_duration": "P1Y",
          "private": true,
          "created_at": "1944-04-08T20:19:51.0Z",
          "updated_at": "1933-03-16T09:01:16.0Z"
        },
        {
          "id": "1ccd1d9d-14c1-8651-7347-c38f85226fc0",
          "membership_type_id": "0d6d3dae-1f66-a273-917d-dbc1bbb6b421",
          "name": "Standard rate",
          "currency": "GBP",
          "price": 5000,
          "joining_fee": 1000,
          "billing_frequency": "P1M",
          "processors": [
            "laborum qui"
          ],
          "default_duration": "P1Y",
          "private": true,
          "created_at": "1920-03-15T11:21:42.0Z",
          "updated_at": "1951-08-07T12:34:27.0Z"
        }
      ],
      "revenue_schedule": "FREQ=WEEKLY",
      "created_at": "1922-02-10T16:29:04.0Z",
      "updated_at": "1969-02-16T13:14:06.0Z",
      "deleted_at": "1904-06-26T06:35:46.0Z"
    },
    "payment_details_url": "consectetur fugiat dolor",
    "created_at": "1895-11-07T11:44:23.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": "b53e65fb-bd0d-1cbe-febb-88d7416645d7",
    "membership": {
      "id": "f0baf83f-6e75-371c-df04-2a832e4db6b5",
      "membership_number": "00000014",
      "type_name": "Gold Membership",
      "customer_id": "79d012ab-0f56-0ba1-d4fe-48664fd80f14"
    },
    "processor": "adyen",
    "processor_data": {
      "cardholder_name": "Mrs J Jones",
      "last_4": 4001,
      "processor_type": "Cash",
      "processor_type_id": "6a158fe91de4ab01720001e6"
    },
    "amount": 3995,
    "original_amount": 3995,
    "currency": "gbp",
    "tax": 1000,
    "status": "succeeded",
    "description": "mollit Duis amet laborum",
    "can_download_receipt": true,
    "amount_refunded": 50470403,
    "refunded": true,
    "refunds": [
      {
        "id": "100ed8fd-195e-96df-44cf-48d734d01941",
        "status": "succeeded",
        "amount": 995,
        "currency": "gbp",
        "notes": "Gesture of good will",
        "refunded_by": {
          "id": "12802d22-b2a1-f207-5cc2-6c760f073817",
          "full_name": "Jane Jenkins"
        },
        "processor_data": {
          "processor": "adyen",
          "processor_id": "re_64301e0b2df9d11814010ea6"
        },
        "created_at": "1929-05-02T03:59:21.0Z",
        "updated_at": "1961-11-24T04:45:35.0Z"
      },
      {
        "id": "3bb59edd-5229-4cd5-6d34-73ade4b9e5a3",
        "status": "succeeded",
        "amount": 995,
        "currency": "gbp",
        "notes": "Gesture of good will",
        "failure_reason": "invalid_details",
        "refunded_by": {
          "id": "62a30ab2-ef78-10a7-1e04-25776f18f41a",
          "full_name": "Jane Jenkins"
        },
        "processor_data": {
          "processor": "adyen",
          "processor_id": "re_64301e0b2df9d11814010ea6"
        },
        "created_at": "1941-03-14T17:06:27.0Z",
        "updated_at": "1937-05-09T13:06:28.0Z"
      }
    ],
    "site_id": "8da7eaae-6149-15b0-158a-798dbbba1221",
    "billing_period_from": "1960-07-06",
    "billing_period_to": "1902-04-26",
    "processing_at": "1923-11-25T02:30:09.0Z",
    "created_at": "1902-06-05T20:14:31.0Z",
    "updated_at": "1919-09-09T12:18:36.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": "42d6b9a0-53eb-759a-357b-609ebf0f976c",
    "membership": {
      "id": "cb46f9bc-dc5f-90b7-8802-29a1bdf70042",
      "membership_number": "00000014",
      "type_name": "Gold Membership",
      "customer_id": "02c09032-14df-c1e6-c34e-3a6a9d90b142",
      "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": "aliquip commodo",
    "can_download_receipt": true,
    "amount_refunded": -37163641,
    "refunded": false,
    "refunds": [
      {
        "id": "84cef656-b626-6400-216c-e3ae9363c3e0",
        "status": "succeeded",
        "amount": 995,
        "currency": "gbp",
        "notes": "Gesture of good will",
        "failure_reason": "invalid_details",
        "refunded_by": {
          "id": "d7a44863-6c58-6a34-03f6-225dde1140f9",
          "full_name": "Jane Jenkins"
        },
        "processor_data": {
          "processor": "adyen",
          "processor_id": "re_64301e0b2df9d11814010ea6"
        },
        "created_at": "1923-09-19T03:15:16.0Z",
        "updated_at": "1922-03-29T21:34:13.0Z"
      },
      {
        "id": "49b1ce75-6728-e08b-c734-594a86c86cf1",
        "status": "succeeded",
        "amount": 995,
        "currency": "gbp",
        "notes": "Gesture of good will",
        "refunded_by": {
          "id": "992830e4-c0a3-f167-1c27-a44d0caebed0",
          "full_name": "Jane Jenkins"
        },
        "processor_data": {
          "processor": "adyen",
          "processor_id": "re_64301e0b2df9d11814010ea6"
        },
        "created_at": "1941-03-06T07:04:40.0Z",
        "updated_at": "1924-12-02T20:26:32.0Z"
      },
      {
        "id": "b18d867f-6cc3-788d-fe71-0b8c8b46ffe1",
        "status": "succeeded",
        "amount": 995,
        "currency": "gbp",
        "notes": "Gesture of good will",
        "failure_reason": "invalid_details",
        "refunded_by": {
          "id": "d2c07df6-2924-73e7-6fdc-d70428b692ff",
          "full_name": "Jane Jenkins"
        },
        "processor_data": {
          "processor": "adyen",
          "processor_id": "re_64301e0b2df9d11814010ea6"
        },
        "created_at": "1954-09-06T12:24:31.0Z",
        "updated_at": "1966-03-10T04:43:13.0Z"
      },
      {
        "id": "20764789-7504-2c35-85a9-15d255c5498c",
        "status": "succeeded",
        "amount": 995,
        "currency": "gbp",
        "notes": "Gesture of good will",
        "failure_reason": "invalid_details",
        "refunded_by": {
          "id": "af38b975-3b9f-8897-b14b-78786774b50d",
          "full_name": "Jane Jenkins"
        },
        "processor_data": {
          "processor": "adyen",
          "processor_id": "re_64301e0b2df9d11814010ea6"
        },
        "created_at": "1948-03-20T04:18:09.0Z",
        "updated_at": "1901-04-18T17:27:43.0Z"
      },
      {
        "id": "af73698e-7cd8-c835-4c41-26ccea5a0279",
        "status": "succeeded",
        "amount": 995,
        "currency": "gbp",
        "notes": "Gesture of good will",
        "failure_reason": "invalid_details",
        "refunded_by": {
          "id": "3954f1fa-de54-fba9-a08e-b9022eda22c0",
          "full_name": "Jane Jenkins"
        },
        "processor_data": {
          "processor": "adyen",
          "processor_id": "re_64301e0b2df9d11814010ea6"
        },
        "created_at": "1923-08-17T11:49:09.0Z",
        "updated_at": "1969-06-14T13:20:33.0Z"
      }
    ],
    "site_id": "6c9cd8d7-21bc-5a1d-9863-d0397d9ff2cf",
    "billing_period_from": "1891-10-11",
    "billing_period_to": "1894-03-06",
    "processing_at": "1955-06-19T04:02:31.0Z",
    "created_at": "1946-07-09T05:05:12.0Z",
    "updated_at": "1898-07-19T21:03:02.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": "1c025736-4d01-2423-8e15-183b6b1444b7",
    "membership": {
      "id": "d9c259dc-ec9c-7c2f-1849-a1765c4a6820",
      "membership_number": "00000014",
      "type_name": "Gold Membership",
      "customer_id": "2bcdba92-064f-d3e6-8b93-57ff01b42f99",
      "customer_name": "Jane Jones"
    },
    "processor": "adyen",
    "processor_data": {
      "processor_type": "Cash",
      "processor_type_id": "6a158fe81de4ab01720000a9"
    },
    "amount": 3995,
    "original_amount": 3995,
    "currency": "gbp",
    "tax": 1000,
    "status": "succeeded",
    "description": "dolor id eiusmod",
    "can_download_receipt": true,
    "amount_refunded": 78189015,
    "refunded": true,
    "refunds": [
      {
        "id": "34bdb88a-5f00-16e1-6f3c-28d21b9d2fe6",
        "status": "succeeded",
        "amount": 995,
        "currency": "gbp",
        "notes": "Gesture of good will",
        "failure_reason": "invalid_details",
        "refunded_by": {
          "id": "954c259e-2270-28ad-b1b7-cf722daec94e",
          "full_name": "Jane Jenkins"
        },
        "processor_data": {
          "processor": "adyen",
          "processor_id": "re_64301e0b2df9d11814010ea6"
        },
        "created_at": "1953-05-19T05:17:01.0Z",
        "updated_at": "1952-05-24T20:34:27.0Z"
      },
      {
        "id": "a439b6de-097a-0609-1b88-5af2d6c23abe",
        "status": "succeeded",
        "amount": 995,
        "currency": "gbp",
        "notes": "Gesture of good will",
        "failure_reason": "invalid_details",
        "refunded_by": {
          "id": "3964b1d0-87c0-a0bc-d0f3-aa2320f3cc7d",
          "full_name": "Jane Jenkins"
        },
        "processor_data": {
          "processor": "adyen",
          "processor_id": "re_64301e0b2df9d11814010ea6"
        },
        "created_at": "1937-02-24T21:32:36.0Z",
        "updated_at": "1965-08-07T22:01:54.0Z"
      },
      {
        "id": "a74c5aee-aa5c-7c34-5a81-b3b952288a83",
        "status": "succeeded",
        "amount": 995,
        "currency": "gbp",
        "notes": "Gesture of good will",
        "failure_reason": "invalid_details",
        "refunded_by": {
          "id": "c695d564-dde4-57bd-6af6-d8445e0c5a85",
          "full_name": "Jane Jenkins"
        },
        "processor_data": {
          "processor": "adyen",
          "processor_id": "re_64301e0b2df9d11814010ea6"
        },
        "created_at": "1958-08-04T22:29:38.0Z",
        "updated_at": "1906-02-17T02:31:07.0Z"
      },
      {
        "id": "c1a40a39-b8ba-a101-2b9c-44ee6778d084",
        "status": "succeeded",
        "amount": 995,
        "currency": "gbp",
        "notes": "Gesture of good will",
        "failure_reason": "invalid_details",
        "refunded_by": {
          "id": "b5e2f4cf-37a9-0b4f-025b-3514aa9fb459",
          "full_name": "Jane Jenkins"
        },
        "processor_data": {
          "processor": "adyen",
          "processor_id": "re_64301e0b2df9d11814010ea6"
        },
        "created_at": "1964-01-13T01:46:32.0Z",
        "updated_at": "1922-07-14T18:30:56.0Z"
      },
      {
        "id": "5c33fda2-1f00-56f7-4436-63ee2a29fb16",
        "status": "succeeded",
        "amount": 995,
        "currency": "gbp",
        "notes": "Gesture of good will",
        "failure_reason": "invalid_details",
        "refunded_by": {
          "id": "9bf80948-bf4e-ab94-fc7d-8185a3e0d5b5",
          "full_name": "Jane Jenkins"
        },
        "processor_data": {
          "processor": "adyen",
          "processor_id": "re_64301e0b2df9d11814010ea6"
        },
        "created_at": "1936-09-14T09:20:27.0Z",
        "updated_at": "1964-11-08T05:20:36.0Z"
      }
    ],
    "site_id": "cb80de54-4636-7adc-663d-a072651c5b98",
    "billing_period_from": "1909-01-12",
    "billing_period_to": "1906-08-21",
    "processing_at": "1912-06-08T08:17:40.0Z",
    "created_at": "1949-02-04T01:03:52.0Z",
    "updated_at": "1944-12-24T07:52:42.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": "6a158fe91de4ab01720001e7",
    "organisation_id": "c7472d1a-eda2-5f6d-6750-944c326e078f",
    "site_id": "1943c058-ee24-109b-0c51-d5bc84b0224c",
    "customer_id": "7bc001da-8a0a-245f-17ce-e5fdf34583b1",
    "membership_id": "aa62ab78-65b4-0346-77b7-7890a7da8b89",
    "from": "Trybe",
    "to": "+447123456789",
    "message": "non nostrud tempor",
    "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": {
    "amet6_": [
      "ut enim et eiusmod nulla",
      "est ex non aliqua",
      "esse proident",
      "eu nostrud ex",
      "sit elit"
    ],
    "enim_9": [
      "cillum Ut velit non"
    ],
    "culpac86": [
      "veniam dolor",
      "sunt Excepteur cupidatat",
      "in est veniam ut",
      "officia proident Ut cillum minim"
    ]
  },
  "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": "dfef4410-ee10-9e9c-eed7-9fd0529422c0",
    "organisation_id": "49ba7d25-602f-b487-e9f8-f39b59b6dc2d"
  }
}
404
example response
{
  "message": "The requested resource could not be found"
}