@sumup/sdk
Version:
The official TypeScript SDK for the SumUp API
90 lines • 3.49 kB
TypeScript
import { APIResource, type RequestOptions, type WithResponse } from "../../core";
import type { Attributes, Member, MembershipStatus, Metadata } from "../../types";
export type ListMerchantMembersQueryParams = {
offset?: number;
limit?: number;
scroll?: boolean;
email?: string;
"user.id"?: string;
status?: MembershipStatus;
roles?: string[];
};
export type ListMerchantMembersResponse = {
items: Member[];
total_count?: number;
};
export type CreateMerchantMemberParams = {
/**
* True if the user is managed by the merchant. In this case, we'll created a virtual user with the provided password and nickname.
*/
is_managed_user?: boolean;
/**
* Email address of the member to add.
*/
email: string;
/**
* Password of the member to add. Only used if `is_managed_user` is true. In the case of service accounts, the password is not used and can not be defined by the caller.
*/
password?: string;
/**
* Nickname of the member to add. Only used if `is_managed_user` is true. Used for display purposes only.
*/
nickname?: string;
/**
* List of roles to assign to the new member.
*/
roles: string[];
metadata?: Metadata;
attributes?: Attributes;
};
export type UpdateMerchantMemberParams = {
roles?: string[];
metadata?: Metadata;
attributes?: Attributes;
/**
* Allows you to update user data of managed users.
*/
user?: {
/**
* User's preferred name. Used for display purposes only.
*/
nickname?: string;
/**
* Password of the member to add. Only used if `is_managed_user` is true.
*/
password?: string;
};
};
/**
* API resource for the Members endpoints.
*
* Endpoints to manage account members. Members are users that have membership within merchant accounts.
*/
export declare class Members extends APIResource {
/**
* Lists merchant members.
*/
list(merchantCode: string, query?: ListMerchantMembersQueryParams, options?: RequestOptions): Promise<ListMerchantMembersResponse>;
listWithResponse(merchantCode: string, query?: ListMerchantMembersQueryParams, options?: RequestOptions): Promise<WithResponse<ListMerchantMembersResponse>>;
/**
* Create a merchant member.
*/
create(merchantCode: string, body: CreateMerchantMemberParams, options?: RequestOptions): Promise<Member>;
createWithResponse(merchantCode: string, body: CreateMerchantMemberParams, options?: RequestOptions): Promise<WithResponse<Member>>;
/**
* Retrieve a merchant member.
*/
get(merchantCode: string, memberId: string, options?: RequestOptions): Promise<Member>;
getWithResponse(merchantCode: string, memberId: string, options?: RequestOptions): Promise<WithResponse<Member>>;
/**
* Update the merchant member.
*/
update(merchantCode: string, memberId: string, body: UpdateMerchantMemberParams, options?: RequestOptions): Promise<Member>;
updateWithResponse(merchantCode: string, memberId: string, body: UpdateMerchantMemberParams, options?: RequestOptions): Promise<WithResponse<Member>>;
/**
* Deletes a merchant member.
*/
delete(merchantCode: string, memberId: string, options?: RequestOptions): Promise<void>;
deleteWithResponse(merchantCode: string, memberId: string, options?: RequestOptions): Promise<WithResponse<void>>;
}
//# sourceMappingURL=index.d.ts.map