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[]stringrequireddeprecatedCaution
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.idstring
Filter memberships by the ID of the resource the membership is in.
- resource.parent.idstring
Filter memberships by the parent of the resource the membership is in. Omit both
resource.parent.idandresource.parent.typeto skip parent filtering. When filtering by parent, both parameters must be present. To select resources without a parent, set each parameter to an empty value. Otherwise, both parameters must identify a parent. - resource.parent.typestring
Filter memberships by the parent of the resource the membership is in. Omit both
resource.parent.idandresource.parent.typeto skip parent filtering. When filtering by parent, both parameters must be present. To select resources without a parent, set each parameter to an empty value. Otherwise, both parameters must identify a parent.Example:"merchant" - 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[]stringrequireddeprecatedCaution
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"sumup memberships listimport SumUp from "@sumup/sdk";
async function main() { const client = new SumUp({ apiKey: "sup_sk_your_api_key" });
const result = await client.memberships.list( { "offset": 0 } ); console.log(result);}
main().catch(console.error);using System;using System.Collections.Generic;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
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)$sumup = new \SumUp\SumUp();
$result = $sumup->memberships->list();package main
import ( "context" "fmt"
"github.com/sumup/sumup-go")
func main() { client := sumup.NewClient() result, err := client.Memberships.List(context.TODO(), sumup.MembershipsListParams{ Offset: new(0), Limit: new(10), Kind: new(sumup.ResourceType("merchant")), Status: new(sumup.MembershipStatus("accepted")), ResourceType: new(sumup.ResourceType("merchant")), Roles: []string{"role_employee", "role_accountant"}, }) if err != nil { panic(err.Error()) }
fmt.Printf("%+v\n", result)}use sumup::{Authorization, Client};#[tokio::main]async fn main() { let client = Client::default() .with_authorization(Authorization::api_key("sup_sk_test_...")); let response = client .memberships() .list(Default::default()) .await .expect("list request failed"); println!("{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.
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."}