MollieAPI.Api.SubscriptionsAPI (mollie_api v0.1.0-20260303)
View SourceAPI calls for all endpoints tagged SubscriptionsAPI.
Summary
Functions
Cancel subscription Cancel an existing subscription. Canceling a subscription has no effect on the mandates of the customer.
Create subscription
With subscriptions, you can schedule recurring payments to take place at regular intervals. For example, by simply specifying an amount and an interval, you can create an endless subscription to charge a monthly fee, until you cancel the subscription. Or, you could use the times parameter to only charge a limited number of times, for example to split a big transaction in multiple parts. A few example usages: amount[currency]="EUR" amount[value]="5.00" interval="2 weeks" Your customer will be charged €5 once every two weeks. amount[currency]="EUR" amount[value]="20.00" interval="1 day" times=5 Your customer will be charged €20 every day, for five consecutive days. amount[currency]="EUR" amount[value]="10.00" interval="1 month" startDate="2018-04-30" Your customer will be charged €10 on the last day of each month, starting in April 2018.
Get subscription Retrieve a single subscription by its ID and the ID of its parent customer.
List all subscriptions Retrieve all subscriptions initiated across all your customers. The results are paginated.
List subscription payments Retrieve all payments of a specific subscription. The results are paginated.
List customer subscriptions Retrieve all subscriptions of a customer. The results are paginated.
Update subscription Update an existing subscription. Canceled subscriptions cannot be updated. For an in-depth explanation of each parameter, refer to the Create subscription endpoint.
Functions
@spec cancel_subscription(Tesla.Env.client(), String.t(), String.t(), keyword()) :: {:ok, MollieAPI.Model.ErrorResponse.t()} | {:ok, MollieAPI.Model.SubscriptionResponse.t()} | {:error, Tesla.Env.t()}
Cancel subscription Cancel an existing subscription. Canceling a subscription has no effect on the mandates of the customer.
Parameters
connection(MollieAPI.Connection): Connection to servercustomer_id(String.t): Provide the ID of the related customer.subscription_id(String.t): Provide the ID of the related subscription.opts(keyword): Optional parameters:"idempotency-key"(String.t): A unique key to ensure idempotent requests. This key should be a UUID v4 string.:body(DeletePaymentLinkRequest):
Returns
{:ok, MollieAPI.Model.SubscriptionResponse.t}on success{:error, Tesla.Env.t}on failure
@spec create_subscription(Tesla.Env.client(), String.t(), keyword()) :: {:ok, MollieAPI.Model.ErrorResponse.t()} | {:ok, MollieAPI.Model.SubscriptionResponse.t()} | {:error, Tesla.Env.t()}
Create subscription
With subscriptions, you can schedule recurring payments to take place at regular intervals. For example, by simply specifying an amount and an interval, you can create an endless subscription to charge a monthly fee, until you cancel the subscription. Or, you could use the times parameter to only charge a limited number of times, for example to split a big transaction in multiple parts. A few example usages: amount[currency]="EUR" amount[value]="5.00" interval="2 weeks" Your customer will be charged €5 once every two weeks. amount[currency]="EUR" amount[value]="20.00" interval="1 day" times=5 Your customer will be charged €20 every day, for five consecutive days. amount[currency]="EUR" amount[value]="10.00" interval="1 month" startDate="2018-04-30" Your customer will be charged €10 on the last day of each month, starting in April 2018.
Parameters
connection(MollieAPI.Connection): Connection to servercustomer_id(String.t): Provide the ID of the related customer.opts(keyword): Optional parameters:"idempotency-key"(String.t): A unique key to ensure idempotent requests. This key should be a UUID v4 string.:body(SubscriptionRequest):
Returns
{:ok, MollieAPI.Model.SubscriptionResponse.t}on success{:error, Tesla.Env.t}on failure
@spec get_subscription(Tesla.Env.client(), String.t(), String.t(), keyword()) :: {:ok, MollieAPI.Model.ErrorResponse.t()} | {:ok, MollieAPI.Model.SubscriptionResponse.t()} | {:error, Tesla.Env.t()}
Get subscription Retrieve a single subscription by its ID and the ID of its parent customer.
Parameters
connection(MollieAPI.Connection): Connection to servercustomer_id(String.t): Provide the ID of the related customer.subscription_id(String.t): Provide the ID of the related subscription.opts(keyword): Optional parameters:testmode(boolean()): Most API credentials are specifically created for either live mode or test mode. In those cases thetestmodequery parameter must not be sent. For organization-level credentials such as OAuth access tokens, you can enable test mode by setting thetestmodequery parameter totrue. 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.SubscriptionResponse.t}on success{:error, Tesla.Env.t}on failure
@spec list_all_subscriptions( Tesla.Env.client(), keyword() ) :: {:ok, MollieAPI.Model.ErrorResponse.t()} | {:ok, MollieAPI.Model.ListAllSubscriptions200Response.t()} | {:error, Tesla.Env.t()}
List all subscriptions Retrieve all subscriptions initiated across all your customers. The results are paginated.
Parameters
connection(MollieAPI.Connection): Connection to serveropts(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.:profileId(String.t): The identifier referring to the profile you wish to retrieve subscriptions for. Most API credentials are linked to a single profile. In these cases theprofileIdis already implied. To retrieve all subscriptions across the organization, use an organization-level API credential and omit theprofileIdparameter.:testmode(boolean()): Most API credentials are specifically created for either live mode or test mode. In those cases thetestmodequery parameter must not be sent. For organization-level credentials such as OAuth access tokens, you can enable test mode by setting thetestmodequery parameter totrue. 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.ListAllSubscriptions200Response.t}on success{:error, Tesla.Env.t}on failure
@spec list_subscription_payments( Tesla.Env.client(), String.t(), String.t(), keyword() ) :: {:ok, MollieAPI.Model.ListSettlementPayments200Response.t()} | {:ok, MollieAPI.Model.ErrorResponse.t()} | {:error, Tesla.Env.t()}
List subscription payments Retrieve all payments of a specific subscription. The results are paginated.
Parameters
connection(MollieAPI.Connection): Connection to servercustomer_id(String.t): Provide the ID of the related customer.subscription_id(String.t): Provide the ID of the related subscription.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 you wish to retrieve the resources for. Most API credentials are linked to a single profile. In these cases theprofileIdmust not be sent. For organization-level credentials such as OAuth access tokens however, theprofileIdparameter is required.:testmode(boolean()): Most API credentials are specifically created for either live mode or test mode. In those cases thetestmodequery parameter must not be sent. For organization-level credentials such as OAuth access tokens, you can enable test mode by setting thetestmodequery parameter totrue. 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.ListSettlementPayments200Response.t}on success{:error, Tesla.Env.t}on failure
@spec list_subscriptions(Tesla.Env.client(), String.t(), keyword()) :: {:ok, MollieAPI.Model.ErrorResponse.t()} | {:ok, MollieAPI.Model.ListSubscriptions200Response.t()} | {:error, Tesla.Env.t()}
List customer subscriptions Retrieve all subscriptions of a customer. The results are paginated.
Parameters
connection(MollieAPI.Connection): Connection to servercustomer_id(String.t): Provide the ID of the related customer.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 thetestmodequery parameter must not be sent. For organization-level credentials such as OAuth access tokens, you can enable test mode by setting thetestmodequery parameter totrue. 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.ListSubscriptions200Response.t}on success{:error, Tesla.Env.t}on failure
@spec update_subscription(Tesla.Env.client(), String.t(), String.t(), keyword()) :: {:ok, MollieAPI.Model.ErrorResponse.t()} | {:ok, MollieAPI.Model.SubscriptionResponse.t()} | {:error, Tesla.Env.t()}
Update subscription Update an existing subscription. Canceled subscriptions cannot be updated. For an in-depth explanation of each parameter, refer to the Create subscription endpoint.
Parameters
connection(MollieAPI.Connection): Connection to servercustomer_id(String.t): Provide the ID of the related customer.subscription_id(String.t): Provide the ID of the related subscription.opts(keyword): Optional parameters:"idempotency-key"(String.t): A unique key to ensure idempotent requests. This key should be a UUID v4 string.:body(UpdateSubscriptionRequest):
Returns
{:ok, MollieAPI.Model.SubscriptionResponse.t}on success{:error, Tesla.Env.t}on failure