List all non-subscription charges in Stripe - api

I am making an e-commerce web app, users can purchase physical products via stripe and users can subscribe to different plans such as Lite, Premium, Standard, etc.
case-1: For checkout of physical products, I use:
stripe.charges.create()
case-2: For Subscriptions, I use:
stripe.subscriptions.create()
What I want is to retrieve a list of ONLY checkout charges (made via case-1, not case-2), I use
stripe.charges.list()
but It retrieves all charges including subscriptions which is not wanted.
How can I get all charges which are of non-subscription charges, is there any filter available in Stripe or an alternate method is available?

Unfortunately, the List Charges API doesn't have any parameters that you can use to specify that you only want charges associated with invoices:
https://stripe.com/docs/api/charges/list
That being said though, you can list all the Charges within a given window and filter them manually. Any charge that is associated with a subscription will have its invoice field populated:
https://stripe.com/docs/api/charges/object#charge_object-invoice
That is, if the Charge is linked to an invoice then it (most likely) came from a subscription. Otherwise it was a Charge for a physical product. This of course assumes that you aren't creating one-off invoices manually.

Related

Big Commerce - Custom Price Retrieval

I'm looking at using Big Commerce.
Is it possible through customizations that I can programmatically pull a price via a web service based on who the user is?
User logs into my store; when they search, for each product the price (and some other information) is being populated by a web service call. Same goes for the product page, cart, etc.
Yes, this would be possible, although the implementation may vary depending on the size of your catalog/number of individual users who need pricing unique to them.
One option would be to call your web service for pricing and send those prices to the storefront for a specific customer (or group of customers) using the Price Lists API:
https://developer.bigcommerce.com/api-reference/catalog/pricelists-api
Another possibility would be to listen for the ID of the logged in customer, and based on that ID, update the prices of the products in the cart using the Cart API:
https://developer.bigcommerce.com/api-reference/cart-checkout/server-server-cart-api

Can I charge a fee on top of the merchant payout with balanced orders

I'm updating my code to use balanced api 1.1 and I'm interested in the new Orders construct. Everything looks pretty good about it, since our orders are only associated with one merchant customer. We charge an inclusive fee on the order and don't want to make 2 charges to the customer, which leads to my question:
If I create a single order, with one buyer, one seller, and one debit, can I credit both the seller's account, and my business account?
In other words, after debiting the buyer the full amount (let's say $100) and crediting the seller with their portion (let's say $95) will the remaining $5 be 'stuck' or will I be able to transfer that into the business's account (my business)?
Yes, an Order can technically have two merchants associated to it. The one specified when you create it and the owner_customer from your marketplace.
The documentation appears to be lacking anything referring to this so I've created a Github issue to track documenting how to collect fees with Orders!

How best to calculate sales tax in a marketplace (i.e., with multiple sellers)?

We process orders for multiple sellers (a typical "marketplace" scenario). Are there APIs or services that correctly compute sales tax for our use case?
I simply want to provide the sellers' (1 or more) locations and the buyer's location, and receive the correct tax rate to assess on the corresponding line item.
Most offerings I've evaluated (TaxCloud is one) seem to fall down in this use case.
I'm implementing a TaxCloud solution for a single-seller and multiple-buyer situation. You can utilize TaxCloud to determine tax cost by creating an account for each seller in the marketplace, configuring nexus for each, then using the appropriate API key/ID pair to lookup tax on items based on the seller.
Unfortunately, this means that you'll have to make multiple calls if the shopping cart has items from multiple sellers.

Products as a service with Recurly

I'm having a hard time figuring out if Recurly supports a "products as a service" kind of business.
"Products as a service" has following characteristics:
No monthly fee
No charge upfront
Just charge the products itself
A subscription can have different products and different amounts
per product for each customer
The products or (amount of them) can change montly
For example:
A costumer can choose out of products A, B, C and D. He chooses to subscribe to our service and wants a montly delivery of a pack containing product A and 2 of product B.
After three months receiving this subscriptiopn he wants to change his pack. He deletes product A out of his pack and adds product C. The next delivery contains those products.
As far as I understand the API I have the following options:
Create a different subscription per user per "pack"
Seems too
complicated for managing all subscriptions. There will be many
subscriptions created and deleted (set on inactive, as deleting is
not possible). And it certainly isn't intended to be used this way.
Subscription plan of €0,00 with add-ons per product
Add-ons seem to be defined rather fixed when creating the subscription plan. I want my products to be flexible, taking them in and out of the subscription as I please. Doesn't seem to support that.
Metered billing
Also defined as usage-based billing. The proposed use cases in the docs all have a fixed subscription fee (which I don't want). They also add a defined and linear 'product' (eg. 0,1 / minute). Doesn't seem to fit my needs either.
How can I handle this kind of business best with Recurly?
A €0,00 with add-ons per product will be your best path forward. Add-ons are flexible and can be added/removed from a subscription plan as needed.

Paypal integration to serve multiple sellers in one go for a shopping site

We are in a process of making a shopping site. Here, the buyer can select the items of their choice and put them in shopping cart. These items can be from different sellers. Now, when the buyer makes the payment we want that the amount should be automatically deposited in each sellers account as per his product price.
Please suggest, how this can be achieved using paypal?
Perhaps via an intermediary account?
I'm affraid that you can not do that for the moment.
this will be possible soon with the new API (Split Payment or parallel payment)
You will find more information on x.com
Cheers