RolesPreview feature
Endpoints to manage custom roles. Custom roles allow you to tailor roles from individual permissions to match your needs. Once created, you can assign your custom roles to your merchant account members using the memberships.
The Role object
A custom role that can be used to assign set of permissions to members.
Role
- id string required
Unique identifier of the role.
Example:"role_WZsm7QTPhVrompscmPhoGTXXcrd58fr9MOhP" - name string required
User-defined name of the role.
Example:"Senior Shop Manager II" - description string
User-defined description of the role.
Example:"Manges the shop and the employees." - permissions []string max items: 100 required
List of permission granted by this role.
- is_predefined boolean required
True if the role is provided by SumUp.
Example:true - 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:{} - created_at string date-time required
The timestamp of when the role was created.
Example:"2023-01-20T15:16:17Z" - updated_at string date-time required
The timestamp of when the role was last updated.
Example:"2023-01-20T15:16:17Z"
{ "id": "role_WZsm7QTPhVrompscmPhoGTXXcrd58fr9MOhP", "name": "Senior Shop Manager II", "description": "Manges the shop and the employees.", "permissions": [], "is_predefined": true, "metadata": {}, "created_at": "2023-01-20T15:16:17Z", "updated_at": "2023-01-20T15:16:17Z"}Path Parameters
- merchant_code string required
Short unique identifier for the merchant.
Example:"MK10CL2A"
Response 200
- items []object required
A custom role that can be used to assign set of permissions to members.
CloseRole- id string required
Unique identifier of the role.
Example:"role_WZsm7QTPhVrompscmPhoGTXXcrd58fr9MOhP" - name string required
User-defined name of the role.
Example:"Senior Shop Manager II" - description string
User-defined description of the role.
Example:"Manges the shop and the employees." - permissions []string max items: 100 required
List of permission granted by this role.
- is_predefined boolean required
True if the role is provided by SumUp.
Example:true - 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:{} - created_at string date-time required
The timestamp of when the role was created.
Example:"2023-01-20T15:16:17Z" - updated_at string date-time required
The timestamp of when the role was last updated.
Example:"2023-01-20T15:16:17Z"
-
curl https://api.sumup.com/v0.1/merchants/{merchant_code}/roles \ -X GET \ -H "Authorization: Bearer $SUMUP_API_KEY"import SumUp from '@sumup/sdk';
const client = new SumUp();
const result = await client.roles.list("MK10CL2A");using SumUp;
var client = new SumUpClient();
var result = await client.Roles.ListAsync( "MK10CL2A");import com.sumup.sdk.SumUpClient;
SumUpClient client = SumUpClient.builder().build();
var result = client.roles().listMerchantRoles( "MK10CL2A");from sumup import Sumup
client = Sumup()
result = client.roles.list("MK10CL2A")$sumup = new \SumUp\SumUp();
$result = $sumup->roles->list('MK10CL2A');client := sumup.NewClient()
result, err := client.Roles.List(context.Background(), "MK10CL2A")use sumup::Client;
let client = Client::default();
let result = client.roles().list("MK10CL2A").await;{ "items": [ { "id": "role_WZsm7QTPhVrompscmPhoGTXXcrd58fr9MOhP", "name": "Senior Shop Manager II", "description": "Manges the shop and the employees.", "permissions": [], "is_predefined": true, "metadata": {}, "created_at": "2023-01-20T15:16:17Z", "updated_at": "2023-01-20T15:16:17Z" } ]}Create a role
Create a custom role for the merchant. Roles are defined by the set of permissions that they grant to the members that they are assigned to.
Path Parameters
- merchant_code string required
Short unique identifier for the merchant.
Example:"MK10CL2A"
Body Parameters
- name string required
User-defined name of the role.
Example:"Senior Shop Manager II" - permissions []string max items: 100 required
User's permissions.
- 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:{} - description string
User-defined description of the role.
Example:"Manges the shop and the employees."
Role
- id string required
Unique identifier of the role.
Example:"role_WZsm7QTPhVrompscmPhoGTXXcrd58fr9MOhP" - name string required
User-defined name of the role.
Example:"Senior Shop Manager II" - description string
User-defined description of the role.
Example:"Manges the shop and the employees." - permissions []string max items: 100 required
List of permission granted by this role.
- is_predefined boolean required
True if the role is provided by SumUp.
Example:true - 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:{} - created_at string date-time required
The timestamp of when the role was created.
Example:"2023-01-20T15:16:17Z" - updated_at string date-time required
The timestamp of when the role was last updated.
Example:"2023-01-20T15:16:17Z"
curl https://api.sumup.com/v0.1/merchants/{merchant_code}/roles \ -X POST \ -H "Authorization: Bearer $SUMUP_API_KEY" \ --json '{ "name": "Senior Shop Manager II", "permissions": [ "catalog_access", "taxes_access", "members_access" ] }'import SumUp from '@sumup/sdk';
const client = new SumUp();
const result = await client.roles.create("MK10CL2A", { name: "Senior Shop Manager II", permissions: ["catalog_access","taxes_access","members_access"],});using SumUp;
var client = new SumUpClient();
var result = await client.Roles.CreateAsync( "MK10CL2A", new CreateMerchantRoleBody { Name = "Senior Shop Manager II", Permissions = new[] { "catalog_access", "taxes_access", "members_access" }, });import com.sumup.sdk.SumUpClient;
SumUpClient client = SumUpClient.builder().build();
var result = client.roles().createMerchantRole( "MK10CL2A", CreateMerchantRoleBody.builder() .name("Senior Shop Manager II") .permissions(java.util.List.of( "catalog_access", "taxes_access", "members_access" )) .build());from sumup import Sumup
client = Sumup()
result = client.roles.create("MK10CL2A", CreateMerchantRoleBody( name="Senior Shop Manager II", permissions=["catalog_access","taxes_access","members_access"],))$sumup = new \SumUp\SumUp();
$result = $sumup->roles->create('MK10CL2A', [ 'name' => 'Senior Shop Manager II', 'permissions' => [ 'catalog_access', 'taxes_access', 'members_access'],]);client := sumup.NewClient()
result, err := client.Roles.Create(context.Background(), "MK10CL2A", sumup.RolesCreateParams{ Name: "Senior Shop Manager II", Permissions: ["catalog_access","taxes_access","members_access"],})use sumup::Client;
let client = Client::default();
let result = client.roles().create("MK10CL2A", sumup::CreateMerchantRoleBody{ name: "Senior Shop Manager II".to_string(), permissions: vec!["catalog_access", "taxes_access", "members_access"],}).await;{ "id": "role_WZsm7QTPhVrompscmPhoGTXXcrd58fr9MOhP", "name": "Senior Shop Manager II", "description": "Manges the shop and the employees.", "permissions": [], "is_predefined": true, "metadata": {}, "created_at": "2023-01-20T15:16:17Z", "updated_at": "2023-01-20T15:16:17Z"}Path Parameters
- merchant_code string required
Short unique identifier for the merchant.
Example:"MK10CL2A" - role_id string required
The ID of the role to retrieve.
Example:"role_WZsm7QTPhVrompscmPhoGTXXcrd58fr9MOhP"
Role
- id string required
Unique identifier of the role.
Example:"role_WZsm7QTPhVrompscmPhoGTXXcrd58fr9MOhP" - name string required
User-defined name of the role.
Example:"Senior Shop Manager II" - description string
User-defined description of the role.
Example:"Manges the shop and the employees." - permissions []string max items: 100 required
List of permission granted by this role.
- is_predefined boolean required
True if the role is provided by SumUp.
Example:true - 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:{} - created_at string date-time required
The timestamp of when the role was created.
Example:"2023-01-20T15:16:17Z" - updated_at string date-time required
The timestamp of when the role was last updated.
Example:"2023-01-20T15:16:17Z"
curl https://api.sumup.com/v0.1/merchants/{merchant_code}/roles/{role_id} \ -X GET \ -H "Authorization: Bearer $SUMUP_API_KEY"import SumUp from '@sumup/sdk';
const client = new SumUp();
const result = await client.roles.get("MK10CL2A", "role_WZsm7QTPhVrompscmPhoGTXXcrd58fr9MOhP");using SumUp;
var client = new SumUpClient();
var result = await client.Roles.GetAsync( "MK10CL2A", "role_WZsm7QTPhVrompscmPhoGTXXcrd58fr9MOhP");import com.sumup.sdk.SumUpClient;
SumUpClient client = SumUpClient.builder().build();
var result = client.roles().getMerchantRole( "MK10CL2A", "role_WZsm7QTPhVrompscmPhoGTXXcrd58fr9MOhP");from sumup import Sumup
client = Sumup()
result = client.roles.get("MK10CL2A", "role_WZsm7QTPhVrompscmPhoGTXXcrd58fr9MOhP")$sumup = new \SumUp\SumUp();
$result = $sumup->roles->get('MK10CL2A', 'role_WZsm7QTPhVrompscmPhoGTXXcrd58fr9MOhP');client := sumup.NewClient()
result, err := client.Roles.Get(context.Background(), "MK10CL2A", "role_WZsm7QTPhVrompscmPhoGTXXcrd58fr9MOhP")use sumup::Client;
let client = Client::default();
let result = client.roles().get("MK10CL2A", "role_WZsm7QTPhVrompscmPhoGTXXcrd58fr9MOhP").await;{ "id": "role_WZsm7QTPhVrompscmPhoGTXXcrd58fr9MOhP", "name": "Senior Shop Manager II", "description": "Manges the shop and the employees.", "permissions": [], "is_predefined": true, "metadata": {}, "created_at": "2023-01-20T15:16:17Z", "updated_at": "2023-01-20T15:16:17Z"}Path Parameters
- merchant_code string required
Short unique identifier for the merchant.
Example:"MK10CL2A" - role_id string required
The ID of the role to retrieve.
Example:"role_WZsm7QTPhVrompscmPhoGTXXcrd58fr9MOhP"
Body Parameters
- name string
User-defined name of the role.
Example:"Senior Shop Manager II" - permissions []string max items: 100
User's permissions.
- description string
User-defined description of the role.
Example:"Manges the shop and the employees."
Role
- id string required
Unique identifier of the role.
Example:"role_WZsm7QTPhVrompscmPhoGTXXcrd58fr9MOhP" - name string required
User-defined name of the role.
Example:"Senior Shop Manager II" - description string
User-defined description of the role.
Example:"Manges the shop and the employees." - permissions []string max items: 100 required
List of permission granted by this role.
- is_predefined boolean required
True if the role is provided by SumUp.
Example:true - 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:{} - created_at string date-time required
The timestamp of when the role was created.
Example:"2023-01-20T15:16:17Z" - updated_at string date-time required
The timestamp of when the role was last updated.
Example:"2023-01-20T15:16:17Z"
curl https://api.sumup.com/v0.1/merchants/{merchant_code}/roles/{role_id} \ -X PATCH \ -H "Authorization: Bearer $SUMUP_API_KEY" \ --json '{ "name": "Senior Shop Manager III", "permissions": [ "catalog_edit", "taxes_access", "members_edit" ] }'import SumUp from '@sumup/sdk';
const client = new SumUp();
const result = await client.roles.update("MK10CL2A", "role_WZsm7QTPhVrompscmPhoGTXXcrd58fr9MOhP", { name: "Senior Shop Manager III", permissions: ["catalog_edit","taxes_access","members_edit"],});using SumUp;
var client = new SumUpClient();
var result = await client.Roles.UpdateAsync( "MK10CL2A", "role_WZsm7QTPhVrompscmPhoGTXXcrd58fr9MOhP", new UpdateMerchantRoleBody { Name = "Senior Shop Manager III", Permissions = new[] { "catalog_edit", "taxes_access", "members_edit" }, });import com.sumup.sdk.SumUpClient;
SumUpClient client = SumUpClient.builder().build();
var result = client.roles().updateMerchantRole( "MK10CL2A", "role_WZsm7QTPhVrompscmPhoGTXXcrd58fr9MOhP", UpdateMerchantRoleBody.builder() .name("Senior Shop Manager III") .permissions(java.util.List.of( "catalog_edit", "taxes_access", "members_edit" )) .build());from sumup import Sumup
client = Sumup()
result = client.roles.update("MK10CL2A", "role_WZsm7QTPhVrompscmPhoGTXXcrd58fr9MOhP", UpdateMerchantRoleBody( name="Senior Shop Manager III", permissions=["catalog_edit","taxes_access","members_edit"],))$sumup = new \SumUp\SumUp();
$result = $sumup->roles->update('MK10CL2A', 'role_WZsm7QTPhVrompscmPhoGTXXcrd58fr9MOhP', [ 'name' => 'Senior Shop Manager III', 'permissions' => [ 'catalog_edit', 'taxes_access', 'members_edit'],]);client := sumup.NewClient()
result, err := client.Roles.Update(context.Background(), "MK10CL2A", "role_WZsm7QTPhVrompscmPhoGTXXcrd58fr9MOhP", sumup.RolesUpdateParams{ Name: "Senior Shop Manager III", Permissions: ["catalog_edit","taxes_access","members_edit"],})use sumup::Client;
let client = Client::default();
let result = client.roles().update("MK10CL2A", "role_WZsm7QTPhVrompscmPhoGTXXcrd58fr9MOhP", sumup::UpdateMerchantRoleBody{ name: "Senior Shop Manager III".to_string(), permissions: vec!["catalog_edit", "taxes_access", "members_edit"],}).await;{ "id": "role_WZsm7QTPhVrompscmPhoGTXXcrd58fr9MOhP", "name": "Senior Shop Manager II", "description": "Manges the shop and the employees.", "permissions": [], "is_predefined": true, "metadata": {}, "created_at": "2023-01-20T15:16:17Z", "updated_at": "2023-01-20T15:16:17Z"}Path Parameters
- merchant_code string required
Short unique identifier for the merchant.
Example:"MK10CL2A" - role_id string required
The ID of the role to retrieve.
Example:"role_WZsm7QTPhVrompscmPhoGTXXcrd58fr9MOhP"
curl https://api.sumup.com/v0.1/merchants/{merchant_code}/roles/{role_id} \ -X DELETE \ -H "Authorization: Bearer $SUMUP_API_KEY"import SumUp from '@sumup/sdk';
const client = new SumUp();
const result = await client.roles.delete("MK10CL2A", "role_WZsm7QTPhVrompscmPhoGTXXcrd58fr9MOhP");using SumUp;
var client = new SumUpClient();
var result = await client.Roles.DeleteAsync( "MK10CL2A", "role_WZsm7QTPhVrompscmPhoGTXXcrd58fr9MOhP");import com.sumup.sdk.SumUpClient;
SumUpClient client = SumUpClient.builder().build();
var result = client.roles().deleteMerchantRole( "MK10CL2A", "role_WZsm7QTPhVrompscmPhoGTXXcrd58fr9MOhP");from sumup import Sumup
client = Sumup()
result = client.roles.delete("MK10CL2A", "role_WZsm7QTPhVrompscmPhoGTXXcrd58fr9MOhP")$sumup = new \SumUp\SumUp();
$result = $sumup->roles->delete('MK10CL2A', 'role_WZsm7QTPhVrompscmPhoGTXXcrd58fr9MOhP');client := sumup.NewClient()
result, err := client.Roles.Delete(context.Background(), "MK10CL2A", "role_WZsm7QTPhVrompscmPhoGTXXcrd58fr9MOhP")use sumup::Client;
let client = Client::default();
let result = client.roles().delete("MK10CL2A", "role_WZsm7QTPhVrompscmPhoGTXXcrd58fr9MOhP").await;