Square v2 API - Questions on filtering - square-connect

When we wrote or initial integration for Square v1 API, there wasn't an option to filter ListOrders by Date
Our questions for v2 api:
In v2, looks like all transactions are housed under the same endpoint.
Okay, we call GET /transactions
How do we tell what is an order vs. payment vs. refund in the response?
not all payments are generated off an order. For example, I can do one-off Square transactions on my phone for walk-up customers, which would not have an order associated with it)
Can we filter for orders only?
Does the Transaction endpoint supports date filtering now?
Thank you for your time

Take a look at the documentation for the v2 Transaction object. Refunds and orders are subsets of that object.
Also look at the documentation for the List Transactions where you can see that you can currently filter based on times only right now.
If it isn't listed in the documentation, then it probably isn't supported.

Related

Is it possible to link transaction line items to sale transaction in Square pos API

I understand that the Square POS API does not currently support the ability for an external app to pass itemized line items when calling Square to process the payment. Is there a way for the external app to associate the itemized details with the completed sale transaction in Square via an API after the payment is completed and square returns control to the external app?
Are there specific plans to provide support for itemized transactions within the POS API?
There's no way to formally do this currently, and there's no current timeline or guarantee that it will be released for the POS API.
It's possible to link it via the Orders API in a workaround. Basically, prior to initializing the transaction, you would call CreateOrder with the items in the order. The response would give you an Order object, which you can retrieve the order_id from. Then, you can pass in the order_id into the notes field when creating the POS API request. This would allow you to at least look up the itemization later on (by utilizing BatchRetrieveOrders) for each of the POS API transactions.
Furthermore, if you are going further and utilizing your own database, then you wouldn't even need to pass in the order_id to the note field, as you could just link the order_id and transaction_id in your own database for easy lookup later.
References:
https://docs.connect.squareup.com/more-apis/orders/overview
https://docs.connect.squareup.com/api/connect/v2#navsection-orders

Ads Actions Stats purchase and other values

I want to fetch keys from facebook using their graph Api. Currently i am being able to fetch keys that were pretty straightforward in graph api console like frequency , reach etc. Keys like purchase, Adds to cart are not available in the graph api console and their documentation isnt very explanatory. Most of these keys are not returning any value in facebook's ads manager as well.
It would be really helpful if anyone can explain:
When these metrics will be available ?
I have seen a tool qwaya and it copies all the columns that facebook provides. How are they doing it ?
What actions are to be performed on my ad so i can see any changes in
those values ( PURCHASE , ADDS TO CART etc )
Another side note : I was using facebook-ads-sdk but now they have changed its name to business-sdk

How to identify Voids and Comp transaction?

I am using GET /v1/{location_id}/payments to list all payments.
I am not able to identify Voids/Comps transaction from the list. Also how to get total number of Items Comped/Voided along with amount and reason using API?
Comped and Voided transactions are not currently identifiable via API.

square-connect v2 - how are sales metrics defined / calculated?

Is there somewhere in the square documentation where terms like "Gross Sales", "Net Sales", etc are defined precisely, along with how the taxes are calculated?
Looking at the sales reports it's totally unclear how these numbers are produced.
I've been trying to re-create the sales summary report with the /ListTransactions endpoint but it's impossible without this info.
Currently, the v2 ListTransactions endpoint does not break down transaction amounts in such a way that it's straightforward to recreate the Square dashboard's sales summary report. However, the v1 List Payments endpoint does. This section of the v1 documentation describes the monetary fields of a Payment object returned by v1.
Additionally, this PHP code sample demonstrates generating something very similar to the dashboard sales summary report using v1 endpoints. The sample is also available in a few other languages.

Possible to search for transactions by 'escrow_status' with Braintree API?

I'd like to search for transactions associated with my merchant_id, which have a certain escrow status. Something along these lines:
collection = braintree.Transaction.search(
braintree.TransactionSearch.escrow_status == 'hold_pending'
)
Is there a way to accomplish this?
Full disclosure: I work at Braintree. If you have any further questions, feel free to contact our support team.
Searching for transactions based on escrow_status is not supported by our api at this time. A workaround is to collect all transactions for a particular time period and manually filter these based on escrow status.

Resources