How to identify Voids and Comp transaction? - square-connect

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.

Related

Laravel payment multi subscriptions

I am working on a SAAS project where users can create various projects. With each project, they can choose from 5 different plans. Each plan has its own costs per month. Hotjar is a kind of equal concept.
Now I want to arrange the subscription with Stripe. The problem with that was that a user can have a maximum x subscription, which of course was a shame. Then I decided to take 1 subscription that has several plans. But now I have a dilemma, to update the subscription you have to change the number via SubscriptionItem. Then you have to save yourself which plan has which SubscriptionItem_id for which user. That is quite a detour and can cause many problems.
Someone is a better way with Stripe or another payment software.
You don't necessarily need to store the subscritpion_item IDs, you can look it up via the subscription_item list API. All you need to do is store the subscription_id for your customers, and based on that ID you can retrieve the list of subscription_items:
\Stripe\Stripe::setApiKey("sk_test_9GavlLpfiKewqeCBXvRvmVgd");
\Stripe\SubscriptionItem::all(["subscription" => "sub_EQlPGjVj4o5luH"]);
Then you can handle the data part of the returned JSON object and update / delete / etc these subscription items.
If you only have the customer_id handy, then you can use the subscription list API (with status as well on the GET params) to retrieve the list of active subscriptions.

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

Square v2 API - Questions on filtering

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.

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.

Square Connect API Chargebacks/Disputes

If a merchant experiences a dispute / chargeback, where does that appear in the Square Connect API? As a refund? As a negative payment? Is there another endpoint specifically for this event?
Thanks for pointing out this gap in the documentation. I've updated this answer with the definitive settlement entry type.
Events like chargebacks are reflected in the entries of Settlement objects returned by the List and Retrieve Settlement endpoints. All chargeback-related settlement entries have the type HOLD_ADJUSTMENT. These entries can indicate the placing of a hold on disputed funds, or the subsequent release of a hold if a chargeback is won by the merchant.
Chargebacks are not reflected in payment- or refund-related endpoints.

Resources