Refund a Payment 

Refund a Payment

Use this endpoint to request a full refund or partial refund of a successful ShopeePay transaction.

Types of Refund:

  • Full Refund: a transaction’s full amount
  • Partial Refund: multiple (partial) amounts as long as the sum does not exceed the transaction's full amount. Merchant should wait for the previous partial refund to complete successfully before creating the next partial refund.

The refund expiration period is set at 365 days, starting from when the initial payment is made.

Calling Create Refund endpoint will return 2 status types:

  • Success - transaction successfully refunded, customer can try paying again.
  • Failed - transaction can be found but it does not meet the requirements for refund.

Note: Refund endpoint supports idempotent response. Multiple API requests using the same payload will only trigger the action once to prevent the risk of creating duplicate refunds.

For detailed information about our refund eligibility criteria, please refer to this link

Specification

The following table is the specification of the API:

MPMCPMCheckout with ShopeePay Link & Pay, SubscriptionAuthorization & Capture
HTTP MethodPOSTPOSTPOSTPOST
Service Code78805869
Path.../v1.0.2/qr/qr-mpm-refund.../v1.0/qr/qr-cpm-refund.../v1.0/debit/refund.../v1.0/auth/refund
Versionv1.0.2v1.0v1.0v1.0

Request Parameter

FieldTypeMandatoryDescription
originalPartnerReferenceNoStringMUnique identifier of the transaction that merchant would like to refund.
partnerRefundNoStringMUnique identifier of refund transaction generated by merchant.
  • Accepts up to 64 characters.
merchantIdStringMUnique identifier of merchant in merchant system.
externalStoreIdStringMUnique identifier of store in merchant system.
refundAmountObjectM
  • value
StringMRefund amount, including cents.
  • Sample: 10.000,00 will be placed with 10000.00
  • currency
StringMCurrency that is associated with the refund amount
  • Accepted values: IDR
additionalInfoObjectM
  • transactionType
uint32M
  • Refer to Transaction Types for specific transaction types. Eligible transaction types for refund are: Payment Payment captured

Sample API Request

REQUEST

{
"originalPartnerReferenceNo": "Testing-123",
"partnerRefundNo": "Refund-Testing-123",
"merchantId": "Merchant123",
"externalStoreId": "Store123",
"refundAmount": {
"value": "10000.00",
"currency": "IDR"
},
"additionalInfo": {
"transactionType": 13
}
}
arrow-svg

Copy

Response Parameter

FieldTypeMandatoryDescription
responseCodeStringMError code to specify the error returned
responseMessageStringMDebug message to provide more information
partnerRefundNoStringOUnique identifier of refund transaction generated by merchant.
refundAmountObjectO
  • value
StringCRefund amount, including cents
  • currency
StringCCurrency that is associated with the refund amount.
  • Accepted values: IDR
refundTimeStringMUpdate time of the individual transaction.
  • Using ISO-8601 timestamp format.
additionalInfoObjectO
  • createTime
StringOCreate time of the individual transaction.
  • Using ISO-8601 timestamp format.
  • transactionType
uint32O15, referring to refund transaction type.
  • latestTransactionStatus
StringORefer to Transaction Status for specific transaction statuses
  • merchantId
StringOUnique identifier of merchant in merchant system.
  • externalStoreId
StringOUnique identifier of store in merchant system.
  • userIdHash
StringOUsed to identify the unique user.
  • terminalId
StringOIf terminal ID info exists in transaction.
  • paymentChannel
int32OIndicates the source of fund used.

Additional Fields

APIFieldTypeMandatoryDescription
  • MPM
  • CPM
  • Checkout with ShopeePay
  • Link & Pay
  • Subscription
refundNoStringMTransaction serial number of the refund transaction in ShopeePay system.
  • Authorization & Capture
originalReferenceNoStringCTransaction identifier in ShopeePay system. Will be returned upon successful refund.

Sample API Response

Sample API Response MPM

RESPONSE

{
"responseCode": "2007800",
"responseMessage": "Successful",
"refundNo": "Refund-Payment-123",
"partnerRefundNo": "Refund-Testing-123",
"refundAmount": {
"value": "10000.00",
"currency": "IDR"
},
"refundTime": "2022-07-20T07:30:00+07:00",
"additionalInfo": {
"createTime": "2022-07-20T07:30:00+07:00",
"transactionType": 15,
"merchantId": "Merchant123",
"terminalId": "2903",
"externalStoreId": "Store123",
"userIdHash": "15e455125fba426a4a2bb9145b3af2906813a7f222f6eab93b026ead62dc8d76",
"latestTransactionStatus": "00",
"paymentChannel": 1
}
}
arrow-svg

Copy

Sample API Response CPM

RESPONSE

{
"responseCode": "2008000",
"responseMessage": "Successful",
"refundNo": "Refund-Payment-123",
"partnerRefundNo": "Refund-Testing-123",
"refundAmount": {
"value": "10000.00",
"currency": "IDR"
},
"refundTime": "2022-07-20T07:30:00+07:00",
"additionalInfo": {
"createTime": "2022-07-20T07:30:00+07:00",
"transactionType": 15,
"merchantId": "Merchant123",
"terminalId": "2903",
"externalStoreId": "Store123",
"userIdHash": "15e455125fba426a4a2bb9145b3af2906813a7f222f6eab93b026ead62dc8d76",
"latestTransactionStatus": "00",
"paymentChannel": 1
}
}
arrow-svg

Copy

Sample API Response Checkout with ShopeePay, Link&Pay, Subscription

RESPONSE

{
"responseCode": "2005800",
"responseMessage": "Successful",
"refundNo": "Refund-Payment-123",
"partnerRefundNo": "Refund-Testing-123",
"refundAmount": {
"value": "10000.00",
"currency": "IDR"
},
"refundTime": "2022-07-20T07:30:00+07:00",
"additionalInfo": {
"createTime": "2022-07-20T07:30:00+07:00",
"transactionType": 15,
"merchantId": "Merchant123",
"terminalId": "2903",
"externalStoreId": "Store123",
"userIdHash": "15e455125fba426a4a2bb9145b3af2906813a7f222f6eab93b026ead62dc8d76",
"latestTransactionStatus": "00",
"paymentChannel": 1
}
}
arrow-svg

Copy

Sample API Response for Authorization and Capture

RESPONSE

{
"responseCode": "2006900",
"responseMessage": "Successful",
"refundNo": "143899353717011270",
"partnerRefundNo": "partner_refund_no_integration_00010",
"refundAmount": {
"value": "1.00",
"currency": "IDR"
},
"refundTime": "2024-05-01T18:00:10+07:00",
"additionalInfo": {
"createTime": "2024-05-01T18:00:09+07:00",
"transactionType": 15,
"merchantId": "merchant_123",
"externalStoreId": "store_123",
"userIdHash": "a8fbf03545686dacbe22beee16512f89d8403ce5a02d42512522724c1b09cfe1",
"latestTransactionStatus": "00",
"paymentChannel": 1
},
"originalReferenceNo": "143899353717011270"
}
arrow-svg

Copy

Response Codes

Response Codes for MPM Payment

HTTP codeService CodeSub-error CodeResponse CodeResponse MessagePartner Action
20078002007800SuccessfulMark MPM refund process to corresponding status according to response.additionalInfo.latestTransactionStatus. Retry request "Check MPM Refund Status" periodically if didn't get final status
40078004007800Bad RequestMark MPM refund process to Failed. Retry request with proper parameter
40078014007801
  • Invalid field format {fieldName}
  • Invalid field format {currency}
  • Invalid Field Format
Mark MPM refund process to Failed. Retry request with proper parameter
40078024007802
  • Invalid mandatory field {fieldName}
  • Invalid mandatory field {transactionType}
  • Invalid mandatory field {merchantId}
  • Invalid mandatory field {externalStoreId}
  • Invalid mandatory field {merchantId}. Exceed maximum character length
  • Invalid mandatory field {externalStoreId}. Exceed maximum character length
  • Invalid mandatory field {originalPartnerReferenceNo}
  • Invalid mandatory field {partnerRefundNo}
  • Invalid mandatory field {partnerRefundNo}. Exceed Maximum 64 Characters.
  • Invalid Mandatory Field + {error message}
Mark MPM refund process to Failed. Retry request with proper parameter
40178004017800Unauthorized.{error message}Mark MPM refund process to Failed. Retry request with proper parameter
40178014017801Invalid TokenMark MPM refund process to Failed. Retry request with proper parameter
40378004037800Transaction ExpiredMark MPM refund process to Failed. Consult to Shopeepay about refund validity days
40378014037801Feature not allowedMark MPM refund process to Failed. Contact Shopeepay to check merchant/store supported product flow
40378064037806Feature Not Allowed. Service Is Temporarily Down For Scheduled MaintenanceMark MPM refund process to Failed. Retry request periodically or consult to Shopeepay
40378144037814Insufficient FundsMark MPM refund process to Failed. Check source of fund
40378154037815
  • Transaction not permitted. An ongoing refund for this payment exists
  • Transaction not permitted. Mismatch Merchant/Store
  • Transaction not permitted. Original transaction not successful
  • Transaction not permitted. Request to refund does not meet rules
  • Transaction not permitted. Cannot refund payment with voucher
  • Transaction not permitted. Credit wallet balance exceeded
Mark MPM refund process to Failed. Retry request with proper parameter or consult to Shopeepay
40478014047801Transaction not foundMark MPM refund process to Failed. Retry request with proper parameter
40478084047808
  • Invalid merchant. Status Is Not Active
  • Invalid {fieldName}
  • Invalid Store. Status Is Not Active
Mark MPM refund process to Failed. Contact Shopeepay to check merchant/store status
40478134047813
  • Invalid amount. Mismatch refund amount
  • Invalid amount. Non-positive amount is not allowed
  • Invalid amount. Refund amount exceed transaction
  • Invalid amount
Mark MPM refund process to Failed. Retry request with proper parameter
40478154047815Transaction not permittedMark MPM refund process to Failed. Retry request periodically or consult to Shopeepay
40478184047818Inconsistent RequestMark MPM refund process to Failed. Retry request with proper parameter
40578014057801Requested Operation Is Not AllowedMark MPM refund process to Failed. Retry request with proper parameter
40978004097800ConflictMark MPM refund process to Pending. Retry request periodically or consult to Shopeepay
50078005007800General ErrorMark MPM refund process to Pending. Retry request periodically or consult to Shopeepay
50078015007801Internal Server ErrorMark MPM refund process to Pending. Retry request periodically or consult to Shopeepay
50478005047800TimeoutMark MPM refund process to Pending. Retry request periodically or consult to Shopeepay

Response Codes for CPM Payment

HTTP codeService CodeSub-error CodeResponse CodeResponse MessagePartner Action
20080002008000SuccessfulMark CPM refund process to corresponding status according to response.additionalInfo.latestTransactionStatus. Retry request "Check CPM Refund Status" periodically if didn't get final status
40080004008000Bad RequestMark CPM refund process to Failed. Retry request with proper parameter
40080014008001
  • Invalid field format {fieldName}
  • Invalid field format {currency}
  • Invalid Field Format
Mark CPM refund process to Failed. Retry request with proper parameter
40080024008002
  • Invalid mandatory field {fieldName}
  • Invalid mandatory field {transactionType}
  • Invalid mandatory field {merchantId}
  • Invalid mandatory field {externalStoreId}
  • Invalid mandatory field {merchantId}. Exceed maximum character length
  • Invalid mandatory field {externalStoreId}. Exceed maximum character length
  • Invalid mandatory field {originalPartnerReferenceNo}
  • Invalid mandatory field {partnerRefundNo}
  • Invalid mandatory field {partnerRefundNo}. Exceed Maximum 64 Characters.
  • Invalid Mandatory Field + {error message}
Mark CPM refund process to Failed. Retry request with proper parameter
40180004018000Unauthorized.{error message}Mark CPM refund process to Failed. Retry request with proper parameter
40180014018001Invalid TokenMark CPM refund process to Failed. Retry request with proper parameter
40380004038000Transaction ExpiredMark CPM refund process to Failed. Consult to Shopeepay about refund validity days
40380014038001Feature not allowedMark CPM refund process to Failed. Contact Shopeepay to check merchant/store supported product flow
40380064038006Feature Not Allowed. Service Is Temporarily Down For Scheduled MaintenanceMark CPM refund process to Failed. Retry request periodically or consult to Shopeepay
40380144038014Insufficient FundsMark CPM refund process to Failed. Retry request periodically or consult to Shopeepay
40380154038015
  • Transaction not permitted. An ongoing refund for this payment exists
  • Transaction not permitted. Mismatch Merchant/Store
  • Transaction not permitted. Original transaction not successful
  • Transaction not permitted. Request to refund does not meet rules
  • Transaction not permitted. Cannot refund payment with voucher
  • Transaction not permitted. Credit wallet balance exceeded
Mark CPM refund process to Failed. Retry request with proper parameter or consult to Shopeepay
40480014048001Transaction not foundMark CPM refund process to Failed. Retry request with proper parameter
40480084048008
  • Invalid merchant. Status Is Not Active
  • Invalid {fieldName}
  • Invalid Store. Status Is Not Active
Mark CPM refund process to Failed. Contact Shopeepay to check merchant/store status
40480134048013
  • Invalid amount. Mismatch refund amount
  • Invalid amount. Non-positive amount is not allowed
  • Invalid amount. Refund amount exceed transaction
  • Invalid amount
Mark CPM refund process to Failed. Retry request with proper parameter
40480154048015Transaction not permittedMark CPM refund process to Failed. Retry request periodically or consult to Shopeepay
40480184048018Inconsistent RequestMark CPM refund process to Failed. Retry request with proper parameter
40580014058001Requested Operation Is Not AllowedMark CPM refund process to Failed. Retry request with proper parameter
40980004098000ConflictMark CPM refund process to Pending. Retry request periodically or request "Check CPM Refund Status" periodically to get final status
50080005008000General ErrorMark CPM refund process to Pending. Retry request periodically or request "Check CPM Refund Status" periodically to get final status
50080015008001Internal Server ErrorMark CPM refund process to Pending. Retry request periodically or request "Check CPM Refund Status" periodically to get final status
50480005048000TimeoutMark CPM refund process to Pending. Retry request periodically or request "Check CPM Refund Status" periodically to get final status
Response Codes for Checkout With ShopeePay
HTTP codeService CodeSub-error CodeResponse CodeResponse MessagePartner Action
20058002005800SuccessfulMark Debit refund process to corresponding status according to response.additionalInfo.latestTransactionStatus. Retry request "Check Debit Refund Status" periodically if didn't get final status
40058004005800Bad RequestMark Debit refund process to Failed. Retry request with proper parameter
40058014005801
  • Invalid field format {fieldName}
  • Invalid field format {currency}
  • Invalid Field Format
Mark Debit refund process to Failed. Retry request with proper parameter
40058024005802
  • Invalid mandatory field {fieldName}
  • Invalid mandatory field {transactionType}
  • Invalid mandatory field {merchantId}
  • Invalid mandatory field {externalStoreId}
  • Invalid mandatory field {merchantId}. Exceed maximum character length
  • Invalid mandatory field {externalStoreId}. Exceed maximum character length
  • Invalid mandatory field {originalPartnerReferenceNo}
  • Invalid mandatory field {partnerRefundNo}
  • Invalid mandatory field {partnerRefundNo}. Exceed Maximum 64 Characters.
  • Invalid Mandatory Field + {error message}
Mark Debit refund process to Failed. Retry request with proper parameter
40158004015800Unauthorized.{error message}Mark Debit refund process to Failed. Retry request with proper parameter
40158014015801Invalid TokenMark Debit refund process to Failed. Retry request with proper parameter
40358004035800Transaction ExpiredMark Debit refund process to Failed. Consult to Shopeepay about refund validity days
40358014035801Feature not allowedMark Debit refund process to Failed. Contact Shopeepay to check merchant/store supported product flow
40358064035806Feature Not Allowed. Service Is Temporarily Down For Scheduled MaintenanceMark Debit refund process to Failed. Retry request periodically or consult to Shopeepay
40358144035814Insufficient FundsMark Debit refund process to Failed. Check source of fund
40358154035815
  • Transaction not permitted. An ongoing refund for this payment exists
  • Transaction not permitted. Mismatch Merchant/Store
  • Transaction not permitted. Original transaction not successful
  • Transaction not permitted. Request to refund does not meet rules
  • Transaction not permitted. Cannot refund payment with voucher
  • Transaction not permitted. Credit wallet balance exceeded
Mark Debit refund process to Failed. Retry request with proper parameter or consult to Shopeepay
40458014045801Transaction not foundMark Debit refund process to Failed. Retry request with proper parameter
40458084045808
  • Invalid merchant. Status Is Not Active
  • Invalid {fieldName}
  • Invalid Store. Status Is Not Active
Mark Debit refund process to Failed. Contact Shopeepay to check merchant/store status
40458134045813
  • Invalid amount. Mismatch refund amount
  • Invalid amount. Non-positive amount is not allowed
  • Invalid amount. Refund amount exceed transaction
  • Invalid amount
Mark Debit refund process to Failed. Retry request with proper parameter
40458154045815Transaction not permittedMark Debit refund process to Failed. Retry request periodically or consult to Shopeepay
40458184045818Inconsistent RequestMark Debit refund process to Failed. Retry request with proper parameter
40558014055801Requested Operation Is Not AllowedMark Debit refund process to Failed. Retry request with proper parameter
40958004095800ConflictMark Debit refund process to Pending. Retry request periodically or request "Check Debit Refund Status" periodically to get final status
50058005005800General ErrorMark Debit refund process to Pending. Retry request periodically or request "Check Debit Refund Status" periodically to get final status
50058015005801Internal Server ErrorMark Debit refund process to Pending. Retry request periodically or request "Check Debit Refund Status" periodically to get final status
50458005045800TimeoutMark Debit refund process to Pending. Retry request periodically or request "Check Debit Refund Status" periodically to get final status

Response Codes for Auth & Capture

HTTP codeService CodeSub-error CodeResponse CodeResponse MessagePartner Action
20069002006900SuccessfulMark Auth refund process to corresponding status according to response.additionalInfo.latestTransactionStatus. Retry request "Check Auth Refund Status" periodically if didn't get final status
40069004006900Bad RequestMark Auth refund process to Failed. Retry request with proper parameter
40069014006901
  • Invalid field format {fieldName}
  • Invalid field format {currency}
  • Invalid Field Format
Mark Auth refund process to Failed. Retry request with proper parameter
40069024006902
  • Invalid mandatory field {fieldName}
  • Invalid mandatory field {transactionType}
  • Invalid mandatory field {merchantId}
  • Invalid mandatory field {externalStoreId}
  • Invalid mandatory field {merchantId}. Exceed maximum character length
  • Invalid mandatory field {externalStoreId}. Exceed maximum character length
  • Invalid mandatory field {originalPartnerReferenceNo}
  • Invalid mandatory field {partnerRefundNo}
  • Invalid mandatory field {partnerRefundNo}. Exceed Maximum 64 Characters.
  • Invalid Mandatory Field + {error message}
Mark Auth refund process to Failed. Retry request with proper parameter
40169004016900Unauthorized.{error message}Mark Auth refund process to Failed. Retry request with proper parameter
40169014016901Invalid TokenMark Auth refund process to Failed. Retry request with proper parameter
40369004036900Transaction ExpiredMark Auth refund process to Failed. Consult to Shopeepay about refund validity days
40369014036901Feature not allowedMark Auth refund process to Failed. Contact Shopeepay to check merchant/store supported product flow
40369064036906Feature Not Allowed. Service Is Temporarily Down For Scheduled MaintenanceMark Auth refund process to Failed. Retry request periodically or consult to Shopeepay
40369144036914Insufficient FundsMark Auth refund process to Failed. Retry request periodically or consult to Shopeepay
40369154036915
  • Transaction not permitted. An ongoing refund for this payment exists
  • Transaction not permitted. Mismatch Merchant/Store
  • Transaction not permitted. Original transaction not successful
  • Transaction not permitted. Request to refund does not meet rules
  • Transaction not permitted. Cannot refund payment with voucher
  • Transaction not permitted. Credit wallet balance exceeded
Mark Auth refund process to Failed. Retry request with proper parameter or consult to Shopeepay
40469014046901Transaction not foundMark Auth refund process to Failed. Retry request with proper parameter
40469084046908
  • Invalid merchant. Status Is Not Active
  • Invalid fieldName
  • Invalid Store. Status Is Not Active
Mark Auth refund process to Failed. Contact Shopeepay to check merchant/store status
40469134046913
  • Invalid amount. Mismatch refund amount
  • Invalid amount. Non-positive amount is not allowed
  • Invalid amount. Refund amount exceed transaction
  • Invalid amount
Mark Auth refund process to Failed. Retry request with proper parameter or consult to Shopeepay
40469154046915Transaction not permittedMark Auth refund process to Failed. Retry request with proper parameter
40469184046918Inconsistent RequestMark Auth refund process to Failed. Retry request with proper parameter
40569014056901Requested Operation Is Not AllowedMark Auth refund process to Failed. Retry request with proper parameter
40969004096900ConflictMark Auth refund process to Pending. Retry request periodically or request "Check Auth Refund Status" periodically to get final status
50069005006900General ErrorMark Auth refund process to Pending. Retry request periodically or request "Check Auth Refund Status" periodically to get final status
50069015006901Internal Server ErrorMark Auth refund process to Pending. Retry request periodically or request "Check Auth Refund Status" periodically to get final status
50469005046900TimeoutMark Auth refund process to Pending. Retry request periodically or request "Check Auth Refund Status" periodically to get final status