Skip to content

Memberships

SumUp API reference and code samples.

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.

  • idstringrequired

    ID of the membership.

    Example: "mem_WZsm7QTPhVrompscmPhoGTXXcrd58fr9MOhP"
  • resource_idstringrequired

    ID of the resource the membership is in.

    Example: "M2DDT39A"
  • typestringrequired

    The type of the membership resource. Possible values are:

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

    User's roles.

  • permissions[]stringrequireddeprecated

    User's permissions.

  • created_atstringrequiredformat: date-time

    The timestamp of when the membership was created.

    Example: "2023-01-20T15:16:17Z"
  • updated_atstringrequiredformat: date-time

    The timestamp of when the membership was last updated.

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

    Pending invitation for membership.

     Show attributes
     Close
    Invite
    • emailstringrequiredformat: email

      Email address of the invited user.

      Example: "boaty.mcboatface@sumup.com"
    • expires_atstringrequiredformat: date-time
      Example: "2023-01-20T15:16:17Z"
  • statusstringrequired
    Options: acceptedpendingexpireddisabledunknown

    The status of the membership.

  • metadataobjectmax 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: {}
  • attributesobject

    Object attributes that are modifiable only by SumUp applications.

    Example: {}
  • resourceResourcerequired

    Information about the resource the membership is in.

     Show attributes
     Close
    Resource
    • idstringrequired

      ID of the resource the membership is in.

      Example: "M2DDT39A"
    • typestringrequired

      The type of the membership resource. Possible values are:

      • merchant - merchant account(s)
      • organization - organization(s)
      Example: "merchant"
    • namestringrequired

      Display name of the resource.

      Example: "Acme Corp"
    • logostringmax length: 256, format: uri

      Logo fo the resource.

      Example: "https://images.sumup.com/img_2x4y6z8a0b1c2d3e4f5g6h7j8k.png"
    • created_atstringrequiredformat: date-time

      The timestamp of when the membership resource was created.

      Example: "2023-01-20T15:16:17Z"
    • updated_atstringrequiredformat: date-time

      The timestamp of when the membership resource was last updated.

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

      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

GET/v0.1/memberships

List memberships of the current user.

Query Parameters

  • offsetintegerminimum: 0, default: 0

    Offset of the first member to return.

    Example: 0
  • limitintegerminimum: 1, maximum: 25, default: 10

    Maximum number of members to return.

    Example: 10
  • kindstring

    Filter memberships by resource kind.

    Example: "merchant"
  • statusstring
    Options: acceptedpendingexpireddisabledunknown

    Filter the returned memberships by the membership status.

  • resource.typestring

    Filter memberships by resource kind.

    Example: "merchant"
  • resource.attributes.sandboxboolean

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

  • resource.namestring

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

  • resource.parent.idstringnullable

    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.typeobjectnullable

    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

Returns a list of Membership objects. See Membership object.

  • items[]Membershiprequired

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

     Show attributes
     Close
    Membership
    • idstringrequired

      ID of the membership.

      Example: "mem_WZsm7QTPhVrompscmPhoGTXXcrd58fr9MOhP"
    • resource_idstringrequired

      ID of the resource the membership is in.

      Example: "M2DDT39A"
    • typestringrequired

      The type of the membership resource. Possible values are:

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

      User's roles.

    • permissions[]stringrequireddeprecated

      User's permissions.

    • created_atstringrequiredformat: date-time

      The timestamp of when the membership was created.

      Example: "2023-01-20T15:16:17Z"
    • updated_atstringrequiredformat: date-time

      The timestamp of when the membership was last updated.

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

      Pending invitation for membership.

       Show attributes
       Close
      Invite
      • emailstringrequiredformat: email

        Email address of the invited user.

        Example: "boaty.mcboatface@sumup.com"
      • expires_atstringrequiredformat: date-time
        Example: "2023-01-20T15:16:17Z"
    • statusstringrequired
      Options: acceptedpendingexpireddisabledunknown

      The status of the membership.

    • metadataobjectmax 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: {}
    • attributesobject

      Object attributes that are modifiable only by SumUp applications.

      Example: {}
    • resourceResourcerequired

      Information about the resource the membership is in.

       Show attributes
       Close
      Resource
      • idstringrequired

        ID of the resource the membership is in.

        Example: "M2DDT39A"
      • typestringrequired

        The type of the membership resource. Possible values are:

        • merchant - merchant account(s)
        • organization - organization(s)
        Example: "merchant"
      • namestringrequired

        Display name of the resource.

        Example: "Acme Corp"
      • logostringmax length: 256, format: uri

        Logo fo the resource.

        Example: "https://images.sumup.com/img_2x4y6z8a0b1c2d3e4f5g6h7j8k.png"
      • created_atstringrequiredformat: date-time

        The timestamp of when the membership resource was created.

        Example: "2023-01-20T15:16:17Z"
      • updated_atstringrequiredformat: date-time

        The timestamp of when the membership resource was last updated.

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

        Object attributes that are modifiable only by SumUp applications.

        Example: {}
  • total_countintegerrequired
    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
}

Content-Type: application/problem+json

Invalid query parameter combination.

  • typestringrequiredformat: uri

    A URI reference that identifies the problem type.

    Example: "https://developer.sumup.com/problem/not-found"
  • titlestring

    A short, human-readable summary of the problem type.

    Example: "Requested resource couldn't be found."
  • statusinteger

    The HTTP status code generated by the origin server for this occurrence of the problem.

    Example: 404
  • detailstring

    A human-readable explanation specific to this occurrence of the problem.

    Example: "The requested resource doesn't exist or does not belong to you."
  • instancestringformat: uri

    A URI reference that identifies the specific occurrence of the problem.

Error 400
{
"type": "https://developer.sumup.com/problem/bad-request",
"title": "Bad Request",
"status": 400,
"detail": "Request validation failed."
}