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

{
  "id": "85fc0bef-bede-1abb-380c-ffaa90ba4cd8",
  "site_id": "9668525f-f79b-606a-1190-a91fecc8d6ec",
  "payment_method": {
    "id": "adipisicing amet minim ea",
    "type": "direct_debit",
    "last_4": "eu qui",
    "status": "revoked",
    "card_brand": "amex"
  }
}
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": [
    {
      "created_at": "1945-10-01T12:57:31.0Z",
      "basket_id": "68714d9b823dd20147000080",
      "next_charge": {
        "id": "1233713d-9fee-d57a-7cac-95b3ae5865d7",
        "amount": 3995,
        "currency": "GBP",
        "status": "processing",
        "billing_period_from": "1924-09-21",
        "billing_period_to": "1923-03-26"
      }
    },
    {
      "site_id": "f88a0262-3518-0d8b-eb3d-bcd97ad3894c",
      "customer": {
        "id": "bcc4266a-dc4b-5c25-913e-0864877a15e9",
        "first_name": "Jane",
        "last_name": "Doe",
        "full_name": "Jane Doe",
        "phone": "+447900000000",
        "has_password": true,
        "dob": "1948-10-24",
        "brand_id": "41bce81f-309b-67a3-8fab-dcd87604d938",
        "site_id": "7c83d5ac-febf-891c-f926-b6b8ea7ab6fc",
        "stripe_id": "cus_1234567890",
        "express_stripe_id": "cus_1234567890",
        "email": "janedoe@example.com",
        "labels": [
          {
            "id": "92ce8dc5-fb60-63a3-d459-19c8a5930bba",
            "value": "VIP",
            "colour": "ff6634"
          },
          {
            "id": "7068f765-f59c-52a7-15b0-69ade4c8379a",
            "value": "VIP",
            "colour": "ff6634"
          },
          {
            "id": "c9f745b9-444f-1cf1-e04d-978a3ad37be2",
            "value": "VIP",
            "colour": "ff6634"
          }
        ],
        "preferred_locale": "en",
        "locked_at": "1935-01-14T01:30:27.0Z",
        "created_at": "1959-05-13T19:08:59.0Z",
        "updated_at": "1934-07-15T04:10:16.0Z",
        "deleted_at": "1915-03-26T18:06:54.0Z",
        "last_active_at": "1933-08-15T06:04:32.0Z",
        "email_verified_at": "1896-05-19T12:42:03.0Z",
        "last_check_in": {
          "checked_in_at": "1891-01-12T18:12:19.0Z",
          "method": "Scanned"
        },
        "avatar_id": "000000-000000-000000-000000",
        "avatar": {
          "id": "e85a8ee7-9de9-8734-be4b-2094b04366b8",
          "file_name": "super-cool-photo.jpg",
          "mime_type": "image/jpeg",
          "size": 84256,
          "url": "https://example.com/media/super-cool-photo.jpg"
        },
        "external_ref": "ullamco elit"
      },
      "members": [
        {
          "customer_id": "69c4f6ba-df48-7d0f-5e6e-9c3a35c6759d"
        },
        {
          "customer_id": "0d4d2d4f-f026-0448-c0e7-4e54b12d0a03",
          "membership_number": "1234567890",
          "is_lead": false
        },
        {
          "customer_id": "89713f4d-19e7-6bb2-229f-dce2ddb5ea39",
          "is_lead": false
        },
        {
          "customer_id": "461da234-e3be-35da-8f13-65173e3f096d"
        }
      ],
      "type": {
        "id": "5417291c-e8d7-d542-a1da-17211cadae2c",
        "name": "Gold tier",
        "description": "Enjoy exclusive benefits as part of being a member in our Gold tier",
        "terms": "Excepteur veniam",
        "brand_id": "77b2bd79-608c-11d9-381b-54a3da53fbf2",
        "offline_payments": true,
        "disable_confirmation_email": true,
        "private": true,
        "visibility": "public",
        "minimum_start_date": "1898-10-24T09:06:08.0Z",
        "min_members": 2,
        "max_members": 4,
        "rates": [
          {
            "id": "4ea8a3cf-9cf3-260c-c085-9547cd358928",
            "membership_type_id": "adb78af8-7cef-977c-1d10-3fc6f352aa59",
            "name": "Standard rate",
            "currency": "GBP",
            "price": 5000,
            "joining_fee": 1000,
            "tax": 1250,
            "billing_frequency": "P1M",
            "processors": [
              "officia minim sunt proident magna",
              "magna Lorem ad sunt aute",
              "mollit dolore",
              "esse eu anim"
            ],
            "default_duration": "P1Y",
            "private": true,
            "created_at": "1923-10-27T10:08:51.0Z",
            "updated_at": "1927-05-08T15:52:39.0Z"
          },
          {
            "id": "3433336a-1da0-c1f4-2c09-b0a5a7277578",
            "membership_type_id": "d0477187-18c9-0b42-d91e-03e98c41f3a8",
            "currency": "GBP",
            "price": 5000,
            "tax": 1250,
            "processors": [
              "ea ullamco ex amet",
              "qui eu fugiat",
              "esse anim laborum in eu"
            ],
            "created_at": "1912-08-22T05:14:27.0Z",
            "updated_at": "1960-09-29T03:03:32.0Z"
          }
        ],
        "revenue_schedule": "FREQ=WEEKLY",
        "created_at": "1961-01-04T20:02:08.0Z",
        "updated_at": "1933-05-26T07:55:09.0Z",
        "deleted_at": "1924-04-08T13:06:55.0Z"
      },
      "status": "expired",
      "source": "unknown",
      "start_date": "1958-08-14T09:52:34.0Z",
      "end_date": "1918-06-21T12:53:10.0Z",
      "created_at": "1916-08-02T20:02:20.0Z",
      "basket_id": "68714d9b823dd20147000081",
      "external_ref": "anim et tempor voluptate quis"
    }
  ],
  "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": "75500510-aa2f-fd8b-2454-01535e78fbcd",
    "site_id": "92770cb4-bc5f-e37e-c45c-95014d73655c",
    "membership_number": "1234567890",
    "customer": {
      "id": "7cca0f26-7b6a-afbd-c289-c01d596bb60b",
      "first_name": "Jane",
      "last_name": "Doe",
      "full_name": "Jane Doe",
      "phone": "+447900000000",
      "has_password": true,
      "dob": "1900-04-14",
      "brand_id": "bc3d9316-cb2b-c7b4-686c-2acb4b8ab12e",
      "site_id": "196ce70b-5171-04a4-4d3f-181890f169c7",
      "stripe_id": "cus_1234567890",
      "express_stripe_id": "cus_1234567890",
      "email": "janedoe@example.com",
      "labels": [
        {
          "id": "2fee611b-14e6-bdaa-eb39-49aa14d2400f",
          "value": "VIP",
          "colour": "ff6634"
        },
        {
          "id": "42525304-e884-99f3-bc94-f998d1e81bc8",
          "value": "VIP",
          "colour": "ff6634"
        },
        {
          "id": "295be4e8-437d-1365-37d8-43f169b43f63",
          "value": "VIP",
          "colour": "ff6634"
        }
      ],
      "preferred_locale": "en",
      "locked_at": "1954-01-31T03:43:08.0Z",
      "created_at": "1967-07-15T01:50:50.0Z",
      "updated_at": "1898-08-03T01:41:14.0Z",
      "deleted_at": "1951-07-05T11:25:41.0Z",
      "last_active_at": "1894-08-02T11:58:59.0Z",
      "email_verified_at": "1910-11-04T11:05:08.0Z",
      "last_check_in": {
        "checked_in_at": "1891-03-07T11:11:40.0Z",
        "method": "Scanned"
      },
      "avatar_id": "000000-000000-000000-000000",
      "avatar": {
        "id": "9a5f9921-2855-09ba-3fa2-a89c30a1a516",
        "file_name": "super-cool-photo.jpg",
        "mime_type": "image/jpeg",
        "size": 84256,
        "url": "https://example.com/media/super-cool-photo.jpg"
      },
      "external_ref": "incididunt quis consectetur in irure"
    },
    "members": [
      {
        "membership_number": "1234567890",
        "is_lead": false
      },
      {
        "membership_number": "1234567890"
      },
      {
        "customer_id": "3e9b7dfc-4d5b-3156-2186-3f8928bd3d1d",
        "membership_number": "1234567890"
      },
      {
        "customer_id": "91a59690-6a46-bd9e-e379-53963085068b"
      },
      {
        "customer_id": "51e9d10c-aa66-e869-38c0-9b5dfe3923ec",
        "membership_number": "1234567890"
      }
    ],
    "type": {
      "id": "67559153-fd46-932b-b96f-6b8f942e6851",
      "name": "Gold tier",
      "description": "Enjoy exclusive benefits as part of being a member in our Gold tier",
      "terms": "magna Lorem",
      "brand_id": "a889112f-7570-29e0-3cf1-819bb35b1d28",
      "offline_payments": false,
      "disable_confirmation_email": true,
      "private": true,
      "visibility": "private",
      "minimum_start_date": "1942-03-31T07:13:18.0Z",
      "min_members": 2,
      "max_members": 4,
      "rates": [
        {
          "id": "1d550c64-15a2-e326-f03a-e07a29025e70",
          "membership_type_id": "80073588-4eca-85f1-345c-18ae50127135",
          "currency": "GBP",
          "price": 5000,
          "joining_fee": 1000,
          "tax": 1250,
          "billing_frequency": "P1M",
          "default_duration": "P1Y",
          "created_at": "1906-06-18T08:54:22.0Z",
          "updated_at": "1919-04-10T06:52:35.0Z"
        },
        {
          "membership_type_id": "4099bbf0-764f-88da-9d3e-b01523689731",
          "name": "Standard rate",
          "joining_fee": 1000,
          "tax": 1250,
          "billing_frequency": "P1M",
          "processors": [
            "sint aute ea ad minim",
            "Duis laboris",
            "nulla Excepteur adipisicing"
          ],
          "private": true
        }
      ],
      "revenue_schedule": "FREQ=WEEKLY",
      "created_at": "1947-09-27T10:28:23.0Z",
      "updated_at": "1923-03-22T05:47:57.0Z",
      "deleted_at": "1946-07-07T18:03:28.0Z"
    },
    "rate": {
      "id": "ebfe27ca-065b-9faf-eb03-935492ba8955",
      "membership_type_id": "7a22436f-a8e6-844f-5725-ca1036be5132",
      "name": "Standard rate",
      "currency": "GBP",
      "price": 5000,
      "joining_fee": 1000,
      "tax": 1250,
      "billing_frequency": "P1M",
      "processors": [
        "ea in amet cillum",
        "exercitation esse",
        "dolore nisi voluptate"
      ],
      "private": true,
      "created_at": "1925-07-13T05:37:35.0Z",
      "updated_at": "1948-04-06T21:36:25.0Z"
    },
    "status": "needs_attention",
    "source": "app"
  }
}
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/memberships/{membershipId}/charges/{chargeId}/payment
200
example response
{
  "data": {
    "id": "103396f9-eab9-66b3-8a29-5edcb3b0980e",
    "membership": {
      "id": "5d63f099-1688-daa4-a9d2-8cf6d1ac992c",
      "membership_number": "00000014",
      "type_name": "Gold Membership",
      "customer_id": "a17eaf01-713c-773f-5605-ecfe6ea815fe"
    },
    "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",
    "can_download_receipt": true,
    "amount_refunded": "mollit pariatur et",
    "refunded": "velit mollit dolor anim ut",
    "refunds": [
      {
        "id": "c41f46ad-9222-896f-4bcd-a21242e1c38d",
        "status": "succeeded",
        "amount": 995,
        "currency": "gbp",
        "notes": "Gesture of good will",
        "failure_reason": "invalid_details",
        "refunded_by": {
          "id": "a91ff000-61c6-0922-2be9-0bbea4afab63",
          "full_name": "Jane Jenkins"
        },
        "processor_data": {
          "processor": "adyen",
          "processor_id": "re_64301e0b2df9d11814010ea6"
        },
        "created_at": "1944-10-05T07:29:27.0Z",
        "updated_at": "1942-09-22T02:59:11.0Z"
      },
      {
        "id": "cf91154d-5e55-9af7-828a-e81aa9b45eed",
        "status": "succeeded",
        "amount": 995,
        "currency": "gbp",
        "notes": "Gesture of good will",
        "failure_reason": "invalid_details",
        "refunded_by": {
          "id": "e3ed30a5-d0d2-d00e-c012-af1b78920126",
          "full_name": "Jane Jenkins"
        },
        "processor_data": {
          "processor": "adyen",
          "processor_id": "re_64301e0b2df9d11814010ea6"
        },
        "created_at": "1960-10-12T01:30:51.0Z",
        "updated_at": "1957-03-10T22:02:29.0Z"
      },
      {
        "id": "82be4af4-c0ab-ba97-cbb4-255554e9e330",
        "status": "succeeded",
        "amount": 995,
        "currency": "gbp",
        "notes": "Gesture of good will",
        "failure_reason": "invalid_details",
        "refunded_by": {
          "id": "c9c25c0d-6a25-0150-edaa-41444753aa03",
          "full_name": "Jane Jenkins"
        },
        "processor_data": {
          "processor": "adyen",
          "processor_id": "re_64301e0b2df9d11814010ea6"
        },
        "created_at": "1924-03-20T13:36:47.0Z",
        "updated_at": "1900-01-15T02:48:17.0Z"
      }
    ],
    "site_id": "77bee2c6-7c36-b2a4-a665-bc280788bd8b",
    "billing_period_from": "1901-11-17",
    "billing_period_to": "1959-11-11",
    "created_at": "1901-05-14T23:40:49.0Z",
    "updated_at": "1961-12-05T14:43:48.0Z"
  }
}
404
example response
{
  "message": "The requested resource could not be found"
}