Order and pay for an item based on the SKU

Hi, I’m trying to restructure our payments for gift cards so that we can see a gift card category in the Square reports. Right now, I’m only sending a payment for the total amount.

I think to get the category, I have to create an order with a line item for a gift card item then after creating that order, send a payment.

My questions are:

  • Is there no way to shortcut this into 1 API request (order and pay for 1 item)?
  • Is there any way to use the SKU to create the line item? It’s always the same item for this transaction, and I don’t want to add yet another API request for every payment just to search in the catalog for an item with that SKU. Or is there any way to view the id I need for the line item from the Square dashboard?

Follow up question…

I manually found the item’s id by requesting the catalog list (not ideal again), and created an order and sent in a payment, but the sandbox doesn’t list the order in the Orders page though the transaction is shown on the transactions page and if I click through it shows the order fulfilled. But, it’s not associating that order amount with the line item category in the reports.

Transaction showing correct item:

Apparently I can only put one image in a post, so sorry for the multiple posts…

When clicking on the order link in the transaction:

Report not putting the $100 in the Gift Cards bucket:

EDIT: I just realized this is probably for gift cards within the Square ecosystem whereas ours is a product that we manually create vouchers for.

Only one Gift Card item with the Gift Card category set:

No orders shown (clarification: I don’t actually need to see the order in the UI, I was just looking for it for debugging purposes):

Though the item sales report does catch the category???

Is the sandbox just buggy?

Here’s the answer from Bryan-Square in the Slack chat:

:wave: , Yes, that can be confusing at times with gift cards. Unfortunately there isn’t a way to fast track order creation and payment processing in one call. Also a line item does need the variation_id which you will need to SearchCatalog to match the SKU with the variation_id.