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": [],
  "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": {
    "start_date": "1929-07-10T19:07:36.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": "68c452cf-871e-11d1-0aaf-14d5fcba15da",
    "membership": {
      "id": "8d317027-4026-715e-68e6-4375c6ed2b71",
      "membership_number": "00000014",
      "type_name": "Gold Membership",
      "customer_id": "f7312d37-2ce3-5d49-2c0e-2e801062cf14"
    },
    "processor": "adyen",
    "processor_data": {
      "cardholder_name": "Mrs J Jones"
    },
    "amount": 3995,
    "original_amount": 3995,
    "currency": "gbp",
    "tax": 1000,
    "status": "succeeded",
    "description": "enim id",
    "can_download_receipt": false,
    "amount_refunded": -49160442,
    "refunded": false,
    "refunds": [],
    "site_id": "6ae63ba9-d2ff-622c-8bee-452911fde326",
    "billing_period_from": "1921-11-05",
    "billing_period_to": "1937-10-13",
    "processing_at": "1965-09-18T19:01:16.0Z",
    "created_at": "1911-09-09T17:24:06.0Z",
    "updated_at": "1958-09-15T22:13: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": "063e4d52-694a-57cb-a817-cac5832f668d",
    "membership": {
      "id": "d87c1b3c-9fd1-afca-c47b-23b59c3d8c57",
      "membership_number": "00000014",
      "type_name": "Gold Membership",
      "customer_id": "5da3aa44-3778-067d-45e3-159841c7ecdc",
      "customer_name": "Jane Jones"
    },
    "processor": "adyen",
    "processor_data": {
      "cardholder_name": "Mrs J Jones",
      "last_4": 4001,
      "processor_type": "Cash",
      "processor_type_id": "6967585ddef1db01370000e3"
    },
    "amount": 3995,
    "original_amount": 3995,
    "currency": "gbp",
    "tax": 1000,
    "status": "succeeded",
    "description": "sunt quis consectetur aute esse",
    "can_download_receipt": false,
    "amount_refunded": -72213858,
    "refunded": true,
    "refunds": [
      {
        "id": "a080c037-1e8d-cac0-ef59-2923f69605f2",
        "status": "succeeded",
        "amount": 995,
        "currency": "gbp",
        "notes": "Gesture of good will",
        "failure_reason": "invalid_details",
        "refunded_by": {
          "id": "86665ae6-9d36-148a-b781-f0eb6aa7eee9",
          "full_name": "Jane Jenkins"
        },
        "processor_data": {
          "processor": "adyen",
          "processor_id": "re_64301e0b2df9d11814010ea6"
        },
        "created_at": "1962-10-31T01:24:20.0Z",
        "updated_at": "1965-02-08T03:28:20.0Z"
      }
    ],
    "site_id": "db7ce937-ae77-747a-868f-e5be77d53b08",
    "billing_period_from": "1937-02-16",
    "billing_period_to": "1930-06-18",
    "processing_at": "1967-08-13T23:27:26.0Z",
    "created_at": "1945-10-12T21:54:22.0Z",
    "updated_at": "1896-07-04T01:18:15.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": "e2933216-1ad3-7202-e405-803a1d99ea14",
    "membership": {
      "id": "58211aee-3fe3-8117-e666-2814e6d9ffa2",
      "membership_number": "00000014",
      "type_name": "Gold Membership",
      "customer_id": "dfffd61a-3872-d805-b66c-3cd2f25c83f5",
      "customer_name": "Jane Jones"
    },
    "processor": "adyen",
    "processor_data": {
      "last_4": 4001,
      "processor_type": "Cash",
      "processor_type_id": "6967585ddef1db01370000e4"
    },
    "amount": 3995,
    "original_amount": 3995,
    "currency": "gbp",
    "tax": 1000,
    "status": "succeeded",
    "description": "reprehenderit Ut sint non",
    "can_download_receipt": false,
    "amount_refunded": -25674632,
    "refunded": false,
    "refunds": [
      {
        "id": "13548664-8ae5-e252-2b60-9cedf32c8087",
        "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": "1961-07-06T11:37:09.0Z",
        "updated_at": "1899-04-19T10:25:24.0Z"
      },
      {
        "id": "4a01dd49-173b-cbad-1bb2-0b3c6c5741c2",
        "status": "succeeded",
        "amount": 995,
        "currency": "gbp",
        "notes": "Gesture of good will",
        "failure_reason": "invalid_details",
        "refunded_by": {
          "id": "647766d3-83d5-6e19-bca9-00ea47176d93",
          "full_name": "Jane Jenkins"
        },
        "processor_data": {
          "processor": "adyen",
          "processor_id": "re_64301e0b2df9d11814010ea6"
        },
        "created_at": "1965-06-21T01:30:44.0Z",
        "updated_at": "1917-11-22T23:40:31.0Z"
      },
      {
        "id": "807dda1b-6871-004a-599e-725b06b66de3",
        "status": "succeeded",
        "amount": 995,
        "currency": "gbp",
        "notes": "Gesture of good will",
        "failure_reason": "invalid_details",
        "refunded_by": {
          "id": "19ac40cb-e619-fd3b-3b17-dfa87bef5757",
          "full_name": "Jane Jenkins"
        },
        "processor_data": {
          "processor": "adyen",
          "processor_id": "re_64301e0b2df9d11814010ea6"
        },
        "created_at": "1921-04-21T04:08:45.0Z",
        "updated_at": "1931-03-09T03:11:10.0Z"
      },
      {
        "id": "697fb853-3c26-c0f0-dea9-a037da5025b9",
        "status": "succeeded",
        "amount": 995,
        "currency": "gbp",
        "notes": "Gesture of good will",
        "failure_reason": "invalid_details",
        "refunded_by": {
          "id": "bab14491-e5f8-0d39-4a23-7cc5e63121d2",
          "full_name": "Jane Jenkins"
        },
        "processor_data": {
          "processor": "adyen",
          "processor_id": "re_64301e0b2df9d11814010ea6"
        },
        "created_at": "1902-02-28T01:44:07.0Z",
        "updated_at": "1968-10-21T01:04:20.0Z"
      },
      {
        "id": "cb463f0e-a937-2b17-3b20-86f3d0a31620",
        "status": "succeeded",
        "amount": 995,
        "currency": "gbp",
        "notes": "Gesture of good will",
        "failure_reason": "invalid_details",
        "refunded_by": {
          "id": "01e76d31-3375-ec89-ecbd-a660d5322ef0",
          "full_name": "Jane Jenkins"
        },
        "processor_data": {
          "processor": "adyen",
          "processor_id": "re_64301e0b2df9d11814010ea6"
        },
        "created_at": "1891-01-03T01:19:41.0Z",
        "updated_at": "1969-11-24T18:09:24.0Z"
      }
    ],
    "site_id": "64f257fa-6706-7cad-89d9-89e77ba4bd46",
    "billing_period_from": "1952-06-08",
    "billing_period_to": "1893-08-23",
    "processing_at": "1959-01-17T17:23:45.0Z",
    "created_at": "1955-08-16T16:16:14.0Z",
    "updated_at": "1960-06-23T11:51:07.0Z"
  }
}
404
example response
{
  "message": "The requested resource could not be found"
}