Squarespace transactions

Hello!

I managed to use Squarespace API for orders and export to google sheet. I’d like to do the same with the Squarespace API for transactions but for some reason, I’m getting the “no result” error message.

The API endpoint URL I am using is: https://api.squarespace.com/1.0/commerce/transactions
and I made a specific API key in Squarespace for transactions that I entered in the Bearer Token field.

Any tips on how to make it work? Thanks :slight_smile:

Hey Gabrielle,

Can you try hitting the refresh button next to the name of the name of the step, after you open it up?

It looks like it should work.

Best,
Brian

Hi Brian,

I still get the “No data recieved” after refreshing the step.

Best,
Gabrielle

I took a deeper look on my end. Looks like a setting was stuck in some weird state. I cleared that up for you and you should be good to go now!

Just set the Max Pages to Fetch to the number of pages that you need to pull in! Keeping in mind that each page represents 50 transactions.

Indeed it’s working now! Many thanks :slight_smile:

4 Likes

Hummm the last data it’s able to fetch is from 2018-11-06T21:35:41.227Z despite increasing the number of pages to gather data from. Is this a transaction API thing versus the order API that can go back to 2016?

Hey Gabrielle - thanks for your patience.

I believe this API is pretty new, so it certainly could have a limitation on how far back it can pull.

Could you reach out to their team and ask that? I won’t be able to answer it, but I think it would be valuable for the community to know! Happy to help you answer any questions they have about how you are fetching the data.

Hi Brian,

Here is there reply:

Would you please be able to share the request you’re currently making when attempting to pull all transactions? My guess here is that if you are using the modifiedBefore and modifiedAfter parameters, it may be preventing you from pulling the dates you’re looking for. The reasoning behind this is that sometimes if a mass import or something similar has occurred, it will update the modification date to whenever that event happened. By leaving out those parameters, you should be able pull all transactions, regardless of modification date, and then sort by createdOn.

Is this what’s happening here?

Hmm as far as I can tell you are not using those parameters. Your request is as follows:

GET https://api.squarespace.com/1.0/commerce/transactions?nextPageCursor={pagination.nextPageUrl}

With pagination.nextPageUrl being replaced by the URL in that position in the prior response to page through all available pages. That parameter is omitted from the first call.

Here is Squarespace reply:

Our accounting database and service were both established in 2018, so there are no guarantees for accounting data in our system prior to 01-01-2018. Since the accounting database didn’t go live until Fall of 2018, any 2018 transactions prior to that date had to be backfilled. Whenever there is a backfill, the modifiedOn date of the transaction will be listed on the date when the transaction was backfilled, which is why you will see all 2018 transactions starting in mid-2018.

I’ve made a note to our team to add this information to our documentation.

In the meanwhile, you can always export your entire order history through the CMS by navigating to Orders --> Export.

2 Likes