Documentación Mercado Libre
Descubre toda la información que debes conocer sobre las APIs de Mercado Libre.![circulos azuis em degrade](https://http2.mlstatic.com/storage/developers-site-cms-admin/DevImgs/230801158836-ImgMS--1-.png)
Documentación
Orders invoicing with coupons
Validate approved payment
Before consulting the discounts applied to certain order payments, you should check that the payment detail in the order has status: paid, and the payment with status: approved.
When the sale is through a shopping cart, you must remember:
- The pack_order tag is generated automatically to be able to discriminate if the order is associated with a cart and cannot be deleted by the buyer or seller.
- The pack_id field shows the cart number to which the order belongs.
Check discount coupons to invoice
Using the order payment/s, you can check the discount coupons. Check the fee_details node to get the discount value, as long as the fee_payer field equals collector and the type equals coupon_fee.
To get the discount total value on the invoice you must add the amounts with type: coupon_fee.
Order payment example:
curl -X GET -H 'Authorization: Bearer $ACCESS_TOKEN' https://api.mercadopago.com/v1/payments/15733180247
Short response:
[…]
"fee_details": [
{
"amount": 13243.78,
"fee_payer": "collector,
"type": "coupon_fee"
},
{
"amount": 8301.68,
"fee_payer": "collector,
"type": "application_fee"
}
],
"financing_type": null,
"id": 15733180247,
"installments": 1,
"integrator_id": null,
"internal_metadata": {
"rule_engine": {
"valid_promise": false,
"with_promise": false,
"rules": [
{
"rule_id": 21000002955,
"rule_set": "processing_fee_and_release"
}
]
},
[…]
Next: Sales management.