@sumup/sdk
Version:
The official TypeScript SDK for the SumUp API
112 lines • 3.43 kB
TypeScript
import * as Core from "../../core";
/**
* Permissions assigned to an operator or user.
*/
export type Permissions = {
create_moto_payments: boolean;
create_referral: boolean;
full_transaction_history_view: boolean;
refund_transactions: boolean;
admin: boolean;
};
/**
* Operator account for a merchant.
*/
export type Operator = {
id: number;
username: string;
nickname?: string | null;
disabled: boolean;
/**
* The timestamp of when the operator was created.
*/
created_at: string;
/**
* The timestamp of when the operator was last updated.
*/
updated_at: string;
permissions: Permissions;
account_type: "operator" | "normal";
};
/**
* A RFC 9457 problem details object.
*
* Additional properties specific to the problem type may be present.
*
*/
export type Problem = {
/**
* A URI reference that identifies the problem type.
*/
type: string;
/**
* A short, human-readable summary of the problem type.
*/
title?: string;
/**
* The HTTP status code generated by the origin server for this occurrence of the problem.
*/
status?: number;
/**
* A human-readable explanation specific to this occurrence of the problem.
*/
detail?: string;
/**
* A URI reference that identifies the specific occurrence of the problem.
*/
instance?: string;
};
export type ListSubAccountsQueryParams = {
query?: string;
include_primary?: boolean;
};
export type ListSubAccountsResponse = Operator[];
export type CreateSubAccountParams = {
username: string;
password: string;
nickname?: string;
permissions?: {
create_moto_payments?: boolean;
create_referral?: boolean;
full_transaction_history_view?: boolean;
refund_transactions?: boolean;
};
};
export type UpdateSubAccountParams = {
password?: string;
username?: string;
disabled?: boolean;
nickname?: string;
permissions?: {
create_moto_payments?: boolean;
create_referral?: boolean;
full_transaction_history_view?: boolean;
refund_transactions?: boolean;
};
};
export declare class Subaccounts extends Core.APIResource {
/**
* Returns list of operators for currently authorized user's merchant.
*/
listSubAccounts(query?: ListSubAccountsQueryParams, params?: Core.FetchParams): Core.APIPromise<Operator[]>;
/**
* Creates new operator for currently authorized users' merchant.
*/
createSubAccount(body: CreateSubAccountParams, params?: Core.FetchParams): Core.APIPromise<Operator>;
/**
* Returns specific operator.
*/
compatGetOperator(operatorId: number, params?: Core.FetchParams): Core.APIPromise<Operator>;
/**
* Updates operator. If the operator was disabled and their password is updated they will be unblocked.
*/
updateSubAccount(operatorId: number, body: UpdateSubAccountParams, params?: Core.FetchParams): Core.APIPromise<Operator>;
/**
* Disable the specified operator for the merchant account.
*/
deactivateSubAccount(operatorId: number, params?: Core.FetchParams): Core.APIPromise<Operator>;
}
export declare namespace Subaccounts {
export type { CreateSubAccountParams, ListSubAccountsQueryParams, Operator, Permissions, Problem, UpdateSubAccountParams, };
}
//# sourceMappingURL=index.d.ts.map