12. Cancel & Refund
The Cancel & Refund service ensures that both cancellation and refund operations can be managed simultaneously.
Cancel & Refund
POST
{{Private Base Address}}/api/paywall/private/revert
You should replace the address above with your actual environment URL. You can use a specific 'Base Address' for both test and production environments.
The Cancel & Refund service checks the date the payment was made after receiving the request and proceeds according to the following flows:
If the request was sent on the same day the payment was made, a cancellation is processed.
If the request was sent on a different day than the payment date, a refund is processed. a. If the Amount value specified in the request is not zero and differs from the transaction amount, a partial refund is processed.
apikeyprivate
string
Yes
Your Private Key obtained from the merchant panel.
apiclientprivate
string
Yes
Your Private Client obtained from the merchant panel.
Parameters to be sent to the service:
UniqueCode
Guid
Yes
The UniqueCode returned in the API response after the payment initiation from Paywall. This information must be stored on your side.
MerchantUniqueCode
string
Yes
This code must match the MerchantUniqueCode in the request used for payment initiation. It is a unique identifier for your transaction. It should be used to trigger and track the transaction in all Cancel/Refund/Query operations.
Amount
decimal
No
If the Amount parameter is sent as 0, the transaction is processed for the full amount. If an Amount different from the original is sent, the transaction is processed as a Partial Refund.
MarketPlace:DeleteExistingRecords
bool
No
In the context of a marketplace, if the payout approval has been granted for the relevant payment, this parameter must be sent as true. If sent as true, existing payouts will be deleted after the cancellation request is successfully processed.
{
"UniqueCode": "1111-1111-1111-1111", // Ödeme sonucunda Paywall'dan dönmektedir
"MerchantUniqueCode": "ABCD-EFGH-JKLP-MNBV",
"Amount": 0,
"MarketPlace": { // nullable
"DeleteExistingRecords": false
}
}
Response from the service:
ErrorCode
int
Error code. Returns a value of '0' if the operation is successful.
Result
bool
Returns either a true or false value. If the operation is successful, it returns true.
Message
string
If the operation fails, this is the message indicating the error. It provides language support based on the locale parameter.
{
"ErrorCode": 0,
"Result": true,
"Message": "Success",
"Body": null
}
Last updated