2. Paywall Transaction ID
Partial Refund Service with Paywall Transaction ID (UniqueCode)
Partial Refund
POST {{Private Base Address}}/api/paywall/private/refund/partial/by/uniquecode
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:
UniqueCode
Guid
Yes
This is the value contained in the UniqueCode parameter within the response object returned by Paywall after the payment initiation.
Date
Date
Yes
Transaction date.
Amount
Decimal
Yes
Amount to be refunded.
{
"Date": "2024-06-13",
"UniqueCode": "0000-0000-0000-0000-0000",
"Amount": 101.5,
"MarketPlace": {
"ProviderCommissionUpdate": true,
"Platform": {
"Decrease": true,
"DecreaseAmount": 101.5
},
"Member": {
"Decrease": false,
"DecreaseAmount": null
}
}
}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-01-23",
MerchantUniqueCode = "12222a222a",
Amount = 70
};
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/partial", content);
var responseString = await response.Content.ReadAsStringAsync();
Console.WriteLine(responseString);
}
}Response returned from the service:
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