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
Permissions include only legacy permissions, please use roles instead. Member access is based on their roles within a given resource and the permissions these roles grant.
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.
CloseInvite- emailstringrequiredformat: email
Email address of the invited user.
Example:"boaty.mcboatface@sumup.com" - expires_atstringrequiredformat: date-timeExample:
"2023-01-20T15:16:17Z"
- statusstringrequiredOptions:
acceptedpendingexpireddisabledunknownThe 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.
CloseResource- 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:{}
{ "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": {} }}List memberships
List memberships of the current user.
user.profileuser.profile_readonlyQuery Parameters
- offsetintegerminimum: 0, default:
0Offset of the first member to return.
Example:0 - limitintegerminimum: 1, maximum: 25, default:
10Maximum number of members to return.
Example:10 - kindstring
Filter memberships by resource kind.
Example:"merchant" - statusstringOptions:
acceptedpendingexpireddisabledunknownFilter 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.idandresource.parent.typemust 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.idandresource.parent.typemust 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.
CloseMembership- 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
Permissions include only legacy permissions, please use roles instead. Member access is based on their roles within a given resource and the permissions these roles grant.
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.
CloseInvite- emailstringrequiredformat: email
Email address of the invited user.
Example:"boaty.mcboatface@sumup.com" - expires_atstringrequiredformat: date-timeExample:
"2023-01-20T15:16:17Z"
- statusstringrequiredOptions:
acceptedpendingexpireddisabledunknownThe 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.
CloseResource- 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_countintegerrequiredExample:
3
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 System;using System.Collections.Generic;using System.Text.Json;using System.Threading.Tasks;using SumUp;
public static class Program{ public static async Task Main() { using var client = new SumUpClient(); var response = await client.Memberships.ListAsync( new MembershipsListOptions { Offset = 10, Limit = 10, Kind = "example", Status = MembershipStatus.Accepted, ResourceType = "example", ResourceAttributesSandbox = true, ResourceName = "example", ResourceParentId = OptionalQuery<string>.From("example-id"), ResourceParentType = OptionalQuery<string>.From("example"), Roles = Array.Empty<string>(), });
Console.WriteLine(response.StatusCode); }}import com.sumup.sdk.SumUpClient;
public final class ListMembershipsSample { public static void main(String[] args) throws Exception { var client = new SumUpClient();
var result = client.memberships().list(); System.out.println(result); }}import os
import sumup
def main() -> None: client = sumup.Sumup(api_key=os.environ["SUMUP_API_KEY"])
result = client.memberships.list( offset=0, limit=10, kind="merchant", status="accepted", resource_type="merchant", roles=[ "role_employee", "role_accountant", ], ) print(result)
if __name__ == "__main__": main()$sumup = new \SumUp\SumUp();
$result = $sumup->memberships->list();package main
import ( "context" "log"
"github.com/sumup/sumup-go")
func main() { ctx := context.Background() client := sumup.NewClient()
result, err := client.Memberships.List(ctx, sumup.MembershipsListParams{ Offset: ptr(0), Limit: ptr(10), Kind: ptr(sumup.ResourceType("merchant")), Status: ptr(sumup.MembershipStatus("accepted")), ResourceType: ptr(sumup.ResourceType("merchant")), Roles: []string{"role_employee", "role_accountant"}, }) if err != nil { log.Fatal(err) }
log.Printf("%+v", result)}
func ptr[T any](value T) *T { return &value}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;{ "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.
Example:"https://api.sumup.com/v0.1/checkouts/4e425463-3e1b-431d-83fa-1e51c2925e99"
Content-Type: application/problem+json
Authentication failed or missing required scope.
- 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.
Example:"https://api.sumup.com/v0.1/checkouts/4e425463-3e1b-431d-83fa-1e51c2925e99"
{ "type": "https://developer.sumup.com/problem/bad-request", "title": "Bad Request", "status": 400, "detail": "Request validation failed."}{ "type": "https://developer.sumup.com/problem/unauthorized", "title": "Unauthorized", "status": 401, "detail": "Authentication credentials are missing or invalid."}