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": "1bade6d4-ecf6-3a04-b1e1-56ef98c4007d",
    "attention_reason": "mandate_revoked",
    "basket_id": "69faff988a5a1b0150000153",
    "customer": {
      "id": "91da8277-7cf1-60f7-0704-916ec1cf7edf",
      "first_name": "Jane",
      "last_name": "Doe",
      "full_name": "Jane Doe",
      "phone": "+447900000000",
      "has_password": true,
      "dob": "1914-06-21",
      "brand_id": "f31afc58-ac69-ab56-782b-7c639c1c5297",
      "site_id": "c449df76-9056-9c2e-53f4-7717c1ca2dcf",
      "stripe_id": "cus_1234567890",
      "express_stripe_id": "cus_1234567890",
      "email": "janedoe@example.com",
      "labels": [],
      "preferred_locale": "en",
      "locked_at": "1968-06-26T21:18:02.0Z",
      "created_at": "1957-06-21T10:05:37.0Z",
      "updated_at": "1935-04-21T08:02:37.0Z",
      "deleted_at": "1940-12-30T22:12:41.0Z",
      "last_active_at": "1923-11-15T10:59:31.0Z",
      "email_verified_at": "1963-01-19T03:03:36.0Z",
      "last_check_in": {
        "checked_in_at": "1901-02-09T09:36:45.0Z",
        "method": "Scanned"
      },
      "avatar_id": "000000-000000-000000-000000",
      "avatar": {
        "id": "8a466c90-ba4d-5b85-b95a-00f390404734",
        "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": "ea"
    },
    "end_date": "1919-10-04T09:21:17.0Z",
    "external_ref": "occaecat ut sunt deserunt proident",
    "members": [
      {
        "customer_id": "9190f746-7b44-151b-4cd1-f669d04db046",
        "is_lead": true,
        "membership_number": "1234567890"
      },
      {
        "customer_id": "9b777402-215d-59bd-1bdf-9e96cd73aa35",
        "is_lead": true,
        "membership_number": "1234567890"
      }
    ],
    "membership_number": "1234567890",
    "next_billing_date": "1908-02-21T11:54:24.0Z",
    "next_charge": {
      "id": "257d1152-8b40-3e26-45fe-88466611d9f1",
      "amount": 3995,
      "currency": "GBP",
      "status": "pending",
      "billing_period_from": "1913-03-11",
      "billing_period_to": "1909-04-13"
    },
    "payment_method": {
      "id": "veniam reprehenderit esse sit",
      "type": "direct_debit",
      "last_4": "labore",
      "status": "revoked",
      "card_brand": "amex"
    },
    "rate": {
      "id": "f9a76981-d70a-f8ec-b879-21d36c61fd44",
      "membership_type_id": "6d2c311f-c365-56aa-d04a-c70f81276ab2",
      "name": "Standard rate",
      "currency": "GBP",
      "price": 5000,
      "joining_fee": 1000,
      "billing_frequency": "P1M",
      "processors": [
        "in",
        "non"
      ],
      "default_duration": "P1Y",
      "private": true,
      "created_at": "1890-06-10T13:52:47.0Z",
      "updated_at": "1922-08-06T18:10:57.0Z"
    },
    "site_id": "6a56c3cc-f923-1c11-a0f3-f5de3fe837c3",
    "source": "unknown",
    "start_date": "1962-03-15T16:27:23.0Z",
    "status": "upcoming",
    "status_updated_at": "1913-07-15T13:59:11.0Z",
    "type": {
      "id": "5894b696-c5a3-99ff-10dc-fe45597ad70b",
      "name": "Gold tier",
      "description": "Enjoy exclusive benefits as part of being a member in our Gold tier",
      "terms": "deserunt mollit culpa adipisicing",
      "brand_id": "12e33125-e76a-1501-18d2-e8db12183578",
      "offline_payments": false,
      "disable_confirmation_email": false,
      "private": false,
      "visibility": "public",
      "minimum_start_date": "1967-06-29T12:34:39.0Z",
      "min_members": 2,
      "max_members": 4,
      "rates": [
        {
          "id": "ace621b8-c4ec-78f6-a3b0-2e5150c3662f",
          "membership_type_id": "a2d27358-b1ae-f831-fd22-3e5921ae1e34",
          "name": "Standard rate",
          "currency": "GBP",
          "price": 5000,
          "joining_fee": 1000,
          "billing_frequency": "P1M",
          "processors": [
            "eu dolore dolor elit ut",
            "Excepteur",
            "consectetur sint",
            "aliquip"
          ],
          "default_duration": "P1Y",
          "private": true,
          "created_at": "1896-02-09T18:56:40.0Z",
          "updated_at": "1964-02-16T21:53:05.0Z"
        },
        {
          "id": "081da234-84f6-8055-ae73-530284504df5",
          "membership_type_id": "d10d066f-e10e-6860-b7d6-15f8b8afeb37",
          "name": "Standard rate",
          "currency": "GBP",
          "price": 5000,
          "joining_fee": 1000,
          "billing_frequency": "P1M",
          "processors": [],
          "default_duration": "P1Y",
          "private": true,
          "created_at": "1916-03-11T17:24:36.0Z",
          "updated_at": "1964-07-14T19:45:27.0Z"
        },
        {
          "id": "372c386f-207f-d599-2530-1fd4ec8c5001",
          "membership_type_id": "1b20c48f-63b2-912b-da3f-c965f441bce6",
          "name": "Standard rate",
          "currency": "GBP",
          "price": 5000,
          "joining_fee": 1000,
          "billing_frequency": "P1M",
          "processors": [
            "Excepteur exercitation ad sunt ut",
            "mollit non laboris dolore",
            "eiusmod mollit veniam aliquip sed"
          ],
          "default_duration": "P1Y",
          "private": true,
          "created_at": "1956-09-29T22:26:41.0Z",
          "updated_at": "1920-10-10T12:01:49.0Z"
        },
        {
          "id": "088c82db-1aa6-c48e-0e56-41e920d46a70",
          "membership_type_id": "0f002fa7-f3cc-da7b-8f75-56a6e571db76",
          "name": "Standard rate",
          "currency": "GBP",
          "price": 5000,
          "joining_fee": 1000,
          "billing_frequency": "P1M",
          "processors": [
            "consequat sed Excepteur",
            "in consectetur",
            "ullamco dolore incididunt adipisicing in",
            "eiusmod nulla veniam consequat cillum",
            "ullamco elit quis"
          ],
          "default_duration": "P1Y",
          "private": true,
          "created_at": "1891-09-21T03:54:16.0Z",
          "updated_at": "1943-11-21T20:40:04.0Z"
        }
      ],
      "revenue_schedule": "FREQ=WEEKLY",
      "created_at": "1891-08-28T19:06:31.0Z",
      "updated_at": "1898-01-18T21:30:57.0Z",
      "deleted_at": "1959-08-18T01:54:19.0Z"
    },
    "created_at": "1942-02-24T04:33:59.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": "133e1e4d-9436-e6c4-fe96-67eb2de7e690",
    "membership": {
      "id": "c14fb586-d9de-2ef7-3526-c2f24902ff57",
      "membership_number": "00000014",
      "type_name": "Gold Membership",
      "customer_id": "fa9a19ba-b888-444e-0f16-fb457d8d9c01"
    },
    "processor": "adyen",
    "processor_data": {
      "cardholder_name": "Mrs J Jones",
      "last_4": 4001,
      "processor_type_id": "69faff998a5a1b0150000585"
    },
    "amount": 3995,
    "original_amount": 3995,
    "currency": "gbp",
    "tax": 1000,
    "status": "succeeded",
    "description": "ad Excepteur",
    "can_download_receipt": false,
    "amount_refunded": -98681876,
    "refunded": true,
    "refunds": [],
    "site_id": "40307305-140c-fbed-2104-06823d2dc9a8",
    "billing_period_from": "1962-11-28",
    "billing_period_to": "1913-11-03",
    "processing_at": "1929-12-13T16:35:28.0Z",
    "created_at": "1953-09-13T09:26:07.0Z",
    "updated_at": "1942-09-25T07:38:16.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": "e639a28c-0da2-e9bc-9ac4-9ccc01a7c193",
    "membership": {
      "id": "33258fff-d12f-2044-b03b-b2e7dbc1e21e",
      "membership_number": "00000014",
      "type_name": "Gold Membership",
      "customer_id": "22fad3ce-70bb-9f0f-5272-33163830f686",
      "customer_name": "Jane Jones"
    },
    "processor": "adyen",
    "processor_data": {
      "cardholder_name": "Mrs J Jones",
      "last_4": 4001,
      "processor_type": "Cash",
      "processor_type_id": "69faff988a5a1b0150000154"
    },
    "amount": 3995,
    "original_amount": 3995,
    "currency": "gbp",
    "tax": 1000,
    "status": "succeeded",
    "description": "consectetur",
    "can_download_receipt": true,
    "amount_refunded": 49284047,
    "refunded": false,
    "refunds": [
      {
        "id": "98cf0dc0-3301-72c0-feb9-ee75ba1a2d80",
        "status": "succeeded",
        "amount": 995,
        "currency": "gbp",
        "notes": "Gesture of good will",
        "failure_reason": "invalid_details",
        "refunded_by": {
          "id": "4b9eeea6-15fd-6d06-9bd9-6da1f6d8ce15",
          "full_name": "Jane Jenkins"
        },
        "processor_data": {
          "processor": "adyen",
          "processor_id": "re_64301e0b2df9d11814010ea6"
        },
        "created_at": "1925-10-08T16:52:03.0Z",
        "updated_at": "1939-01-26T15:57:55.0Z"
      },
      {
        "id": "4f5bd714-5351-e293-6dbf-39c6fa13fb53",
        "status": "succeeded",
        "amount": 995,
        "currency": "gbp",
        "notes": "Gesture of good will",
        "failure_reason": "invalid_details",
        "refunded_by": {
          "id": "0cf8c38d-3c3e-1036-a9d9-da605e82329c",
          "full_name": "Jane Jenkins"
        },
        "processor_data": {
          "processor": "adyen",
          "processor_id": "re_64301e0b2df9d11814010ea6"
        },
        "created_at": "1927-11-22T14:49:10.0Z",
        "updated_at": "1963-10-28T03:50:35.0Z"
      },
      {
        "id": "f06eb535-16d2-62b0-5b51-6fb7bc5467a5",
        "status": "succeeded",
        "amount": 995,
        "currency": "gbp",
        "notes": "Gesture of good will",
        "failure_reason": "invalid_details",
        "refunded_by": {
          "id": "d5b6d6de-dfd2-e6c2-2402-28430ea2f93b",
          "full_name": "Jane Jenkins"
        },
        "processor_data": {
          "processor": "adyen",
          "processor_id": "re_64301e0b2df9d11814010ea6"
        },
        "created_at": "1927-03-01T09:49:33.0Z",
        "updated_at": "1925-12-13T04:49:35.0Z"
      },
      {
        "id": "d2a622c3-ce91-2620-74ce-56d63e2ab021",
        "status": "succeeded",
        "amount": 995,
        "currency": "gbp",
        "notes": "Gesture of good will",
        "failure_reason": "invalid_details",
        "refunded_by": {
          "id": "b883db81-ddea-f169-f6cd-540ac04d6ec0",
          "full_name": "Jane Jenkins"
        },
        "processor_data": {
          "processor": "adyen",
          "processor_id": "re_64301e0b2df9d11814010ea6"
        },
        "created_at": "1910-10-31T16:02:42.0Z",
        "updated_at": "1900-04-02T23:55:25.0Z"
      },
      {
        "id": "90b894ac-7a1a-03cd-60d8-ad9765571414",
        "status": "succeeded",
        "amount": 995,
        "currency": "gbp",
        "notes": "Gesture of good will",
        "failure_reason": "invalid_details",
        "processor_data": {
          "processor": "adyen",
          "processor_id": "re_64301e0b2df9d11814010ea6"
        },
        "created_at": "1890-05-04T06:35:39.0Z",
        "updated_at": "1937-04-23T23:56:39.0Z"
      }
    ],
    "site_id": "e26c77d3-718b-19c6-7407-ff0172cedcae",
    "billing_period_from": "1904-08-24",
    "billing_period_to": "1953-08-15",
    "processing_at": "1923-08-27T19:35:52.0Z",
    "created_at": "1945-08-19T15:42:22.0Z",
    "updated_at": "1955-05-18T12:08:29.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": "6df2baa0-1d80-f0c4-69fb-e50ab1816a0e",
    "membership": {
      "id": "70b3a249-78d9-2893-c5ea-7d2704e4e129",
      "membership_number": "00000014",
      "type_name": "Gold Membership",
      "customer_id": "f1e2ec43-a2bf-5cf3-56a4-bbf560d74cd1",
      "customer_name": "Jane Jones"
    },
    "processor": "adyen",
    "processor_data": {
      "last_4": 4001
    },
    "amount": 3995,
    "original_amount": 3995,
    "currency": "gbp",
    "tax": 1000,
    "status": "succeeded",
    "description": "ea veniam Lorem exercitation et",
    "can_download_receipt": false,
    "amount_refunded": -55822515,
    "refunded": true,
    "refunds": [
      {
        "id": "0723c9bd-769a-ecd4-7363-ac0fb1996cdc",
        "status": "succeeded",
        "amount": 995,
        "currency": "gbp",
        "notes": "Gesture of good will",
        "failure_reason": "invalid_details",
        "refunded_by": {
          "id": "422a9579-5441-bed9-f4d6-14c1bc3b4392",
          "full_name": "Jane Jenkins"
        },
        "processor_data": {
          "processor": "adyen",
          "processor_id": "re_64301e0b2df9d11814010ea6"
        },
        "created_at": "1932-02-18T13:05:02.0Z",
        "updated_at": "1951-05-13T15:15:12.0Z"
      },
      {
        "id": "c3c7057b-752d-4678-cd46-c4302bb43221",
        "status": "succeeded",
        "amount": 995,
        "currency": "gbp",
        "notes": "Gesture of good will",
        "failure_reason": "invalid_details",
        "refunded_by": {
          "id": "1fc63e9c-f995-d9e5-f8a7-62dfb3f1adf9",
          "full_name": "Jane Jenkins"
        },
        "processor_data": {
          "processor": "adyen",
          "processor_id": "re_64301e0b2df9d11814010ea6"
        },
        "created_at": "1959-12-08T12:18:53.0Z",
        "updated_at": "1964-08-26T23:43:09.0Z"
      },
      {
        "id": "d826bd2d-658c-20b1-6c2c-e3ce34d173c4",
        "status": "succeeded",
        "amount": 995,
        "currency": "gbp",
        "notes": "Gesture of good will",
        "processor_data": {
          "processor": "adyen",
          "processor_id": "re_64301e0b2df9d11814010ea6"
        },
        "created_at": "1937-09-21T17:52:57.0Z",
        "updated_at": "1921-03-09T21:17:33.0Z"
      },
      {
        "id": "dbea0761-d94e-87b6-e586-62619e4e0c8a",
        "status": "succeeded",
        "amount": 995,
        "currency": "gbp",
        "notes": "Gesture of good will",
        "failure_reason": "invalid_details",
        "refunded_by": {
          "id": "9f361a9f-e84c-6a54-675a-ab1b9256b444",
          "full_name": "Jane Jenkins"
        },
        "processor_data": {
          "processor": "adyen",
          "processor_id": "re_64301e0b2df9d11814010ea6"
        },
        "created_at": "1891-12-03T01:43:48.0Z",
        "updated_at": "1939-10-20T14:25:27.0Z"
      }
    ],
    "site_id": "000618ed-9fee-0071-c8b7-1ba4c343234d",
    "billing_period_from": "1922-06-18",
    "billing_period_to": "1923-01-29",
    "processing_at": "1914-06-24T12:48:13.0Z",
    "created_at": "1969-06-25T06:50:49.0Z",
    "updated_at": "1906-07-30T07:02:15.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": "69faff998a5a1b0150000586",
    "organisation_id": "6f9b631d-0820-5452-3dd9-a3a3e7433a23",
    "site_id": "fdf0086d-5d59-3e2f-8402-5d304e951da7",
    "customer_id": "30111541-c3dd-85d5-9ac0-9e02f7261962",
    "membership_id": "df34f209-4a96-655a-4d6d-9fc892f860b9",
    "from": "Trybe",
    "to": "+447123456789",
    "message": "magna sunt in velit sit",
    "message_type": "billing_details_request",
    "message_delivered": true,
    "created_at": "2024-02-02T12:01:01.0Z"
  }
}
404
example response
{
  "message": "The requested resource could not be found"
}
422
example response
{
  "errors": {
    "in_c": [
      "dolore in commodo",
      "reprehenderit culpa aliquip",
      "do deserunt",
      "in ut",
      "minim est irure"
    ],
    "anim_9": [
      "eiusmod dolore velit",
      "do nisi",
      "dolor nisi aliquip in",
      "et exercitation ex sit"
    ]
  },
  "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": "250fe0c5-9b55-5750-65f8-a4197b472109",
    "organisation_id": "7561d0e4-6edd-f61b-9cbd-0873b1474f37"
  }
}
404
example response
{
  "message": "The requested resource could not be found"
}