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

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.

Related

List all non-subscription charges in Stripe

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.

Shopify - New order using the Shopify API - how to know tax and shipping?

We have built an e-commerce web application (Node backend, Vue frontend). We process the payment using Stripe, but many brands have asked us if the order and inventory control can be done in Shopify. We are trying to figure out the best way integrate a payment module into Shopify so that the brand can manage the fulfilment and inventory through Shopify.
It seems we should use the Order API to create an order and mark it as paid. But how do we know that the product is in stock, and what are the cost for shipping and tax from Shopify when creating the order? I think we can use the Product API to get inventory levels, but where is the shipping and tax endpoints?
If I understand the Order API correctly, we need to tell Shopify what are the shipping costs and tax costs, when a new order is created. Is that right? How could we possibly know those figures? Seems like there should be an endpoint to calculate shipping costs and get a product's tax rates so that we can then pass those figures back into the Order API. Am I missing something?
I thought maybe we are supposed to create an order that has financial_status: pending first to get shipping and tax rates back (does it even give you those?), then update the order to either cancel_reason: customer or cancel_reason: inventory if those rates are too expensive and the order is declined? But surely we need to know what shipping methods are available to the customer in order to tell Shopify which one to use, right? Or does it by default choose the cheapest one when creating an order?
Notes:
We know the customers shipping address
We don't know where the product is warehoused (Shopify does I think)
We don't know the weights or dimensions of the product (Shopify does I think)
This answer is a little bit late, but i hope, i can help others that are struggling with the same issue.
First i would recommend to set up all Shipping Rates and Taxes in Shopify. There are plenty of manuals to achieve this:
https://help.shopify.com/manual/taxes#general-process-to-set-up-taxes
https://help.shopify.com/manual/shipping/rates-and-methods/calculated-rates
After this there are different possibilities to calculate your shipping and tax cost.
Your shipping cost can you get via the active_shipping API, which can be found here:
https://github.com/Shopify/active_shipping
Or the following Shopify Application: https://apps.shopify.com/boxify
However, you may need to know size and storage location for theese solutions.
The taxes can you get via the country in the Admin API, there is a specific key-value pair for this:
https://help.shopify.com/api/reference/country
I hope that's enough information to get closer to solving the issue, for at least someone.

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!

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.

Using the Shopify API how can I get tax details on individual line items?

In the UK some items have VAT charged on them while others don't. To import orders into our back office system we need to know whether tax was charged on particular items in the order. Ideally we'd also like to know how much tax was charged on each line item.
This information isn't shown in any of the example responses given in the online docs. Is it possible to get it via the API?
This is currently not available for individual line items, all that is available is the overall taxes charged. You could use this and taxable field on Product to attempt to divide the taxes charged.