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": "db1823e2-ee86-095d-3327-f8d7e71cc430",
      "site_id": "d4b465c5-3e89-b1e1-409c-5f377ba8fc12",
      "membership_number": "1234567890",
      "customer": {
        "id": "fae114f2-ab7a-515b-23a1-8307289b1a21",
        "first_name": "Jane",
        "last_name": "Doe",
        "full_name": "Jane Doe",
        "phone": "+447900000000",
        "has_password": true,
        "dob": "1933-07-06",
        "brand_id": "1e39fd37-6302-a951-24e2-5f1b8bc03bdf",
        "site_id": "9f0c399e-4a89-e481-b272-b8f4f5ce6562",
        "stripe_id": "cus_1234567890",
        "express_stripe_id": "cus_1234567890",
        "email": "janedoe@example.com",
        "labels": [
          {
            "id": "cda2a1c3-4903-2772-5458-503ea50c8eaf",
            "value": "VIP",
            "colour": "ff6634"
          },
          {
            "id": "5d2ea414-da65-2a89-760c-69b81d29282f",
            "value": "VIP",
            "colour": "ff6634"
          },
          {
            "id": "623c6d00-9bb1-00ee-e897-e40b04622e11",
            "value": "VIP",
            "colour": "ff6634"
          }
        ],
        "preferred_locale": "en",
        "locked_at": "1928-02-01T16:11:09.0Z",
        "created_at": "1920-06-25T19:52:18.0Z",
        "updated_at": "1915-09-27T23:26:10.0Z",
        "deleted_at": "1927-07-22T07:01:22.0Z",
        "last_active_at": "1923-05-26T05:40:58.0Z",
        "email_verified_at": "1959-04-02T17:25:48.0Z",
        "last_check_in": {
          "checked_in_at": "1912-05-02T02:40:23.0Z",
          "method": "Scanned"
        },
        "avatar_id": "000000-000000-000000-000000",
        "avatar": {
          "id": "7533ea1f-9568-7aa3-3297-b9e0673437df",
          "file_name": "super-cool-photo.jpg",
          "mime_type": "image/jpeg",
          "size": 84256,
          "url": "https://example.com/media/super-cool-photo.jpg"
        },
        "external_ref": "anim consequat do"
      },
      "members": [
        {
          "customer_id": "623b34c1-401a-b34b-8299-783ca62b1d72",
          "membership_number": "1234567890"
        },
        {
          "is_lead": false
        },
        {
          "customer_id": "f93c2e89-90ac-16ea-6118-1d4eee309f0e",
          "membership_number": "1234567890",
          "is_lead": false
        },
        {
          "customer_id": "fdc0da98-7d45-4071-a1d5-646e863ee4c6",
          "is_lead": false
        }
      ],
      "type": {
        "id": "c5cdaf75-947b-036b-7d26-8530ffd749e1",
        "name": "Gold tier",
        "description": "Enjoy exclusive benefits as part of being a member in our Gold tier",
        "terms": "laboris nulla nostrud",
        "brand_id": "9d727ecb-2d09-5a65-49f2-c3d18b9ec618",
        "offline_payments": false,
        "disable_confirmation_email": true,
        "private": false,
        "visibility": "private",
        "minimum_start_date": "1913-12-07T07:58:34.0Z",
        "min_members": 2,
        "max_members": 4,
        "rates": [
          {
            "id": "ca948af3-9fd9-07b9-7e03-e1bb2abe143e",
            "membership_type_id": "ae38bce8-dd5e-72c0-4f35-9412cd6875b5",
            "name": "Standard rate",
            "currency": "GBP",
            "price": 5000,
            "joining_fee": 1000,
            "tax": 1250,
            "processors": [],
            "created_at": "1932-10-16T18:42:19.0Z",
            "updated_at": "1893-09-12T06:13:11.0Z"
          },
          {
            "id": "1e595aa1-9c60-72b3-4788-bb735302d8c0",
            "membership_type_id": "8e215b1b-ce57-c2a2-bfe7-61a5a99cf778",
            "name": "Standard rate",
            "currency": "GBP",
            "joining_fee": 1000,
            "tax": 1250,
            "billing_frequency": "P1M",
            "processors": [
              "magna",
              "sit in laborum"
            ],
            "default_duration": "P1Y",
            "private": true,
            "created_at": "1913-07-07T18:31:17.0Z",
            "updated_at": "1932-05-15T18:04:05.0Z"
          },
          {
            "name": "Standard rate",
            "currency": "GBP",
            "tax": 1250,
            "default_duration": "P1Y",
            "private": true,
            "updated_at": "1931-06-13T09:32:29.0Z"
          }
        ],
        "revenue_schedule": "FREQ=WEEKLY",
        "created_at": "1897-08-31T08:03:49.0Z",
        "updated_at": "1939-01-25T23:01:08.0Z",
        "deleted_at": "1949-07-15T13:20:30.0Z"
      },
      "rate": {
        "id": "91e54638-7e63-6b60-f684-6316cf77a732",
        "membership_type_id": "d14820b5-18ae-746f-3362-a073846bb740",
        "name": "Standard rate",
        "currency": "GBP",
        "price": 5000,
        "joining_fee": 1000,
        "billing_frequency": "P1M",
        "processors": [
          "Ut",
          "veniam labore et",
          "Duis ipsum",
          "adipisicing id ut magna"
        ],
        "default_duration": "P1Y",
        "created_at": "1915-01-24T12:19:58.0Z",
        "updated_at": "1939-12-22T23:09:04.0Z"
      },
      "status": "inactive",
      "source": "app",
      "payment_method": {
        "id": "irure reprehenderit nostrud sint",
        "type": "direct_debit",
        "last_4": "veniam consectetur et",
        "status": "revoked",
        "card_brand": "amex"
      },
      "start_date": "1950-08-17T18:14:58.0Z"
    },
    {
      "id": "a9990ad9-7d72-56a9-e68f-c84f91aec88c",
      "customer": {
        "id": "1347aafa-1967-0609-552c-331ac719b646",
        "first_name": "Jane",
        "last_name": "Doe",
        "full_name": "Jane Doe",
        "phone": "+447900000000",
        "has_password": true,
        "dob": "1901-08-05",
        "brand_id": "9d894bc8-8ee9-6e58-70df-82960369c5e3",
        "site_id": "7e87f130-ec0b-08df-0778-7de9f47578f6",
        "stripe_id": "cus_1234567890",
        "express_stripe_id": "cus_1234567890",
        "email": "janedoe@example.com",
        "labels": [
          {
            "id": "9539ae6c-a8fd-4117-5732-98a4cf9832ef",
            "value": "VIP",
            "colour": "ff6634"
          }
        ],
        "preferred_locale": "en",
        "locked_at": "1958-07-27T14:15:09.0Z",
        "created_at": "1957-10-27T13:56:25.0Z",
        "updated_at": "1951-02-13T20:25:23.0Z",
        "deleted_at": "1900-07-30T19:33:29.0Z",
        "last_active_at": "1899-06-15T09:58:34.0Z",
        "email_verified_at": "1901-12-25T05:13:27.0Z",
        "last_check_in": {
          "checked_in_at": "1915-09-01T09:55:12.0Z",
          "method": "Scanned"
        },
        "avatar_id": "000000-000000-000000-000000",
        "avatar": {
          "id": "8175f70a-2379-750e-9656-f2dc725d1807",
          "file_name": "super-cool-photo.jpg",
          "mime_type": "image/jpeg",
          "size": 84256,
          "url": "https://example.com/media/super-cool-photo.jpg"
        },
        "external_ref": "do aliquip mollit"
      },
      "members": [],
      "type": {
        "id": "f4075136-aeaa-41df-3db5-3d62f7e969c9",
        "name": "Gold tier",
        "description": "Enjoy exclusive benefits as part of being a member in our Gold tier",
        "terms": "laborum",
        "brand_id": "d9594887-9de7-c352-5259-6988b780653f",
        "offline_payments": true,
        "disable_confirmation_email": false,
        "private": true,
        "visibility": "link_only",
        "minimum_start_date": "1919-01-11T10:01:41.0Z",
        "min_members": 2,
        "max_members": 4,
        "rates": [
          {
            "id": "19728c37-09e6-f56a-d77a-73f2ff330452",
            "membership_type_id": "b7a55a08-f174-7e28-4d28-98b44eb9e4c9",
            "name": "Standard rate",
            "currency": "GBP",
            "joining_fee": 1000,
            "tax": 1250,
            "billing_frequency": "P1M",
            "processors": [],
            "private": true,
            "updated_at": "1903-07-24T15:09:54.0Z"
          },
          {
            "id": "6eaa977d-2ede-d55a-cd9b-5026affe39a9",
            "membership_type_id": "55117ff9-5012-6043-0c72-f962ac325641",
            "name": "Standard rate"
          },
          {
            "updated_at": "1915-05-13T23:41:47.0Z"
          }
        ],
        "revenue_schedule": "FREQ=WEEKLY",
        "created_at": "1917-01-31T10:01:07.0Z",
        "updated_at": "1947-08-23T18:41:21.0Z",
        "deleted_at": "1916-11-14T06:20:17.0Z"
      },
      "rate": {
        "id": "94eedb46-93d3-e9ae-9bee-709cd5ccc0b1",
        "name": "Standard rate",
        "joining_fee": 1000,
        "billing_frequency": "P1M",
        "processors": [
          "sed et"
        ],
        "default_duration": "P1Y",
        "updated_at": "1927-09-27T23:40:37.0Z"
      },
      "source": "self_signup",
      "payment_method": {
        "id": "quis magna",
        "type": "direct_debit",
        "last_4": "elit Excepteur",
        "status": "revoked",
        "card_brand": "amex"
      },
      "start_date": "1918-04-17T01:47:55.0Z",
      "end_date": "1914-04-26T07:27:54.0Z",
      "created_at": "1898-10-22T03:52:22.0Z",
      "external_ref": "veniam officia aute amet",
      "next_billing_date": "1943-10-18T11:36:55.0Z",
      "next_charge": {
        "id": "0220612c-31a5-18cb-ce1b-62fe3e0f7d05",
        "amount": 3995,
        "currency": "GBP",
        "status": "failed",
        "billing_period_from": "1925-08-18",
        "billing_period_to": "1945-01-29"
      },
      "attention_reason": "setup_unpaid"
    }
  ],
  "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": "ac2c8e7c-dcb4-74d8-49b2-c169d1bdbf58",
    "site_id": "04546fdd-f010-7fe5-2136-ae3c52a737bf",
    "membership_number": "1234567890",
    "customer": {
      "id": "f827f273-5355-8e7d-91e6-d6949cdf9187",
      "first_name": "Jane",
      "last_name": "Doe",
      "full_name": "Jane Doe",
      "phone": "+447900000000",
      "has_password": true,
      "dob": "1901-05-22",
      "brand_id": "721e8b45-832a-0678-473b-bb206a5aa05d",
      "site_id": "80122219-ffd3-7f00-0cf2-2f0f98019d91",
      "stripe_id": "cus_1234567890",
      "express_stripe_id": "cus_1234567890",
      "email": "janedoe@example.com",
      "labels": [
        {
          "id": "2c39b0cd-3eb8-f2c0-5328-a15edc3a62bb",
          "value": "VIP",
          "colour": "ff6634"
        },
        {
          "id": "82bf1195-fe8f-11de-fa3f-8f6ee3562400",
          "value": "VIP",
          "colour": "ff6634"
        },
        {
          "id": "59475edc-996e-79d3-cd8f-982074ce024c",
          "value": "VIP",
          "colour": "ff6634"
        },
        {
          "id": "8c875f0c-6b68-0edc-a6da-590cc191acde",
          "value": "VIP",
          "colour": "ff6634"
        },
        {
          "id": "88d6dd4f-338a-48d5-e505-c8235706402e",
          "value": "VIP",
          "colour": "ff6634"
        }
      ],
      "preferred_locale": "en",
      "locked_at": "1928-07-27T07:20:47.0Z",
      "created_at": "1891-06-19T05:38:05.0Z",
      "updated_at": "1896-04-14T17:30:48.0Z",
      "deleted_at": "1929-10-23T16:34:54.0Z",
      "last_active_at": "1905-03-06T05:42:01.0Z",
      "email_verified_at": "1916-02-03T07:57:51.0Z",
      "last_check_in": {
        "checked_in_at": "1923-11-28T03:05:58.0Z",
        "method": "Scanned"
      },
      "avatar_id": "000000-000000-000000-000000",
      "avatar": {
        "id": "c2ec7ce3-32ee-15a6-91cb-fd9e77830638",
        "file_name": "super-cool-photo.jpg",
        "mime_type": "image/jpeg",
        "size": 84256,
        "url": "https://example.com/media/super-cool-photo.jpg"
      },
      "external_ref": "reprehenderit laborum aute elit amet"
    },
    "members": [
      {
        "customer_id": "b1018666-9a84-1d9c-6a4c-1065e6c3f34f",
        "membership_number": "1234567890",
        "is_lead": true
      },
      {
        "customer_id": "60f52d71-acf1-3138-a5b2-5829643c4e9e",
        "membership_number": "1234567890",
        "is_lead": true
      },
      {
        "membership_number": "1234567890",
        "is_lead": false
      },
      {
        "customer_id": "34dc202f-723f-19dd-35aa-18a15d77c214",
        "membership_number": "1234567890",
        "is_lead": false
      }
    ],
    "type": {
      "id": "902cca0e-8dac-721d-b8e4-cff8b8c10e2a",
      "name": "Gold tier",
      "description": "Enjoy exclusive benefits as part of being a member in our Gold tier",
      "terms": "magna exercitation id",
      "brand_id": "b0a70dd4-cdb3-fa16-1a63-69293240ef5d",
      "offline_payments": true,
      "disable_confirmation_email": true,
      "private": false,
      "visibility": "public",
      "minimum_start_date": "1969-08-01T08:09:35.0Z",
      "min_members": 2,
      "max_members": 4,
      "rates": [
        {
          "membership_type_id": "f8899912-7632-0330-a3f2-d3bf158c4eef",
          "price": 5000,
          "joining_fee": 1000,
          "tax": 1250,
          "billing_frequency": "P1M",
          "processors": [],
          "private": true,
          "created_at": "1909-04-13T04:10:43.0Z",
          "updated_at": "1931-03-27T07:35:06.0Z"
        },
        {
          "name": "Standard rate",
          "currency": "GBP",
          "price": 5000,
          "billing_frequency": "P1M"
        }
      ],
      "revenue_schedule": "FREQ=WEEKLY",
      "created_at": "1955-09-07T06:23:45.0Z",
      "updated_at": "1898-10-22T03:09:40.0Z",
      "deleted_at": "1919-05-21T06:21:45.0Z"
    },
    "source": "import",
    "start_date": "1960-10-19T11:16:57.0Z",
    "end_date": "1966-04-03T16:35:02.0Z",
    "created_at": "1934-08-25T22:15:33.0Z",
    "next_charge": {
      "id": "2528ff4c-1843-2e26-48ec-9ee8a71dc2fd",
      "amount": 3995,
      "currency": "GBP",
      "status": "failed",
      "billing_period_from": "1938-08-11",
      "billing_period_to": "1913-05-07"
    }
  }
}
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": "e22ae358-d32a-6d05-c95f-2ffd8a067a17",
    "membership": {
      "id": "080290a5-d5fa-5e6c-cec7-ab5e3938022c",
      "membership_number": "00000014",
      "type_name": "Gold Membership",
      "customer_id": "c46f55d8-3eda-08cf-c7ce-e222fc492072",
      "customer_name": "Jane Jones"
    },
    "processor": "adyen",
    "processor_data": {},
    "amount": 3995,
    "original_amount": 3995,
    "currency": "gbp",
    "tax": 1000,
    "status": "succeeded",
    "description": "dolore enim Duis tempor proident",
    "can_download_receipt": false,
    "amount_refunded": "nulla dolore ullamco aliqua minim",
    "refunded": "sint nulla aliquip sit quis",
    "refunds": [
      {
        "id": "2d8e8562-845c-478f-9d32-81c877259cda",
        "status": "succeeded",
        "amount": 995,
        "currency": "gbp",
        "notes": "Gesture of good will",
        "failure_reason": "invalid_details",
        "refunded_by": {
          "id": "860e786a-6954-82d9-5815-9a7ddcfd06ef",
          "full_name": "Jane Jenkins"
        },
        "processor_data": {
          "processor": "adyen",
          "processor_id": "re_64301e0b2df9d11814010ea6"
        },
        "created_at": "1947-08-23T18:35:55.0Z",
        "updated_at": "1907-04-08T11:26:16.0Z"
      }
    ],
    "site_id": "9760a2da-0bb4-a159-ec1c-40e7bb592ee5",
    "billing_period_from": "1949-03-26",
    "billing_period_to": "1953-12-10",
    "processing_at": "1903-09-24T05:45:23.0Z",
    "created_at": "1901-02-09T07:41:59.0Z",
    "updated_at": "1906-08-09T22:49:38.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": "019e73cb-c345-4be0-cbf8-15f595ed126c",
    "membership": {
      "id": "5134ec52-d365-de44-8a69-06882c24ce97",
      "membership_number": "00000014",
      "type_name": "Gold Membership",
      "customer_id": "02b15ea1-4fa8-e388-a198-e7c694b5d0e5",
      "customer_name": "Jane Jones"
    },
    "processor": "adyen",
    "processor_data": {
      "cardholder_name": "Mrs J Jones",
      "last_4": 4001,
      "processor_type_id": "68a6e8df08f78501350000b4"
    },
    "amount": 3995,
    "currency": "gbp",
    "tax": 1000,
    "status": "succeeded",
    "description": "commodo voluptate",
    "can_download_receipt": true,
    "amount_refunded": "nisi Excepteur pariatur adipisicing Lorem",
    "refunded": "voluptate et ad dolor irure",
    "refunds": [
      {
        "id": "de3b0f1e-1e05-ce49-5fbb-e2f418397e3f",
        "status": "succeeded",
        "amount": 995,
        "currency": "gbp",
        "notes": "Gesture of good will",
        "failure_reason": "invalid_details",
        "refunded_by": {
          "id": "ecc799c2-a1c0-804e-b274-4bd23d687f4d",
          "full_name": "Jane Jenkins"
        },
        "processor_data": {
          "processor": "adyen",
          "processor_id": "re_64301e0b2df9d11814010ea6"
        },
        "created_at": "1899-01-22T01:05:22.0Z",
        "updated_at": "1955-10-19T18:09:51.0Z"
      },
      {
        "id": "7c35c1fc-9a92-6f70-cf5f-b1abb698790b",
        "status": "succeeded",
        "amount": 995,
        "currency": "gbp",
        "notes": "Gesture of good will",
        "failure_reason": "invalid_details",
        "refunded_by": {
          "id": "8a0b106d-a8c7-fbb0-4805-9567da96c4d1",
          "full_name": "Jane Jenkins"
        },
        "processor_data": {
          "processor": "adyen",
          "processor_id": "re_64301e0b2df9d11814010ea6"
        },
        "created_at": "1891-11-14T04:01:13.0Z",
        "updated_at": "1897-10-25T06:55:42.0Z"
      }
    ],
    "site_id": "038c33f2-441e-38a6-6add-c7189cb67cea",
    "billing_period_from": "1904-07-23",
    "billing_period_to": "1963-05-22",
    "processing_at": "1952-11-08T10:42:15.0Z",
    "created_at": "1893-11-11T18:43:37.0Z",
    "updated_at": "1933-04-04T12:21:46.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": "6c663b45-9614-e31d-b3e5-69808944e108",
    "membership": {
      "id": "15514409-cddd-6e06-b9f4-b2b78a661792",
      "membership_number": "00000014",
      "type_name": "Gold Membership",
      "customer_id": "9bbeb095-df1a-eb6a-5cfc-f1cc02a09fa1",
      "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": "reprehenderit",
    "can_download_receipt": false,
    "amount_refunded": "dolore Excepteur",
    "refunded": "Excepteur nostrud sunt cupidatat",
    "refunds": [
      {
        "id": "b1860d5e-3a58-491a-f830-a7f154fca55e",
        "status": "succeeded",
        "amount": 995,
        "currency": "gbp",
        "notes": "Gesture of good will",
        "failure_reason": "invalid_details",
        "refunded_by": {
          "id": "64bb5b3d-8c8e-4d9f-2720-69db5ce7a1fc",
          "full_name": "Jane Jenkins"
        },
        "processor_data": {
          "processor": "adyen",
          "processor_id": "re_64301e0b2df9d11814010ea6"
        },
        "created_at": "1899-04-07T08:03:17.0Z",
        "updated_at": "1903-03-04T18:47:12.0Z"
      }
    ],
    "site_id": "8571fc50-f094-7643-e5d0-20f4d9009c7a",
    "billing_period_from": "1964-04-27",
    "billing_period_to": "1928-01-09",
    "processing_at": "1944-02-25T19:42:22.0Z",
    "created_at": "1959-05-10T09:24:21.0Z",
    "updated_at": "1956-02-22T16:39:07.0Z"
  }
}
404
example response
{
  "message": "The requested resource could not be found"
}