2 apps one Square account

Hi,
I have a square account and a developer account. I have an app that I developed for my business. Now I have developed a 2nd app for the same business. The second app is in the same developer account but has a different app Id, access token and webhook signature key. The 2 apps have 2 different websites on 2 different webservers and so have different webhook urls. The problem is that I can’t seem to use the second app. Even if I use the appId, access token and webhook signature of the second app the data seems to go only to the first app. For example square sends the webhooks to the first web server and not the second. Is there some way to tell the square system to use the second app and not the first? I would have thought using all 3 different credentials would have been enough to achieve this. Is there some way to link or unlink apps?

:wave: Could you provide the application_id for the two apps you configured webhooks to?

Hi Brian,

application_id for app1: sq0idp-7H7yIReJF-yZx3SOoCBnYw

application_id for app2: sq0idp-xikX7cnH-tSB59hpB-AoSA

Thank you.

Looks like sq0idp-7H7yIReJF-yZx3SOoCBnYw is the only application that is subscribed to receive webhooks. Is there a reason that you are subscribing to the deprecated v1 webhooks instead of our v2 webhooks?

Yes. There are a few reasons.
We started with Square using Square POS where we could give each driver an employee_id.
Then we upgraded to ReaderSDK which was much better because it was a fully integrated application rather than 2 separate applications. There was an issue however because we could not attribute an in-person payment to a particular employee_id. So we used the note field to record which driver took the payment.
With the v2 payment webhook there is no employee_id and no note field so we now have no way of knowing which driver took the payment. This is important because this determines how much each driver will be paid the following day.
The other issue is that there is no receipt_url either which we used to print out customer receipts on a mobile printer. So now we will not be able to print out customer receipts for those that want that and also I don’t think it includes cash payments now either.
I would like to request that the v2 webhook for payments includes a note field, receipt url and is sent for cash payments as well.
Also I don’t think the v2 webhooks is sending webhook data to the second application either after doing some testing today.

Actually I think I can get the payment information I requested by sending a request to the Payments API after receiving the v2 payment.created webhook.

GET /v2/payments/{payment_id}

Now that the Payments API returns all payments including cash it will have all the information that you are looking for. We’re constantly working to improve our features based on feedback like this, so I’ll be sure to share your request to the API product team. :slightly_smiling_face:

Hi Bryan,

I am now updating to use v2 payment webhooks. It is now sending the webhooks correctly to app2 so that issue is now resolved. Thank you for this. I am receiving the payment.created webhook and then sending a request to the Payment API (php) to get the additional payment information.

$api_response = $client->getPaymentsApi()->getPayment($paymentId);
if ($api_response->isSuccess()) {
$result = $api_response->getResult();

It is all working as it should and storing the info in the database correctly except I don’t seem to be able to get the note field.

$notes = $result->getPayment()->getNote();

gives me nothing every time despite the fact that all payments tested have a note. Am I missing something?

I just did a further test using the Square API Explorer online.

Get payment

GET /v2/payments/{payment_id}

It returned the payment information correctly but there was no note field?

Glad to hear that you were easily able to move to the v2 webhooks. Do you have the payment_id that doesn’t have the note?

Yes. Recent Payment Ids:

pEeT0E9eZuHMq65tt5vxNePEvaB
T1G8oxQD0AEZC4RuF7zU4IAevaB
bta1yxPL6WtZRUhBILJSCQYruaB
1UH9iZLALyc3kbANJLLZ1rfbuaB
RytWZWEgZhCtTpDXEVBoz22ZvaB
XprA9GjrgT8bTGpg1VoSKTLmuaB
z3T6I27bA9MnDVFGsnUy23WvvaB