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.

Note: In order to use the Cancel & Refund service, you must send the parameters apikeyprivate and apiclientprivate in the Header PaymentPrivateAPI Address

Parameter
Type
Compulsory
Description

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:

Parameter
Type
Compulsory
Description

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:

Parameter
Type
Description

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