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": "c9084b5e-70f4-0d0e-88d6-7056b21ad6ec",
      "site_id": "92b3c3d1-3b6e-87de-c9da-f6519b54da5f",
      "membership_number": "1234567890",
      "customer": {
        "id": "0d6f253b-f3c4-74f6-7c8f-9842cc989444",
        "first_name": "Jane",
        "last_name": "Doe",
        "full_name": "Jane Doe",
        "phone": "+447900000000",
        "has_password": true,
        "dob": "1947-05-25",
        "brand_id": "5fe715eb-f38a-5076-4b22-8521b9b97359",
        "site_id": "06c7da70-45dc-2b10-40ec-6d6f26162ef2",
        "stripe_id": "cus_1234567890",
        "express_stripe_id": "cus_1234567890",
        "email": "janedoe@example.com",
        "labels": [
          {
            "id": "51b52fe4-119e-9bef-d5c0-b995b2816262",
            "name": "VIP",
            "color": "ff6634"
          },
          {
            "id": "94db120b-4d0e-93fa-2ecd-a738e16b5df3",
            "name": "VIP",
            "color": "ff6634"
          },
          {
            "id": "40864dda-cea8-2ff8-d847-e633e76604ca",
            "name": "VIP",
            "color": "ff6634"
          },
          {
            "id": "9b22d60d-8db2-8a57-f0f2-f7289c77dfd2",
            "name": "VIP",
            "color": "ff6634"
          }
        ],
        "preferred_locale": "en",
        "locked_at": "1907-09-05T19:46:07.0Z",
        "created_at": "1943-10-03T17:10:36.0Z",
        "updated_at": "1900-03-10T02:12:30.0Z",
        "deleted_at": "1968-09-28T01:11:50.0Z",
        "last_active_at": "1894-06-12T10:05:15.0Z",
        "email_verified_at": "1919-10-13T05:27:21.0Z",
        "last_check_in": {
          "checked_in_at": "1895-06-17T14:42:12.0Z",
          "method": "Scanned"
        },
        "avatar_id": "000000-000000-000000-000000",
        "avatar": {
          "id": "85cb666a-c659-dd97-9ecc-1b88ae8a6df9",
          "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": "fugiat"
      },
      "members": [
        {
          "customer_id": "313eba0a-fdea-840e-207f-969f7f0a8984",
          "membership_number": "1234567890"
        },
        {
          "customer_id": "87d6f5e4-482f-8358-05d2-26e236716c47",
          "membership_number": "1234567890",
          "is_lead": true
        },
        {
          "customer_id": "56e24035-8616-804f-82f4-205d10366680",
          "membership_number": "1234567890"
        },
        {
          "customer_id": "a589a177-e124-0bb4-17e9-6e5b064aa498",
          "membership_number": "1234567890",
          "is_lead": false
        }
      ],
      "type": {
        "id": "3fe021d1-50fb-a30a-6ae4-55d4cae2b6bc",
        "name": "Gold tier",
        "description": "Enjoy exclusive benefits as part of being a member in our Gold tier",
        "terms": "velit",
        "brand_id": "0aa0c19b-9b16-cbc0-c850-04812a4e267e",
        "offline_payments": false,
        "disable_confirmation_email": true,
        "private": false,
        "visibility": "public",
        "minimum_start_date": "1950-06-05T21:22:35.0Z",
        "min_members": 2,
        "max_members": 4,
        "rates": [
          {
            "id": "485d0b30-c8ff-4c9d-a0c6-74df5849070d",
            "membership_type_id": "73254337-82cc-ef8b-3cd5-fd8e21f3ed8b",
            "name": "Standard rate",
            "currency": "GBP",
            "price": 5000,
            "joining_fee": 1000,
            "billing_frequency": "P1M",
            "processors": [
              "Excepteur qui do aute",
              "laboris pariatur nisi quis",
              "veniam consectetur sit et Ut"
            ],
            "default_duration": "P1Y",
            "private": true,
            "created_at": "1928-10-20T07:57:22.0Z",
            "updated_at": "1943-10-07T12:22:11.0Z"
          },
          {
            "id": "04d2bab4-23a0-bb0c-9a1c-24af161be0bc",
            "membership_type_id": "d806910b-5c00-b635-2c9f-91b6b08a07d2",
            "name": "Standard rate",
            "currency": "GBP",
            "price": 5000,
            "joining_fee": 1000,
            "billing_frequency": "P1M",
            "processors": [],
            "default_duration": "P1Y",
            "private": true,
            "created_at": "1902-12-28T12:44:48.0Z",
            "updated_at": "1927-03-11T07:53:06.0Z"
          },
          {
            "id": "f4eea5fa-7cc0-a249-e32e-810c0378a04a",
            "membership_type_id": "8586a4d7-870e-49c4-b0dc-3a39e63333d7",
            "name": "Standard rate",
            "currency": "GBP",
            "price": 5000,
            "joining_fee": 1000,
            "billing_frequency": "P1M",
            "processors": [
              "in voluptate et",
              "Ut adipisicing non amet eiusmod",
              "ex magna",
              "pariatur ex enim",
              "laborum deserunt magna ex"
            ],
            "default_duration": "P1Y",
            "private": true,
            "created_at": "1936-12-05T16:31:47.0Z",
            "updated_at": "1901-03-13T23:01:55.0Z"
          },
          {
            "id": "b237ea97-2a39-c7f9-b2e0-0783393b91c0",
            "membership_type_id": "9ea46c02-9786-4cb2-e8b4-21fca53b4c57",
            "name": "Standard rate",
            "currency": "GBP",
            "price": 5000,
            "joining_fee": 1000,
            "billing_frequency": "P1M",
            "processors": [
              "mollit Duis"
            ],
            "default_duration": "P1Y",
            "private": true,
            "created_at": "1964-02-20T03:20:40.0Z",
            "updated_at": "1892-05-20T21:25:41.0Z"
          },
          {
            "id": "16072e47-164a-a4ad-d2d5-ddc36387af30",
            "membership_type_id": "7a7e0621-de7d-3f94-a7a8-1e5652c62d51",
            "name": "Standard rate",
            "currency": "GBP",
            "price": 5000,
            "joining_fee": 1000,
            "billing_frequency": "P1M",
            "processors": [
              "elit",
              "id in ad sed"
            ],
            "default_duration": "P1Y",
            "private": true,
            "created_at": "1900-03-12T05:37:51.0Z",
            "updated_at": "1924-06-14T01:36:56.0Z"
          }
        ],
        "revenue_schedule": "FREQ=WEEKLY",
        "created_at": "1945-10-11T10:53:39.0Z",
        "updated_at": "1937-03-29T15:12:47.0Z",
        "deleted_at": "1965-10-26T11:16:40.0Z"
      },
      "rate": {
        "id": "6dabed7e-31dd-1d73-0964-067e580ffc18",
        "membership_type_id": "5f30a573-d555-4696-8262-616875c20f6f",
        "name": "Standard rate",
        "currency": "GBP",
        "price": 5000,
        "joining_fee": 1000,
        "billing_frequency": "P1M",
        "processors": [
          "laborum",
          "sint sunt"
        ],
        "default_duration": "P1Y",
        "private": true,
        "created_at": "1938-09-07T07:12:47.0Z",
        "updated_at": "1968-03-24T09:51:51.0Z"
      },
      "status": "needs_attention",
      "source": "import",
      "payment_method": {
        "id": "ullamco nulla",
        "type": "card",
        "status": "revoked"
      },
      "start_date": "1910-07-26T01:48:41.0Z",
      "end_date": "1931-12-21T17:43:54.0Z",
      "created_at": "1961-06-10T01:26:21.0Z",
      "external_ref": "adipisicing deserunt id incididunt"
    }
  ],
  "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": "fc7054d2-8140-e00b-8a4d-a675947c1537",
    "site_id": "1ca11704-0f7b-8079-e7be-5dc79b19268e",
    "membership_number": "1234567890",
    "customer": {
      "id": "a3ee13b1-c17c-6038-1704-5488e14c0e64",
      "first_name": "Jane",
      "last_name": "Doe",
      "full_name": "Jane Doe",
      "phone": "+447900000000",
      "has_password": true,
      "dob": "1955-08-04",
      "brand_id": "b1cd0c59-d98b-eee3-426d-13055d10008e",
      "site_id": "bffea1c3-0484-3c55-249d-56ccb26dae2f",
      "stripe_id": "cus_1234567890",
      "express_stripe_id": "cus_1234567890",
      "email": "janedoe@example.com",
      "labels": [],
      "preferred_locale": "en",
      "locked_at": "1962-12-03T03:39:01.0Z",
      "created_at": "1936-03-21T18:01:07.0Z",
      "updated_at": "1895-03-27T18:58:14.0Z",
      "deleted_at": "1928-08-06T02:52:03.0Z",
      "last_active_at": "1908-08-05T04:19:27.0Z",
      "email_verified_at": "1938-07-25T01:38:50.0Z",
      "last_check_in": {
        "checked_in_at": "1963-03-12T17:20:03.0Z",
        "method": "Scanned"
      },
      "avatar_id": "000000-000000-000000-000000",
      "avatar": {
        "id": "f9cd81e0-99e9-8f51-76c8-ba8456aed9c7",
        "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": "Duis sed"
    },
    "members": [
      {
        "customer_id": "34f75592-9dcb-bc21-355c-ad6812956987",
        "membership_number": "1234567890",
        "is_lead": false
      }
    ],
    "type": {
      "id": "893b1863-8bc9-fc57-0930-5294cd868821",
      "name": "Gold tier",
      "description": "Enjoy exclusive benefits as part of being a member in our Gold tier",
      "terms": "dolore do proident velit",
      "brand_id": "02e10009-9bbd-a202-8ce4-b9b8afcfe971",
      "offline_payments": false,
      "disable_confirmation_email": true,
      "private": false,
      "visibility": "private",
      "minimum_start_date": "1920-07-08T13:02:53.0Z",
      "min_members": 2,
      "max_members": 4,
      "rates": [
        {
          "id": "e0fac167-6e16-a144-9e0a-81fb632e90b1",
          "membership_type_id": "f58b6dea-67e2-a29a-4552-cbe39088f00e",
          "name": "Standard rate",
          "currency": "GBP",
          "price": 5000,
          "joining_fee": 1000,
          "billing_frequency": "P1M",
          "processors": [
            "cupidatat ullamco sit ut",
            "Lorem aliquip in ad dolore",
            "laborum anim quis ea ipsum"
          ],
          "default_duration": "P1Y",
          "private": true,
          "created_at": "1954-07-02T18:10:50.0Z",
          "updated_at": "1915-07-24T10:30:04.0Z"
        },
        {
          "id": "fcecfc4d-3b42-7407-4a47-83b60e2ea12d",
          "membership_type_id": "d640e8da-4635-b284-a7f4-564803a1fc54",
          "name": "Standard rate",
          "currency": "GBP",
          "price": 5000,
          "joining_fee": 1000,
          "billing_frequency": "P1M",
          "processors": [
            "ea anim",
            "reprehenderit ut anim in qui",
            "in cupidatat",
            "culpa cillum dolore ut",
            "tempor incididunt fugiat exercitation reprehenderit"
          ],
          "default_duration": "P1Y",
          "private": true,
          "created_at": "1906-12-08T04:20:23.0Z",
          "updated_at": "1904-03-12T13:04:20.0Z"
        },
        {
          "id": "2d0d6771-23c4-3a5f-78ab-cccddd6233d3",
          "membership_type_id": "145c6f51-59e5-81c6-d4bc-e55e08f116a7",
          "name": "Standard rate",
          "currency": "GBP",
          "price": 5000,
          "joining_fee": 1000,
          "billing_frequency": "P1M",
          "processors": [
            "magna sit",
            "reprehenderit in",
            "adipisicing",
            "pariatur amet"
          ],
          "default_duration": "P1Y",
          "private": true,
          "created_at": "1935-12-23T18:58:40.0Z",
          "updated_at": "1896-03-05T04:26:49.0Z"
        },
        {
          "id": "1a90540a-646d-809a-388a-bc75952d7702",
          "membership_type_id": "33be394a-581f-e969-4842-9527ce710e97",
          "name": "Standard rate",
          "currency": "GBP",
          "price": 5000,
          "joining_fee": 1000,
          "billing_frequency": "P1M",
          "processors": [],
          "default_duration": "P1Y",
          "private": true,
          "created_at": "1936-12-07T20:33:25.0Z",
          "updated_at": "1921-07-22T01:42:19.0Z"
        },
        {
          "id": "0e5261c9-26d2-1bdd-0135-dada8624053e",
          "membership_type_id": "6627d8fe-fe91-0826-09cd-b88d50635017",
          "name": "Standard rate",
          "currency": "GBP",
          "price": 5000,
          "joining_fee": 1000,
          "billing_frequency": "P1M",
          "processors": [
            "et aliquip",
            "officia veniam nulla cillum",
            "dolor velit Excepteur",
            "pariatur ea Ut",
            "minim"
          ],
          "default_duration": "P1Y",
          "private": true,
          "created_at": "1964-08-02T13:01:37.0Z",
          "updated_at": "1914-12-29T09:17:10.0Z"
        }
      ],
      "revenue_schedule": "FREQ=WEEKLY",
      "created_at": "1953-08-11T19:04:07.0Z",
      "updated_at": "1942-10-16T11:40:28.0Z",
      "deleted_at": "1903-01-01T18:49:54.0Z"
    },
    "rate": {
      "id": "2bd312c5-2328-5b5a-1f04-af78c6e47f3f",
      "membership_type_id": "ff542575-7a7b-0c36-9644-bbbacabd6d72",
      "name": "Standard rate",
      "currency": "GBP",
      "price": 5000,
      "joining_fee": 1000,
      "billing_frequency": "P1M",
      "processors": [
        "cillum in veniam nisi fugiat",
        "deserunt eu in consequat"
      ],
      "default_duration": "P1Y",
      "private": true,
      "created_at": "1914-02-22T19:37:13.0Z",
      "updated_at": "1935-09-10T15:57:49.0Z"
    },
    "status": "active",
    "source": "import",
    "payment_method": {
      "id": "laboris laborum nisi enim elit",
      "type": "card",
      "last_4": "ut",
      "card_brand": "amex"
    },
    "start_date": "1948-11-22T12:31:20.0Z",
    "basket_id": "695e87b4c76b3b012e0000c3",
    "next_billing_date": "1897-12-19T12:22: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": "a294459e-3005-fa85-351d-cf5fc430dd83",
    "membership": {
      "id": "d9b25f61-fd62-84f8-f67a-05a0ac6b165a",
      "membership_number": "00000014",
      "type_name": "Gold Membership",
      "customer_id": "0b50f0fb-14cb-f201-7330-b4e14936cce5",
      "customer_name": "Jane Jones"
    },
    "processor": "adyen",
    "processor_data": {
      "cardholder_name": "Mrs J Jones",
      "last_4": 4001,
      "processor_type": "Cash",
      "processor_type_id": "695e87b4c76b3b012e0000c4"
    },
    "amount": 3995,
    "original_amount": 3995,
    "currency": "gbp",
    "tax": 1000,
    "status": "succeeded",
    "description": "aliquip",
    "can_download_receipt": false,
    "amount_refunded": -79284680,
    "refunded": true,
    "refunds": [
      {
        "id": "fd067b02-9141-c195-8852-1cf7866121ae",
        "status": "succeeded",
        "amount": 995,
        "currency": "gbp",
        "notes": "Gesture of good will",
        "failure_reason": "invalid_details",
        "refunded_by": {
          "id": "3f6e0424-1f83-4948-fba1-63e3c9de65d3",
          "full_name": "Jane Jenkins"
        },
        "processor_data": {
          "processor": "adyen",
          "processor_id": "re_64301e0b2df9d11814010ea6"
        },
        "created_at": "1929-04-19T14:59:26.0Z",
        "updated_at": "1898-12-18T13:36:33.0Z"
      }
    ],
    "site_id": "4bac6709-b7fe-d860-295d-7b50d1d18afa",
    "billing_period_from": "1947-10-03",
    "billing_period_to": "1890-04-23",
    "processing_at": "1927-09-01T20:42:57.0Z",
    "created_at": "1943-07-12T04:28:45.0Z",
    "updated_at": "1960-01-31T06:02: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": "54f9fa95-113b-960b-4da7-fd505a9a698a",
    "membership": {
      "id": "f4d60cf5-1e61-b531-4665-c1e2d3f03b07",
      "membership_number": "00000014",
      "type_name": "Gold Membership",
      "customer_id": "c003af72-6255-5bbf-0a81-d8d79b1e9530",
      "customer_name": "Jane Jones"
    },
    "processor": "adyen",
    "processor_data": {
      "cardholder_name": "Mrs J Jones",
      "last_4": 4001,
      "processor_type": "Cash",
      "processor_type_id": "695e87b4c76b3b012e0000c5"
    },
    "amount": 3995,
    "original_amount": 3995,
    "currency": "gbp",
    "tax": 1000,
    "status": "succeeded",
    "description": "consequat adipisicing ut",
    "can_download_receipt": true,
    "amount_refunded": -26486798,
    "refunded": true,
    "refunds": [
      {
        "id": "2e727342-eba6-bbb0-219a-d29b96e73007",
        "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": "1927-11-22T03:56:36.0Z",
        "updated_at": "1916-03-26T09:47:20.0Z"
      },
      {
        "id": "213207e4-6a92-8cb5-24ba-913cfb58961b",
        "status": "succeeded",
        "amount": 995,
        "currency": "gbp",
        "notes": "Gesture of good will",
        "failure_reason": "invalid_details",
        "refunded_by": {
          "id": "fcf7b6b6-6bae-d280-64ee-87a747ae7924",
          "full_name": "Jane Jenkins"
        },
        "processor_data": {
          "processor": "adyen",
          "processor_id": "re_64301e0b2df9d11814010ea6"
        },
        "created_at": "1934-05-19T13:16:53.0Z",
        "updated_at": "1943-08-26T16:24:49.0Z"
      }
    ],
    "site_id": "390fa82c-3cc2-efd6-9f45-f0305f776e24",
    "billing_period_from": "1895-08-01",
    "billing_period_to": "1914-12-16",
    "processing_at": "1953-10-14T16:32:23.0Z",
    "created_at": "1961-05-12T06:46:09.0Z",
    "updated_at": "1959-02-23T19:58:04.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": "6bb11823-94b1-1b7a-d592-407d71c9c9bb",
    "membership": {
      "id": "5d658c9d-ee7a-ea50-fbf3-5db8e17e9d17",
      "membership_number": "00000014",
      "type_name": "Gold Membership",
      "customer_id": "e68a78e6-0780-f2be-2a8c-4969511aa094"
    },
    "processor": "adyen",
    "processor_data": {
      "cardholder_name": "Mrs J Jones",
      "last_4": 4001
    },
    "amount": 3995,
    "original_amount": 3995,
    "currency": "gbp",
    "tax": 1000,
    "status": "succeeded",
    "description": "sit mollit anim tempor eu",
    "can_download_receipt": true,
    "amount_refunded": 92996282,
    "refunded": true,
    "refunds": [],
    "site_id": "8509bc69-6cb6-2414-335d-7a9dd276a294",
    "billing_period_from": "1900-02-22",
    "billing_period_to": "1951-10-11",
    "processing_at": "1934-04-08T19:52:52.0Z",
    "created_at": "1914-02-28T05:29:39.0Z",
    "updated_at": "1902-07-24T18:50:59.0Z"
  }
}
404
example response
{
  "message": "The requested resource could not be found"
}