How do I refund a single item and shipping proportional to the item refunded? - shopify

I have an order with 3 different line items.
I need to refund 1 of those items (which is heavy and adds to the shipping price). Without this item I can reduce the price of the shipping by X.
How can I refund X? How can I automatically calculate how much I have to refund from the shipping? Does Shopify do that automatically?
The documentation example doesn't go too much in detail, it only states that you can send amount, but not how to figure out what the amount is.

Just refund the price of the item itself. Refunding a percentage of shipping? Who does that. I have never experience any e-commerce where you get shipping refunds. If I pay for shipping, I paid for something non-refundable.

Related

Shopify - Is there a way to offer discount after taxes are calculated

I have a collection of items which has a 13% tax. So if you buy $1 in goods, your final charge would be $1.13 because of this tax.
I give users the option to return certain items while purchasing others (imagine returning the keg of beer while buying another).
The problem, however, is that the "return" (where I subtract $X from the checkout) affects the checkout pre tax. So if the total was $100, which is $113 after tax, my current code would deduct $50 pre-tax, which would affect the tax I need to collect.
Is it possible to have the items purchased + tax show in the checkout, and subtract the "returns" after the price plus tax is calculated?
I have looked at this link identifying a similar issue and people claiming they can solve it. The only solution provided by shopify was to pay $2000/month to get access to checkout.liquid where * maybe * I could solve the problem.
Unfortunately, your question is unclear. You have to understand how Shopify works to accomplish certain goals. One, you cannot mess with the pricing of goods or taxes. About the only thing you can offer customers are discount codes.
Anything that gets committed to checkout is out of your control. You cannot adjust anything in the checkout, with the exception being, Plus merchants can indeed script checkout, and even alter the Liquid.
Until you are more clear about what you are attempting, I suggest you ensure that whatever you are doing, the cart is fair game, do as you wish. Have the customer replace one item with another. Submit to checkout. Be done.
Sure, there are cheesy Apps that help fake things financially by using discount codes, but that is often a road to more problems than it is worth.
we have tried this but it did not work for us.
We then ended up disabling the tax altogether
The items were calculated inclusive of tax and we would then provide a tax invoice separately using API

Changing quantity units on certain products in BigCommerce

Site: www.peekaboopatternshop.com
Theme: Barcelona Red v. 1.0.1
Stencil
The shop is selling both physical and digital products, and I need the quantity unit to display differently. For instance, if someone is buying fabric, the quantity box should have options like "1/2 yard, 1 yard, 1.5 yards" etc. But for a digital file I want to the quantity box to just have a standard options "1,2,3".
I played around with product options, but I can't figure out how to tie that into the inventory - if someone orders 2 yards of fabric, I need it to take 4 units off my available inventory (inventory for fabric is tracked in 1/2 yards), and I didn't see any way for my product options to affect my inventory unless I get into SKUs, which didn't seem relevant since I don't have variations available for each product.
On a separate note, I also can't seem to get the Quantity option to change from a box to a dropdown.
To have the inventory take off the correct number of units, you would need to setup the product for customers to purchase using the smallest possible unit.
So a customer would have to purchase per the 1/2 yard. Then the stock would be setup as normal. And it would deduct one for every 1/2 yard purchased.
Currently physical and downloadable are treated as separate products on the store.
There are several options:
1. Sell the physical and digital separate
2. Work with a developer to create a custom product where both are available.
3. On the product add a product option that customers can select to have someone email them the digital product later. You can also add price change rules to increase the price based on the option picked.
4. There is a app in the BigCommerce Marketplace called FetchApp that might allow this functionality also.
If you still have questions please reach out to BigCommerce support.

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.

Shopify - Is there a way to determine the type of discount code in the api response

When discount codes are applied to orders the way they are brought in in an order is a 2 field array, code and amount. Although, in the admin interface a Shopify user can choose whether or not the type of code is an absolute amount, percent, or free shipping.
In the api response is there a way to determine whether the code used was for free shipping or one of the others? This is causing issues with our sync because taxes are handled different in different locations for shipping costs compared to general order line items.
Thank you,
Brandon
Short answer: No, you can't tell the difference.
Long answer: Internally, free shipping codes are actually applied to items in the cart up to the value of the shipping method selected, and then the shipping amount is applied on top.
The upshot of this is that there is no difference between the three discount types as stored on Shopify. They're all just dollar amounts taken off the order subtotal. Therefore you can't tell whether the shipping was discounted because it never is.

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.