1. Payment ID
Refund Service with Payment ID (PaymentId)
Refund with Payment ID
POST {{Private Base Address}}/api/paywall/private/refund/by/paymentid
It is sufficient to send a request to the address provided above. You can use the “Base Address” as needed for both the test and live environments.
apikeyprivate
string
Yes
The Private Key obtained from the merchant panel.
apiclientprivate
string
Yes
The Private Client obtained from the merchant panel.
The parameters to be sent to the service are as follows:
Date
date
Yes
The date when the payment was made.
PaymentId
int
Yes
This is the value contained in the PaymentId parameter within the response object returned by Paywall after the payment initiation.
MarketPlace:DeleteExistingRecords
bool
No
Within the scope of the marketplace, if the earnings approval for the relevant payment is granted, this parameter must be sent as true. When sent as true, existing earnings will be deleted after the cancellation request is successfully completed.
CompletePartialRefund
bool
No
If a partial refund has already been made for the relevant payment, the refunded amount is deducted from the main amount, and the refund process is completed with another partial refund request for the remaining amount.
{
"Date": "2023-02-07",
"PaymentId": 84753984783,
"CompletePartialRefund": false,
"MarketPlace": { // nullable
"DeleteExistingRecords": false
}
}using System;
using System.Net.Http;
using System.Text;
using System.Threading.Tasks;
using Newtonsoft.Json;
public class Program
{
private static readonly HttpClient client = new HttpClient();
private static async Task Main()
{
var data = new
{
Date = "2023-02-07",
MerchantUniqueCode = "AA90T0SD0ASF99"
};
var content = new StringContent(JsonConvert.SerializeObject(data), Encoding.UTF8, "application/json");
content.Headers.Add("apikeyprivate", "%PRIVATEKEY%");
content.Headers.Add("apiclientprivate", "%PRIVATECLIENT%");
var response = await client.PostAsync("{{Private Base Address}}/api/paywall/private/refund", content);
var responseString = await response.Content.ReadAsStringAsync();
Console.WriteLine(responseString);
}
}Response returned from the service:
Body
object
Optional JSON containing payment details.
ErrorCode
int
Error code. Returns “0” if the operation is successful.
Result
bool
Returns a true or false value. Returns “true” if the operation is successful.
Message
string
If the operation fails, this is the message describing the error; it provides language support based on the locale parameter.
Last updated