Mercado Pago’s recurring billing system is built around two complementary clients.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/mercadopago/sdk-java/llms.txt
Use this file to discover all available pages before exploring further.
PreApprovalPlanClient manages subscription plan templates — reusable billing configurations (frequency, currency, amount) that multiple subscribers can share. PreapprovalClient manages individual subscriptions (preapprovals) — the authorisation from a specific payer to be charged on a recurring schedule, either via a plan or configured directly.
Together, these two clients cover the full lifecycle of subscription billing: create a plan, link subscribers to it, and manage each subscription’s status independently.
PreApprovalPlanClient
Package:com.mercadopago.client.preapprovalplan
PreApprovalPlanClient provides CRUD operations for subscription plan templates. Each plan defines the billing frequency, currency, and amount that all subscriptions attached to it will inherit. Creating a plan returns an initPoint URL that subscribers visit to sign up.
Constructors
PreApprovalPlanClient()
Creates a client using the default HTTP client from MercadoPagoConfig.
PreApprovalPlanClient(MPHttpClient httpClient)
Creates a client with a custom HTTP client.
The HTTP client implementation used to execute all requests.
Methods
get — Retrieve a plan
The unique identifier of the subscription plan.
Optional per-request overrides for access token, custom headers, or timeouts. Pass
null to use global defaults.PreApprovalPlan — the requested plan.
Throws: MPException on transport/SDK errors; MPApiException on non-2xx API responses.
create — Create a plan
Plan configuration. Key fields:
| Field | Type | Description |
|---|---|---|
reason | String | Short descriptive title of the plan, shown to subscribers during checkout. |
backUrl | String | URL to redirect the subscriber after completing the checkout flow. |
externalReference | String | Your system’s reference identifier for reconciliation. |
autoRecurring | PreApprovalPlanAutoRecurringCreateRequest | Recurring billing configuration (frequency type, frequency, currency, transaction amount, etc.). |
Optional per-request overrides. Pass
null to use global defaults.PreApprovalPlan — the created plan, including id and initPoint.
Throws: MPException on transport/SDK errors; MPApiException on non-2xx API responses.
update — Update a plan
The unique identifier of the plan to update.
Updated plan fields. Available fields:
| Field | Type | Description |
|---|---|---|
reason | String | New title for the plan. |
backUrl | String | New back URL for the plan. |
status | String | New plan status (e.g. "cancelled"). |
autoRecurring | PreApprovalPlanAutoRecurringUpdateRequest | Updated recurring billing configuration. |
Optional per-request overrides. Pass
null to use global defaults.PreApprovalPlan — the updated plan.
Throws: MPException on transport/SDK errors; MPApiException on non-2xx API responses.
search — Search plans with pagination
Search parameters. Build with
MPSearchRequest.builder().filters(map).offset(0).limit(20).build().Optional per-request overrides. Pass
null to use global defaults.MPResultsResourcesPage<PreApprovalPlan> — contains .getResults() and .getPaging().
Throws: MPException on transport/SDK errors; MPApiException on non-2xx API responses.
PreApprovalPlan resource
Unique identifier of the subscription plan.
Short title of the plan displayed to subscribers.
Current plan status:
active or cancelled.Production checkout URL for subscribing to this plan. Share with users who want to subscribe.
Sandbox checkout URL for testing subscription sign-ups.
Recurring billing configuration: frequency type, frequency, currency, and transaction amount.
Mercado Pago user identifier of the seller who receives the charges.
Your system’s reference identifier.
URL subscribers are redirected to after completing the checkout flow.
Timestamp when the plan was created.
Timestamp of the last modification.
Plan usage example
PreapprovalClient
Package:com.mercadopago.client.preapproval
PreapprovalClient manages individual subscriptions (preapprovals). A preapproval authorises a specific seller to collect recurring payments from a payer’s payment method according to the billing schedule defined in the autoRecurring configuration. Each subscription has its own lifecycle: it begins as pending, becomes authorized after the payer completes the checkout flow, and can be paused or cancelled at any time.
Constructors
PreapprovalClient()
Creates a client using the default HTTP client from MercadoPagoConfig.
PreapprovalClient(MPHttpClient httpClient)
Creates a client with a custom HTTP client.
The HTTP client implementation used to execute all requests.
Methods
get — Retrieve a subscription
The unique identifier of the preapproval (subscription).
Optional per-request overrides for access token, custom headers, or timeouts. Pass
null to use global defaults.Preapproval — the requested subscription.
Throws: MPException on transport/SDK errors; MPApiException on non-2xx API responses.
create — Create a subscription
preapproval.getInitPoint() so they can authorize recurring charges.
Subscription creation request. Key fields:
| Field | Type | Description |
|---|---|---|
payerEmail | String | Email address of the subscriber (payer). |
backUrl | String | URL to redirect the payer after completing the subscription flow. |
collectorId | String | Unique identifier of the seller (collector). |
reason | String | Title or reason describing the subscription. |
externalReference | String | Your system’s reference identifier. |
status | String | Initial status of the preapproval. |
autoRecurring | PreApprovalAutoRecurringCreateRequest | Billing schedule: frequency, frequencyType ("days" or "months"), transactionAmount, currencyId, startDate, endDate. |
Optional per-request overrides. Pass
null to use global defaults.Preapproval — the created subscription, including id, status, initPoint, and sandboxInitPoint.
Throws: MPException on transport/SDK errors; MPApiException on non-2xx API responses.
update — Update a subscription
The unique identifier of the preapproval to update.
Updated subscription fields. Available fields:
| Field | Type | Description |
|---|---|---|
backUrl | String | Updated redirect URL. |
reason | String | Updated title or description. |
externalReference | String | Updated external reference. |
status | String | New status: authorized, paused, or cancelled. |
autoRecurring | PreApprovalAutoRecurringUpdateRequest | Updated billing configuration (amount, dates, frequency). |
Optional per-request overrides. Pass
null to use global defaults.Preapproval — the updated subscription.
Throws: MPException on transport/SDK errors; MPApiException on non-2xx API responses.
search — Search subscriptions with pagination
Search parameters. Build with
MPSearchRequest.builder().filters(map).offset(0).limit(20).build(). Common filters include status, payer_email, external_reference.Optional per-request overrides. Pass
null to use global defaults.MPResultsResourcesPage<Preapproval> — contains .getResults() and .getPaging().
Throws: MPException on transport/SDK errors; MPApiException on non-2xx API responses.
Preapproval resource
Unique identifier of the subscription.
Current subscription status:
pending, authorized, paused, cancelled.Title or description of the subscription.
Production checkout URL where the payer authorizes recurring charges. Redirect the payer here after creating the subscription.
Sandbox checkout URL for testing subscription authorization.
Identifier of the payer who authorized the recurring charges.
Email address of the payer.
Identifier of the seller who receives the recurring payments.
Your system’s reference identifier.
Scheduled date of the next automatic payment debit.
Active billing configuration: frequency, currency, and transaction amount.
Payment method used for recurring charges.
Timestamp when the subscription was created.
Timestamp when the subscription was last modified.