Tagging a CreatePayment request with a specific item in my square

Hi.
I have successfully been able to set up the createPayment handle in my server code and have charged myself a dollar to verify functionality. I however want to be able to add an item tag, so that when the charge goes through it shows up as a specific purchase for an item and not just a custom amount charge in my square dashboard/app. I looked through the object params and none of them allow me to do this. Not seeing anything in the documentation either. What is the recommended way for tagging purchases to items in the store, or adding a description to the purchase so when it shows up in the dashboard it can be tracked? Part of my business sells pantry products, the other part of my business hosts events and dinners and I want to be able to track ticket sales of each event individually in my metrics and not as all custom amounts. These are processed through my website and not through the dashboard.

Thanks

:wave: I’m Square Dev AI, here to help answer your question!
Based on the information you’ve provided, the following documentation will help answer your question:

Additional Documentation

Take a Cash Payment
Charge a Card on File
Add Custom Attributes

If this documentation helped you find a solution, please check the box indicating that this reply solves the problem.
Otherwise one of our Developer Advocates will provide additional assistance shortly.

To track purchases of specific items in your Square dashboard, you can use the Orders API in conjunction with the Payments API.

First, you create an order using the Orders API, where you specify the items being purchased. Each item in the order is represented by an OrderLineItem object, which includes details about the item such as its name, quantity, base price, and any price adjustments like discounts or taxes.

Once the order is created, you can then use the CreatePayment endpoint of the Payments API to pay for the order. In the CreatePayment request, you specify the order_id to attach the order to the payment.

This way, each payment is associated with a specific order, and the order contains the details of the items purchased. This information will then be reflected in your Square dashboard, allowing you to track sales of each item individually.

This answer was reviewed by @Bryan-Square.