AI resources

Create payment with shipment

Through the preference, it is possible to create a payment with an associated shipment. This way, you can offer customers home delivery of purchased products leveraging Mercado Libre's logistics without extra effort from the business.

Creating payments with shipments is only available for integrators who have Mercado Pago authorization. If you don't have this functionality, you can request it from your Sales Advisor.

To create a payment with an associated shipment, create a preference by sending a POST to the endpoint /checkout/preferences, including your Access TokenPrivate key of the application created in Mercado Pago, used in the backend. You can access it through Your integrations > Application details > Testing > Test credentials. and the items and shipments nodes as indicated in the table below.

curl

curl --location 'https://api.mercadopago.com/checkout/preferences' \
--header 'Authorization: Bearer [Access Token]' \
--header 'Content-Type: application/json' \
--data '{
"external_reference": "External reference 123",
  "items": [
    {
      "title": "Product 1",
      "description": "Product 1 description",
      "picture_url": "image.jpg",
      "quantity": 1,
      "currency_id": "MXN",
      "unit_price": 100,
      "fiscal_data": {
        "sat": "23241500",
        "sat_measurement_id": "H87",
        "measurement_unit": "Piece",
        "package_id": "4G",
        "dangerous_material_id": "M2340"
      },
      "dimensions": {
        "unit": "G",
        "height": 3,
        "width": 11,
        "length": 18,
        "weight": 100
      }
    }, 
    {  
      "title": "Product 2",
      "description": "Product 2 description",
      "picture_url": "image.jpg",
      "quantity": 1,
      "currency_id": "MXN",
      "unit_price": 110,
      "fiscal_data": {
        "sat": "23241500",
        "sat_measurement_id": "H87",
        "measurement_unit": "Piece",
        "package_id": "4G",
        "dangerous_material_id": "M2340"
      },
      "dimensions": {
        "unit": "G",
        "height": 3,
        "width": 10,
        "length": 18,
        "weight": 90
      }
    },

  ],
   "shipments": {
    "dimensions": "21x15x6.5,360",
    "free_methods_types": [
            {
                "id": "standard"
            }
        ],
    "local_pickup": false,
    "mode": "me2",
    "stock_origin_id": "id",
    "receiver_address": {
         "zip_code": "06250",
         "street_name": "Ex-Hipódromo de Peralvillo",
         "street_number": null,
         "floor": "",
         "apartment": "",
         "neighborhood": Colonia,
         "city_name": Cuauhtémoc,
         "state_name": Ciudad de México,
         "country_name": México
        }
    }
}'
FieldDescriptionTypeRequired
external_referenceReference that you can synchronize with your payment system to identify the shipment. This field must have a maximum of 64 characters and should only contain numbers, letters, hyphens (-) and underscores (_). Special characters like ([ ], (), '', @) are not allowed.StringOptional
itemsInformation about the items sold to be shipped.ArrayRequired
items.titleItem title that will be displayed during the payment process, in the checkout, activities and emails.StringRequired
items.descriptionItem description.StringOptional
items.picture_urlItem image URL.StringOptional
items.quantityQuantity of items. This property is used to calculate the total purchase cost.NumberRequired
items.currency_idUnique identifier of the currency involved in the transaction. The only possible value is Mexican pesos (MXN).StringOptional
items.unit_priceUnit price of the item. This property is used together with the quantity property to determine the purchase cost.NumberRequired
items.fiscal_dataObject containing the product's fiscal data.ObjectRequired to create shipments. If you send it, you must also include the shipments attribute.
items.fiscal_data.satSAT category of the item. Check the possible values by accessing the following link.StringRequired
items.fiscal_data.sat_measurement_idUnique identifier of the product's unit of measurement.StringRequired
items.fiscal_data.measurement_unitProduct unit of measurement according to SAT UnitsStringRequired
items.fiscal_data.package_idIdentifier of the product's packaging type.StringRequired
items.fiscal_data.dangerous_material_idIdentifier for dangerous products.StringOptional
items.dimensionsObject containing information about the item's size.ObjectOptional
items.dimensions.unitUnit of measurement for the item. Must be cm (centimeters).StringRequired
items.dimensions.heightItem height in centimeters.NumberRequired
items.dimensions.widthItem width in centimeters.NumberRequired
items.dimensions.lengthItem length in centimeters.NumberRequired
items.dimensions.weightItem weight in grams.NumberRequired
shipmentsShipment information.ObjectRequired
shipments.dimensionsPackage size, which will be used to define the shipping cost. The format must be cm x cm x cm, g. If it contains more than one item, its size should be calculated considering the sum of the dimensions of all items, always ensuring that the maximum allowed dimensions per package are not exceeded.
Check the best practices for sizing by accessing the documentation.
StringRequired
shipments.free_methods_typeShipping method identifier. Should only be sent when offering free shipping, with the value standard. This free shipping is only possible when the sale value is greater than the shipping cost. If the shipping cost is borne by the buyer, the field should not be sent.StringOptional
shipments.local_pickupIndicates whether you want to offer package pickup at a branch. For this solution, enter false.BooleanRequired
shipments.modeShipping mode. For this solution, enter me2.StringRequired
shipments.stock_origin_idIdentifier of the package's origin address, which must be requested from the Mercado Pago team. If there is more than one pickup address, the stock_origin_id of the origin address must be informed.StringOptional
shipments.receiver_addressDetails of the destination address. Sending it is recommended to offer the best shopping experience and, if necessary, the data can be reused.ObjectOptional
shipments.receiver_address.zip_codePostal code of the destination address.StringOptional
shipments.receiver_address.street_nameDestination street name.StringOptional
shipments.receiver_address.street_numberDestination address number.StringOptional
shipments.receiver_address.floorDestination apartment floor.StringOptional
shipments.receiver_address.apartmentDestination apartment number.StringOptional
shipments.receiver_address.neighborhoodDestination address neighborhood.StringOptional
shipments.receiver_address.city_nameDestination address city.StringOptional
shipments.receiver_address.state_nameDestination address state.StringOptional
shipments.receiver_address.country_nameDestination address country.StringOptional

If the request is sent successfully, the payment with shipment will have been created and the response will look like the example below.

json

{
    "additional_info": "",
    "auto_return": "",
    "back_urls": {
        "failure": "",
        "pending": "",
        "success": ""
    },
    "binary_mode": false,
    "client_id": "6607075136335166",
    "collector_id": 2681149695,
    "coupon_code": null,
    "coupon_labels": null,
    "date_created": "2025-10-15T15:30:39.775-04:00",
    "date_of_expiration": null,
    "expiration_date_from": null,
    "expiration_date_to": null,
    "expires": false,
    "external_reference": "External reference 123",
    "id": "2681149695-c464c4e0-1834-4e81-9956-25a3cc1e8db8",
    "init_point": "https://www.mercadopago.com.mx/checkout/v1/redirect?pref_id=2681149695-c464c4e0-1834-4e81-9956-25a3cc1e8db8",
    "internal_metadata": null,
    "items": [
        {
            "id": "",
            "category_id": "",
            "currency_id": "MXN",
            "description": "Product 1 description",
            "title": "Product 1",
            "quantity": 1,
            "unit_price": 100,
            "fiscal_data": {
                "sat": "23241500",
                "sat_measurement_id": "H87",
                "measurement_unit": "Piece",
                "package_id": "4G",
                "dangerous_material_id": "M2340"
            },
            "dimensions": {
                "unit": "G",
                "height": 3,
                "width": 11,
                "length": 18,
                "weight": 100
            }
        },
        {
            "id": "",
            "category_id": "",
            "currency_id": "MXN",
            "description": "Product 2 description",
            "title": "Product 2",
            "quantity": 1,
            "unit_price": 110,
            "fiscal_data": {
                "sat": "23241500",
                "sat_measurement_id": "H87",
                "measurement_unit": "Piece",
                "package_id": "4G",
                "dangerous_material_id": "M2340"
            },
            "dimensions": {
                "unit": "G",
                "height": 3,
                "width": 10,
                "length": 18,
                "weight": 90
            }
        },
            ],
    "marketplace": "NONE",
    "marketplace_fee": 0,
    "metadata": {},
    "notification_url": null,
    "operation_type": "regular_payment",
    "payer": {
        "phone": {
            "area_code": "",
            "number": ""
        },
        "address": {
            "zip_code": "",
            "street_name": "",
            "street_number": null
        },
        "email": "",
        "identification": {
            "number": "",
            "type": ""
        },
        "name": "",
        "surname": "",
        "date_created": null,
        "last_purchase": null
    },
    "payment_methods": {
        "default_card_id": null,
        "default_payment_method_id": null,
        "excluded_payment_methods": [
            {
                "id": ""
            }
        ],
        "excluded_payment_types": [
            {
                "id": ""
            }
        ],
        "installments": null,
        "default_installments": null
    },
    "processing_modes": null,
    "product_id": null,
    "preference_expired": false,
    "redirect_urls": {
        "failure": "",
        "pending": "",
        "success": ""
    },
    "sandbox_init_point": "https://sandbox.mercadopago.com.mx/checkout/v1/redirect?pref_id=2681149695-c464c4e0-1834-4e81-9956-25a3cc1e8db8",
    "site_id": "MLM",
    "shipments": {
        "mode": "me2",
        "local_pickup": false,
        "dimensions": "21x15x6.5,360",
        "free_methods": [],
        "free_methods_types": [
            {
                "id": "standard"
            }
        ],
        "default_shipping_method": null,
        "receiver_address": {
            "zip_code": "06250",
            "street_name": "Ex-Hipódromo de Peralvillo",
            "street_number": null,
            "floor": "",
            "apartment": "",
            "city_name": "Cuauhtémoc",
            "state_name": "Ciudad",
            "country_name": "México",
            "neighborhood": "Colonia"
        },
        "stock_origin_id": "id"
    },
    "total_amount": null,
    "last_updated": null,
    "financing_group": ""
}

If necessary, it is possible to cancel the created shipment. To do so, you must cancel the payment to which it is associated in its entirety.

Manage shipments

If you choose to create payments with shipments, you can use our shipment management APIs, which will allow you to optimize your pre and post-sale experience.



Configure shipment notifications

Configure Webhook notifications to receive alerts about shipments and their status changes.

To do so, you need to indicate the URLs to which they will be sent by following the step-by-step below:

  1. Go to Your integrations and select the application integrated with Checkout Pro for which you want to activate notifications.

Application

  1. In the left menu, select Webhooks > Configure notifications.

Webhooks

  1. Select the Production mode tab and provide an HTTPS URL to receive notifications with your production integration.

URL

  1. Select the Shipments (Mercado Pago) event to receive notifications, which will be sent in JSON format via an HTTPS POST to the URL specified above.

Shipments

  1. Finally, click Save configuration. This will generate a secret key exclusive to the application, which will allow you to validate the authenticity of the received notifications, ensuring they were sent by Mercado Pago. Keep in mind that this generated key has no expiration date and its periodic renewal is not mandatory, although it is recommended. To do so, just click the Reset button.

If you want more information on how to simulate sending a notification, validate its origin, or what actions are necessary after receiving them, go to Configure notifications.