Packages
mollie_api
0.1.0-20260521
0.1.0-20260722
0.1.0-20260721
0.1.0-20260717
0.1.0-20260716
0.1.0-20260708
0.1.0-20260702
0.1.0-20260629
0.1.0-20260625
0.1.0-20260622
0.1.0-20260619
0.1.0-20260617
0.1.0-20260615
0.1.0-20260611
0.1.0-20260609
0.1.0-20260601
0.1.0-20260529
0.1.0-20260527
0.1.0-20260526
0.1.0-20260525
0.1.0-20260521
0.1.0-20260519
0.1.0-20260515
0.1.0-20260513
0.1.0-20260512
0.1.0-20260507
0.1.0-20260505
0.1.0-20260504
0.1.0-20260430
0.1.0-20260429
0.1.0-20260428
0.1.0-20260427
0.1.0-20260423
0.1.0-20260421
0.1.0-20260420
0.1.0-20260415
0.1.0-20260410
0.1.0-20260409
0.1.0-20260408
0.1.0-20260402
0.1.0-20260401
0.1.0-20260331
0.1.0-20260330
0.1.0-20260327
0.1.0-20260317
0.1.0-20260313
0.1.0-20260310
0.1.0-20260309
0.1.0-20260306
0.1.0-20260305
0.1.0-20260303
0.1.0-20260302
0.1.0-20260226
0.1.0-20260218
0.1.0-20260217
0.1.0-20260210
0.1.0-20260206
0.1.0-20260205
0.1.0-20260204
0.1.0-20260203
0.1.0-20260202
0.1.0-20260130
0.1.0-20260129
0.1.0-20260114
0.1.0-20260109
0.1.0-20260107
0.1.0-20251222
0.1.0-20251125
0.1.0-20251121
0.1.0-20251119
0.1.0-20251118
0.1.0-20251113
An autogenerated Elixir client for the Mollie API, generated from the OpenAPI specification.
Current section
Files
Jump to
Current section
Files
lib/mollie_api/api/terminals_api.ex
# NOTE: This file is auto generated by OpenAPI Generator 7.17.0 (https://openapi-generator.tech).
# Do not edit this file manually.
defmodule MollieAPI.Api.TerminalsAPI do
@moduledoc """
API calls for all endpoints tagged `TerminalsAPI`.
"""
alias MollieAPI.Connection
import MollieAPI.RequestBuilder
@doc """
Get terminal
Retrieve a single terminal by its ID.
### Parameters
- `connection` (MollieAPI.Connection): Connection to server
- `terminal_id` (String.t): Provide the ID of the related terminal.
- `opts` (keyword): Optional parameters
- `:testmode` (boolean()): Most API credentials are specifically created for either live mode or test mode. In those cases the `testmode` query parameter must not be sent. For organization-level credentials such as OAuth access tokens, you can enable test mode by setting the `testmode` query parameter to `true`. Test entities cannot be retrieved when the endpoint is set to live mode, and vice versa.
- `:"idempotency-key"` (String.t): A unique key to ensure idempotent requests. This key should be a UUID v4 string.
### Returns
- `{:ok, MollieAPI.Model.EntityTerminal.t}` on success
- `{:error, Tesla.Env.t}` on failure
"""
@spec get_terminal(Tesla.Env.client, String.t, keyword()) :: {:ok, MollieAPI.Model.ErrorResponse.t} | {:ok, MollieAPI.Model.EntityTerminal.t} | {:error, Tesla.Env.t}
def get_terminal(connection, terminal_id, opts \\ []) do
optional_params = %{
:testmode => :query,
:"idempotency-key" => :headers
}
request =
%{}
|> method(:get)
|> url("/v2/terminals/#{terminal_id}")
|> add_optional_params(optional_params, opts)
|> Enum.into([])
connection
|> Connection.request(request)
|> evaluate_response([
{200, MollieAPI.Model.EntityTerminal},
{404, MollieAPI.Model.ErrorResponse},
{429, MollieAPI.Model.ErrorResponse}
])
end
@doc """
List terminals
Retrieve a list of all physical point-of-sale devices. The results are paginated.
### Parameters
- `connection` (MollieAPI.Connection): Connection to server
- `opts` (keyword): Optional parameters
- `:from` (String.t): Provide an ID to start the result set from the item with the given ID and onwards. This allows you to paginate the result set.
- `:limit` (integer()): The maximum number of items to return. Defaults to 50 items.
- `:sort` (Sorting): Used for setting the direction of the result set. Defaults to descending order, meaning the results are ordered from newest to oldest.
- `:testmode` (boolean()): Most API credentials are specifically created for either live mode or test mode. In those cases the `testmode` query parameter must not be sent. For organization-level credentials such as OAuth access tokens, you can enable test mode by setting the `testmode` query parameter to `true`. Test entities cannot be retrieved when the endpoint is set to live mode, and vice versa.
- `:"idempotency-key"` (String.t): A unique key to ensure idempotent requests. This key should be a UUID v4 string.
### Returns
- `{:ok, MollieAPI.Model.ListTerminals200Response.t}` on success
- `{:error, Tesla.Env.t}` on failure
"""
@spec list_terminals(Tesla.Env.client, keyword()) :: {:ok, MollieAPI.Model.ErrorResponse.t} | {:ok, MollieAPI.Model.ListTerminals200Response.t} | {:error, Tesla.Env.t}
def list_terminals(connection, opts \\ []) do
optional_params = %{
:from => :query,
:limit => :query,
:sort => :query,
:testmode => :query,
:"idempotency-key" => :headers
}
request =
%{}
|> method(:get)
|> url("/v2/terminals")
|> add_optional_params(optional_params, opts)
|> Enum.into([])
connection
|> Connection.request(request)
|> evaluate_response([
{200, MollieAPI.Model.ListTerminals200Response},
{400, MollieAPI.Model.ErrorResponse},
{429, MollieAPI.Model.ErrorResponse}
])
end
@doc """
Get terminal pairing code
> ℹ️ **Test mode** > > This endpoint currently does not support test mode yet. Get a pairing code to onboard a point-of-sale terminal. The response includes a human-readable `code` for manual entry on the terminal and, optionally, a QR Code as a base64 encoded SVG data URI when you use the `include` query parameter with value `details.qrCode`.
### Parameters
- `connection` (MollieAPI.Connection): Connection to server
- `pairing_code_id` (String.t): Provide the ID of the terminal pairing code.
- `opts` (keyword): Optional parameters
- `:include` (String.t): This endpoint allows you to include additional information via the `include` query string parameter.
- `:"idempotency-key"` (String.t): A unique key to ensure idempotent requests. This key should be a UUID v4 string.
### Returns
- `{:ok, MollieAPI.Model.EntityPairingCode.t}` on success
- `{:error, Tesla.Env.t}` on failure
"""
@spec terminals_get_pairing_code(Tesla.Env.client, String.t, keyword()) :: {:ok, MollieAPI.Model.ErrorResponse.t} | {:ok, MollieAPI.Model.EntityPairingCode.t} | {:error, Tesla.Env.t}
def terminals_get_pairing_code(connection, pairing_code_id, opts \\ []) do
optional_params = %{
:include => :query,
:"idempotency-key" => :headers
}
request =
%{}
|> method(:get)
|> url("/v2/terminals/pairing-codes/#{pairing_code_id}")
|> add_optional_params(optional_params, opts)
|> Enum.into([])
connection
|> Connection.request(request)
|> evaluate_response([
{200, MollieAPI.Model.EntityPairingCode},
{404, MollieAPI.Model.ErrorResponse},
{429, MollieAPI.Model.ErrorResponse}
])
end
@doc """
List terminal pairing codes
> ℹ️ **Test mode** > > This endpoint currently does not support test mode yet. Returns all pairing codes: `active`, `expired`, and `revoked`. Results are paginated.
### Parameters
- `connection` (MollieAPI.Connection): Connection to server
- `opts` (keyword): Optional parameters
- `:from` (String.t): Provide an ID to start the result set from the item with the given ID and onwards. This allows you to paginate the result set.
- `:limit` (integer()): The maximum number of items to return. Defaults to 50 items.
- `:sort` (Sorting): Used for setting the direction of the result set. Defaults to descending order, meaning the results are ordered from newest to oldest.
- `:profileId` (String.t): The identifier referring to the [profile](get-profile) you wish to retrieve pairing codes for.
- `:"idempotency-key"` (String.t): A unique key to ensure idempotent requests. This key should be a UUID v4 string.
### Returns
- `{:ok, MollieAPI.Model.TerminalsListPairingCodes200Response.t}` on success
- `{:error, Tesla.Env.t}` on failure
"""
@spec terminals_list_pairing_codes(Tesla.Env.client, keyword()) :: {:ok, MollieAPI.Model.TerminalsListPairingCodes200Response.t} | {:ok, MollieAPI.Model.ErrorResponse.t} | {:error, Tesla.Env.t}
def terminals_list_pairing_codes(connection, opts \\ []) do
optional_params = %{
:from => :query,
:limit => :query,
:sort => :query,
:profileId => :query,
:"idempotency-key" => :headers
}
request =
%{}
|> method(:get)
|> url("/v2/terminals/pairing-codes")
|> add_optional_params(optional_params, opts)
|> Enum.into([])
connection
|> Connection.request(request)
|> evaluate_response([
{200, MollieAPI.Model.TerminalsListPairingCodes200Response},
{400, MollieAPI.Model.ErrorResponse},
{429, MollieAPI.Model.ErrorResponse}
])
end
@doc """
Request terminal pairing code
> ℹ️ **Test mode** > > This endpoint currently does not support test mode yet. Request a pairing code to onboard a point-of-sale terminal. The response includes a human-readable `code` for manual entry on the terminal, and a QR Code as a base64 encoded SVG data URI for scanning if you specify the query parameter `include` with value `details.qrCode`. Pairing codes expire after 90 days (see `expiresAt`) and can be used multiple times.
### Parameters
- `connection` (MollieAPI.Connection): Connection to server
- `opts` (keyword): Optional parameters
- `:include` (String.t): This endpoint allows you to include additional information via the `include` query string parameter.
- `:"idempotency-key"` (String.t): A unique key to ensure idempotent requests. This key should be a UUID v4 string.
- `:body` (TerminalsRequestPairingCodeRequest):
### Returns
- `{:ok, MollieAPI.Model.EntityPairingCode.t}` on success
- `{:error, Tesla.Env.t}` on failure
"""
@spec terminals_request_pairing_code(Tesla.Env.client, keyword()) :: {:ok, MollieAPI.Model.ErrorResponse.t} | {:ok, MollieAPI.Model.EntityPairingCode.t} | {:error, Tesla.Env.t}
def terminals_request_pairing_code(connection, opts \\ []) do
optional_params = %{
:include => :query,
:"idempotency-key" => :headers,
:body => :body
}
request =
%{}
|> method(:post)
|> url("/v2/terminals/pairing-codes")
|> add_optional_params(optional_params, opts)
|> ensure_body()
|> Enum.into([])
connection
|> Connection.request(request)
|> evaluate_response([
{201, MollieAPI.Model.EntityPairingCode},
{422, MollieAPI.Model.ErrorResponse},
{429, MollieAPI.Model.ErrorResponse}
])
end
@doc """
Revoke terminal pairing code
> ℹ️ **Test mode** > > This endpoint currently does not support test mode yet. Revoke a pairing code, preventing the onboarding of new point-of-sale terminals. Terminals that have already paired with this code are not affected.
### Parameters
- `connection` (MollieAPI.Connection): Connection to server
- `pairing_code_id` (String.t): Provide the ID of the terminal pairing code.
- `opts` (keyword): Optional parameters
- `:"idempotency-key"` (String.t): A unique key to ensure idempotent requests. This key should be a UUID v4 string.
### Returns
- `{:ok, MollieAPI.Model.EntityPairingCode.t}` on success
- `{:error, Tesla.Env.t}` on failure
"""
@spec terminals_revoke_pairing_code(Tesla.Env.client, String.t, keyword()) :: {:ok, MollieAPI.Model.ErrorResponse.t} | {:ok, MollieAPI.Model.EntityPairingCode.t} | {:error, Tesla.Env.t}
def terminals_revoke_pairing_code(connection, pairing_code_id, opts \\ []) do
optional_params = %{
:"idempotency-key" => :headers
}
request =
%{}
|> method(:delete)
|> url("/v2/terminals/pairing-codes/#{pairing_code_id}")
|> add_optional_params(optional_params, opts)
|> Enum.into([])
connection
|> Connection.request(request)
|> evaluate_response([
{200, MollieAPI.Model.EntityPairingCode},
{404, MollieAPI.Model.ErrorResponse},
{422, MollieAPI.Model.ErrorResponse},
{429, MollieAPI.Model.ErrorResponse}
])
end
end