UNPKG

@sumup/sdk

Version:

The official TypeScript SDK for the SumUp API

102 lines 2.78 kB
import * as Core from "../../core.js"; /** * User permissions */ export type Permissions = { /** * Create MOTO payments */ create_moto_payments?: boolean; /** * Can view full merchant transaction history */ full_transaction_history_view?: boolean; /** * Refund transactions */ refund_transactions?: boolean; /** * Create referral */ create_referral?: 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"; }; /** * Error object for compat API calls. */ export type CompatError = { error_code: string; message: 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 { /** * List operators */ listSubAccounts(query?: ListSubAccountsQueryParams, params?: Core.FetchParams): Core.APIPromise<Operator[]>; /** * Create an operator */ createSubAccount(body: CreateSubAccountParams, params?: Core.FetchParams): Core.APIPromise<Operator>; /** * Retrieve an operator */ compatGetOperator(operatorId: number, params?: Core.FetchParams): Core.APIPromise<Operator>; /** * Update an operator */ updateSubAccount(operatorId: number, body: UpdateSubAccountParams, params?: Core.FetchParams): Core.APIPromise<Operator>; /** * Disable an operator. */ deactivateSubAccount(operatorId: number, params?: Core.FetchParams): Core.APIPromise<Operator>; } export declare namespace Subaccounts { export type { CompatError, CreateSubAccountParams, ListSubAccountsQueryParams, Operator, Permissions, UpdateSubAccountParams, }; } //# sourceMappingURL=index.d.ts.map