I am trying to release a payment using rest api
- I Created invoice by calling put request and was successful and get the reference Nbr
- I called release payment object
Payment soPaymentToBeReleased = new Payment
{
Type = new StringValue { Value = type },
ReferenceNbr = new StringValue { Value = paymentRefNo }
};
created release object
var releasePayment = new Models.AcumaticaModels.Actions.ReleasePayment(soPaymentToBeReleased);
then I called post request
var token = await acumaticaTokenHelper.GetAccessToken();
using var httpClientPost = new HttpClient();
var requestMessage = new HttpRequestMessage(HttpMethod.Post, "https://acctqa.nabp.pharmacy/entity/NABPR2/24.200.001/Payment/ReleasePayment");
requestMessage.Headers.Add("Accept", "application/json");
requestMessage.Headers.Add("Authorization", $"Bearer {token.AccessToken}");
requestMessage.Headers.Add("PX-CbApiBranch", branch);
requestMessage.Content = new StringContent(JsonConvert.SerializeObject(soPaymentToBeReleased ), null, "application/json");
var response = await httpClientPost.SendAsync(requestMessage);
response.EnsureSuccessStatusCode();
then I receive 400 http code error with message:
The Entity field is required.
any help would be appreciated