Before payment you need to create a quote with Beneficiary id from beneficiaries list.
Endpoint
GET /api/Payment/GetQuoteByBeneficiery
Request
URI Parameters
Name | Type | Additional information |
---|---|---|
beneficieryId | globally unique identifier | Beneficiary id from beneficiaries list |
Currency | string | The currency you want to be charge |
Amount | decimal number | The amount you want to send it's depended on beneficiary currency |
doSave | boolean | Choose false if you just want to see the details without save the quote |
Response
Name | Type | Additional information |
---|---|---|
QuoteId | globally unique identifier | None. |
Spot | decimal number | None. |
Charge | string | Charge amount from your wallet |
Send | string | Send amount to beneficiary |
CostList | Collection of Pair of string [key] and decimal number [value] | Show list of cost that you need to update in other call |
NecessaryFiles | Collection of string | Show need of necessary files that you need to upload |
Example Request
public async Task<object> GetQuoteByBeneficiery(string access_token, Guid beneficieryId, string currency, decimal amount, bool doSave)
{
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>
{
{ "beneficieryId", beneficieryId.ToString() },
{ "currency", currency},
{ "amount", amount.ToString()},
{ "doSave", doSave.ToString()}
};
var dictFormUrlEncoded = new FormUrlEncodedContent(queryParameters);
var queryString = await dictFormUrlEncoded.ReadAsStringAsync();
var url = root + "/api/Payment/GetQuoteByBeneficiery";
HttpResponseMessage response = await client.GetAsync(url + $"?{queryString}");
if (response.IsSuccessStatusCode)
{
string result = await response.Content.ReadAsStringAsync();
JObject jObject = JObject.Parse(result);
return jObject;
}
else return response.StatusCode;
}
catch (Exception e)
{
return "Exception: " + e.Message;
}
}
}
Example Response
{
"QuoteId": "48e5f91f-98dc-4588-a243-df8b7482ec53",
"Spot": 3.48773,
"Charge": "174.39 ILS",
"Send": "50 CHF",
"CostList": [
{
"Key": "1 - Regular",
"Value": 0.0
},
{
"Key": "2 - Our",
"Value": 83.02
}
],
"NecessaryFiles": [
"Sign File Needed.",
"Upload a transaction invoice file."
]
}