question

ismdcf avatar image
ismdcf asked Jeffrey Blattman commented

Custom Line Items For Delivery Charge

We have a requirement to pass the delivery charge for an order created through clover REST API.

We have tried two approaches for this - both of them are having issues.

Approach #1 -
We have used a custom line item to represent delivery charge.
But for custom line items, clover seems to apply service charge which result in incorrect total price for the order. Because we don't want service charge to be applied for a delivery charge.

>>>>>>>>>>>>>>>>>>>>

Approach #2 -
We have created a TaxRate which is a flat tax amount to represent the delivery charge. Then create a
zero price inventory item called 'Delivery Fee' and assign the aforementioned tax rate to it. When we want to add delivery fee for an order, we add Delivery Fee inventory item to the order.

However this approach also have three issues

1. Order receipt available to the merchant via orders app in clover web and android, is having a price breakdown on taxes and subtotals. With this approach delivery charge will appear as a tax.

2. If merchant is using clover orders report to settle taxes, then delivery charge will be also listed under taxes. Merchant would have to filter out flat tax components created for delivery charge.

3. In case of delivery matrix with different delivery charges, we will have to configure multiple flat tax components, and multiple Delivery Fee products.

>>>>>>>>>>>>>>>>>>>>>>>>


Can you please suggest a better approach or methods to overcome issues with our current approaches.
REST APILineItemsTaxes
10 |2000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Jeffrey Blattman avatar image
Jeffrey Blattman answered Jeffrey Blattman commented
Yes don't use taxes.

You could use a custom line item, but apply a line item discount to that equal to the service charge. Will make for a less than clear receipt for the merchant.

You could not use service charges and instead incorporate the service charge into a custom line item. Then it will not effect the delivery charge line item.
2 comments
10 |2000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

ismdcf avatar image ismdcf commented ·

I have issues with both methods you have suggested.

#Approach 1

In clover service charge is calculated only after discount is applied.

For an example if delivery charge is $1 and service charge is $0.10 (which is 10%)

if we apply the discount of $0.10, then service charge would apply for $0.90 which result in $0.09 service charge.

So the total line item price will be $0.99, which is less than the actual delivery charge I want.

This is just an elaboration. But I hope the issue am trying to make is clear. And also this might effect the reporting. Because even the total is correct, the portion of amount which should be for delivery charge is now shown under service charge. If there are other accounting apps created for clover, this will create a wrong impression to the merchant.

# Approach 2

If there are accounting apps works on clover, they will have trouble showing service charge amounts as we are using custom line items to represent service charge.

0 Likes 0 ·
Jeffrey Blattman avatar image Jeffrey Blattman ♦♦ ismdcf commented ·

Understood. That's what is available however. We do not have the concept of exempting line items from the service charge.

0 Likes 0 ·
Rohit Bhardwaj avatar image
Rohit Bhardwaj answered zgreathouse Deactivated commented
I have used custom line item to add delivery fee to the whole order. Please see the example below.
LineItem li = new LineItem();
li.setName("Delivery Fee");
li.setPrice(Long.valueOf(fees + ""));
try {
    orderConnector.addCustomLineItem(orderId, li, true);
} catch (Exception e) 
{e.printStackTrace();
}
The value "true" is to set this line item taxable.
1 comment
10 |2000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

zgreathouse avatar image zgreathouse commented ·

The Rest API equivalent of this would be the following:

Endpoint:
POST /v3/merchants/{mId}/orders/{orderId}/line_items

Example Request body:

{
                   
"price": 1000,
"name": "Delivery Charge"
}
0 Likes 0 ·

Welcome to the
Clover Developer Community