pub struct Client { /* private fields */ }Expand description
The main SumUp API client.
Use this client to access different API endpoints organized by tags.
Implementations§
Source§impl Client
impl Client
Sourcepub fn new() -> Self
pub fn new() -> Self
Creates a new SumUp API client with the default base URL. Tries to read the authorization token from the SUMUP_API_KEY environment variable. Default timeout is 10 seconds.
Sourcepub fn with_client(self, http_client: Client) -> Self
pub fn with_client(self, http_client: Client) -> Self
Overrides the underlying HTTP client used for requests.
Returns a new client with the provided reqwest::Client.
Sourcepub fn with_base_url(self, base_url: impl Into<String>) -> Self
pub fn with_base_url(self, base_url: impl Into<String>) -> Self
Sets the base URL for API requests. Returns a new client with the updated base URL.
Sets the authorization token for API requests. Returns a new client with the updated token.
Sourcepub fn with_timeout(self, timeout: Duration) -> Self
pub fn with_timeout(self, timeout: Duration) -> Self
Sets the request timeout for API requests. Returns a new client with the updated timeout.
Returns the authorization token if set.
pub fn checkouts(&self) -> CheckoutsClient<'_>
pub fn customers(&self) -> CustomersClient<'_>
pub fn members(&self) -> MembersClient<'_>
pub fn memberships(&self) -> MembershipsClient<'_>
pub fn merchants(&self) -> MerchantsClient<'_>
pub fn payouts(&self) -> PayoutsClient<'_>
pub fn readers(&self) -> ReadersClient<'_>
pub fn receipts(&self) -> ReceiptsClient<'_>
pub fn roles(&self) -> RolesClient<'_>
pub fn subaccounts(&self) -> SubaccountsClient<'_>
Subaccounts API is deprecated, please use Members API instead to manage your account members.