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": "60c0c44d-bc2a-5e28-8891-c8897c4a4a95",
    "attention_reason": "site_id",
    "basket_id": "6a0ee84fa63311017400007a",
    "customer": {
      "id": "1e3b9eba-a969-5af1-9914-ef3b2405dffc",
      "first_name": "Jane",
      "last_name": "Doe",
      "full_name": "Jane Doe",
      "phone": "+447900000000",
      "has_password": true,
      "dob": "1922-02-06",
      "brand_id": "530be163-b55b-bf5f-3fbd-415de09ab584",
      "site_id": "a3bf721f-aefd-e4f5-efbc-415eca59671d",
      "stripe_id": "cus_1234567890",
      "express_stripe_id": "cus_1234567890",
      "email": "janedoe@example.com",
      "labels": [],
      "preferred_locale": "en",
      "locked_at": "1955-08-08T07:58:38.0Z",
      "created_at": "1953-05-10T21:42:49.0Z",
      "updated_at": "1969-08-02T02:09:06.0Z",
      "deleted_at": "1968-09-30T22:36:48.0Z",
      "last_active_at": "1921-03-11T12:28:23.0Z",
      "email_verified_at": "1933-05-28T04:56:23.0Z",
      "last_check_in": {
        "checked_in_at": "1941-11-11T23:56:37.0Z",
        "method": "Scanned"
      },
      "avatar_id": "000000-000000-000000-000000",
      "avatar": {
        "id": "6f978fd0-d21d-27b7-3aef-637fd06ecd5e",
        "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": "laborum proident magna mollit"
    },
    "end_date": "1965-09-09T05:56:46.0Z",
    "external_ref": "esse",
    "members": [
      {
        "customer_id": "8ef4e187-555e-f3e1-1909-2b203b5de510",
        "is_lead": true,
        "membership_number": "1234567890"
      },
      {
        "customer_id": "7e07e48b-e784-c912-86e4-81fd9ecb4140",
        "is_lead": false,
        "membership_number": "1234567890"
      },
      {
        "customer_id": "78da704e-ccac-446d-36c1-e6111672a723",
        "is_lead": true,
        "membership_number": "1234567890"
      },
      {
        "customer_id": "328e7cbb-ac08-5200-280b-6b6fc9d7a00d",
        "is_lead": true,
        "membership_number": "1234567890"
      }
    ],
    "membership_number": "1234567890",
    "next_billing_date": "1892-12-28T01:39:57.0Z",
    "next_charge": {
      "id": "640e3bc4-5e99-4af1-23b0-d4b28ab07f78",
      "amount": 3995,
      "currency": "GBP",
      "status": "pending",
      "billing_period_from": "1897-06-03",
      "billing_period_to": "1905-03-12"
    },
    "payment_method": {
      "id": "eu"
    },
    "rate": {
      "id": "e0f3e601-a8b0-dd00-4b97-21da7c1d29e0",
      "membership_type_id": "9a35d29c-aacd-fb88-e23b-132c07037ded",
      "name": "Standard rate",
      "currency": "GBP",
      "price": 5000,
      "joining_fee": 1000,
      "billing_frequency": "P1M",
      "processors": [
        "ullamco ut esse culpa Ut"
      ],
      "default_duration": "P1Y",
      "private": true,
      "created_at": "1905-01-30T02:27:41.0Z",
      "updated_at": "1924-11-05T18:57:52.0Z"
    },
    "site_id": "b36a2da3-be80-ee87-1e96-9b6b72cc360c",
    "source": "import",
    "start_date": "1924-11-04T05:37:09.0Z",
    "status": "active",
    "status_updated_at": "1934-06-11T03:35:12.0Z",
    "type": {
      "id": "907a8f18-ef0b-8adb-696a-3142d9b6ddec",
      "name": "Gold tier",
      "description": "Enjoy exclusive benefits as part of being a member in our Gold tier",
      "terms": "aliqua exercitation",
      "brand_id": "ed7f589f-5241-6954-d556-5956dec7fdf9",
      "offline_payments": true,
      "disable_confirmation_email": true,
      "private": true,
      "visibility": "link_only",
      "minimum_start_date": "1925-01-16T21:59:33.0Z",
      "min_members": 2,
      "max_members": 4,
      "rates": [
        {
          "id": "f679ebfa-6066-22d3-3c4c-7b4fe477f610",
          "membership_type_id": "b64b9420-c74c-11d0-1de6-2daf7a593ba4",
          "name": "Standard rate",
          "currency": "GBP",
          "price": 5000,
          "joining_fee": 1000,
          "billing_frequency": "P1M",
          "processors": [
            "cillum pariatur cupidatat ea",
            "tempor",
            "incididunt velit labore amet"
          ],
          "default_duration": "P1Y",
          "private": true,
          "created_at": "1898-04-22T19:56:52.0Z",
          "updated_at": "1932-09-27T01:59:10.0Z"
        }
      ],
      "revenue_schedule": "FREQ=WEEKLY",
      "created_at": "1944-02-07T06:12:31.0Z",
      "updated_at": "1952-05-02T20:58:37.0Z",
      "deleted_at": "1893-10-23T18:47:43.0Z"
    },
    "payment_details_url": "in ut dolor",
    "created_at": "1943-08-30T18:47:50.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": "98f13b7c-5b4d-215d-2e10-9c76ed074584",
    "membership": {
      "id": "029cd90e-0cd4-e294-0808-463af1692bb9",
      "membership_number": "00000014",
      "type_name": "Gold Membership",
      "customer_id": "9e4c32aa-6506-b653-c7df-2b387637233e",
      "customer_name": "Jane Jones"
    },
    "processor": "adyen",
    "processor_data": {
      "cardholder_name": "Mrs J Jones",
      "last_4": 4001,
      "processor_type": "Cash",
      "processor_type_id": "6a0ee850a633110174000192"
    },
    "amount": 3995,
    "original_amount": 3995,
    "currency": "gbp",
    "tax": 1000,
    "status": "succeeded",
    "description": "in nostrud",
    "can_download_receipt": false,
    "amount_refunded": 67331558,
    "refunded": true,
    "refunds": [
      {
        "id": "96a737b1-5078-353c-d8e1-c06b6aa2aa9b",
        "status": "succeeded",
        "amount": 995,
        "currency": "gbp",
        "notes": "Gesture of good will",
        "failure_reason": "invalid_details",
        "refunded_by": {
          "id": "f97967a4-e38a-68ca-a0f8-eb929bf40ece",
          "full_name": "Jane Jenkins"
        },
        "processor_data": {
          "processor": "adyen",
          "processor_id": "re_64301e0b2df9d11814010ea6"
        },
        "created_at": "1966-01-31T01:43:46.0Z",
        "updated_at": "1944-06-20T19:30:51.0Z"
      },
      {
        "id": "8758f6cd-bb0c-7e18-b8eb-91675789f9f7",
        "status": "succeeded",
        "amount": 995,
        "currency": "gbp",
        "notes": "Gesture of good will",
        "failure_reason": "invalid_details",
        "refunded_by": {
          "id": "de2b3ba8-b10d-05b9-82b9-6547f6b0ea55",
          "full_name": "Jane Jenkins"
        },
        "processor_data": {
          "processor": "adyen",
          "processor_id": "re_64301e0b2df9d11814010ea6"
        },
        "created_at": "1897-03-27T06:50:27.0Z",
        "updated_at": "1922-05-20T15:13:55.0Z"
      },
      {
        "id": "f4d23c47-76a7-85c3-997b-fb69a4f6dda6",
        "status": "succeeded",
        "amount": 995,
        "currency": "gbp",
        "notes": "Gesture of good will",
        "failure_reason": "invalid_details",
        "refunded_by": {
          "id": "dea01d3f-7e25-eb8f-6f9e-cece3c19bd13",
          "full_name": "Jane Jenkins"
        },
        "processor_data": {
          "processor": "adyen",
          "processor_id": "re_64301e0b2df9d11814010ea6"
        },
        "created_at": "1960-07-13T07:30:59.0Z",
        "updated_at": "1903-04-28T11:57:39.0Z"
      }
    ],
    "site_id": "d5f759af-fac9-26fc-a0f3-e77cc969de42",
    "billing_period_from": "1936-04-11",
    "billing_period_to": "1907-12-11",
    "processing_at": "1903-11-23T20:58:42.0Z",
    "created_at": "1896-11-21T14:44:54.0Z",
    "updated_at": "1926-06-09T02:16:50.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": "bc8d8238-0360-fc1d-89e7-cec99bcac844",
    "membership": {
      "id": "4533d5d3-3e5f-716b-8ff2-29038a014240",
      "membership_number": "00000014",
      "type_name": "Gold Membership",
      "customer_id": "44d7164d-31b9-a68d-bfe0-41ff2549d4e9",
      "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": "irure officia sunt aute",
    "can_download_receipt": false,
    "amount_refunded": 14025217,
    "refunded": true,
    "refunds": [
      {
        "id": "497602c6-2ee0-0d17-6c5c-9c9404021ad3",
        "status": "succeeded",
        "amount": 995,
        "currency": "gbp",
        "notes": "Gesture of good will",
        "failure_reason": "invalid_details",
        "refunded_by": {
          "id": "c8f4f473-2620-5c22-1890-92066c223172",
          "full_name": "Jane Jenkins"
        },
        "processor_data": {
          "processor": "adyen",
          "processor_id": "re_64301e0b2df9d11814010ea6"
        },
        "created_at": "1907-02-09T11:35:38.0Z",
        "updated_at": "1894-01-29T01:01:18.0Z"
      },
      {
        "id": "f0002fd2-0466-5f1f-f4e9-204e20d4037a",
        "status": "succeeded",
        "amount": 995,
        "currency": "gbp",
        "notes": "Gesture of good will",
        "processor_data": {
          "processor": "adyen",
          "processor_id": "re_64301e0b2df9d11814010ea6"
        },
        "created_at": "1953-07-31T17:31:52.0Z",
        "updated_at": "1962-08-19T03:55:15.0Z"
      },
      {
        "id": "69107484-ad37-5d3d-3681-7fc25a4a01bf",
        "status": "succeeded",
        "amount": 995,
        "currency": "gbp",
        "notes": "Gesture of good will",
        "failure_reason": "invalid_details",
        "refunded_by": {
          "id": "7aa3c999-bcd0-5df4-558f-03bb1fbf6869",
          "full_name": "Jane Jenkins"
        },
        "processor_data": {
          "processor": "adyen",
          "processor_id": "re_64301e0b2df9d11814010ea6"
        },
        "created_at": "1939-06-27T15:12:03.0Z",
        "updated_at": "1901-10-21T17:38:36.0Z"
      },
      {
        "id": "7878e583-22bc-4335-f402-f949050fef41",
        "status": "succeeded",
        "amount": 995,
        "currency": "gbp",
        "notes": "Gesture of good will",
        "failure_reason": "invalid_details",
        "refunded_by": {
          "id": "6accd0b5-95d9-1e8b-7623-17716090297a",
          "full_name": "Jane Jenkins"
        },
        "processor_data": {
          "processor": "adyen",
          "processor_id": "re_64301e0b2df9d11814010ea6"
        },
        "created_at": "1910-01-02T09:04:23.0Z",
        "updated_at": "1925-06-01T02:10:45.0Z"
      },
      {
        "id": "69075eb5-2921-47b6-269c-936dad4599d4",
        "status": "succeeded",
        "amount": 995,
        "currency": "gbp",
        "notes": "Gesture of good will",
        "failure_reason": "invalid_details",
        "refunded_by": {
          "id": "a55e513b-e949-17e7-2afe-9323828aefff",
          "full_name": "Jane Jenkins"
        },
        "processor_data": {
          "processor": "adyen",
          "processor_id": "re_64301e0b2df9d11814010ea6"
        },
        "created_at": "1962-10-02T03:58:30.0Z",
        "updated_at": "1956-03-26T23:27:21.0Z"
      }
    ],
    "site_id": "3df3ac9c-17c9-a0de-57e2-c0a8aee4fe7d",
    "billing_period_from": "1926-08-26",
    "billing_period_to": "1898-04-10",
    "processing_at": "1902-05-12T09:51:58.0Z",
    "created_at": "1944-02-03T15:12:30.0Z",
    "updated_at": "1895-02-01T20:47:19.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": "3e175422-d8e6-b0f8-e008-c881de6d025a",
    "membership": {
      "id": "6bfc1f90-80e3-1102-04ad-0ad5b837e63d",
      "membership_number": "00000014",
      "type_name": "Gold Membership",
      "customer_id": "0b939fca-d747-f4fa-9615-e350a6cc6c50",
      "customer_name": "Jane Jones"
    },
    "processor": "adyen",
    "processor_data": {
      "cardholder_name": "Mrs J Jones",
      "last_4": 4001,
      "processor_type": "Cash",
      "processor_type_id": "6a0ee84fa63311017400007b"
    },
    "amount": 3995,
    "original_amount": 3995,
    "currency": "gbp",
    "tax": 1000,
    "status": "succeeded",
    "description": "enim ut cupidatat",
    "can_download_receipt": true,
    "amount_refunded": -23606804,
    "refunded": true,
    "refunds": [
      {
        "id": "4a63a117-e4af-2f7c-74b5-b236a4d18946",
        "status": "succeeded",
        "amount": 995,
        "currency": "gbp",
        "notes": "Gesture of good will",
        "failure_reason": "invalid_details",
        "refunded_by": {
          "id": "2ebaf815-faad-8c3e-438c-db236e9e118d",
          "full_name": "Jane Jenkins"
        },
        "processor_data": {
          "processor": "adyen",
          "processor_id": "re_64301e0b2df9d11814010ea6"
        },
        "created_at": "1925-04-23T17:02:57.0Z",
        "updated_at": "1956-01-24T09:34:02.0Z"
      },
      {
        "id": "255c9751-6ca8-7172-6083-4cb3b685eb9f",
        "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": "1965-01-22T02:25:47.0Z",
        "updated_at": "1960-06-13T14:01:45.0Z"
      },
      {
        "id": "d8a7efb5-cdda-9a8a-74fd-f812acc9a8dc",
        "status": "succeeded",
        "amount": 995,
        "currency": "gbp",
        "notes": "Gesture of good will",
        "refunded_by": {
          "id": "01c56e42-2731-0a90-3023-9142a8688991",
          "full_name": "Jane Jenkins"
        },
        "processor_data": {
          "processor": "adyen",
          "processor_id": "re_64301e0b2df9d11814010ea6"
        },
        "created_at": "1949-09-22T20:02:37.0Z",
        "updated_at": "1916-05-12T23:58:25.0Z"
      },
      {
        "id": "80981982-ee36-2a34-34cf-9f7da2aa5d18",
        "status": "succeeded",
        "amount": 995,
        "currency": "gbp",
        "notes": "Gesture of good will",
        "failure_reason": "invalid_details",
        "refunded_by": {
          "id": "a3807a16-03db-732f-3299-f6d5ae037a7b",
          "full_name": "Jane Jenkins"
        },
        "processor_data": {
          "processor": "adyen",
          "processor_id": "re_64301e0b2df9d11814010ea6"
        },
        "created_at": "1938-01-15T09:23:28.0Z",
        "updated_at": "1938-12-10T20:08:42.0Z"
      },
      {
        "id": "cb8ee1bc-c7cd-50f2-7d94-b17bb2e377e3",
        "status": "succeeded",
        "amount": 995,
        "currency": "gbp",
        "notes": "Gesture of good will",
        "failure_reason": "invalid_details",
        "refunded_by": {
          "id": "bbd18f68-b90a-3cec-aa24-734cdd7243e8",
          "full_name": "Jane Jenkins"
        },
        "processor_data": {
          "processor": "adyen",
          "processor_id": "re_64301e0b2df9d11814010ea6"
        },
        "created_at": "1901-09-22T10:10:01.0Z",
        "updated_at": "1893-11-05T22:04:16.0Z"
      }
    ],
    "site_id": "abe19c5b-a2af-89fd-fdfd-8f0771d2ee36",
    "billing_period_from": "1918-08-13",
    "billing_period_to": "1914-11-03",
    "processing_at": "1933-12-30T06:43:06.0Z",
    "created_at": "1900-08-13T01:57:29.0Z",
    "updated_at": "1962-01-20T04:28:19.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": "6a0ee850a633110174000193",
    "organisation_id": "ab877774-9d87-281f-b7ae-5c4212a7192a",
    "site_id": "2a884031-5cff-1a00-548c-139a952e90f3",
    "customer_id": "5a616f74-cf91-b948-0026-17933651ba0f",
    "from": "Trybe",
    "to": "+447123456789",
    "message": "exercitation anim reprehenderit",
    "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": {
    "Lorem_0": [
      "Ut mollit do",
      "eiusmod consequat dolor",
      "qui occaecat minim dolore eu",
      "dolor quis"
    ],
    "non1ed": [
      "do ea enim pariatur",
      "ea",
      "ea esse in fugiat nulla",
      "dolore qui magna pariatur tempor",
      "esse eu fugiat velit"
    ]
  },
  "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": "39bf2e42-87a9-f941-91cd-84be450210be",
    "organisation_id": "133cd7d3-8a40-c9d6-d693-e4cc806b242d"
  }
}
404
example response
{
  "message": "The requested resource could not be found"
}