0

I'm trying to use the Square POS API to enable mobile payments in a web app. I'm able to trigger the Square POS app, charge a card/take cash, and receive the callback from Square.

My problem is the flow after that - here are the questions I have

  1. Here's the iOS callback response which includes a transaction Id. The docs say to use the Receive Transaction API to get information about the transaction. That API is deprecated :(. What is the new API to use? Neither the Payments API or the Orders API works. (BTW what's the diff between payments and transactions?)

  2. There's no information about the fields returned in the Android callback except "the Android Point of Sale app will return to your callback URL with the same parameters set in your URL." I need a transaction Id though.

Thanks!

Nick
  • 695
  • 8
  • 23

1 Answers1

1
  1. Currently, you still need to use Transactions API along with POS API. Even though it's deprecated, it's still guaranteed to work until September 1st, 2021. At a high level, transactions and payments are very similar. They both represent a monetary amount with the possibility of other linked objects (such as orders). The Payments API is a newer API that was built with more things in mind and what will be used for the future APIs.

  2. The transaction id for Android should be com.squareup.pos.SERVER_TRANSACTION_ID as a url parameter. See https://developer.squareup.com/docs/pos-api/build-mobile-web#step-4a-initialize-your-transaction-variables for more info. You're correct, though, it should be listed in the page you linked. I'll be sure to bring that up with our doc team, thanks for reporting.

sjosey
  • 1,360
  • 1
  • 6
  • 7
  • Awesome, this is really helpful sjosey. Thanks! – Nick Jan 03 '20 at 16:32
  • FYI, the callback is a GET, not a POST as mentioned here - https://developer.squareup.com/docs/pos-api/build-mobile-web#step-4-add-code-to-your-callback-file-to-process-the-transaction-response – Nick Jan 10 '20 at 01:15
  • I'm able to get the transaction information through the Orders API by sending in the transaction id as the order id - can I rely on this or is this not encouraged? – Nick Feb 07 '20 at 01:49
  • Hey Nick, glad you were able to figure that out! Yes, from here on out, `order_id` == `transaction_id`. Feel free to look up the order directly using the transaction id! However do note that some information may not match up (I think mainly `customer_id`), so you may still need to jump back to Transactions API in that case. – sjosey Feb 10 '20 at 16:46