Happy Business Starts Here

Highlighted
Tutor

Can't create payment via REST endpoint (ProxyPostPayment)

PaymentsApi paymentsApi = new PaymentsApi(apiClient);
ProxyCreatePayment paymentRequest = new ProxyCreatePayment();
paymentRequest.accountId(accountId)
.amount(1000.00)
.comment("test comment");
paymentRequest.setPaymentMethodId(paymentMethodId);

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?

1 REPLY 1
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.