question

Ajmal M A avatar image
Ajmal M A asked Ajmal M A commented

ClientException: cannot update one or more of these fields When adding the order state

When I create the order with order status ( order.setState("paid") ) in using android sdk the following error occures :

com.clover.sdk.v1.ClientException: cannot update one or more of these fields: Order{json='{"state":"paid","title":"","note":"#order-confirmed 11\/15\/2016 08:33 AM Delivery to: Test Test,26 lois ln, 19525"}', bundle=null, changeLog=null}

Please help me to solve this problem. I want to create an order with Paid status.

Orders
10 |2000 characters needed characters left characters exceeded

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

1 Answer

Miguel avatar image
Miguel Deactivated answered Ajmal M A commented

It looks like setState can only be used internally by Clover apps. 3rd party developers aren't able to set the state using this method.

Thanks, Miguel

6 comments
10 |2000 characters needed characters left characters exceeded

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

So from my app I cant able create an order with payment details and make the status paid programatically. Is that right?

0 Likes 0 ·

You need to apply some payment to show the status as paid. I'm able to set it as paid with our rest API v3/merchant/{mId}/order/{orderId}/payments and using the the external payment tender Id. I'm still investigating if there's a equivalent for the Android SDK.

0 Likes 0 ·

Hi Miguel, i checked the Rest API doc. It specifies Create a payment record on an order using [POST /v3/merchants/{mId}/orders/{orderId}/payments]. Can you specify the required parameters for this API. Documentation shows every parameter as optional. How can i specify external payment tender Id? Also please show me your request sample JSON which able to set it as paid. When i try it always goes to Partially paid status. Thank You.

0 Likes 0 ·

Endpoint https://apisandbox.dev.clover.com/v3/merchants/{mid}/orders/{order_id}/payments

Below is the required params.

{
"tender": {
"id": "G9G2QQTB0DHR4"
},
"amount": 4100
}

You will need to find the tender id using this API request: https://apisandbox.dev.clover.com/v3/merchants/{mid}/tenders

As long as your amount is greater than the order amount, order will be updated to 'paid' status.

0 Likes 0 ·

Thanks Sam. This Helped.Can I able to make the credit card as tender instead of External payment.? Now when i choose credit card as tender it shows permission error.

0 Likes 0 ·
Show more comments

Welcome to the
Clover Developer Community