# Update preference Renew the details of a payment preference. Indicate the ID of the preference and send the parameters with the information you want to update. **PUT** `/checkout/preferences/{id}` ## Request parameters ### Path - `id` (string, required) The preference's ID - `items` (array, optional) Items information. - `items[].id` (string, optional) Item ID. - `items[].title` (string, optional) This is the item`s title, which will display during the payment process, at checkout, activities, and emails. - `items[].description` (string, optional) Item description. This is a free text field. - `items[].picture_url` (string, optional) Item image URL. - `items[].category_id` (string, optional) This is a free string where the item category can be added. - `items[].quantity` (number, optional) Item quantity. This property is used to calculate the total cost. - `items[].currency_id` (string, optional) Unique ID to identify the currency. ISO_4217 code. Some sites allow local currency and USD, but it is important to note that the amount is converted to local currency when the preference is created, as the checkout always processes transactions using local currency. If you use USD please take into consideration that this value is not automatically updated if the value of local currency changes in relation to USD. - `items[].unit_price` (number, optional) Unit price of the item. This property is used together with the property quantity to determine the order cost. The field can contain two decimal places or none. - `items[].fiscal_data` (enum, optional) Presents the tax data of the item. Possible enum values: - `sat` Provides the SAT (Authenticator and Transmitter System for Electronic Tax Receipts) category of the item. - `sat_measurement_id` Indicates whether the item is dangerous or not. - `measurement_unit` If the item is considered dangerous, specifies the type of the dangerous material. - `package_id` Identification of the package key. - `dangerous_material_idOP` Identification of the hazardous material key. - `items[].dimensions` (enum, optional) Presents the dimensions of the item to be shipped. Possible enum values: - `unit` Unit of measure for the item. - `height` Height of the item. - `width` Item width. - `length` Item length. - `weight` Item weight. - `payer` (object, optional) Buyer's information, such as name, last name, e-mail, phone, personal identification, address, and registration date. - `payer.name` (string, optional) Buyer name. - `payer.surname` (string, optional) Buyer last name. - `payer.email` (string, optional) Buyer e-mail address. - `payer.phone` (object, optional) Buyer phone. - `payer.phone.area_code` (string, optional) Area code. - `payer.phone.number` (number, optional) Number. - `payer.identification` (object, optional) Personal identification. - `payer.identification.type` (string, optional) Identification Type. - `payer.identification.number` (string, optional) Number. - `payer.address` (object, optional) Buyer’s address. - `payer.address.zip_code` (string, optional) Zip code. - `payer.address.street_name` (string, optional) Street name. - `payer.address.street_number` (number, optional) Street number. - `payer.date_created` (string, optional) Registration date. - `payment_methods` (object, optional) All configuration related to payments methods, such as excluded payment methods, excluded payment types, default payment method, and installments. - `payment_methods.excluded_payment_methods` (array, optional) Payment methods excluded from the payment process (except account_money, which is always allowed). The payment methods included here will not be available at checkout. - `payment_methods.excluded_payment_methods[].id` (string, optional) Payment method ID. - `payment_methods.excluded_payment_types` (array, optional) Payment types excluded from the payment process. The payment types included here will not be available at checkout. - `payment_methods.excluded_payment_types[].id` (string, optional) Payment method data_type ID. - `payment_methods.default_payment_method_id` (string, optional) Suggested payment method. The user will initiate the checkout this this payment method already selected. It is considered suggested because Checkouts follow different logics in order to select the best payment method for a specific transaction, and this property is the option with the least relevance. - `payment_methods.installments` (number, optional) Maximum number of credit card installments to be accepted. - `payment_methods.default_installments` (number, optional) Prefered number of credit card installments. - `shipments` (object, optional) Shipments information. - `shipments.mode` (string, optional) Shipment mode. Possible enum values: - `custom` Custom shipping. Not available for Checkout Pro or Payment link. - `me2` Mercado Envíos. - `not_specified` Shipping mode not specified. - `shipments.local_pickup` (boolean, optional) The payer have the option to pick up the shipment in your store (mode:me2 only). - `shipments.dimensions` (string, optional) Dimensions of the shipment in cm x cm x cm, gr (mode:me2 only). - `shipments.default_shipping_method` (number, optional) Select default shipping method in checkout (mode:me2 only). - `shipments.free_methods` (array, optional) Offer a shipping method as free shipping (mode:me2 only). - `shipments.free_methods[].id` (number, optional) Shipping method ID. - `shipments.cost` (number, optional) Shipment cost (mode:custom only). - `shipments.free_shipping` (boolean, optional) Free shipping for mode:custom. - `shipments.receiver_address` (object, optional) Shipping address. - `shipments.receiver_address.zip_code` (string, optional) Zip code. - `shipments.receiver_address.street_name` (string, optional) Street name. - `shipments.receiver_address.city_name` (string, optional) City name. - `shipments.receiver_address.state_name` (string, optional) State name. - `shipments.receiver_address.street_number` (number, optional) Street number. - `shipments.receiver_address.floor` (string, optional) Floor. - `shipments.receiver_address.apartment` (string, optional) Apartment. - `shipments.receiver_address.country_name` (string, optional) Country name. - `back_urls` (object, optional) Return URLs to the seller's site, either automatically ("auto_return") or through the 'Return to site' button, depending on the payment status. The use of the protocol ("https") in the URL is mandatory. - `back_urls.success` (string, optional) Approved payment URL. - `back_urls.pending` (string, optional) Pending or in process payment URL. - `back_urls.failure` (string, optional) Canceled payment URL. - `notification_url` (string, optional) Notifications URL available to receive notifications of events related to Payment. The maximum number of characters allowed for submission in this parameter is 248 characters. The use of the protocol ("https") in the URL is mandatory. - `additional_info` (string, optional) Additional information. - `auto_return` (String, optional) If specified, the buyer will be automatically redirected to the seller's site after the purchase is approved with a credit card. Possible enum values: - `approved` The redirection takes place only for approved payments with a credit card. - `all` The redirection takes place only for approved payments with a credit card, forward compatibility only if we change the default behavior. - `external_reference` (string, optional) Reference you can synchronize with your payment system. - `expires` (boolean, optional) Boolean value that determines if a preference expires. - `date_of_expiration` (string, optional) Expiration date of cash payment. - `expiration_date_from` (string, optional) Date in "yyyy-MM-dd'T'HH:mm:ssz" format which indicates the start of the preference`s validity period. This can be used, for instance, for limited sales, where sellers make an offer between certain dates. For example - 2022-11-17T09:37:52.000-04:00. - `expiration_date_to` (string, optional) Date in "yyyy-MM-dd'T'HH:mm:ssz" format which indicates the end of the preference`s validity period. This can be used, for instance, for limited sales, where sellers make an offer between certain dates. For example - 2022-11-17T09:37:52.000-04:00. - `marketplace` (string, optional) Origin of the payment. This is an alphanumeric field whose default value is NONE. If the collector has their own marketplace, this is where the credentials to identify it are sent. As the marketplace is associated to the Application ID, the marketplace credentials must correspond to the credentials used to create the preference. Using the wrong credentials will result in an error. - `marketplace_fee` (number, optional) Marketplace`s fee charged by application owner. It is a fixed amount and its default value is 0 in local currency. This property can only be sent if a valid marketplace has been defined as well, otherwise the request will fail. - `differential_pricing` (object, optional) Differential pricing configuration for this preference. The seller can have their own configuration regarding payment methods and installments, and it`s in this parameter where they will include the numeric ID to indicate so. This value is used to apply custom payment methods. - `differential_pricing.id` (number, optional) Differential pricing ID. - `metadata` (object, optional) Valid JSON that can be added to the payment to save additional attributes. ## Response parameters - `additional_info` (string, optional) Additional information. - `auto_return` (String, optional) If specified, the buyer will be automatically redirected to the seller's site after the purchase is approved with a credit card. Possible enum values: - `approved` The redirection takes place only for approved payments with a credit card. - `all` The redirection takes place only for approved payments with a credit card, forward compatibility only if we change the default behavior. - `back_urls` (object, optional) Return URLs to the seller's site, either automatically ("auto_return") or through the 'Return to site' button, depending on the payment status. The use of the protocol ("https") in the URL is mandatory. - `back_urls.failure` (string, optional) Canceled payment URL. - `back_urls.pending` (string, optional) Pending or in process payment URL. - `back_urls.success` (string, optional) Approved payment URL. - `binary_mode` (boolean, optional) When the payment is activated, it can only be approved or rejected. Otherwise, the payment may be pending. - `client_id` (string, optional) Unique ID used to identify the client. It is obtained from the credentials used to create the preference. It´s the application ID. - `collector_id` (number, optional) Unique ID used to identify the collector. It is the same as the Cust ID. - `coupon_code` (object, optional) Discount campaign with a specific code. - `coupon_labels` (object, optional) - `date_created` (string, optional) Registration date. - `date_of_expiration` (object, optional) Expiration date. - `expiration_date_from` (string, optional) Date in "yyyy-MM-dd'T'HH:mm:ssz" format which indicates the start of the preference`s validity period. This can be used, for instance, for limited sales, where sellers make an offer between certain dates. For example - 2022-11-17T09:37:52.000-04:00. - `expiration_date_to` (string, optional) Date in "yyyy-MM-dd'T'HH:mm:ssz" format which indicates the end of the preference`s validity period. This can be used, for instance, for limited sales, where sellers make an offer between certain dates. For example - 2022-11-17T09:37:52.000-04:00. - `expires` (boolean, optional) Boolean value that determines if a preference expires. - `external_reference` (string, optional) Reference you can synchronize with your payment system. - `id` (string, optional) Autogenerated unique ID that identifies the preference. For example 036151801-2484cd71-7140-4c51-985a-d4cfcf133baf. - `init_point` (string, optional) Automatically generated URL to open the Checkout. - `internal_metadata` (object, optional) - `items` (array, optional) Items information. - `items[].id` (string, optional) Item ID. - `items[].picture_url` (string, optional) Item image URL. - `items[].title` (string, optional) This is the item`s title, which will display during the payment process, at checkout, activities, and emails. - `items[].description` (string, optional) Item description. This is a free text field. - `items[].category_id` (string, optional) This is a free string where the item category can be added. - `items[].currency_id` (string, optional) Unique ID to identify the currency. ISO_4217 code. Some sites allow local currency and USD, but it is important to note that the amount is converted to local currency when the preference is created, as the checkout always processes transactions using local currency. If you use USD please take into consideration that this value is not automatically updated if the value of local currency changes in relation to USD. - `items[].quantity` (number, optional) Item quantity. This property is used to calculate the total cost. - `items[].unit_price` (number, optional) Unit price of the item. This property is used together with the property quantity to determine the order cost. - `items[].fiscal_data` (enum, optional) Presents the tax data of the item. Possible enum values: - `sat` Provides the SAT (Authenticator and Transmitter System for Electronic Tax Receipts) category of the item. - `sat_measurement_id` Indicates whether the item is dangerous or not. - `measurement_unit` If the item is considered dangerous, specifies the type of the dangerous material. - `package_id` Identification of the package key. - `dangerous_material_idOP` Identification of the hazardous material key. - `items[].dimensions` (enum, optional) Presents the dimensions of the item to be shipped. Possible enum values: - `unit` Unit of measure for the item. - `height` Height of the item. - `width` Ancho del artículo. - `length` Item length. - `weight` Item weight. - `marketplace` (string, optional) Origin of the payment. This is an alphanumeric field whose default value is NONE. If the collector has their own marketplace, this is where the credentials to identify it are sent. As the marketplace is associated to the Application ID, the marketplace credentials must correspond to the credentials used to create the preference. Using the wrong credentials will result in an error. - `marketplace_fee` (number, optional) Marketplace`s fee charged by application owner. It is a fixed amount and its default value is 0 in local currency. This property can only be sent if a valid marketplace has been defined as well, otherwise the request will fail. - `metadata` (object, optional) Valid JSON that can be added to the payment to save additional attributes. - `notification_url` (string, optional) Notifications URL available to receive notifications of events related to Payment. The maximum number of characters allowed for submission in this parameter is 248 characters. The use of the protocol ("https") in the URL is mandatory. - `operation_type` (String, optional) Operation data_type. Possible enum values: - `regular_payment` Normal payment. - `money_transfer` Money request. - `payer` (object, optional) Buyer information, such as name, last name, e-mail, phone, personal identification, address, and registration date. - `payer.phone` (object, optional) Buyer phone. - `payer.phone.area_code` (string, optional) Area code. - `payer.phone.number` (number, optional) Number. - `payer.address` (object, optional) Buyer’s address. - `payer.address.zip_code` (string, optional) Zip code. - `payer.address.street_name` (string, optional) Street name. - `payer.address.street_number` (string, optional) Street number. - `payer.email` (string, optional) Buyer e-mail address. - `payer.identification` (object, optional) Personal identification. - `payer.identification.number` (string, optional) Number. - `payer.identification.type` (string, optional) Identification Type. - `payer.name` (string, optional) Buyer name. - `payer.surname` (string, optional) Buyer last name. - `payer.date_created` (string, optional) Registration date. - `payer.last_purchase` (object, optional) Date of last purchase. - `payment_methods` (object, optional) All configuration related to payments methods, such as excluded payment methods, excluded payment types, default payment method, and installments. - `payment_methods.default_card_id` (object, optional) Default card ID. - `payment_methods.default_payment_method_id` (string, optional) Suggested payment method. The user will initiate the checkout this this payment method already selected. It is considered suggested because Checkouts follow different logics in order to select the best payment method for a specific transaction, and this property is the option with the least relevance. - `payment_methods.excluded_payment_methods` (array, optional) Payment methods excluded from the payment process (except account_money, which is always allowed). The payment methods included here will not be available at checkout. - `payment_methods.excluded_payment_methods[].id` (string, optional) Payment method ID. - `payment_methods.excluded_payment_types` (array, optional) Payment types excluded from the payment process. The payment types included here will not be available at checkout. - `payment_methods.excluded_payment_types[].id` (string, optional) Payment method data_type ID. - `payment_methods.installments` (string, optional) Maximum number of credit card installments to be accepted. - `payment_methods.default_installments` (string, optional) Prefered number of credit card installments. - `processing_modes` (object, optional) Processing mode. - `product_id` (object, optional) Unique ID used to identify the product. - `redirect_urls` (object, optional) URL (in https) where you want to receive the authorization code when your integration is set up as a marketplace or performed through the flow Authorization code by OAuth. - `sandbox_init_point` (string, optional) Do not use this parameter. For integration testing, use init_point. - `site_id` (string, optional) Unique ID used to identify the site. - `shipments` (object, optional) Shipments information. - `shipments.default_shipping_method` (object, optional) Select default shipping method in checkout (mode:me2 only). - `shipments.receiver_address` (object, optional) Shipping address. - `shipments.receiver_address.zip_code` (string, optional) Zip code. - `shipments.receiver_address.street_name` (string, optional) Street name. - `shipments.receiver_address.street_number` (string, optional) Street number. - `shipments.receiver_address.floor` (string, optional) Floor. - `shipments.receiver_address.apartment` (string, optional) Apartment. - `shipments.receiver_address.city_name` (object, optional) City name. - `shipments.receiver_address.state_name` (object, optional) State name. - `shipments.receiver_address.country_name` (string, optional) Country name. - `total_amount` (object, optional) Total amount of the order. - `last_updated` (object, optional) Last updated date. - `statement_descriptor` (string, optional) The statement descriptor is a long text (up to 13 characters) that will be visualized in the payer´s credit card statement to easily identify the purchase. ## Errors | Status | Error | Description | | ------- | ------- | ----------- | | 400 | invalid_collector_id | collector_id invalid. | | 400 | invalid_sponsor_id | sponsor_id is not an active user. | | 400 | invalid_collector_email | collector is not collector_email owner. | | 400 | invalid_operation_type | operation_type invalid. | | 400 | invalid_expiration_date_to | expiration_date_to invalid. | | 400 | invalid_date | invalid date of expiration. | | 400 | invalid_expiration_date_from | expiration_date_from invalid. | | 400 | invalid_items | unit_price invalid. | | 400 | invalid_back_urls | back_urls invalid. Wrong format. | | 400 | invalid_payment_methods | installments invalid. Should be a number between 1 and 36. | | 400 | invalid_marketplace_fee | marketplace_fee must not be greater than total amount. | | 400 | invalid_id | preference_id not found. | | 400 | invalid_access_token | access denied | | 400 | invalid_shipments | invalid type () for field shipments.cost. | ## Request example ### cURL ```bash curl -X PUT \ 'https://api.mercadopago.com/checkout/preferences/{id}' \ -H 'Content-Type: application/json' \ -H 'Authorization: Bearer ' \ -d '{ "items": [ { "id": "202809963-a2201f8d-11cb-443f-adf6-de5a42eed67d", "title": "Dummy Title", "description": "Dummy Description", "picture_url": "https://www.myapp.com/myimage.jpg", "category_id": "cat123", "quantity": 1, "currency_id": "ARS", "unit_price": "24.50", "fiscal_data": "sat", "dimensions": "unit" } ], "payer": { "name": "string", "surname": "string", "email": "test@testuser.com", "phone": { "area_code": "string", "number": 0 }, "identification": { "type": "string", "number": "string" }, "address": { "zip_code": "string", "street_name": "string", "street_number": 0 }, "date_created": "string" }, "payment_methods": { "excluded_payment_methods": [ { "id": "string" } ], "excluded_payment_types": [ { "id": "string" } ], "default_payment_method_id": "string", "installments": 0, "default_installments": 0 }, "shipments": { "mode": "custom", "local_pickup": false, "dimensions": "string", "default_shipping_method": 0, "free_methods": [ { "id": 0 } ], "cost": 0, "free_shipping": false, "receiver_address": { "zip_code": "string", "street_name": "string", "city_name": "string", "state_name": "string", "street_number": 0, "floor": "string", "apartment": "string", "country_name": "string" } }, "back_urls": { "success": "string", "pending": "string", "failure": "string" }, "notification_url": "string", "additional_info": "string", "auto_return": "approved", "external_reference": "string", "expires": false, "date_of_expiration": "string", "expiration_date_from": "2022-11-17T09:37:52.000-04:00", "expiration_date_to": "2022-11-17T10:37:52.000-05:00", "marketplace": "string", "marketplace_fee": 0, "differential_pricing": { "id": 0 }, "metadata": {} }' ``` ### Node.js ```javascript const client = new MercadoPago({ accessToken: config.access_token }); const preference = new Preference(client); const updatePreferenceRequest = { items: [ { id: '1234', title: 'Dummy Title', description: 'Dummy description', picture_url: 'https://www.myapp.com/myimage.jpg', category_id: 'car_electronics', quantity: 1, currency_id: 'BRL', unit_price: 10, }, ], marketplace_fee: 0, payer: { name: 'Test', surname: 'User', email: 'your_test_email@example.com', phone: { area_code: '11', number: '4444-4444', }, identification: { type: 'CPF', number: '19119119100', }, address: { zip_code: '06233200', street_name: 'Street', street_number: 123, }, }, back_urls: { success: 'https://test.com/success', failure: 'https://test.com/failure', pending: 'https://test.com/pending', }, differential_pricing: { id: 1, }, expires: false, additional_info: 'Discount: 12.00', auto_return: 'all', binary_mode: true, external_reference: '1643827245', marketplace: 'marketplace', notification_url: 'https://notificationurl.com', operation_type: 'regular_payment', payment_methods: { default_payment_method_id: 'master', excluded_payment_types: [ { id: 'ticket', }, ], excluded_payment_methods: [ { id: '', }, ], installments: 5, default_installments: 1, }, shipments: { mode: 'custom', local_pickup: false, default_shipping_method: null, free_methods: [ { id: 1, }, ], cost: 10, free_shipping: false, dimensions: '10x10x20,500', receiver_address: { zip_code: '06000000', street_number: 123, street_name: 'Street', floor: '12', apartment: '120A', }, }, statement_descriptor: 'Test Store', }; const id = 'id'; const response = await preference.update({ id, updatePreferenceRequest }); ``` ### PHP ```php update("id", [ "back_urls"=>array( "success" => "https://test.com/success", "failure" => "https://test.com/failure", "pending" => "https://test.com/pending" ), "differential_pricing" => array( "id" => 1, ), "expires" => false, "items" => array( array( "id" => "1234", "title" => "Dummy Title", "description" => "Dummy description", "picture_url" => "https://www.myapp.com/myimage.jpg", "category_id" => "car_electronics", "quantity" => 2, "currency_id" => "BRL", "unit_price" => 100 ) ), "marketplace_fee" => 0, "payer" => array( "name" => "Test", "surname" => "User", "email" => "your_test_email@example.com", "phone" => array( "area_code" => "11", "number" => "4444-4444" ), "identification" => array( "type" => "CPF", "number" => "19119119100" ), "address" => array( "zip_code" => "06233200", "street_name" => "Street", "street_number" => "123" ) ), "additional_info" => "Discount: 12.00", "auto_return" => "all", "binary_mode" => true, "external_reference" => "1643827245", "marketplace" => "none", "notification_url" => "https://notificationurl.com", "operation_type" => "regular_payment", "payment_methods" => array( "default_payment_method_id" => "master", "excluded_payment_types" => array( array( "id" => "visa" ) ), "excluded_payment_methods" => array( array( "id" => "" ) ), "installments" => 5, "default_installments" => 1 ), "shipments" >= array( "mode" => "custom", "local_pickup" => false, "default_shipping_method" => null, "free_methods" => array( array( "id" => 1 ) ), "cost" => 10, "free_shipping" => false, "dimensions" => "10x10x20,500", "receiver_address" => array( "zip_code" => "06000000", "street_number" => "123", "street_name" => "Street", "floor" => "12", "apartment" => "120A", "city_name" => "Rio de Janeiro", "state_name" => "Rio de Janeiro", "country_name" => "Brasil" ) ), "statement_descriptor" => "Test Store", ]); echo implode($preference); ?> ``` ### Python ```python import mercadopago sdk = mercadopago.SDK("PROD_ACCESS_TOKEN") request = { "items": [ { "id": "1234", "title": "Dummy Title", "description": "Dummy description", "picture_url": "https://www.myapp.com/myimage.jpg", "category_id": "car_electronics", "quantity": 1, "currency_id": "BRL", "unit_price": 10, }, ], "marketplace_fee": 0, "payer": { "name": "Test", "surname": "User", "email": "your_test_email@example.com", "phone": { "area_code": "11", "number": "4444-4444", }, "identification": { "type": "CPF", "number": "19119119100", }, "address": { "zip_code": "06233200", "street_name": "Street", "street_number": 123, }, }, "back_urls": { "success": "https://test.com/success", "failure": "https://test.com/failure", "pending": "https://test.com/pending", }, "differential_pricing": { "id": 1, }, "expires": False, "additional_info": "Discount: 12.00", "auto_return": "all", "binary_mode": True, "external_reference": "1643827245", "marketplace": "marketplace", "notification_url": "https://notificationurl.com", "operation_type": "regular_payment", "payment_methods": { "default_payment_method_id": "master", "excluded_payment_types": [ { "id": "ticket", }, ], "excluded_payment_methods": [ { "id": "", }, ], "installments": 5, "default_installments": 1, }, "shipments": { "mode": "custom", "local_pickup": False, "default_shipping_method": None, "free_methods": [ { "id": 1, }, ], "cost": 10, "free_shipping": False, "dimensions": "10x10x20,500", "receiver_address": { "zip_code": "06000000", "street_number": 123, "street_name": "Street", "floor": "12", "apartment": "120A", }, }, "statement_descriptor": "Test Store", } preference_response = sdk.preference().update("id", request) preference = preference_response["response"] ``` ### Java ```java MercadoPagoConfig.setAccessToken("ACCESS_TOKEN"); PreferenceClient client = new PreferenceClient(); PreferenceItemRequest itemRequest = PreferenceItemRequest.builder() .id("1234") .title("Dummy Title") .description("Dummy description") .pictureUrl("https://www.myapp.com/myimage.jpg") .categoryId("car_electronics") .quantity(2) .currencyId("BRL") .unitPrice(new BigDecimal("100")) .build(); List items = new ArrayList<>(); items.add(itemRequest); PreferenceFreeMethodRequest freeMethod = PreferenceFreeMethodRequest.builder() .id(1L).build(); List freeMethodList = new ArrayList<>(); freeMethodList.add(freeMethod); List excludedPaymentTypes = new ArrayList<>(); excludedPaymentTypes.add(PreferencePaymentTypeRequest.builder().id("ticket").build()); List excludedPaymentMethods = new ArrayList<>(); excludedPaymentMethods.add(PreferencePaymentMethodRequest.builder().id("").build()); PreferenceRequest updateRequest = PreferenceRequest.builder() .backUrls( PreferenceBackUrlsRequest.builder() .success("https://test.com/success") .failure("https://test.com/failure") .pending("https://test.com/pending") .build()) .differentialPricing( PreferenceDifferentialPricingRequest.builder() .id(1L) .build()) .expires(false) .items(items) .marketplaceFee(new BigDecimal("0")) .payer( PreferencePayerRequest.builder() .name("Test") .surname("User") .email("your_test_email@example.com") .phone(PhoneRequest.builder().areaCode("11").number("4444-4444").build()) .identification( IdentificationRequest.builder().type("CPF").number("19119119100").build()) .address( AddressRequest.builder() .zipCode("06233200") .streetName("Street") .streetNumber("123") .build()) .build()) .additionalInfo("Discount: 12.00") .autoReturn("all") .binaryMode(true) .externalReference("1643827245") .marketplace("marketplace") .notificationUrl("https://notificationurl.com") .operationType("regular_payment") .paymentMethods( PreferencePaymentMethodsRequest.builder() .defaultPaymentMethodId("master") .excludedPaymentTypes(excludedPaymentTypes) .excludedPaymentMethods(excludedPaymentMethods) .installments(5) .defaultInstallments(1) .build()) .shipments( PreferenceShipmentsRequest.builder() .mode("custom") .localPickup(false) .defaultShippingMethod(null) .freeMethods(freeMethodList) .cost(BigDecimal.TEN) .freeShipping(false) .dimensions("10x10x20,500") .receiverAddress( PreferenceReceiverAddressRequest.builder() .zipCode("06000000") .streetNumber("123") .streetName("Street") .floor("12") .apartment("120A") .build()) .build()) .statementDescriptor("Test Store") .build(); Preference preference = client.update("id", updateRequest); ``` ### .Net ```csharp MercadoPagoConfig.AccessToken = "PROD_ACCESS_TOKEN"; PreferenceRequest request = new PreferenceRequest { BackUrls = new PreferenceBackUrlsRequest { Success = "https://test.com/success", Failure = "https://test.com/failure", Pending = "https://test.com/pending" }, DifferentialPricing = new PreferenceDifferentialPricingRequest { Id = 1 }, Expires = false, Items = new List { new PreferenceItemRequest { Id = "1234", Title = "Dummy Title", Description = "Dummy description", PictureUrl = "https://www.myapp.com/myimage.jpg", CategoryId = "car_electronics", Quantity = 2, CurrencyId = "BRL", UnitPrice = 100 } }, MarketplaceFee = 0, Payer = new PreferencePayerRequest { Name = "Test", Surname = "User", Email = "your_test_email@example.com", Phone = new PhoneRequest { AreaCode = "11", Number = "4444-4444" }, Identification = new IdentificationRequest { Type = "CPF", Number = "19119119100" }, Address = new AddressRequest { ZipCode = "06233200", StreetName = "Street", StreetNumber = "123" } }, AdditionalInfo = "Discount: 12.00", AutoReturn = "all", BinaryMode = true, ExternalReference = "1643827245", Marketplace = "none", NotificationUrl = "https://notificationurl.com", OperationType = "regular_payment", PaymentMethods = new PreferencePaymentMethodsRequest { DefaultPaymentMethodId = "master", ExcludedPaymentTypes = new List { new PreferencePaymentTypeRequest { Id = "visa" } }, ExcludedPaymentMethods = new List { new PreferencePaymentMethodRequest { Id = "" } }, Installments = 5, DefaultInstallments = 1 }, Shipments = new PreferenceShipmentsRequest { Mode = "custom", LocalPickup = false, FreeMethods = new List { new PreferenceFreeMethodRequest { Id = 1 } }, Cost = 10, FreeShipping = false, Dimensions = "10x10x20,500", ReceiverAddress = new PreferenceReceiverAddressRequest { ZipCode = "06000000", StreetNumber = "123", StreetName = "Street", Floor = "12", Apartment = "120A", City = "Rio de Janeiro", State = "Rio de Janeiro", Country = "Brasil" } }, StatementDescriptor = "Test Store" }; PreferenceClient client = new PreferenceClient(); Preference preference = await client.UpdateAsync("id", request); ``` ### Ruby ```text sdk = MercadoPago::Client.new('ACCES_TOKEN') request = { items: [ { id: '1234', title: 'Dummy Title', description: 'Dummy description', picture_url: 'https://www.myapp.com/myimage.jpg', category_id: 'car_electronics', quantity: 1, currency_id: 'BRL', unit_price: 10, }, ], marketplace_fee: 0, payer: { name: 'Test', surname: 'User', email: 'your_test_email@example.com', phone: { area_code: '11', number: '4444-4444', }, identification: { type: 'CPF', number: '19119119100', }, address: { zip_code: '06233200', street_name: 'Street', street_number: 123, }, }, back_urls: { success: 'https://test.com/success', failure: 'https://test.com/failure', pending: 'https://test.com/pending', }, differential_pricing: { id: 1, }, expires: false, additional_info: 'Discount: 12.00', auto_return: 'all', binary_mode: true, external_reference: '1643827245', marketplace: 'marketplace', notification_url: 'https://notificationurl.com', operation_type: 'regular_payment', payment_methods: { default_payment_method_id: 'master', excluded_payment_types: [ { id: 'ticket', }, ], excluded_payment_methods: [ { id: '', }, ], installments: 5, default_installments: 1, }, shipments: { mode: 'custom', local_pickup: false, default_shipping_method: nil, free_methods: [ { id: 1, }, ], cost: 10, free_shipping: false, dimensions: '10x10x20,500', receiver_address: { zip_code: '06000000', street_number: 123, street_name: 'Street', floor: '12', apartment: '120A', }, }, statement_descriptor: 'Test Store', } preference_response = sdk.preference.update('id', request) preference = preference_response[:response] ``` ## Response example ```json { "additional_info": "string", "auto_return": "approved", "back_urls": { "failure": "string", "pending": "string", "success": "string" }, "binary_mode": false, "client_id": 6295877106812064, "collector_id": 202809963, "coupon_code": {}, "coupon_labels": {}, "date_created": "2018-02-02T19:22:23.535Z", "date_of_expiration": {}, "expiration_date_from": "2022-11-17T09:37:52.000-04:00", "expiration_date_to": "2022-11-17T10:37:52.000-05:00", "expires": false, "external_reference": "string", "id": "202809963-920c288b-4ebb-40be-966f-700250fa5370", "init_point": "https://www.mercadopago.com/mla/checkout/start?pref_id=202809963-920c288b-4ebb-40be-966f-700250fa5370", "internal_metadata": {}, "items": [ { "id": "string", "picture_url": "string", "title": "Dummy Item", "description": "Multicolor Item", "category_id": "string", "currency_id": "ARS", "quantity": 1, "unit_price": "24.50", "fiscal_data": "sat", "dimensions": "unit" } ], "marketplace": "MP-MKT-6295877106812064", "marketplace_fee": 0, "metadata": {}, "notification_url": "https://url.com.br/notificacao", "operation_type": "regular_payment", "payer": { "phone": { "area_code": "string", "number": 0 }, "address": { "zip_code": "string", "street_name": "Mc Street", "street_number": "7304" }, "email": "test@testuser.com", "identification": { "number": "string", "type": "string" }, "name": "string", "surname": "string", "date_created": "string", "last_purchase": {} }, "payment_methods": { "default_card_id": {}, "default_payment_method_id": "string", "excluded_payment_methods": [ { "id": "master" } ], "excluded_payment_types": [ { "id": "credit_card" } ], "installments": "string", "default_installments": "string" }, "processing_modes": {}, "product_id": {}, "redirect_urls": {}, "sandbox_init_point": "https://sandbox.mercadopago.com/mla/checkout/pay?pref_id=202809963-920c288b-4ebb-40be-966f-700250fa5370", "site_id": "MLA", "shipments": { "default_shipping_method": {}, "receiver_address": { "zip_code": "string", "street_name": "string", "street_number": "string", "floor": "string", "apartment": "string", "city_name": {}, "state_name": {}, "country_name": "string" } }, "total_amount": {}, "last_updated": {}, "statement_descriptor": "MERCADOPAGO" } ```