# Add transactions to the order This endpoint allows payment transactions to be added to the order. This operation can only be carried out in manual mode (processing the transaction in stages that can be configured and executed incrementally), with the "processing_mode" field filled with "manual" value. In case of success, the request will return a response with status 201. **POST** `/v1/orders/{order_id}/transactions` ## Request parameters ### Header - `X-Idempotency-Key` (string, required) This feature allows you to safely retry requests without the risk of accidentally performing the same action more than once. This is useful for avoiding errors, such as creating two identical payments. To ensure that each request is unique, it's important to use an exclusive value in the header of your request. We suggest using a UUID V4 or random strings. The header accepts values between 1 and 64 characters. ### Path - `id` (string, required) Order ID, returned in the response to the request made for its creation. - `payments` (array, optional) Contains information about the payment order. - `payments[].amount` (string, optional) Transaction amount. If only one payment method is used, it must be equivalent to the amount entered in the "total_amount" field. If two are used, it is the sum between the two "amount" that must be equivalent to the "total_amount" value. The field can contain two decimal places or none. - `payments[].payment_method` (object, optional) Information about the payment method. Access the endpoint "/v1/payment_methods" to check all available payment methods and get a list with the details of each one and their properties. The requirement of this parameter varies according to the need to send its attributes in the request. Depending on the payment method you are integrating, check below which of these attributes are required. - `payments[].payment_method.id` (string, optional) Identifier of the payment method selected to make the payment. If it's a "card" payment, it will show the brand. Possible enum values: - `visa` "Visa credit" card. - `master` "Master credit" card. - `debmaster` "Master debit" card. - `debvisa` "Visa debit" card. - `rapipago` "Rapipago" payment. - `pagofacil` "Pago fácil" payment. - `payments[].payment_method.type` (string, optional) Type of payment method selected to make the payment. Possible enum values: - `credit_card` Credit card. - `debit_card` Debit card. - `ticket` Cash payment. - `payments[].payment_method.token` (string, optional) Token that identifies the card and contains its data securely. Only required for "card" payments. It has a minimum length of 32 characters, and a maximum length of 33. If you don't know how to generate it, go to the "card" payment configuration in the Checkout API documentation. - `payments[].payment_method.installments` (integer, optional) Number of installments selected. - `payments[].payment_method.statement_descriptor` (string, optional) Description that the payment will appear with in the card statement. Accepts up to 50 characters. ## Response parameters - `payments` (array, optional) Contains information about the payment associated with the order. - `payments[].id` (string, optional) Identifier of the payment transaction created in the request, automatically generated by Mercado Pago. - `payments[].amount` (string, optional) Transaction amount. - `payments[].date_of_expiration` (string, optional) Date and time of the expiration of the payment. It is returned in the response to the 'Create order' ("/v1/orders") request. If an "expiration_time" is not sent, this field adopts a default value that depends on the payment method. - `payments[].status` (string, optional) Payment status. Possible enum values: - `created` The order has been created successfully. - `payments[].status_detail` (string, optional) Details about payment status. Possible enum values: - `created` Payment has been created successfully. - `payments[].payment_method` (object, optional) Information about the payment method. Access the endpoint "/v1/payment_methods" to check all available payment methods and get a list with the details of each one and their properties. The requirement of this parameter varies according to the need to send its attributes in the request. Depending on the payment method you are integrating, check below which of these attributes are required. - `payments[].payment_method.id` (string, optional) Identifier of the payment method selected to make the payment. If it's a "card" payment, it will show the brand. Possible enum values: - `visa` "Visa credit" card. - `master` "Master credit" card. - `debmaster` "Master debit" card. - `debvisa` "Visa debit" card. - `rapipago` "Rapipago" payment. - `pagofacil` "Pago fácil" payment. - `payments[].payment_method.type` (string, optional) Type of payment method selected to make the payment. Possible enum values: - `credit_card` Credit card. - `debit_card` Debit card. - `ticket` Cash payment. - `payments[].payment_method.token` (string, optional) Token that identifies the card and contains its data securely. Only required for "card" payments. It has a minimum length of 32 characters, and a maximum length of 33. If you don't know how to generate it, go to the "card" payment configuration in the Checkout API documentation. - `payments[].payment_method.installments` (integer, optional) Number of installments selected. - `payments[].payment_method.statement_descriptor` (string, optional) Description that the payment will appear with in the card statement. Accepts up to 50 characters. ## Errors | Status | Error | Description | | ------- | ------- | ----------- | | 400 | empty_required_header | The "X-Idempotency-Key" header is required and was not sent. Make the requisition again including it. | | 400 | invalid_idempotency_key_length | The value sent in the "X-Idempotency-Key" header exceeded the allowed size. The header accepts values between 1 and 64 characters. | | 400 | invalid_path_param | The "order_id" provided in the request path is not correct. Please confirm it and provide a valid ID to try again. | | 400 | required_properties | There are some required properties missing. Check the message returned in the error details to find out what the problem was and try again. | | 400 | unsupported_properties | An unsupported property was sent. Check the message returned in the error details to find out what the problem was and try again. | | 400 | minimum_properties | The minimum number of properties required to execute the request was not sent. Check the message returned in the error details to find out what the problem was and try again. | | 400 | property_type | The wrong property type was submitted. For example, an "integer" value for a "string" property. Check the message returned in the error details to find out what the problem was and try again. | | 400 | minimum_items | The minimum number of items for some property was not sent. Check the message returned in the error details to find out what the problem was and try again. | | 400 | maximum_items | A greater number of items were sent than allowed for some property. Check the message returned in the error details to find out what the problem was and try again. | | 400 | property_value | An incorrect value for some property was sent. Check the message returned in the error details to find out what the problem was and try again. | | 400 | json_syntax_error | An incorrect JSON was sent. Check the message returned in the error details to find out what the problem was and try again. | | 400 | invalid_properties | Incorrect information was sent. Check the message returned in the error details to find out what the problem was and try again. | | 400 | exceeded_number_of_transactions | An error occurred in the request. The order accepts a maximum of one transaction. Remove the excess transactions. | | 400 | invalid_order_mode_for_operation | This operation is not allowed in the mode defined for order processing. | | 401 | 401 | The value sent as Access Token is incorrect. Please check and try again with the correct value. | | 401 | invalid_credentials | There is no support for test credentials. Use test users with production credentials for the sandbox environment and your production credentials for the production environment. | | 404 | order_not_found | Order not found. Please check if you provided the correct order ID. | | 409 | idempotency_key_already_used | The value sent as the idempotency header ("X-Idempotency-Key") has already been used. Please try the request again sending a new value. | | 500 | idempotency_validation_failed | Validation fail. Please try submitting the request again. | | 500 | internal_error | Generic error. Please try submitting the request again. | ## Request example ### cURL ```bash curl -X POST \ 'https://api.mercadopago.com/v1/orders/{order_id}/transactions' \ -H 'Content-Type: application/json' \ -H 'Authorization: Bearer ' \ -d '{ "payments": [ { "amount": "50.00", "payment_method": { "id": "master", "type": "credit_card", "token": "12345", "installments": 1, "statement_descriptor": "My Store" } } ] }' ``` ## Response example ```json { "payments": [ { "id": "PAY01J49MMW3SSBK5PSV3DFR32959", "amount": "24.50", "date_of_expiration": "2023-03-01T10:00:00.000-04:00", "status": "created", "status_detail": "created", "payment_method": { "id": "master", "type": "credit_card", "token": "12345", "installments": 1, "statement_descriptor": "My Store" } } ] } ```