Question

Extracting Transaction Data

  • 12 December 2023
  • 0 replies
  • 25 views

Hello,

Finally made some progress in getting my API request into the proper format and the data returned to work as well. The App I am integrating is a point of sale system.

The data that it returns is a JSON object with multiple transactions in it. Within each transaction there is some data at the top level of the transaction and then it contains SKUs or line items for each item purchased.

The data basically looks like the example below.

 

Transaction 1
Location ID - 12345
Date - 2023_12_12
Customer ID - 33333
  • Item 1 - $5.99
  • Item 2 - $7.99
  • Item 3 - $4.99
  • Item 4 - $3. 99
Transaction 2
Location ID - 12345
Date - 2023_12_12
Customer ID - 55555
  • Item 1 - $7.99
  • Item 2 - $4.99

My need is to get this into an output like the one below. We are taking this data and formatting it to push into a tax reporting software. We would need each SKU to become its own row, include details specific to that SKU and ALSO the info from the parent transaction.

Output
 
Transaction 1, Location - 12345, Date - 2023_12_12, Customer ID 3333, Item 1, 5.99
Transaction 1, Location - 12345, Date - 2023_12_12, Customer ID 3333, Item 2, 7.99
Transaction 1, Location - 12345, Date - 2023_12_12, Customer ID 3333, Item 3, 4.99
Transaction 1, Location - 12345, Date - 2023_12_12, Customer ID 3333, Item 4, 3.99
Transaction 2, Location - 12345, Date - 2023_12_12, Customer ID 5555, Item 1, 7.99
Transaction 2, Location - 12345, Date - 2023_12_12, Customer ID 5555, Item 2, 4.99
 
Locally, on my computer I can do this easily in python with a nested loop. I have no idea how to get this working in Zapier and I am losing my mind on this. I have tried to use Python code snips, loops, formatters, etc.
 
Any help would be greatly appreciated!
 
Thank you!
 
Brandon

This post has been closed for comments. Please create a new post if you need help or have a question about this topic.