Happy Business Starts Here

Can't create payment via REST endpoint (ProxyPostPayment)


Can't create payment via REST endpoint (ProxyPostPayment)

PaymentsApi paymentsApi = new PaymentsApi(apiClient);
ProxyCreatePayment paymentRequest = new ProxyCreatePayment();
.comment("test comment");

Sending this as request returns io.swagger.client.ApiException: Bad Request 

As per the documentation, setting currency is a required parameter, but ProxyCreatePayment  does not support this. Is there a workaround or any other way to create a payment?

Zuora Documentation

Re: Can't create payment via REST endpoint (ProxyPostPayment)

According to my investigation, I think the cause of this issue is probably that you used the wrong field names for ProxyPostPayment. The "accountId" and "paymentMethodId" fields are only for the Create Payment operation, not for ProxyPostPayment (CRUD: Create Payment). Thus, you can try to change the "accoundId" to AccountId, and "paymentMethodId" to PaymentMethodId in your code snippet. 


Hope it helps.