I’m having an issue using the Square Orders API with the Online Checkout links. We have a flow where a customer will pay using the link, and will then be directed to our website via the “Send buyers to your site after purchase” option to fill out an additional form. This sends the customer to our site with a
transactionId query parameter which I can then use with the Orders API (as in
GET https://connect.squareup.com/v2/orders/[transactionId]) to get the transaction on our custom backend. I would like to use this to link the customer information (phone number, email, etc) to the information the user fills out on our custom form. The Orders API documentation says that there should be a
customer_id field in the response body, but sometimes it’s not there.
Does anyone know why that is? And if it’s not there, where can I go to get the associated customer? I can see the customer in the Square Dashboard, so I know the relation exists.
I also found this topic where it was suggested to use the deprecated
RetrieveTransaction API, but this didn’t work either. I copied the location ID from the response body of the order to create an API endpoint like
https://connect.squareup.com/v2/locations/[location]/transactions/[original-transaction-id] but this gave me a 404.