Nhảy tới nội dung

Hoàn tiền giao dịch

Dùng để hoàn tiền các giao dịch thành công (có mã trạng thái là 0).

Hoàn tiền 1 phần: hoàn một phần tiền của số tiền đã thanh toán (khi mà số tiền cần hoàn nhỏ hơn số tiền đã trả).

Hoàn tiền toán phần: Hoàn lại toàn bộ số tiền đã thanh toán (khi mà số tiền cần hoàn bằng số tiền đã trả).

Luồng Xử Lý

Refund_flow

Cấu Hình API

HTTP Request

POST /v2/gateway/api/refund

AttributeTypeRequiredDescription
partnerCodeStringThông tin tích hợp
subPartnerCodeStringSub partner Id
orderIdStringId của giao dịch hoàn tiền, khác với Id đã dùng cho giao dịch mua ban đầu của hàng hóa/dịch vụ này
requestIdString(50)Định danh duy nhất cho mỗi yêu cầu
Đối tác sử dụng requestId cho xử lý idempotency control
amountLongSố tiền cần hoàn
transIdLongMã giao dịch của MoMo
Đây là Id do MoMo cung cấp cho giao dịch mua thành công của hàng hóa/dịch vụ này
langStringNgôn ngữ của message được trả về (vi hoặc en)
descriptionStringMô tả chi tiết yêu cầu hoàn tiền
signatureStringChữ ký để kiểm tra thông tin. Sử dụng thuật toán Hmac_SHA256 với data theo định dạng sau:
accessKey=$acessKey&amount=$amount&description=
$description&orderId=$orderId&partnerCode=$partnerCode
&requestId=$requestId&transId=$transId

Mẫu Request

{
"partnerCode": "MOMO",
"orderId": "1527297954700",
"requestId": "1527314064527",
"amount": 55000,
"transId": 144492817,
"lang": "vi",
"description": "",
"signature": "8cdba11a7ff4cc7267d2b23c1f5d228a2ee52af1095420f9571c2d64ec6735fe"
}

HTTP Response

AttributeTypeRequiredDescription
partnerCodeStringThông tin tích hợp
orderIdStringMã đơn hàng của đối tác
requestIdStringID duy nhất cho mỗi request
amountLongSố tiền cần hoàn
transIdLongMã giao dịch của MoMo
resultCodeintResult Code
messageStringMô tả kết quả dựa trên lang
responseTimeLongThời gian trả kết quả thanh toán về đối tác
Định dạng: timestamp

Mẫu Response

{
"partnerCode": "MOMO",
"orderId": "1527297954700",
"requestId": "1527314064527",
"amount": 55000,
"transId": 144518121,
"resultCode": 0,
"message": "Thành công",
"responseTime": 12454547875
}