Skip to content

List memberships

SumUp API reference and code samples.

MembershipsPreview feature

Endpoints to manage user's memberships. Memberships are used to connect the user to merchant accounts and to grant them access to the merchant's resources via roles.

The Membership object

A membership associates a user with a resource, memberships is defined by user, resource, resource type, and associated roles.

Membership

  • id string required

    ID of the membership.

    Example: "mem_WZsm7QTPhVrompscmPhoGTXXcrd58fr9MOhP"
  • resource_id string required

    ID of the resource the membership is in.

    Example: "M2DDT39A"
  • type string required

    The type of the membership resource. Possible values are:

    • merchant - merchant account(s)
    • organization - organization(s)
    Example: "merchant"
  • roles []string required

    User's roles.

  • permissions []string deprecated required

    User's permissions.

  • created_at string date-time required

    The timestamp of when the membership was created.

    Example: "2023-01-20T15:16:17Z"
  • updated_at string date-time required

    The timestamp of when the membership was last updated.

    Example: "2023-01-20T15:16:17Z"
  • invite object

    Pending invitation for membership.

     Show attributes
     Close
    Invite
    • email string email required

      Email address of the invited user.

      Example: "boaty.mcboatface@sumup.com"
    • expires_at string date-time required
      Example: "2023-01-20T15:16:17Z"
  • status string required

    The status of the membership.

  • metadata object max properties: 64

    Set of user-defined key-value pairs attached to the object. Partial updates are not supported. When updating, always submit whole metadata. Maximum of 64 parameters are allowed in the object.

    Example: {}
  • attributes object

    Object attributes that are modifiable only by SumUp applications.

    Example: {}
  • resource object required

    Information about the resource the membership is in.

     Show attributes
     Close
    Resource
    • id string required

      ID of the resource the membership is in.

      Example: "M2DDT39A"
    • type string required

      The type of the membership resource. Possible values are:

      • merchant - merchant account(s)
      • organization - organization(s)
      Example: "merchant"
    • name string required

      Display name of the resource.

      Example: "Acme Corp"
    • logo string max length: 256uri

      Logo fo the resource.

      Example: "https://images.sumup.com/img_2x4y6z8a0b1c2d3e4f5g6h7j8k.png"
    • created_at string date-time required

      The timestamp of when the membership resource was created.

      Example: "2023-01-20T15:16:17Z"
    • updated_at string date-time required

      The timestamp of when the membership resource was last updated.

      Example: "2023-01-20T15:16:17Z"
    • attributes object

      Object attributes that are modifiable only by SumUp applications.

      Example: {}
The Membership object
{
"id": "mem_WZsm7QTPhVrompscmPhoGTXXcrd58fr9MOhP",
"resource_id": "M2DDT39A",
"type": "merchant",
"roles": [
"role_admin"
],
"permissions": [
"members_read",
"members_write",
"create_moto_payments",
"full_transaction_history_view",
"refund_transactions",
"create_referral",
"developer_settings_edit",
"developer_settings_access"
],
"created_at": "2023-01-20T15:16:17Z",
"updated_at": "2023-01-20T15:16:17Z",
"invite": {
"email": "boaty.mcboatface@sumup.com",
"expires_at": "2023-01-20T15:16:17Z"
},
"status": "",
"metadata": {},
"attributes": {},
"resource": {
"id": "M2DDT39A",
"type": "merchant",
"name": "Acme Corp",
"logo": "https://images.sumup.com/img_2x4y6z8a0b1c2d3e4f5g6h7j8k.png",
"created_at": "2023-01-20T15:16:17Z",
"updated_at": "2023-01-20T15:16:17Z",
"attributes": {}
}
}
Memberships

List memberships

List memberships of the current user.

Query Parameters

  • offset integer minimum: 0default: 0

    Offset of the first member to return.

    Example: 0
  • limit integer minimum: 1maximum: 25default: 10

    Maximum number of members to return.

    Example: 10
  • kind string

    Filter memberships by resource kind.

    Example: "merchant"
  • status string
    Options:  accepted pending expired disabled unknown

    Filter the returned memberships by the membership status.

  • resource.type string

    Filter memberships by resource kind.

    Example: "merchant"
  • resource.attributes.sandbox boolean

    Filter memberships by the sandbox status of the resource the membership is in.

  • resource.name string

    Filter memberships by the name of the resource the membership is in.

  • resource.parent.id string nullable

    Filter memberships by the parent of the resource the membership is in. When filtering by parent both resource.parent.id and resource.parent.type must be present. Pass explicit null to filter for resources without a parent.

  • resource.parent.type object nullable

    Filter memberships by the parent of the resource the membership is in. When filtering by parent both resource.parent.id and resource.parent.type must be present. Pass explicit null to filter for resources without a parent.

  • roles []string

    Filter the returned memberships by role.

    Example: ["role_employee","role_accountant"]

Response 200

  • items []object required

    A membership associates a user with a resource, memberships is defined by user, resource, resource type, and associated roles.

     Show attributes
     Close
    Membership
    • id string required

      ID of the membership.

      Example: "mem_WZsm7QTPhVrompscmPhoGTXXcrd58fr9MOhP"
    • resource_id string required

      ID of the resource the membership is in.

      Example: "M2DDT39A"
    • type string required

      The type of the membership resource. Possible values are:

      • merchant - merchant account(s)
      • organization - organization(s)
      Example: "merchant"
    • roles []string required

      User's roles.

    • permissions []string deprecated required

      User's permissions.

    • created_at string date-time required

      The timestamp of when the membership was created.

      Example: "2023-01-20T15:16:17Z"
    • updated_at string date-time required

      The timestamp of when the membership was last updated.

      Example: "2023-01-20T15:16:17Z"
    • invite object

      Pending invitation for membership.

       Show attributes
       Close
      Invite
      • email string email required

        Email address of the invited user.

        Example: "boaty.mcboatface@sumup.com"
      • expires_at string date-time required
        Example: "2023-01-20T15:16:17Z"
    • status string required

      The status of the membership.

    • metadata object max properties: 64

      Set of user-defined key-value pairs attached to the object. Partial updates are not supported. When updating, always submit whole metadata. Maximum of 64 parameters are allowed in the object.

      Example: {}
    • attributes object

      Object attributes that are modifiable only by SumUp applications.

      Example: {}
    • resource object required

      Information about the resource the membership is in.

       Show attributes
       Close
      Resource
      • id string required

        ID of the resource the membership is in.

        Example: "M2DDT39A"
      • type string required

        The type of the membership resource. Possible values are:

        • merchant - merchant account(s)
        • organization - organization(s)
        Example: "merchant"
      • name string required

        Display name of the resource.

        Example: "Acme Corp"
      • logo string max length: 256uri

        Logo fo the resource.

        Example: "https://images.sumup.com/img_2x4y6z8a0b1c2d3e4f5g6h7j8k.png"
      • created_at string date-time required

        The timestamp of when the membership resource was created.

        Example: "2023-01-20T15:16:17Z"
      • updated_at string date-time required

        The timestamp of when the membership resource was last updated.

        Example: "2023-01-20T15:16:17Z"
      • attributes object

        Object attributes that are modifiable only by SumUp applications.

        Example: {}
  • total_count integer required
    Example: 3
GET /v0.1/memberships
curl https://api.sumup.com/v0.1/memberships \
-X GET \
-H "Authorization: Bearer $SUMUP_API_KEY"
import SumUp from '@sumup/sdk';
const client = new SumUp();
const result = await client.memberships.list();
using SumUp;
var client = new SumUpClient();
var result = await client.Memberships.ListAsync();
import com.sumup.sdk.SumUpClient;
SumUpClient client = SumUpClient.builder().build();
var result = client.memberships().listMemberships();
from sumup import Sumup
client = Sumup()
result = client.memberships.list()
$sumup = new \SumUp\SumUp();
$result = $sumup->memberships->list();
client := sumup.NewClient()
result, err := client.Memberships.List(context.Background())
use sumup::Client;
let client = Client::default();
let result = client.memberships().list(sumup::ListMembershipsParams{
offset: Some(0),
limit: Some(10),
kind: Some("merchant".to_string()),
status: Some("status".to_string()),
resource_type: Some("merchant".to_string()),
resource_attributes_sandbox: Some("resource.attributes.sandbox".to_string()),
resource_name: Some("resource.name".to_string()),
resource_parent_id: Some("resource.parent.id".to_string()),
resource_parent_type: Some("resource.parent.type".to_string()),
roles: Some(["role_employee","role_accountant"]),
}).await;
List memberships response
{
"items": [
{
"id": "mem_WZsm7QTPhVrompscmPhoGTXXcrd58fr9MOhP",
"resource_id": "M2DDT39A",
"type": "merchant",
"roles": [
"role_admin"
],
"permissions": [
"members_read",
"members_write",
"create_moto_payments",
"full_transaction_history_view",
"refund_transactions",
"create_referral",
"developer_settings_edit",
"developer_settings_access"
],
"created_at": "2023-01-20T15:16:17Z",
"updated_at": "2023-01-20T15:16:17Z",
"invite": {
"email": "boaty.mcboatface@sumup.com",
"expires_at": "2023-01-20T15:16:17Z"
},
"status": "",
"metadata": {},
"attributes": {},
"resource": {
"id": "M2DDT39A",
"type": "merchant",
"name": "Acme Corp",
"logo": "https://images.sumup.com/img_2x4y6z8a0b1c2d3e4f5g6h7j8k.png",
"created_at": "2023-01-20T15:16:17Z",
"updated_at": "2023-01-20T15:16:17Z",
"attributes": {}
}
}
],
"total_count": 3
}