Update:--- Code provided which fixes an issue on the graph which was preventing the API from allowing me to create.
public class CustomerPaymentMethodMaint_Extension:PXGraphExtension<CustomerPaymentMethodMaint>
{
#region Event Handlers
protected virtual void CustomerPaymentMethodDetail_RowSelected(PXCache cache, PXRowSelectedEventArgs e, PXRowSelected del)
{
if (del != null)
{
del(cache, e);
}
if (Base.IsContractBasedAPI)
{
CustomerPaymentMethodDetail row = (CustomerPaymentMethodDetail)e.Row;
PXDefaultAttribute.SetPersistingCheck<CustomerPaymentMethodDetail.value>(cache, row, PXPersistingCheck.Nothing);
}
}
#endregion
}
For the life of me, I cannot figure out what Acumatica is expecting me to send to it to either retrieve or create a customer payment method using the Rest API. It would be greatly appreciated if you could point me in the right direction. The examples we are given are very basic and don't seem to cover any scenarios such as this.
I would assume it would be retrieved using the standard "Retrieval of a Record by Key Fields" as described in the help section.
I have tried using all of the below url structures and it either gives me an "Operation is not valud due to the current state of the object" error, or "More than one entity satisfies the condition".
/entity/Default/6.00.001/CustomerPaymentMethod/{BAccountID}/{PMInstanceID}
/entity/Default/6.00.001/CustomerPaymentMethod/{AcctCD}/{PMInstanceID}
/entity/Default/6.00.001/CustomerPaymentMethod/{BAccountID}
/entity/Default/6.00.001/CustomerPaymentMethod/{PMInstanceID}
/entity/Default/6.00.001/CustomerPaymentMethod/{AcctCD}
While trying to create a payment method I tried using a "PUT" to the CustomerPaymentMethod endpoint with the following json Body (I also tried using the soap friendly names of these fields instead of the label thats in the UI "CCDNUM","CVV","EXPDATE","NAMEONCC"). The error I get returned to me is that "Value" cannot be empty.
{
"CustomerID" : { value: "0000467" },
"PaymentMethod" : { value: "CC" },
"CustomerPaymentMethodDetail" : [
{
"Description" : { value : "Card Number" },
"Value" : { value : "4111111111111111" },
},
{
"Description" : { value : "Expiration Date" },
"Value" : { value : "102020" },
},
{
"Description" : { value : "Name on the Card" },
"Value" : { value : "Test API" },
}
]
}