Before Create Payment, you can see cost and Type for the beneficiary
Endpoints
GET /api/Payment/GetCostListDelivery
Request
URI Parameters
Name | Type | Additional information |
---|---|---|
beneficeryId | globally unique identifier | Beneficiary id from beneficiaries list |
Response
Name | Type | Additional information |
---|---|---|
CostList | Pair of string [key] and decimal number [value] | The Cost chosen |
Example Request
public async Task<object> GetCostListDelivery(string access_token, Guid beneficeryId)
{
using (var client = new HttpClient())
{
try
{
ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12 | SecurityProtocolType.Tls11 | SecurityProtocolType.Tls;
client.DefaultRequestHeaders.Authorization =
new AuthenticationHeaderValue("Bearer", access_token);
var queryParameters = new Dictionary<string, string>
{
{ "beneficeryId", beneficeryId.ToString() },
};
var dictFormUrlEncoded = new FormUrlEncodedContent(queryParameters);
var queryString = await dictFormUrlEncoded.ReadAsStringAsync();
var url = root + "/api/Payment/GetCostListDelivery";
HttpResponseMessage response = await client.GetAsync(url + $"?{queryString}");
if (response.IsSuccessStatusCode)
{
string result = await response.Content.ReadAsStringAsync();
JArray jsonArray = JArray.Parse(result);
return jsonArray;
}
else return response.StatusCode;
}
catch (Exception e)
{
return "Exception: " + e.Message;
}
}
}
Example Response
[
{
"Key": "Regular",
"Value": 0.0
},
{
"Key": "Our",
"Value": 15.0
}
]