Transaction Data from clientTransactionId

Hello everyone,

We are in the process of implementing POS API into one of our apps.
Our app is built using capacitor and another developer has built a plugin that seems to work great so far.

My question is: How can I get transaction details from the clientTransactionId that is provided with the chargeRequest.Success callback?

I’ve tried using the Retreive Order API but i’m getting the following error:

"code": "NOT_FOUND",
      "detail": "Order not found for id c8b055f4-9b0c-4af7-9c31-xxxxxxxxxxxx",
      "category": "INVALID_REQUEST_ERROR"

Any help is much appreciated :slight_smile:

:wave: Sometimes there can be a slight delay when a payment is taken and the order is retrievable with the APIs. If you retry the request it’ll return the order. We recommend putting in a retry method when this happens with payments. :slightly_smiling_face:

Does that order_id look correct though? Because I’ve been trying minutes after the transaction is complete.

I’m not calling the retreiveOrder, through code, right after the transaction is complete, I’m just using the API explorer to see if it would work.

That looks more like the client_id. Was that for a cash payment? What was the full response you got back from Square?

Yes it was for a cash payment. We are just hoping to be able to connect any transaction with our order ID. So even it is a cash payment, it would be nice to be able to relate our order number to a certain cash transaction.

Is there another/better way of doing that?

This is the code for the Capacitor Plugin, I’m not a java developer but it looks like whatever response is given from Square is just sent to Js success event listener.

I just tried a manual credit card entry and i’m getting a response with a similar clientTrans

Yeah, that’s definitely the client_id. Are you able to have the plugin return the transactionId in the response? That’s what you’ll want if it’s available. Please note that it’s not always available in the response. When it’s not available at this time you’ll need to use ListTransactions and parse the results for a matching client_id. :slightly_smiling_face:

Okay, yeah that works.

I will ask the plugin developer about adding the transactionId, I’m not familiar at all with Java

Looks like the transactions api is depreciated, is there a different api that will give us a similar response?

Great! At this time there isn’t currently a replacement for finding the client_id with our APIs. :slightly_smiling_face: