Subscription with no associated plan
Subscriptions with no associated plan are when different subscriptions have different characteristics because they are specific to each payer. A single-month subscription with a unique discount, for instance.
This subscription model can be
Subscriptions with authorized payment
Subscriptions with authorized payment allow an installment to be generated and billed based on a defined recurrence, causing the subscription engine to automatically schedule and create payments based on the payment method defined at the time of the subscription creation.
To offer subscriptions without an associated plan and with authorized payment, send a POST with the necessary attributes to the /preapproval endpoint and pay attention to the status
parameter, which must be filled in with the value authorized
. If you prefer, use the curl below.
curl --location --request POST 'https://api.mercadopago.com/preapproval?access_token=APP_USR-????????' \
--header 'Content-Type: application/json' \
--header 'X-scope: stage' \
--data-raw '{
"back_url": "https://www.google.com",
"reason": "Test Subscription",
"auto_recurring": {
"frequency": 1,
"frequency_type": "months",
"start_date": "2020-06-02T13:07:14.260Z",
"end_date": "2022-07-20T15:59:52.581Z",
"transaction_amount": 10,
"currency_id": "ARS"
},
"payer_email": "test_user+1020927396@testuser.com",
"card_token_id": "{{EL_CARD_TOKEN_QUE_CREASTE}}",
"status": "authorized"
}'
Collection reattempt logic
By automating the recurrence of your collections, authorized payments that will have a debit date configured based on the periodicity that was defined in the subscription are created. The first installment is charged until the period of approximately one hour to subscribe.
Payment statuses
In the case that the installment cannot be collected on the fourth reattempt, it will automatically remain in processed
status, associated with a declined payment.
After 3 installments with rejected payments, the subscription is automatically canceled and the seller account will be notified of the cancellation of the subscription by e-mail.
Subscriptions with pending payment
Subscriptions with pending payments are a model in which the payment method is not defined when the subscription is created. According to this model, payments automatically go into pending
status and depend on the users to complete it.
In this case, there are two options: The first one is to update the subscription by defining a payment method through the /preapproval/{id} endpoint. The second one is to share a payment link with the buyer so they can complete the purchase with the payment method of their choice.
To offer subscriptions without an associated plan and with pending payments, send a POST with the necessary attributes to the /preapproval endpoint and then pay attention to the status
parameter, which must be filled in with the pending
value. If you prefer, use the curl below.
curl --location --request POST 'https://api.mercadopago.com/preapproval' \
--header 'Authorization: Bearer YOU_ACCESS_TOKEN' \
--header 'Content-Type: application/json' \
--data-raw '{
"reason": "Yoga classes",
"external_reference": "YG-1234",
"payer_email": "test_user_75650838@testuser.com",
"auto_recurring": {
"frequency": 1,
"frequency_type": "months",
"end_date": "2023-07-20T15:59:52.581Z",
"transaction_amount": 10,
"currency_id": "BRL"
},
"back_url": "https://www.yoursite.com",
"status": "pending"
}'