# MD for: https://www.mercadopago.com.mx/developers/es/docs/automatic-payments-orders/process-recurring-payments.md \# Scheduled recurring payments Scheduled recurring payments allow you to make automatic charges at defined intervals, using the previously saved payment method data without the need for new user interaction. The recurrence logic is defined and managed by the seller through the creation of payments, adapting to business needs. This model is indicated for recurring charges, such as subscriptions, plans, and continuous services. To process scheduled recurring payments, send a \*\*POST\*\* to the endpoint :TagComponent{tag="API" text="/v1/orders" href="/developers/en/reference/online-payments/checkout-api/create-order/post"}. You must send your :toolTipComponent\[Access Token\]{content="Private key of the application created in Mercado Pago, used in the \_backend\_. You can access it through \*Your integrations > Application details\*."} and the information detailed below for this type of payment. \`\`\`curl curl -X POST \\ 'https://api.mercadopago.com/v1/orders' \\ -H 'Content-Type: application/json' \\ -H 'X-Idempotency-Key: {{SOME\_UNIQUE\_VALUE}}' \\ -H 'Authorization: Bearer {{YOUR\_ACCESS\_TOKEN}}' \\ -d '{ "type": "online", "external\_reference": "ext\_ref\_1234", "total\_amount": "1000.00", "processing\_mode": "automatic\_async", "payer": { "customer\_id": "1234567890" }, "transactions": { "payments": \[ { "amount": "1000.00", "automatic\_payments": { "payment\_profile\_id": "035979dc46c645c4ae12554835b07943", "retries": 3, "subscription": { "id": "subscription-id", "sequence": { "number": 1, "total": 12 }, "invoice": { "id": "00000000000", "billing\_date": "2024-09-02", "period": { "interval": 1, "type": "monthly" } } } }, "stored\_credential": { "payment\_initiator": "customer", "reason": "recurring", "previous\_transaction\_reference": "REF-987-654-321", "first\_payment": false } } \] } }' \`\`\` | Attribute | Type | Description | Required | | :--- | :--- | :--- | :--- | | \`Authorization\` | \_Header\_ | Refers to your private key, the :toolTipComponent\[Access Token\]{content="Private key of the application created in Mercado Pago, used in the \_backend\_. You can access it through \*Your integrations > Application details\*."}. | Required | | \`X-Idempotency-Key\` | \_Header\_ | Idempotency key. This key ensures that each request is processed only once, avoiding duplicates. Use a unique value in your request header, such as a UUID V4 or random \_strings\_. | Required | | \`type\` | \_Body. String\_ | Order type, associated with the Mercado Pago solution for which it is created. For online payments with cards, the only possible value is \`online\`. | Required | | \`external\_reference\` | \_Body. String\_ | External reference for the order. It can be, for example, a Central Bank hashcode, functioning as a transaction origin identifier. This field must have a maximum of 64 characters and can only contain numbers, letters, hyphens (-) and underscores (\_). Special characters such as (\[ \], (), '', @) are not allowed. | Required | | \`total\_amount\` | \_Body. String\_ | Total transaction amount. | Required | | \`processing\_mode\` | \_Body. String\_ | Order processing mode. Possible values are: \-\`automatic\`, to create and process the order in automatic mode. \-\`automatic\_async\`, to create the order with retry logic. For more information, access \[Orders processing modes\](https://www.mercadopago.com.mx/developers/en/docs/automatic-payments-orders/process-payments#bookmark\_orders\_processing\_modes). | Optional | | \`payer.customer\_id\` | \_Body. String\_ | Identifier of the customer who will make the payment. It is obtained in the Register payment method stage, when creating the customer, whether it is \[with a first time payment\](https://www.mercadopago.com.mx/developers/en/docs/automatic-payments-orders/register-first-payment) or a \[registration for future payments\](https://www.mercadopago.com.mx/developers/en/docs/automatic-payments-orders/register-future-payment). | Required | | \`transactions.payments.amount\` | \_Body. String\_ | Transaction amount. | Required | | \`transaction.payments.automatic\_payments.payment\_profile\_id\` | \_Body. String\_ | Customer's payment profile identifier. Obtained in the Register payment method stage, when creating the payment profile, whether it is \[with a first time payment\](https://www.mercadopago.com.mx/developers/en/docs/automatic-payments-orders/register-first-payment) or a \[registration for future payments\](https://www.mercadopago.com.mx/developers/en/docs/automatic-payments-orders/register-future-payment). | Required | | \`transaction.payments.automatic\_payments.retries\` | \_Body. Integer\_ | Number of times the payment will be retried in case of initial failure. Must be a number between 1 and 5\. This field is only allowed if \`processing\_mode=automatic\_async\` has been defined. Additionally, if the customer's payment profile has the \`max\_day\_overdue\` field configured, the retry configuration set for \`retries\` \*\*will not take priority\*\*. | Optional | | \`transaction.payments.automatic\_payments.subscription.id\` | \_Body. String\_ | Subscription identifier. We suggest that this value be composed of the collector + a unique subscription ID per user. | Required if \`sequence\_control\` is \`manual\` | | \`transaction.payments.automatic\_payments.subscription.sequence.number\` | \_Body. Integer\_ | Indicates the subsequent payment number. | Required if \`sequence\_control\` is \`manual\` | | \`transaction.payments.automatic\_payments.subscription.sequence.total\` | \_Body. Integer\_ | Indicates the total number of payments in the subscription. For permanent subscriptions, it should be \`null\`. | Required if \`sequence\_control\` is \`manual\` | | \`transaction.payments.automatic\_payments.subscription.invoice.id\` | \_Body. String\_ | Invoice identifier associated with the billing cycle. | Required if \`sequence\_control\` is \`manual\` | | \`transaction.payments.automatic\_payments.subscription.invoice.billing\_date\` | \_Body. String\_ | Billing date corresponding to the subscription cycle. | Required if \`sequence\_control\` is \`manual\` | | \`transaction.payments.automatic\_payments.subscription.invoice.period.interval\` | \_Body. Number\_ | Time interval between each charge. | Required if \`sequence\_control\` is \`manual\` | | \`transaction.payments.automatic\_payments.subscription.invoice.period.type\` | \_Body. String\_ | Recurrence period type. Possible values are \`daily\`, \`weekly\`, or \`monthly\`. | Required if \`sequence\_control\` is \`manual\` | | \`transaction.payments.stored\_credentials.payment\_initiator\` | \_Body. String\_ | Identifies who initiates the transaction. Possible values are: \-\`customer\`, when the transaction is initiated by the customer. \-\`merchant\`, when the transaction is initiated by the seller. | Required | | \`transaction.payments.stored\_credentials.reason\` | \_Body. String\_ | Payment type identifier, which is the reason why it is being stored. The only possible value for scheduled recurring payments is \`recurring\`. If you send this field and the payment profile has the \`sequence\_control\` field defined as \`auto\`, it is \*\*not necessary\*\* to send the \`automatic\_payments.subscription\` node, as the recurrence information will be automatically managed by the system. Go to \[Manage scheduled recurring payments\](https://www.mercadopago.com.mx/developers/en/docs/automatic-payments-orders/process-recurring-payments#bookmark\_manage\_scheduled\_recurring\_payments) for more information | Optional | | \`transaction.payments.stored\_credentials.previous\_transaction\_reference\` | \_Body. String\_ | Reference code of the previous transaction being processed, if any. Must be sent from the second payment processed for the same customer. | Required when \`first\_payment: false\` | | \`transaction.payments.stored\_credentials.first\_payment\` | \_Body. Boolean\_ | Indicates whether this is the processing of a first payment (\`true\`) or a subsequent payment (\`false\`). | Optional | If the request is sent correctly, the payment will have been created and the response will look like the example below. \`\`\`json { "id": "ORD01J6TC8BYRR0T4ZKY0QR39WGYE", "processing\_mode": "automatic\_async", "external\_reference": "ext\_ref\_1234", "total\_amount": "200.00", "country\_code": "MEX", "user\_id": "1245621468", "created\_date": "2024-09-02T22:04:01.880469Z", "last\_updated\_date": "2024-09-02T22:04:04.429289Z", "type": "online", "status": "processing", "status\_detail": "processing", "capture\_mode": "automatic\_async", "integration\_data": { "application\_id": "4599991948843755" }, "payer": { "customer\_id": "1234567890" }, "transactions": { "payments": \[ { "id": "PAY01J6TC8BYRR0T4ZKY0QRTZ0E24", "reference\_id": "74e9f7137a3246d3a3ad607c82da9880", "amount": "200.00", "status": "processing", "status\_detail": "processing", "automatic\_payments": { "payment\_profile\_id": "035979dc46c645c4ae12554835b07943", "subscription": { "id": "subscription-id", "sequence": { "number": 1, "total": 12 }, "invoice": { "id": "invoice-id", "billing\_date": "2024-09-02", "period": { "interval": 1, "type": "month" } } } }, "stored\_credential": { "payment\_initiator": "customer", "reason": "recurring", "previous\_transaction\_reference": "REF-987-654-321", "first\_payment": false } } \] } } \`\`\` > NOTE > > You can check the detail of possible statuses to be returned in the response by going to the \[Order status\](https://www.mercadopago.com.mx/developers/en/docs/automatic-payments-orders/order-status) and \[Transaction status\](https://www.mercadopago.com.mx/developers/en/docs/automatic-payments-orders/payment-status) sections, respectively. Additionally, you can check the \[Possible errors\](https://www.mercadopago.com.mx/developers/en/docs/automatic-payments-orders/possible-errors) when sending this request. ## Manage scheduled recurring payments When you create a scheduled recurring payment, certain fields linked to the payment frequency are required to improve the approval rate. In the Orders API, these fields are contained in the \`subscription\` node. With the support of the Profiles API, the management of this information can be done in two ways: automatic or manual. ::::TabsComponent :::TabComponent{title="Automatic management"} To automate the management of information related to payment recurrence, and avoid sending this information manually, you must: \* Set the \`sequence\_control\` field of the customer's payment profile to \`auto\`. If you need more information on how to do this, access our \[API Reference\](https://www.mercadopago.com.mx/developers/en/reference/automatic-payments/payment-profiles/post). \* Create the payment by sending the value \`recurring\` for the \`transaction.payments.stored\_credentials.reason\` field. This way, \*\*it will not be necessary to send the information contained in the \`transaction.payments.automatic\_payments.subscription\` node\*\* as it will be automatically managed by the system. ::: :::TabComponent{title="Manual management"} If you want to send the frequency information manually when creating a scheduled recurring payment, you must: \* Set the \`sequence\_control\` field of the customer's payment profile to \`manual\`. If you need more information on how to do this, access our \[API Reference\](https://www.mercadopago.com.mx/developers/en/reference/automatic-payments/payment-profiles/post). \* Create the payment by sending all parameters related to the \`automatic\_payments.subscription\` node. With manual management of scheduled recurring payments, \*\*you must send this information in each subsequent payment within the defined billing chain\*\*. ::: ::::