Mercadopago.Subscription (mercadopago_sdk_elixir v0.3.1)

Copy Markdown View Source

Plan-based recurring subscriptions.

These are the same /preapproval endpoints Mercadopago.Preapproval exposes; this module exists so the name matches the reference Ruby SDK, where sdk.subscription was added in 3.3.0 alongside sdk.preapproval. Every function here delegates — pick whichever name reads better at the call site.

A subscription ties a payer to a Mercadopago.PreapprovalPlan, so create/3 expects a preapproval_plan_id in the body.

Summary

Functions

Creates a subscription from subscription_data.

Fetches a subscription by id.

Searches subscriptions matching filters (query-string parameters).

Updates a subscription (e.g. to pause, resume or cancel it).

Functions

create(client, subscription_data, opts \\ [])

Creates a subscription from subscription_data.

get(client, subscription_id, opts \\ [])

Fetches a subscription by id.

search(client, filters \\ nil, opts \\ [])

Searches subscriptions matching filters (query-string parameters).

search_stream(client, filters \\ nil, opts \\ [])

Streams every result of search/3. See Mercadopago.Pagination.stream/3.

update(client, subscription_id, subscription_data, opts \\ [])

Updates a subscription (e.g. to pause, resume or cancel it).