/preapproval

BASE URI https://api.mercadopago.com/preapproval

HTTP Request

curl

 curl --location --request POST 'https://api.mercadopago.com/preapproval?access_token=' \
--header 'Content-Type: application/json' \
--data-raw '{
  "auto_recurring": {
    "currency_id": "ARS",
    "transaction_amount": 10,
    "frequency": 1,
    "frequency_type": "months",
    "end_date": "2022-07-20T11:59:52.581-04:00",
   
  },
  "back_url": "https://www.mercadopago.com.ar",
  "collector_id": 555435388,
  "external_reference": "1245AT234562",
  "payer_email": "test_user@testuser.com",
  "reason": "Suscripción particular",
  "status": "pending"
}' 

Request Params

ParameterTypeDescription
payer_email String Customer's e-mail.
back_url String Return URL.
collector_id String Seller ID.
status String Preapproval status.
reason String Preapproval titlte.
external_reference String Preapproval reference value.
auto_recurring Object Recurring data.
frequency Integer Recurring frecuency.
frequency_type String Recurring frecuency type (days or months).
transaction_amount Number Recurring amount.
currency_id String Currency Id.
start_date Date(ISO_8601) preapproval's start date.
end_date Date(ISO_8601) preapproval's end date.

HTTP Response

json

 {
    "id": "2c938084726fca480172750000000000",
    "payer_id": 123123123,
    "payer_email": "test_user@testuser.com",
    "back_url": "https://www.mercadopago.com.ar",
    "collector_id": 100200300,
    "application_id": 1234567812345678,
    "status": "pending",
    "reason": "Suscripcion Particular",
    "external_reference": "23546246234",
    "date_created": "2020-06-02T09:07:14.260-04:00",
    "last_modified": "2020-06-02T09:07:14.263-04:00",
    "init_point": "https://www.mercadopago.com/[FAKER][GLOBALIZE][UPPER_SITE_ID]/debits/new?preapproval_id=2c938084726fca480172750000000000",
    "sandbox_init_point": "https://sandbox.mercadopago.com/[FAKER][GLOBALIZE][UPPER_SITE_ID]/debits/new?preapproval_id=2c938084726fca480172750000000000",
    "auto_recurring": {
        "frequency": 1,
        "frequency_type": "months",
        "transaction_amount": 10,
        "currency_id": "ARS",
        "start_date": "2020-06-02T09:07:14.260-04:00",
        "end_date": "2022-07-20T11:59:52.581-04:00"
    },
    "version": 0
} 

Error Codes

CodeDescription
400 BAD_REQUEST
Card token was used, please generate new Card token was used, please generate new.
Card token was generated without cvv validation Card token was generated without cvv validation.
Subscriptions are not available for this country yet Subscriptions are not available for this country yet.
The payment method account money is not available in your country The payment method account money is not available in your country.
Collector and Application cannot be from different countries Collector and Application cannot be from different countries.
card_token_id is required card_token_id is required.
payer_email is required payer_email is required.
Invalid value for payer_email, must be a valid email address Invalid value for payer_email, must be a valid email address.
Invalid value for transaction amount, must be a positive number Invalid value for transaction amount, must be a positive number.
Invalid value for transaction amount, only two decimals are allowed Invalid value for transaction amount, only two decimals are allowed.
Cannot pay an amount lower than ${currency_id} ${min amount} Cannot pay an amount lower than ${currency_id} ${min amount}.
Cannot pay an amount greater than ${currency_id} ${max amount} Cannot pay an amount greater than ${currency_id} ${max amount}.
The transaction_amount must be the same as preapproval_plan The transaction_amount must be the same as preapproval_plan.
You cannot create a new preapproval from a cancelled/inactive template You cannot create a new preapproval from a cancelled/inactive template.
back_url is required back_url is required.
Invalid value for back url, must be a valid URL Invalid value for back url, must be a valid URL.
reason is required reason is required.
reason has more than 255 characters reason has more than 255 characters.
reason has unsupported characters reason has unsupported characters.
auto_recurring.frequency is required auto_recurring.frequency is required.
Invalid value for frequency, must be a positive integer Invalid value for frequency, must be a positive integer.
Invalid value for frequency type, valid ones are [days, months] Invalid value for frequency type, valid ones are [days, months].
auto_recurring.frequency_type is required auto_recurring.frequency_type is required.
auto_recurring.transaction_amount is required auto_recurring.transaction_amount is required.
auto_recurring.currency_id is required auto_recurring.currency_id is required.
Invalid field -> auto_recurring.currency_id Invalid field -> auto_recurring.currency_id.
Invalid value for auto_recurring.end_date, the date must be after today Invalid value for auto_recurring.end_date, the date must be after today.
auto_recurring.end_date must be after auto_recurring.start_date auto_recurring.end_date must be after auto_recurring.start_date.
Invalid value for auto_recurring.start_date, the date must be after today Invalid value for auto_recurring.start_date, the date must be after today.
Invalid format in auto_recurring.start_date or auto_recurring.end_date Invalid format in auto_recurring.start_date or auto_recurring.end_date.
external_reference has more than 255 characters external_reference has more than 255 characters.
external_reference has unsupported characters external_reference has unsupported characters.
Already exists a preapproval for user ${payer_email} and application ${application_id} Already exists a preapproval for user ${payer_email} and application ${application_id}.
Cannot operate between different countries Cannot operate between different countries.
Payer and collector cannot be the same user Payer and collector cannot be the same user.
Both payer and collector must be real or test users Both payer and collector must be real or test users.
This preapproval cannot be created: The seller does not accept account_money This preapproval cannott be created. The seller does not accept account_money.
This preapproval cannot be created only with payment method account_money This preapproval can't be created only with payment method account_money.
You cannot create a preapproval with payment_method in status pending You cannot create a preapproval with payment_method in status pending.
Cannot create preapproval pending, the feature with account money is disabled for your country. Cannot create preapproval pending, the feature with account money is disabled for your country.
Invalid request data Invalid request data.
401 UNAUTHORIZED
CC_VAL_433 CC_VAL_433 Credit card validation has failed.
Verification of collectors personal data is in process, come back later Verification of collector's personal data is in process, come back later.
Unauthorized access to resource Unauthorized access to resource.
This app cannot create preapprovals without a plan This app can't create preapprovals without a plan.
403 UNAUTHORIZED
The collector does not meet the personal data verification requirements The collector does not meet the personal data verification requirements.
The caller is not authorized to access this resource The caller is not authorized to access this resource.
AM_VAL_01 Unauthorized seller for this feature AM_VAL_01 Unauthorized seller for this feature (account money) .
404 NOT_FOUND
The preapproval with id ${preapproval id} does not exist The preapproval with id ${preapproval id} does not exist.
Card token service not found Card token service not found.

Your search returns no results.

Verifique a ortografia de termos de pesquisa ou teste com outras palavras-chave.