Retrieve "Shopify Payments" fees by Order # for reconciliation with Accounting + Bank Deposits? - shopify

Reconciling deposits, within an accounting system, coming into a Shopify User's bank account from a Shopify store running Shopify Payments (or otherwise) appears to be one of the things people frequently stumble on — based on the number of requests about the topic on Shopify's Support Community Forums, for example: https://community.shopify.com/c/Shopify-APIs-SDKs/Fees-charged-by-Shopify-via-API/m-p/265261/
The issue (for accounting) is that Shopify Payments removes the Fee Amount (for a full list of fees see: https://www.shopify.com/pricing) prior to depositing the balance of the transaction into a Store Owner's bank account.
Shopify Fees generally look something like: 2.6% of transaction value + $0.30
Calculation of the fees that should be taken out based on the above is pretty simple (hard code the fee schedule), until those fees change at some point in the future.
How does this impact Integrations?
For many of the available simple integrations this causes a discrepancy between the invoice amount of money hitting the bank account and the amount of money we 'Expect' to hit the bank account based on the Shopify Invoice Amount that is readily retrieved via Shopify's API by many such solutions.
That discrepancy means that it is necessary for an Accounting based user to manually deduce which Shopify Invoice is associated with which incomming bank deposit — and then manually add a negative line item to account for the difference / balance the books.
This is the suggested methodology coming from several different Accounting System / Software vendors (specifically Xero and Quickbooks) when asked how their customers solved the above issue.
I know that there are solutions out there that attempt to solve all of the above problems (with varying degrees of success), but due to the amount of Kitting that my current situation involves none of them adequately solve the other required functionality for our business.
We need to be able to find the fees (or alternately calculate them ourselves) and add those fees to the invoice so our accounting system is expecting the correct amount of funds to hit our bank account — hence the question: How can we retrieve the current accounts "Shopify Payments" fees / rates.
Ideally I want to avoid hard coding this information since Shopify likely does change the fees (potentially with only minor notification) meaning that at that point our integration would break. It would be much better to be able to retrieve the fee schedule for a given account via API request thereby avoiding issue if the fees change.
I have multiple clients who are also facing the same issue — so I figured it was worth checking to see if anyone has faced / solved the problem, and discuss my current solution
What does Shopify Say?
Generally their comment is that there is no road map to including the fees deducted from an invoice when responding to an API Request as taken from: https://community.shopify.com/c/Shopify-APIs-SDKs/Fees-charged-by-Shopify-via-API/m-p/265261/ (which seems strange) — meaning that 'wont do' is the best classification for the feature request that would provide this information with simple / readily available calls to the currently available API Endpoints.
Without access to Fee amounts on a per order basis I am not sure how Shopify Stores are currently interfacing with their account systems.
I would love to hear solutions from any Shopify user who may have encountered this issue previously! I opened a ticket request with support so I will see what I get back over there as well and post back.

OK so this isn't a total solution but I am updating as I go and will continue to edit this answer until I find a full solution (or until someone who has one adds an answer).
Whitelist / API Endpoint Approval Required
I found a Shopify API endpoint that should give the information I am looking for over here: https://help.shopify.com/en/api/reference/shopify_payments/transaction
According to the Shopify API docs the response should contain the Fee Amount and the API Endpoint would be:
/admin/shopify_payments/balance/transactions.json
That would get me exactly what I need, except that sending a properly formatted request to the avoid Endpoint gives the following response:
{
"errors": "[API] This action requires merchant approval for read_shopify_payments_payouts scope."
}
Basically it seems like it needs to be approved per merchant making it a less than ideal solution for you guys as an App. I requested the functionality and will add to this if it makes something easier (when / if it's granted to our account).
Public Access to Similar Fee Data
While playing around with some of the other endpoints I ran into this one (which IS public and accessible for Apps — I am a partner / develop Shopify Apps myself) which seems to provide similar functionality:
https://help.shopify.com/en/api/reference/orders/transaction
When making a call (and receiving the "kind": "sale" result for a given Order Id) I get the following pieces of JSON that are interesting:
"gateway": "shopify_payments",
"status": "success",
and more importantly:
"balance_transaction": {
"id": "XXXXXXXXXX",
"object": "balance_transaction",
"amount": 12881,
"available_on": 1553040000,
"created": 1552943224,
"currency": "usd",
"description": "XXXXX#outlook.com",
"exchange_rate": null,
"fee": 339,
"fee_details": [
{
"amount": 339,
"application": "ca_1vQrdCwnvOuC2Ypn5R9whwXkGxb4XJjx",
"currency": "usd",
"description": "Shopify Payments application fee",
"type": "application_fee"
}
],
Where the JSON 'amount; property corresponds to the invoice sales amount (including shipping) as a decimal free value.
The "fee": 339 appears to indicate the fee amount deducted by Shopify Payments (based on the JSON idicator attached: description": "Shopify Payments application fee").
Yep. That's the Fee.
After checking the Shopify Account tier (in this case Advanced) the fees deducted should be: 2.4% + 30¢ meaning that the total does match — 2.4% * $128.81 = $3.09144 + 30 cents (per transaction) = $3.39.
So basically everything exists (with no whitelisting required) to get the fee amounts on a per order basis for Shopify Payments users. This probably includes the Shopify Fees charged to external gateways as well although I don't use one so I can't say for sure.
That endpoint functionality means Shopify Fees likely COULD be added to any Shopify App that integrates with an accounting system — but also means it is relatively easy to pull in after the fact if the integration you are working with deposits the Invoiced amount into accounting but DOES NOT add a negative line item associated with the Shopify Fees — like mine does.
Still leaves me with some questions but at least the initial 'How do I find the Shopify Fees?' question is taken care of.

Previously my scripts that handle our accounting had used the Shopify API. As one commenter mentioned this API no longer works (or has changed in some way I have not found a solution to)
For everyone who is now having trouble with the API changes and doesn't mind a slightly manual solution to grab all Shopify payouts information you can dump a CSV out of the Shopify Payouts view, and then load that into your script (or alternately into Google Drive, and then hit that as a database... for example with Autocode's Standard Library).
To export Shopify Payouts data in CSV:
Go to the Shopify Payouts page for your Shopify store: https://XXX-YOURURL-XXX.myshopify.com/admin/payments/payouts
Set your date range / filter range to make sure you are exporting the correct payout date range.
Click the Export button in the top right hand corner, to the left of Documents and Transactions.
Shopify will email you the exported Transaction CSV which you can then do with what you like. This process won't work so well for anyone who is attempting to use a daily payout reconciliation strategy within their accounting system, but for the rest of us peons who are further behind on reconciliation it works well.

Related

Binance API transaction history

I am trying to display a users transaction history in binance, including fund deposits and withdrawals as well as buying and selling of different crypto's. Does anyone know which binance API endpoints I would use to do this? It seems quite complicated in comparison to other trading platforms.
Thanks
This is the link to the docs: https://binance-docs.github.io/apidocs/spot/en/#withdraw-history-supporting-network-user_data
I can see the Wallet endpoints "Withdraw" and "Deposit", but this won't cover crypto trading will it?, The account trade list call would be ideal, but it requires a symbol input which I'm not sure how I would obtain dynamically.
I would also like this endpoint to provide me with the data so I can get the avg buy price for a crypto
Currently this is not supported. See: https://dev.binance.vision/t/fetch-all-account-orders/279/3
This is the route you're looking for to get the user trade history. The big downside is that you have to specify the exchange symbol, you cannot get the history of the account with just one request:
https://binance-docs.github.io/apidocs/spot/en/#account-trade-list-user_data
Get your account information first. You can then extract non-zero balances from here to get symbols for transactions. You can then loop through each currency pair and get its transaction history. This seems to be the most optimistic way we can get right now
You can also try to use caching. For example, you can remember balance for a particular coin, and if it has not changed by the next launch, then it is likely (but not 100%) that no transactions were made with it
You can also connect to WebSocket, but this is still a terrible crutch and requires a DOS attack to get the necessary data
Please note that here the balances for Savings wallet have LD prefix added to their ticker. For example, BTC in the Savings wallet is labeled as LDBTC

Integrating Shopify and third-party gift-card system

Background
I am working with a retailer who has a store on Shopify. The store is not
on Shopify Plus.
The retailer has gift cards from a company other than Shopify. Each gift
card has a number on it that uniquely identifies the card. Associated with
the cards is a HTTP API, available to authenticated users, which can be used
to get or change the balance on a card.
Requirement
The retailer wants to allow customers to use these cards when ordering from
his Shopify store.
Ideal UI
From the user-interface point of view, the ideal would probably be something
like the following. We would add an input field to the Shopify payment
form, near the input field that has the placeholder "Gift card or discount
code". This new input field would be for the third-party gift-card number.
Suppose a customer had a gift card and entered its number into this input
field. Some custom software would check whether the gift-card number was
valid and the gift-card had funds. If either check failed, an error message
would appear in the form.
If both checks succeeded, the form would show success (perhaps by putting a
green check mark) next to the input field. Then it would adjust the balance
to be paid by the customer. For example, if the customer was ordering $300
worth of shoes, and tendered a gift card holding $50, then the $300 would be
adjusted to $250.
When the customer pressed the button to place the order, Shopify would debit
$250 from his credit or debit card, and some custom software would debit $50
from his gift card. It's probably acceptable for this custom software to
run after a delay of 5 seconds or so. (For example, it might be triggered
by a webhook.)
Discussion
I've been looking for a way to do the above. The really hard part is to
adjust $300 to $250 (not just in the form, but when Shopify actually charges
the customer). I have considered the following, singly and in combination:
Changing the Liquid templates.
Putting some custom JavaScript in the Shopify pages.
Writing an app that uses the Shopify Storefront API.
(3) seems the most promising, but it's not easy to see how to do in a "surgical"
way so that I only replace one screen.
I don't want to have to reimplement an entire Shopify store using the Storefront API.
Alternative UI
If you can think of an alternative UI that would achieve the same thing,
please feel free to propose it.
Similar question
This question,
including the questioner's two comments, describes a situation
identical to mine.
However, the only answer (if I understand it correctly) is unacceptable to me.
Ruled-out alternative
I proposed a web service to turn these third-party gift cards into Shopify
discount codes. That idea was rejected by the retailer, because he already
uses Shopify discount codes, and Shopify's form only allows a single
discount code.

Product showing up in Amazon MWS API but not Product Advertising API

I'm building an integration for my warehouse and using Amazon's API's to get product information from UPC. I've ran into a number of times where a result comes back accurately from the GetMatchingProduct on MWS API but not from the Product Advertising API. Even Vice Versa has occurred.
Why might this be? Is there a reason I should just use one or the other?
Example: UPC - 363824072463
MWS brings back ASIN - B0057UUHGU which is the relevant one that also comes back when you just search Amazon. However the Product Advertising API does not return this in its list of results at all.
We have found that often times new, or recently changed items take a little while to correctly populate in the Product Advertising API.
Also, for what you say your purposes are, I would be cautious relying on the Product Advertising API. It is a sales tool, so sometimes when given an out-of-stock item, for instance, it will return results of a different item (maybe similar, maybe was variated with it, etc) as the purpose of that API is to drive sales to Amazon.

Estimate tax based on zip code

Using Google Checkout, I'm able to estimate tax based on the zip code that's assoicated with a user's account when they click "Buy." The user then sees the tax amount when they checkout.
Is it possible to estimate tax based on the user-entered zip code before a user reaches the checkout page? This is similar to the functionality in Google Products currently. I see some data here (http://code.google.com/apis/checkout/articles/Google_Checkout_Articles_Zip_Level_Taxes.html) but am not sure how to implement it within the checkout button I have.
Is there any other tax table or API that allows estimation of taxes based on zip code? Does Paypal offer this functionality?
have you looked at AvaTax module?
http://www.magentocommerce.com/magento-connect/one-pica-avatax-connector.html
If your building a cart from scratch you can use avalara's api. If your using a specific package such as magento, 3dcart, or so on they already connect to the major solutions. Avalara's solution also bridges the gap between the sales software and the accounting software such as Quickbooks and Sage.
Otherwise if the company your building this for is small enough and has time to update them manually, you can go to the states website or go to a place that compiles free tax rate tables such as taxrates.com
One major warning with any solution, sales tax taxability rules can be complex, this compounds when your scaling an e-commerce business. Even if your a small business in one state, there are multiple layers to the rules. Best to work talk with an accountant to double check when your initially setting this up.

How to implement eCommerce susbscription service with multiple products

I've been researching eCommerce payment gateways and service offerings, but I'm an eCommerce novice, so please excuse my ignorance.
I wish to set up an eCommerce solution with the following requirements:
User "subscribes" to the service on a yearly basis. This service includes a single product subscription for a set amount (let's say $50/yr).
User can "subscribe" to additional product services for a lesser rate per year (let's say $25/yr).
I will need to store a product service unique Id of some sort for each product subscription the user subscribes to in order to show them product unique information. I also need to prevent duplicates...for example, user can subscribe to product ABC and XYZ, but not 2 of ABC.
Is PayPal the best solution for something like this? Is there a better solution? Any assistance is greatly appreciated, even if just links to specific tutorials or examples.
Update: It looks like Chargify could be the perfect solution.
You can also use Authorize.Net's CIM solution which, based on what I read at the chargify website, does most of what chargify does except your customers never need to leave your website. The Customer Information Manager allows you to create profiles for your members. These profiles store sensitive information like credit card numbers and billing information so you don't have to worry about PCI compliance or hackers stealing your information. You then can schedule a cron job to charge them monthly for whatever amount they owe based on their current subscription. Since you control when the payments happen it also allows you to charge them pro-rated amounts for subscription changes mid-month.
[link text][1] seems to be the best solution for me. I still need a merchant account, but this takes a lot of the headache out of handling the subscriptions.
[1]: http://chargify.com Chargify