Paypal custom reports Api - api

I need to get a custom report of the payments that we received in the last X (variable) days.
We use a PSP to handle our payments but they only store the amount of the original sales (not without the FEEAMT and currency conversion).
Important is that the report shows the amount that actually is ours, so:
after the FEEAMT
after currency conversion
PAYMENTSTATUS must be "complete"
I cant find any working examples, only code snippets on https://developer.paypal.com

You can use TransactionSearch to pull orders within a time range, and then use GetTransactionDetails to pull specifics about any particular transaction.
If you are using PHP then you can use the PHP SDK for PayPal to make those calls very simple for you.

Related

Why do some variants miss the subscription-related fields like requires_selling_plan?

According to Shopify variant liquid object, there are subscription-related fields like requires_selling_plan, selling_plan_allocations, etc.
But I can't find these fields on my variants. I tried to add subscription plans to my products with Recharge or Awtomatic subscription apps. But these fields are still not found. How can I add these fields to my variants? And why are they missing? I can't find any information from the subscription docs.
After researching for a day, I found out that the payment gateway is the cause. When I was using Bogus gateway, these fields were not shown. After that, I switch to Shopify payment with test mode on, these fields appear.
I guess it's related to the Eligibility requirements
You can assign a subscription to a variant or not. You can therefore expect to find a mix of selling plan information per variant. It is up to you to check for the presence or absence of selling plans per variant.

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

API for auto discount based on customer group Shoopify Plus

Hi we have a shopify plus store and we have to provide a auto discount based on the customer groipus.
Suppose a customr is in vip group he should get automatically 50 % discount.
I can see shopify don't provide this.
Can you please provide an API reference with which i can detect the customer group and apply discount on his cart.
Check out the Shopify Script Generator here https://jgodson.github.io/shopify-script-creator/
I use this for creating all our scripts and it makes it so much easier.
I currently have a script which automatically applies free delivery to all customers with a "VIP Platinum" tag from our loyalty program, you can do the same thing for discounts.
tip, don't forget to export and save the file somewhere, this way if you need to edit or add another rule to it you don't need to start from scratch again.
edit: forgot to mention, as per your requirement this doesn't apply a discount code either. you can use the generator to create another script to block discounts from being used with this if you need/want

How do I access Shopify data without advanced account?

All I'm wanting to do is track sales of certain products from a certain date. My company is wanting to add a banner to track sales goals for raising money for charities. So basically, we'd tag a few products as being part of that goal, set a goal, and then need to update the goal progress by a certain amount every time a sale is made on one of those products. As far as I can tell, without access to Shopify's analytics API, this is not possible. How can I do this?
What you want to build is perfectly possible. However, you need to generate Private App Credentials, so you can use Shopify API. It doesn't matter if you have an account by yourself, someone else can follow these steps and send you the credentials your way.
If you don't actually need to modify anything through the API, you could have them set a webhook (Settings -> Notifications -> Webhook) on Order Creation (or similar) that posts to your server and you can check what product got sold and see if it has got the tag.
The "easy" way to do this is to create an app that receives order webhooks and can check on tagged products and keep a sum of target items sold.
Then the app should have use a script tag to insert a simple script with the current value into the web page at a configured place by css selector
OR the app could update one or more snippet files that you could include until the promo is done.
I'd tend to go with the script tag option since that's a bit more flexible and you should be able to change your theme when the promo is over to report results without having to touch the app again.

Subscription capability

We have a series of products that are subscription based. ie: first 7 days free, then a monthly or annual fee with a start date and finish date. Is this possible ? and could we drive this through the REST API ?
Moving my comment to answer -
I would like to second #KimballRobinson's comments. It might be possible. The REST API by itself gives you access to store data. You can create products and maintain them. In your case, things to consider - what is the product taxonomy like and can it be defined as custom fields or something of that sort. Maybe you can set it up in a way such that you charge/invoice the customer for the same product every month or annually. There are ways in which you can implement subscription. If you define details more on the scope of what you are trying to accomplish, it will be easier to figure out