question

Prasad avatar image
Prasad asked Prasad commented

Order Updation on sand box resulting error Order ID in body does not match URI

HI Guys ,

i have created an order with status "open" which is reflecting in orders table . i need to close the order after Payment . which demands to make another PUT call with basic payload :-

{
        "order": {
            "id": "X87MCDE5GWDM9"
          },
         "state":"close" /// or lock 
    }

as per the above payload the order id itself is the URI . But on PUT call leading to an error

{
  "message": "Order ID in body does not match URI"
}

can any one help me to find the URI (Uniform resource Identifier) ?

Regrads , Prasad.

Orders
3 comments
10 |2000

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

Miguel avatar image Miguel commented ·

Which endpoint are you using to update the order? If you add the payment to the order, it should automatically lock the order.

0 Likes 0 ·
Prasad avatar image Prasad commented ·

HI Miguel Actually i created a payment with result Success but it is not locking the order . Let me show you the response of payment http://www.jsoneditoronline.org/?id=f... . Used PUT Method with api :- /v3/merchants/{mId}/orders/{orderId}. So iam trying to lock the order by updating , After Payment success it is not showing the amount in Order Total .Just showing it as Paid . could you answer for this queries as answers where i can accept . Thanks .

0 Likes 0 ·
Miguel avatar image Miguel commented ·

When creating a payment, you should use the following endpoint: https://apisandbox.dev.clover.com/v3/merchants/{mId}/orders/{orderId}/payments

The body should look something like this:

{
  "amount":"100",
  "tender":{
    "id":"XEH7M12RHCY6M"
  }
}

For tender ID, you can find your tender IDs by using the following endpoint /v3/merchants/{mId}/tenders

I just tried, and my order now shows as "PAID" on the clover device, and 'locked' when I access via the REST endpoint. It took a few seconds to update.

0 Likes 0 ·

0 Answers

Welcome to the
Clover Developer Community