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": [
    {
      "id": "6845a29d-9bc3-e6b9-4e54-018b2c2cadfb",
      "attention_reason": "mandate_revoked",
      "basket_id": "69fca06d986e69013a000309",
      "customer": {
        "id": "84fb8f89-ba90-d08e-faf3-4bed13a101d0",
        "first_name": "Jane",
        "last_name": "Doe",
        "full_name": "Jane Doe",
        "phone": "+447900000000",
        "has_password": true,
        "dob": "1939-02-05",
        "brand_id": "f9271040-4016-7890-2def-40ffb5aa7e82",
        "site_id": "319b6a2b-7e86-b106-244c-936b0ab22c06",
        "stripe_id": "cus_1234567890",
        "express_stripe_id": "cus_1234567890",
        "email": "janedoe@example.com",
        "labels": [],
        "preferred_locale": "en",
        "locked_at": "1924-06-14T01:51:34.0Z",
        "created_at": "1951-11-28T17:53:02.0Z",
        "updated_at": "1918-10-22T15:39:35.0Z",
        "deleted_at": "1945-05-19T15:26:39.0Z",
        "last_active_at": "1918-08-11T10:17:46.0Z",
        "email_verified_at": "1935-03-03T20:24:22.0Z",
        "last_check_in": {
          "checked_in_at": "1964-07-21T06:52:27.0Z",
          "method": "Scanned"
        },
        "avatar_id": "000000-000000-000000-000000",
        "avatar": {
          "id": "7d8ed6ba-e35d-fa93-3903-0b403afb1031",
          "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": "deserunt dolor Excepteur id do"
      },
      "end_date": "1897-11-09T17:11:49.0Z",
      "external_ref": "commodo Ut quis in ipsum",
      "members": [],
      "membership_number": "1234567890",
      "next_billing_date": "1945-11-29T18:48:12.0Z",
      "next_charge": {
        "id": "2c639cd8-27ca-c146-57ab-11c7c09191e8",
        "amount": 3995,
        "currency": "GBP",
        "status": "succeeded",
        "billing_period_from": "1962-01-03",
        "billing_period_to": "1908-11-09"
      },
      "payment_method": {
        "id": "quis irure",
        "type": "card",
        "last_4": "cillum reprehenderit",
        "status": "revoked",
        "card_brand": "amex"
      },
      "rate": {
        "id": "7e0a1a82-f94f-cfb1-c4f1-82fccb3657d4",
        "membership_type_id": "ce5df2a8-3419-e063-b3db-cfb21ea92eb7",
        "name": "Standard rate",
        "currency": "GBP",
        "price": 5000,
        "joining_fee": 1000,
        "billing_frequency": "P1M",
        "processors": [
          "ut",
          "nisi Excepteur aliquip voluptate dolor",
          "deserunt enim quis Lorem Excepteur",
          "incididunt est aute"
        ],
        "default_duration": "P1Y",
        "private": true,
        "created_at": "1955-11-07T12:01:09.0Z",
        "updated_at": "1927-12-18T16:31:32.0Z"
      },
      "site_id": "1185e572-4d4a-76d5-ca8f-0dcbcdf3fb40",
      "source": "self_signup",
      "start_date": "1956-11-03T22:28:15.0Z",
      "status": "upcoming",
      "status_updated_at": "1909-07-06T23:05:16.0Z",
      "type": {
        "id": "7ccccc93-b008-2c50-0cf1-5156dfa590fd",
        "name": "Gold tier",
        "description": "Enjoy exclusive benefits as part of being a member in our Gold tier",
        "terms": "Excepteur",
        "brand_id": "1c190abb-54c2-736b-20ad-b136298c7ff4",
        "offline_payments": false,
        "disable_confirmation_email": true,
        "private": true,
        "visibility": "link_only",
        "minimum_start_date": "1927-11-17T07:54:39.0Z",
        "min_members": 2,
        "max_members": 4,
        "rates": [
          {
            "id": "b801627c-d1b2-cf21-a2a4-ca34876375de",
            "membership_type_id": "628d7dbb-5608-5d9a-4837-b17ee396bfc0",
            "name": "Standard rate",
            "currency": "GBP",
            "price": 5000,
            "joining_fee": 1000,
            "billing_frequency": "P1M",
            "processors": [
              "voluptate dolor ipsum ut",
              "qui",
              "consequat minim",
              "ad dolor officia"
            ],
            "default_duration": "P1Y",
            "private": true,
            "created_at": "1918-11-21T10:45:18.0Z",
            "updated_at": "1954-01-28T11:50:23.0Z"
          }
        ],
        "revenue_schedule": "FREQ=WEEKLY",
        "created_at": "1894-09-22T12:26:33.0Z",
        "updated_at": "1936-02-19T17:38:59.0Z",
        "deleted_at": "1916-06-04T05:14:09.0Z"
      },
      "payment_details_url": "sit commodo",
      "created_at": "1946-07-18T11:31:52.0Z"
    },
    {
      "id": "5b14ad6e-4895-6038-ee3b-f1f712b0b70e",
      "attention_reason": "site_id",
      "basket_id": "69fca06d986e69013a00030a",
      "customer": {
        "id": "9f32255f-4ad0-b5f2-1e19-3562ad59cbea",
        "first_name": "Jane",
        "last_name": "Doe",
        "full_name": "Jane Doe",
        "phone": "+447900000000",
        "has_password": true,
        "dob": "1922-12-03",
        "brand_id": "f8fb0257-671f-2436-7dd6-42690aede0a2",
        "site_id": "b215ab23-aae7-0789-8d0c-3b40f598e1f6",
        "stripe_id": "cus_1234567890",
        "express_stripe_id": "cus_1234567890",
        "email": "janedoe@example.com",
        "labels": [
          {
            "id": "418a9a20-d1a3-18c3-843f-acb3da632317",
            "value": "VIP",
            "colour": "ff6634"
          },
          {
            "id": "0e7498e6-048a-8bdf-6c1e-c07eef9f9e56",
            "value": "VIP",
            "colour": "ff6634"
          },
          {
            "id": "839f25d7-5f66-ada0-ceac-dc2c6017a817",
            "value": "VIP",
            "colour": "ff6634"
          }
        ],
        "preferred_locale": "en",
        "locked_at": "1939-06-09T23:18:58.0Z",
        "created_at": "1908-06-13T20:02:34.0Z",
        "updated_at": "1962-07-19T02:06:53.0Z",
        "deleted_at": "1930-07-05T01:38:37.0Z",
        "last_active_at": "1948-11-11T01:45:01.0Z",
        "email_verified_at": "1942-09-06T04:07:58.0Z",
        "last_check_in": {
          "checked_in_at": "1922-08-29T22:59:27.0Z",
          "method": "Scanned"
        },
        "avatar_id": "000000-000000-000000-000000",
        "avatar": {
          "id": "6383a9c2-8562-eeed-df48-b6bb32f65fdb",
          "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": "mollit sint culpa"
      },
      "end_date": "1960-09-17T11:19:17.0Z",
      "external_ref": "nulla laborum aliquip eu",
      "members": [
        {
          "customer_id": "6c1cdb1f-7481-ce5e-8be0-f374950aa0e3",
          "is_lead": false,
          "membership_number": "1234567890"
        },
        {
          "customer_id": "5bdb71e9-f84d-8493-27d0-c27b18811f54",
          "is_lead": false,
          "membership_number": "1234567890"
        }
      ],
      "membership_number": "1234567890",
      "next_billing_date": "1903-01-28T16:32:45.0Z",
      "next_charge": {
        "id": "93219f2b-367c-b81f-2e6c-95559df69f98",
        "amount": 3995,
        "currency": "GBP",
        "status": "errored",
        "billing_period_from": "1929-11-06",
        "billing_period_to": "1910-09-01"
      },
      "payment_method": {
        "id": "officia occaecat eu reprehenderit",
        "type": "card",
        "last_4": "mollit ut culpa amet",
        "status": "revoked",
        "card_brand": "amex"
      },
      "rate": {
        "id": "aee930c8-e5c3-8eeb-34fe-739300dd53c4",
        "membership_type_id": "98d9dc6d-128a-4d35-3602-69cecf9201ed",
        "name": "Standard rate",
        "currency": "GBP",
        "price": 5000,
        "joining_fee": 1000,
        "billing_frequency": "P1M",
        "processors": [],
        "default_duration": "P1Y",
        "private": true,
        "created_at": "1929-03-27T09:18:12.0Z",
        "updated_at": "1953-06-01T12:49:20.0Z"
      },
      "site_id": "0c33765f-820b-3079-eac0-47b99d482a7b",
      "source": "unknown",
      "start_date": "1912-10-18T14:07:35.0Z",
      "status": "needs_attention",
      "status_updated_at": "1955-11-18T03:33:57.0Z",
      "type": {
        "id": "32637cf8-b827-8a4f-9374-b39be338194b",
        "name": "Gold tier",
        "description": "Enjoy exclusive benefits as part of being a member in our Gold tier",
        "terms": "cillum",
        "brand_id": "0635d50c-41f5-f95c-0b48-52da6539097d",
        "offline_payments": true,
        "disable_confirmation_email": true,
        "private": false,
        "visibility": "private",
        "minimum_start_date": "1920-12-07T01:54:10.0Z",
        "min_members": 2,
        "max_members": 4,
        "rates": [
          {
            "id": "1700577b-b403-3e64-380b-1bd74286f196",
            "membership_type_id": "b3abed52-e63e-f8d9-3ca8-7829bcd69edd",
            "name": "Standard rate",
            "currency": "GBP",
            "price": 5000,
            "joining_fee": 1000,
            "billing_frequency": "P1M",
            "processors": [
              "esse eu pariatur",
              "Ut",
              "in dolore sint in magna",
              "in",
              "est et qui consectetur anim"
            ],
            "default_duration": "P1Y",
            "private": true,
            "created_at": "1942-10-10T22:35:21.0Z",
            "updated_at": "1950-03-11T02:47:34.0Z"
          },
          {
            "id": "e0d2bb78-e1f5-d267-6929-a25c66643035",
            "membership_type_id": "e46428ba-5fb4-2dda-776a-0a013f35af38",
            "name": "Standard rate",
            "currency": "GBP",
            "price": 5000,
            "joining_fee": 1000,
            "billing_frequency": "P1M",
            "processors": [
              "voluptate quis tempor",
              "qui",
              "sed officia",
              "velit"
            ],
            "default_duration": "P1Y",
            "private": true,
            "created_at": "1893-04-05T01:16:44.0Z",
            "updated_at": "1951-01-09T22:43:29.0Z"
          },
          {
            "id": "0c95f513-adc9-79be-9eec-37052e924ac2",
            "membership_type_id": "4660c43e-03cc-f75d-5cca-95e530d8cebf",
            "name": "Standard rate",
            "currency": "GBP",
            "price": 5000,
            "joining_fee": 1000,
            "billing_frequency": "P1M",
            "processors": [],
            "default_duration": "P1Y",
            "private": true,
            "created_at": "1921-10-30T22:07:24.0Z",
            "updated_at": "1901-04-12T10:29:03.0Z"
          },
          {
            "id": "46b9d246-b29f-bedc-a582-007f99f46d34",
            "membership_type_id": "bdd4e30a-a00b-21c4-badb-953cc197635a",
            "name": "Standard rate",
            "currency": "GBP",
            "price": 5000,
            "joining_fee": 1000,
            "billing_frequency": "P1M",
            "processors": [
              "mollit proident",
              "Ut"
            ],
            "default_duration": "P1Y",
            "private": true,
            "created_at": "1927-10-17T01:27:38.0Z",
            "updated_at": "1951-09-28T06:01:31.0Z"
          }
        ],
        "revenue_schedule": "FREQ=WEEKLY",
        "created_at": "1912-09-09T06:31:20.0Z",
        "updated_at": "1917-07-27T19:15:34.0Z",
        "deleted_at": "1903-04-10T23:43:43.0Z"
      },
      "payment_details_url": "culpa",
      "created_at": "1929-12-08T18:35:45.0Z"
    }
  ],
  "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": "0d1dc8cf-8aae-34c9-b169-5763652ce625",
    "attention_reason": "mandate_revoked",
    "basket_id": "69fca06d986e69013a00030b",
    "customer": {
      "id": "ee1cb2a4-a612-7244-1fd9-97b6598154b3",
      "first_name": "Jane",
      "last_name": "Doe",
      "full_name": "Jane Doe",
      "phone": "+447900000000",
      "has_password": true,
      "dob": "1893-11-26",
      "brand_id": "07fca25e-a412-1c07-da7a-60feadbdd335",
      "site_id": "f6576c54-d6de-5e5b-fc7f-58d5ece6ed1c",
      "stripe_id": "cus_1234567890",
      "express_stripe_id": "cus_1234567890",
      "email": "janedoe@example.com",
      "labels": [
        {
          "id": "8e639ee9-d2ab-2b74-c7cd-1b571cf98396",
          "value": "VIP",
          "colour": "ff6634"
        }
      ],
      "preferred_locale": "en",
      "locked_at": "1943-12-15T22:08:51.0Z",
      "created_at": "1918-06-09T05:02:40.0Z",
      "updated_at": "1903-09-01T18:01:01.0Z",
      "deleted_at": "1933-10-01T14:14:28.0Z",
      "last_active_at": "1947-12-13T13:19:46.0Z",
      "email_verified_at": "1919-06-29T15:01:15.0Z",
      "last_check_in": {
        "checked_in_at": "1896-12-04T16:04:19.0Z",
        "method": "Scanned"
      },
      "avatar_id": "000000-000000-000000-000000",
      "avatar": {
        "id": "090f3c4a-f53b-0a83-fea3-311d6f319a14",
        "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": "id"
    },
    "end_date": "1943-08-22T04:09:12.0Z",
    "external_ref": "magna id ex proident enim",
    "members": [
      {
        "customer_id": "7b8dae5f-d395-51c7-8ab6-e28bebe43e6e",
        "is_lead": true,
        "membership_number": "1234567890"
      },
      {
        "customer_id": "0a377bbf-6290-a1ab-eaa8-cbe1e9ada8b6",
        "is_lead": true,
        "membership_number": "1234567890"
      }
    ],
    "membership_number": "1234567890",
    "next_billing_date": "1902-01-27T17:49:58.0Z",
    "next_charge": {
      "id": "57d569d3-5f4f-d0f0-6d26-1fd053299107",
      "amount": 3995,
      "currency": "GBP",
      "status": "failed",
      "billing_period_from": "1957-06-15",
      "billing_period_to": "1891-03-12"
    },
    "payment_method": {
      "id": "nostrud aliqua dolor nisi",
      "type": "card",
      "last_4": "nulla ut do",
      "status": "revoked",
      "card_brand": "amex"
    },
    "rate": {
      "id": "c6a98525-1451-3ce2-7b38-78b041e86f24",
      "membership_type_id": "5d00fd47-4503-f5c0-6afc-d1885b5d6611",
      "name": "Standard rate",
      "currency": "GBP",
      "price": 5000,
      "joining_fee": 1000,
      "billing_frequency": "P1M",
      "processors": [
        "ex proident commodo quis dolor"
      ],
      "default_duration": "P1Y",
      "private": true,
      "created_at": "1933-11-13T03:53:52.0Z",
      "updated_at": "1946-03-13T15:34:03.0Z"
    },
    "site_id": "e0aed0ae-2474-7018-c570-197261c1049e",
    "source": "app",
    "start_date": "1934-08-14T10:05:07.0Z",
    "status": "reserved",
    "status_updated_at": "1958-10-24T04:52:42.0Z",
    "type": {
      "id": "fc4b990c-74cd-aa49-4d44-90419ba7560b",
      "name": "Gold tier",
      "description": "Enjoy exclusive benefits as part of being a member in our Gold tier",
      "terms": "laboris",
      "brand_id": "20ec87ad-e633-c23f-8fe5-99d32f2a68a4",
      "offline_payments": false,
      "disable_confirmation_email": false,
      "private": false,
      "visibility": "public",
      "minimum_start_date": "1906-12-23T07:29:43.0Z",
      "min_members": 2,
      "max_members": 4,
      "rates": [],
      "revenue_schedule": "FREQ=WEEKLY",
      "created_at": "1952-07-23T15:42:53.0Z",
      "updated_at": "1903-07-11T15:20:52.0Z",
      "deleted_at": "1969-06-10T20:36:05.0Z"
    },
    "payment_details_url": "consectetur esse culpa nostrud",
    "created_at": "1958-04-13T13:46:32.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": "f9e9941a-e6ca-05bd-ff83-2f21f241c1fb",
    "membership": {
      "id": "78924f89-c9d4-a237-0425-7859b0e0eb1e",
      "membership_number": "00000014",
      "type_name": "Gold Membership",
      "customer_id": "7ea5cb4b-c664-6b5c-d667-2342d80ee714",
      "customer_name": "Jane Jones"
    },
    "processor": "adyen",
    "processor_data": {
      "cardholder_name": "Mrs J Jones",
      "last_4": 4001,
      "processor_type": "Cash",
      "processor_type_id": "69fca06e986e69013a000821"
    },
    "amount": 3995,
    "original_amount": 3995,
    "currency": "gbp",
    "tax": 1000,
    "status": "succeeded",
    "description": "occaecat cupidatat",
    "can_download_receipt": false,
    "amount_refunded": 40724705,
    "refunded": true,
    "refunds": [
      {
        "id": "28a78b7e-1e98-1111-f071-69480699d698",
        "status": "succeeded",
        "amount": 995,
        "currency": "gbp",
        "notes": "Gesture of good will",
        "failure_reason": "invalid_details",
        "refunded_by": {
          "id": "3d860efd-b621-8b2a-b342-49cb0d1fbff3",
          "full_name": "Jane Jenkins"
        },
        "processor_data": {
          "processor": "adyen",
          "processor_id": "re_64301e0b2df9d11814010ea6"
        },
        "created_at": "1893-11-17T21:49:31.0Z",
        "updated_at": "1944-10-02T13:25:13.0Z"
      },
      {
        "id": "20b1ec2d-49d0-f558-b93f-bcbd7c92c374",
        "status": "succeeded",
        "amount": 995,
        "currency": "gbp",
        "notes": "Gesture of good will",
        "failure_reason": "invalid_details",
        "refunded_by": {
          "id": "9ef0fcf0-8f7c-ac38-7141-19f0ecee2c65",
          "full_name": "Jane Jenkins"
        },
        "processor_data": {
          "processor": "adyen",
          "processor_id": "re_64301e0b2df9d11814010ea6"
        },
        "created_at": "1908-03-23T03:09:59.0Z",
        "updated_at": "1910-12-15T12:21:01.0Z"
      },
      {
        "id": "6d4020aa-a06e-55f6-9b04-73a1ba79750b",
        "status": "succeeded",
        "amount": 995,
        "currency": "gbp",
        "notes": "Gesture of good will",
        "failure_reason": "invalid_details",
        "refunded_by": {
          "id": "448f3ea6-bac5-aa06-ed48-a361dc5fffcf",
          "full_name": "Jane Jenkins"
        },
        "processor_data": {
          "processor": "adyen",
          "processor_id": "re_64301e0b2df9d11814010ea6"
        },
        "created_at": "1919-11-30T23:12:33.0Z",
        "updated_at": "1946-07-04T08:01:18.0Z"
      }
    ],
    "site_id": "2c7476c6-1298-7eb9-bfd5-a35ba09ef2fe",
    "billing_period_from": "1959-06-26",
    "billing_period_to": "1918-03-29",
    "processing_at": "1938-11-01T22:37:24.0Z",
    "created_at": "1920-09-02T03:53:12.0Z",
    "updated_at": "1962-11-17T16:12:25.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": "a937075e-5ccb-54c5-2fd3-62c10ff89f8a",
    "membership": {
      "id": "ebf331b0-270f-d047-f6af-18e3c8fc171d",
      "membership_number": "00000014",
      "type_name": "Gold Membership",
      "customer_id": "a9cb46d2-e90e-ae41-bf57-cf9ef1041745",
      "customer_name": "Jane Jones"
    },
    "processor": "adyen",
    "processor_data": {
      "cardholder_name": "Mrs J Jones",
      "last_4": 4001,
      "processor_type": "Cash",
      "processor_type_id": "69fca06d986e69013a00030c"
    },
    "amount": 3995,
    "original_amount": 3995,
    "currency": "gbp",
    "tax": 1000,
    "status": "succeeded",
    "description": "quis proident sunt",
    "can_download_receipt": true,
    "amount_refunded": -25060614,
    "refunded": true,
    "refunds": [],
    "site_id": "93edd8ab-e616-cae7-0070-2992caae6c3a",
    "billing_period_from": "1929-03-23",
    "billing_period_to": "1906-07-28",
    "processing_at": "1943-09-06T12:41:59.0Z",
    "created_at": "1920-01-08T07:56:15.0Z",
    "updated_at": "1917-06-30T18:25:41.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": "fe45a21d-2b67-0959-39c9-155607134ff0",
    "membership": {
      "id": "15974f46-2bc7-f2ae-17da-5cbe5d2a88c3",
      "membership_number": "00000014",
      "type_name": "Gold Membership",
      "customer_id": "1e179495-b4dd-47f6-b54b-63d67d4e33b2",
      "customer_name": "Jane Jones"
    },
    "processor": "adyen",
    "processor_data": {
      "processor_type": "Cash",
      "processor_type_id": "69fca06d986e69013a00030d"
    },
    "amount": 3995,
    "original_amount": 3995,
    "currency": "gbp",
    "tax": 1000,
    "status": "succeeded",
    "description": "quis enim labore proident",
    "can_download_receipt": false,
    "amount_refunded": 90174029,
    "refunded": false,
    "refunds": [
      {
        "id": "f6f9501c-5422-c694-f22e-4b6d55db749b",
        "status": "succeeded",
        "amount": 995,
        "currency": "gbp",
        "notes": "Gesture of good will",
        "failure_reason": "invalid_details",
        "refunded_by": {
          "id": "6610b3da-ccd3-9939-e569-c780cf1c7c6c",
          "full_name": "Jane Jenkins"
        },
        "processor_data": {
          "processor": "adyen",
          "processor_id": "re_64301e0b2df9d11814010ea6"
        },
        "created_at": "1955-10-26T19:23:58.0Z",
        "updated_at": "1953-04-04T23:16:33.0Z"
      }
    ],
    "site_id": "f05e6cb9-a26b-0703-fe47-6238e6f57741",
    "billing_period_from": "1917-12-24",
    "billing_period_to": "1962-12-14",
    "processing_at": "1891-11-14T05:51:12.0Z",
    "created_at": "1890-03-29T20:46:24.0Z",
    "updated_at": "1960-02-04T21:36:58.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": "69fca06e986e69013a000822",
    "organisation_id": "25bb0b4a-4750-c546-77c3-3a6e0a858d13",
    "site_id": "ae4a1d62-08ed-30d2-8cd2-bad857e5a5b8",
    "customer_id": "a233fd1d-d167-05b6-31e1-121c121569e6",
    "membership_id": "5d27a705-0b00-6b24-4ef9-b4bd682afee7",
    "from": "Trybe",
    "to": "+447123456789",
    "message": "aute ut Ut",
    "message_type": "billing_details_request",
    "message_delivered": true,
    "created_at": "2024-02-02T12:01:01.0Z",
    "sent_at": "2024-02-02T12:01:01.0Z"
  }
}
404
example response
{
  "message": "The requested resource could not be found"
}
422
example response
{
  "errors": {
    "minim_67": [
      "nostrud veniam"
    ],
    "commodo7_": [
      "fugiat minim",
      "Excepteur exercitation in velit"
    ],
    "culpa88": [
      "exercitation",
      "consectetur et",
      "Ut aute id sint pariatur",
      "irure",
      "adipisicing ullamco"
    ]
  },
  "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": "7eb755a0-3e66-c3da-745b-e0e04755ca2f",
    "organisation_id": "bd088f81-c90f-3bed-cdbc-58e41d36b8b2"
  }
}
404
example response
{
  "message": "The requested resource could not be found"
}