Transaction by receipt number - api

I looked through the Squareup.com API v2 for a method to retrieve a transaction using the receipt number on the printed receipt (It is 4 characters) but I found nothing documented for this method.
Is this possible?
I know I can get the transaction details using transaction ID but that's not what I want.

No, you cannot query the API by receipt number at this time.
If you needed to look up by receipt number, you could keep a separate store of the receipts indexed by the receipt code, but that might be more trouble than it is worth.

The 4-digit receipt ID you are referring to is the same as the first four characters of the selected tender ID for the transaction. You could accomplish this by retrieving all transactions for the given location and searching the first four characters. You may need additional details, such as the payment total to guarantee against duplicates.

Related

Update draft invoice from API, Unbalanced exception

Our customers have a subscription on our services.
The subscription generates an draft invoice and one of the product on the draft I want to change the quantity off. This product quantity is different every month and our external software know this number.
What I’ve do through the API/XMLRPC.
We find the draft in the 'account.move' model then search the 'account.move.line' for our product. Then here we change the amount and we write the 'account.move.line' back.
Here we get an exception 'Cannot create unbalanced journal entry. <...>.'.
I can’t believe we have the recalculate all the financial values. Isn’t this something the API should do?

Shopify API get Total Returns/Refunds

I am trying to get the Net Sales of orders of our Shopify store on daily basis. I can do it with the Orders API, but there seems to be a mismatch for the refunds returned by the API and the refunds/returns that show up in the dashboard.
In fact, the API doesnt show any refunds for the orders at all but there does seem to be some amount deducted from the Total Sales of Orders which make the actual Net Sales for that particular day.
I can retrieve the orders for one day by this example URL. I iterate through all the orders and add up each Order's amount which gives an exact number of Total Sales which match up to the number in the dashboard. But this Total Sales value doesnt take into account the refunds/returns.
/admin/api/2021-07/orders.json?status=any&created_at_min=2021-08-17T00:00:00-04:00&created_at_max=2021-08-18T00:00:00-04:00&limit=250
There is a refunds in the returned json for each order as well in the above call but that is empty for all the objects.
I have explicitly tried to retrieve the refunds as well by following API call but it also returns empty for all the orders.
/admin/api/2021-07/orders/{order_id}/refunds.json
You may have a look at the Dashboard Sales image for one day. Please note in this image, I can get the exact value for Total Orders from the API but can not retrieve a single refund/return for any of the order.
Would you be having an idea what are these Refunds/Returns shown in the Dashboard? If so, is there a way how can I accurately calculate the Refunds/Returns by the API as well, so I can accurately calculate the Total Sales for one day?
You should be working with Transactions. Specifically, the refund transactions. An Order has many transactions. So given some order, you can get at the interesting transactions, and calculate your important values, like Net. I have aced this for many clients, as Shopify does not report this type of value very well. So I generate reports with Net, refunds, taxes, etc, providing much clearer guidance than the standard Shopify reports.

How do I access all the information for a Square transaction?

I am a student (so I am pretty new to all of this stuff) trying to create a database for a coffee shop that uses Square for their register and website. I want the database to update with all the information from a transaction every time one is completed.
I have a webhook that gets me the IDs every time a transaction completes, I can send the transaction ID to the Square API with an http request and get back information about the payment, but I still cannot figure out how to get the rest of the transaction information. We want to query the database about what kinds of items are being sold when and with what modifiers, but so far the only way I can get that is through downloading a csv file with the item line information from the Square Dashboard.
If there is a way to get the line item information in some kind of way that can be automatically added to the database, I would really appreciate the help. I have been looking for a solution and cannot find it on my own.
For in-person payments the only way to see itemizations is to use V1 ListPayments (or RetrievePayment).
In order to see itemizations for online payments, you must utilize Square's Orders API. The workflow would be:
Create an order (CreateOrder) with line_items (can be ad-hoc, or use Catalog ids). Save the order_id for the next step.
When calling Charge, pass in the order_id from the previous step.
Once you are successfully attaching the order_id's, when you retrieve a transaction you will be able to call the BatchRetrieveOrders endpoint with the order_id to see the itemizations.
References:
V1 Payments
Orders Overview
Orders Reference

SQL Point of sale how does a return work

Im new to POS systems. I have to create a very simple one for a few stores. Here is my SQL Server DB Schema:
The question that I have is how to handle returns.
In the real world how does a return works? Is a return a new sale but with a negative balance? If so then I would need to add to my sale table a "transactiontype" field (sale, return, etc.) and also a "referencesaleuid" field so the new sale (that will be a return) can reference the original sale ticket.
How to handle returns is a business decision.
For one example, we have worked with retailers of larger ticket items that needed to match returned products back to the original line item. So if a customer walked out of the store with two widgets and later returned one widget then we needed to be able to link the returned SKU back to the original transaction and SKU.
As another example, we have worked with retailers of smaller ticket items where returns were treated negative transactions.
I would suggest consulting closely with the business managers to find out what they would like to do in order to manage the business best.

Yodlee - how to get only new transactions

I am looking for a way to get only 'new' transactions from specific account item. I.e. only transactions that was posted to account after I made previous transactions fetch/search.
For example I have the following scenario:
I have add item to consumer. Lets say consumer have 1 account item named 'BankAccount1'.
I fetch/search ALL transactions for some BankAccount1 and store transactions locally.
Now I need a way to get only new transactions on periodic basis. I.e. only transactions that was posted to 'BankAccount1' after previous fetch/search call. Is it possible to do this or I need to get all transactions every time and just skip transactions with Id which already present locally? If transaction Id is unique and incremental (did they?) maybe its possible to save last fetched transaction Id, and on next time get only transactions with Id > prevFetchId (what API to use if its possible)?
p.s.
I am using container based approach REST API.
As per your question, I can infer that you are going to store transactions locally in your DB. In that case Yodlee recommend to use Procedural Data Extracts, using which you can keep your DB in sync with Yodlee Cloud. You can find more details about it here.
Yodlee recommends you to pass date range in the executeUserSearchRequest API to get the transactions for any specific duration,as getting only new transactions may cause some issues. This is why Yodlee recommends to have few days of overlap, this will help you in not missing any transaction.
Transaction ID would be unique but it may not be incremental.