MercadoPago provides an API to make refunds. There are two types of refund: Full Refund (the payment is completely refunded), or Partial Refund (part of the payment is refunded).
To make a full refund, you will need the Payment's Id.
Event 'FullRefund'
MercadoPago.PaymentCustomCheckout.FullRefund(&PaymentId,&RefundSDT,&Message,&ErrorCode)
&ResponsePaymentInfo = &RefundSDT.ToXml()
if &ErrorCode = 0
//Success
else
Msg(&Message.Description)
endif
Endevent
&RefundSDT is RefundSDT data type, which is used to receive information about the refund.
&Message contains a description in case an error occurs.
To make a partial refund, you will need the Payment's Id and the amount that is going to be refunded.
Note: That amount cannot be greater than the payment's total cost.
Event 'PartialRefund'
MercadoPago.PaymentCustomCheckout.PartialRefund(&PaymentId,&refundAmount,&RefundSDT,&Message,&ErrorCode)
&ResponsePaymentInfo = &RefundSDT.ToXml()
if &ErrorCode = 0
//Success
else
Msg(&Message.Description)
endif
EndEvent
&RefundSDT is RefundSDT data type, which is used to receive information about the refund.
&Message contains a description in case an error occurs.
&refundAmount is the amount to be refunded.
- You must have enough available money in your account so you can refund the payment amount successfully. Otherwise, you'll get a
400 Bad Request
error.
- You can refund a payment within 90 days after it was accredited.
- You can only refund payments made with cards.
- You can only refund
approved
payments.
- You can perform up to 20 partial refunds in one payment.
- By now, it is not possible to perform partial refunds of payments made to MercadoLibre articles (
marketplace=MELI
).
- By now, it is not possible to perform partial refunds of payments made with Brazilian MercadoLibre card (
payment_method_id=melicard
).
- By now, it is not possible to perform partial refunds of recurring payments in Argentina (
operation_type=recurring_payment
).
- The payment status will be
approved:partially_refunded
until it is refunded. Just then the status will change to refunded
- The refund of payments made with credit card will be reimbursed in the card statement.
- All fees and taxes will be refunded partially in a proportional way.
To cancel a payment, you will need the Payment's Id.
Event 'CancelPayment'
MercadoPago.PaymentCustomCheckout.CancelPayment(&PaymentId,&PaymentInfoSDT,&Message,&ErrorCode)
&ResponsePaymentInfo = &PaymentInfoSDT.ToXml()
if &ErrorCode = 0
//Success
else
Msg(&Message.Description)
endif
Endevent
&PaymentInfoSDT is used to receive the payment's new status, where you can confirm the cancellation was made successfully.
- Only
pending
or in_process
payments can be canceled.
- Cancelled coupon payments, deposits, and transfers will be deposited in the buyer’s MercadoPago account.