question

globaliwebsite avatar image
globaliwebsite asked David Marginian Deactivated edited

Line Item not creating on live mode using REST API

Hello,


I am calling this end point to create new line item in existing order, I check the my code on debug mode the return status is OK however when I check my live dashboard of clover line item is not reflecting can you please check and advice.


https://clover.com/v3/merchants/<MID>/orders/<ORDERID>/line_items?access_token=<LIVE ACCESS Token>



this is the order number i am trying to create line item RXRQ42ZZ0N042

LineItems
10 |2000

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

David Marginian avatar image
David Marginian Deactivated answered

Developer using clover.com instead of the correct url api.clover.com - https://docs.clover.com/docs/making-rest-api-calls.

10 |2000

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

David Marginian avatar image
David Marginian Deactivated answered David Marginian Deactivated commented

In order to create a line item you need to POST data to that endpoint. There is not a single POST call to that endpoint in the last 5 days. It looks like you are doing GETs which are for retrieval.

8 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.

globaliwebsite avatar image globaliwebsite commented ·

Please check this is my post method I am using, the same code works well on sandbox its creating line item but its not creating reflecting line item on live the return response of the below post method is OK not error is coming


please advice me


if you want i can tell you merchant id and order id and I am using for your verification


                    
  1. string tokenUrl = String.Format("https://clover.com/v3/merchants/<MID>/orders/<OrderId>/line_items?access_token=<accesstoken>");
  2.  
  3. var client = new RestClient(tokenUrl);
  4.  
  5. var request = new RestRequest(Method.POST);
  6. request.AddHeader("content-type", "application/json");
  7. request.AddParameter("application/json", "{\"printed\":false,\"exchanged\":\"false\",\"refunded\":\"false\",\"refund\":{\"transactionInfo\":{\"isTokenBasedTx\":\"false\",\"emergencyFlag\":\"false\"}},\"isRevenue\":\"false\",\"name\":" + itemproductname + ",\"price\":" + price + ",\"unitQty\":" + qty + "}", ParameterType.RequestBody);
  8.                     IRestResponse response = client.Execute(request);
0 Likes 0 ·
David Marginian avatar image David Marginian ♦♦ globaliwebsite commented ·

I can see all requests made for that order, and they are all GET requests and the merchant is 20Y......TJ34. What merchant are you using for the POSTs (please provide this is a private/moderators only post)?

0 Likes 0 ·
globaliwebsite avatar image globaliwebsite David Marginian ♦♦ commented ·

Hello,


I verified my code I am using this merchant (20YJ....NTJ34) same as you mentioned above so my merchant is okay. Please advice me further


Can you just try to post one line item using the merchant id and order id I have mentioned above you can test that on live account its not creating line item and advice me please.

0 Likes 0 ·
Show more comments
globaliwebsite avatar image
globaliwebsite answered David Marginian Deactivated edited

Are you certain you have checked the response? I think you should be using api.clover.com NOT clover.com. If I try to use clover.com I get an error.



Okay the mistake was api.clover.com instead of clover.com


thanks

1 comment
10 |2000

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

David Marginian avatar image David Marginian ♦♦ commented ·

I am concerned why you thought you were getting a successful response. It is essential that you investigate that because if you don't even know if the call you made succeeded or not that is a serious problem.

0 Likes 0 ·

Welcome to the
Clover Developer Community