After creating a quote and upload all necessary files and cost data you can create the payment.
Endpoint
POST /api/Payment/AddPayment
Request
URI Parameters
Name | Type | Additional information |
---|---|---|
quoteId | globally unique identifier | Quote Id from "Create Quote Response" |
Response
Name | Type | Additional information |
---|---|---|
Payment | object | Payment object with all payment data |
Errors | object array[] | Show errors list if the payment failed |
Status | string | Show status of request |
Example Request
public async Task<object> AddPayment(string access_token, Guid quoteId)
{
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>
{
{ "quoteId", quoteId.ToString() },
};
var dictFormUrlEncoded = new FormUrlEncodedContent(queryParameters);
var queryString = await dictFormUrlEncoded.ReadAsStringAsync();
var url = root + "/api/Payment/AddPayment";
var response = client.PostAsync(url + $"?{queryString}", null).Result;
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
{
"Errors": [],
"Status": "Succsess Create Payment"
}