Skip to main content

Cancel Payments API

Use Case

This API is used to cancel a specific transaction, the referenceId field in the request specifies the transaction of which should be canceled

If the transaction has already been paid or payment prosesing Fundiin will return the status code PAYMENT_ALREADY_COMPLETED, REQUEST_PROCESSING.

Request

POST/v2/payments/cancel

ParameterTypeRequiredDescription
merchantIdStringFundiin provides MID as a unique identifier to each merchant.
referenceIdStringThe reference id of the transaction you want to cancel.
langStringLanguage of returned message (vi or en)
descriptionStringDescription for the order.

Example Request

{
"merchantId": "Your merchant code",
"referenceId": "Your order number",
"lang": "vi",
"description": "description"
}

Response

ParameterTypeRequiredDescription
merchantIdStringFundiin provides MID as a unique identifier to each merchant.
referenceIdStringMerchant's Reference Id unique for every refund transaction
responseTimeStringDate & Time of response:
Format: YYYY-MM-DD hh:mm:ss
resultStatusStringResult Status
resultMsgStringThe result message which contains information about the result.
{
"merchantId": "FundiinVN",
"referenceId": "Your order number",
"responseTime": 1689315609,
"resultMsg": "Thành công",
"resultStatus": "APPROVED"
}

Result Status & Messages

Status codeDescriptionAction to take
APPROVEDCancel transaction was approved.Proceed with the cancellation process as it has been approved.
ACCESS_DENIEDAccess denied.Please check your settings in the merchant portal or contact Fundiin for configurations.
INVALID_REQUESTInvalid request. e.g., Invalid currency, invalid amount, etc.Ensure that the request parameters are correct and meet the API requirements.
INVALID_REFERENCE_IDThe referenceId is invalid.Please retry with a different referenceId.
PAYMENT_INPROGRESSCancel was declined because the transaction is still in progress.The payment transaction does not exist. Check the payment status manually.
PAYMENT_ALREADY_COMPLETEDCancel was declined because the transaction was already completed.Review the transaction status to ensure that it is not already completed before attempting cancellation.
INVALID_CLIENT_IDThe clientId is not registered.Make sure to use a valid and registered clientId for the request.
INVALID_SIGNATUREThe signature is invalid.Double-check the signature generation process to ensure its correctness.
INVALID_MERCHANT_IDThe merchant is not registered.Ensure that the merchant ID is correct and registered with Fundiin.
INVALID_HTTP_METHODThe server does not implement the requested HTTPS method.Use the correct HTTP method (e.g., GET, POST, etc.) when making the request.
INVALID_APIAPI is not defined.Check whether the request URL is correct. Ensure that the endpoint of the called API is correct.
REQUEST_PROCESSINGThe request has already been processed or is in progress.Monitor the transaction status or take appropriate action based on the current progress.
DOWNSTREAM_ERRORPartner downstream timeout. (Retriable)Retry the request later, as the error might be temporary due to partner-related issues.
ERROR_GENERALDeclined due to general reasons other than the specific decline error codes provided.Contact Fundiin support for assistance in identifying and resolving the general issue.