Checkout API and Location ID

When I use the API to generate a Checkout link -

Everything works nicely - ie it generates the link - HOWEVER the Location ID specified does not seem to be respected. I have 2 locations (one is fixed and one is mobile van) both are defined in my Square account… But no matter which one I use in the API call - it always returns the SAME one. When I click through on the generated link - the very top line (like a title) - is the location. However, no mater which of my 2 Location IDs are used in the API call - it always returns the same location as the title of the checkout-payment link

Does anyone know about this ??? Is it a bug ? IS there a different way to use it ?

What’s the application Id that your using to generate the checkout links? :slightly_smiling_face:

“application ID” ?

That is not one of the parameters needed to run it from the explorer:

Right, it isn’t required when making a request to this API however it’s the unique identifier for the application you’re using. I’m requesting this so I can look at the logs for the application to try and troubleshoot your issue. :slightly_smiling_face:

1 Like

Hi Bryan,

Thanks for replying :pray:t2::blush: I hope we can get to bottom of this. I just never saw that “application-id” in any of the calls we have used. The short answer to your question is - I don’t know, probably none (ie no application-id) , if none is a valid answer.

I am not trying to be evasive here, but all I am doing is - using the “Square API explorer”. Does the API-explorer have an Application-ID ? If it does what is it ? I don’t know :man_shrugging:t2:

Before we go ahead and pay a software-developer, we like to proof-of-concept that the API calls will work in the right sequence, with the info that we have available, processing the payments and creating links how we like to have them – so I don’t think we have any Application-ID yet. I guess that would happen after we go ahead to the next step and start creating an application. But that not likely to happen if we cannot get the API to work with each of our 2 locations (when they are correctly specified in the call).

Is there some other data-point with which you can search the logs to find the calls I made ? Like time stamp ? my account name ? - security token ? … I take it that you already tried to reproduce the problem - but could not do that ?

The application ID can be found in your Developer Dashboard. If you click on the app you created you’ll be shown the application ID. Otherwise what’s the location_id you’re using in the request? :slightly_smiling_face:

1 Like

So that explains the confusion about Application ID :blush: As mentioned - am running it from the Square API Explorer, and have not “created any app” as such.

In order to run these calls from the API Explorer “creating credentials” is required to get an Access Token , that token shows an Application ID: sq0idp-RVvrUmYm--8YLo1QHgktdA perhaps that is the one you mean ?

The 2 location IDs that I have used in these calls are:
"location_id": "LM3BVVGN3PVYB"
"location_id": "LKEJS0WJG0NSP"

Looking through the API Logs I’m not seeing anything that’s jumping out. All the request look good. Do you have a checkout_id that didn’t go to the right location? :slightly_smiling_face:

The problem is the TOP LINE (like a title) of the page shown in the generated link.
It is showing the Location name of the location_id: LM3BVVGN3PVYB irrespective of which location-id is sent as a parameter. I tried to describe that in my original post

Do you have the checkout_id or the actual link that was generated so we can look into the logs? :slightly_smiling_face:

1 Like

Here’s one payment link - for one location

Heres another payment link - for a DIFFERENT location

I do not see anything in the returned JSON that says checkout_id :man_shrugging:t2:

Did you mean payment_link id ?

"payment_link": {
    "id": "QG5TI4PXLDU2OZRL",

Sorry is 1am here - I cannot stay up any later tonight… In case it is the payment_link id, here is some data about that :blush::pray:t2:

{
  "payment_links": [
    {
      "id": "6H4EM6DLHIS7MDV7",
      "version": 1,
      "order_id": "lmNg0uQWbBNOtiZiDezSltX8jwQZY",
      "url": "https://square.link/u/GYCY74id",
      "created_at": "2022-10-05T16:50:12Z"
    },
    {
      "id": "QG5TI4PXLDU2OZRL",
      "version": 1,
      "order_id": "TdBSQW1iR6FHgSJ8VdDip6g60XbZY",
      "url": "https://square.link/u/COYm7lfB",
      "created_at": "2022-10-05T16:37:25Z"
    },
    {
      "id": "M5PSNFO6FMZYDDP6",
      "version": 1,
      "order_id": "DlxaC86UOHnfz57V2d9TeNj1ulUZY",
      "url": "https://square.link/u/zwQ8dgNF",
      "created_at": "2022-10-03T07:46:03Z"
    }
  ]
}

@Bryan-Square good morning :blush:
Did you have any more thoughts about this ?
Is it possible that the API is working without any error - however there is a bug in the API Explorer (which only picks up the first location-id , no matter what was specified )

I am curious to know if you have been able to reproduce this problem ?

According to the API Logs every payment link that was created has the same location_id that was passed in when they were created which is expected. :slightly_smiling_face:

The API did create every payment link with the same location_id - that is true.

However - a different location_id was passed in the API call each time. That is the whole problem that I have been describing since the original post… :roll_eyes:

As follows - note this is not “as expected” :

  1. When I create a payment link with "location_id": "LM3BVVGN3PVYB" it correctly creates it with "location_id": "LM3BVVGN3PVYB".

  2. However - when I create a payment link with "location_id": "LKEJS0WJG0NSP" it wrongly creates it with "location_id": "LM3BVVGN3PVYB".

Looking at your API Logs there are 11 calls to CreatePaymentLink in the last 28 days for location_id LKEJS0WJG0NSP. Every response from those calls have the correct location_id of LKEJS0WJG0NSP.

Do you have the API request from the API Logs that shows the location_id in the request doesn’t match the location_id in the API response? :slightly_smiling_face:

why are you telling me it is “correct” when I can see with my own eyes that is “not correct” ?
I only conclude that you are not understanding what I am saying precisely . Apologies if the english wording is not so clear. Please look at the heading … of the generated link page … and not the logs.