# Adding Service charges in Line Item

**URL:** <https://developer.squareup.com/forums/t/adding-service-charges-in-line-item/13797>\
**Category:** Questions\
**Tags:** orders-api\
**Created:** [March 21, 2024, 6:06am UTC](https://developer.squareup.com/forums/t/adding-service-charges-in-line-item/13797 "2024-03-21T06:06:20Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![meghanshukumrawat123](https://avatars.discourse-cdn.com/v4/letter/m/ee7513/32.png) [@meghanshukumrawat123](https://developer.squareup.com/forums/u/meghanshukumrawat123)\
**Post date:** [March 21, 2024, 6:06am UTC](https://developer.squareup.com/forums/t/adding-service-charges-in-line-item/13797/1 "2024-03-21T06:06:20Z")

</div>

We want to add Service charges on Line Items, we are able to add Service charges on the entire Order but not on a single Line Item.

**Request**

```auto
result = client.orders.create_order(
  body = {
    "order": {
      "location_id": "LR6QAWGZD3DDN",
      "customer_id": "7TTBK00HX1N05RAXS3ECQGHY1R",
      "line_items": [
        {
          "name": "tea",
          "quantity": "2",
          "item_type": "ITEM",
          "applied_service_charges": [
            {
              "uid": "101",
              "service_charge_uid": "101"
            }
          ],
          "base_price_money": {
            "amount": 500,
            "currency": "JPY"
          }
        },
        {
          "name": "Coffee",
          "quantity": "3",
          "item_type": "ITEM",
          "base_price_money": {
            "amount": 300,
            "currency": "JPY"
          }
        }
      ],
      "discounts": [
        {
          "uid": "101",
          "name": "line item",
          "percentage": "10",
          "scope": "LINE_ITEM"
        }
      ],
      "service_charges": [
        {
          "uid": "101",
          "name": "charge",
          "amount_money": {
            "amount": 150,
            "currency": "JPY"
          },
          "calculation_phase": "TOTAL_PHASE",
          "treatment_type": "LINE_ITEM_TREATMENT",
          "scope": "LINE_ITEM"
        }
      ]
    },
    "idempotency_key": "c9974015-2be5-4d7a-9da5-5755fd200e2b"
  }
)

if result.is_success():
  print(result.body)
elif result.is_error():
  print(result.errors)

```

**Response**

```auto
{
  "errors": [
    {
      "code": "BAD_REQUEST",
      "detail": "Unexpected calculation phase SURCHARGE_TOTAL_PHASE for applied service charge custom-surcharge:101.",
      "category": "INVALID_REQUEST_ERROR"
    }
  ]
}

```

---

<div class="post-metadata">

**Author:** ![Bryan-Square](https://sea1.discourse-cdn.com/square/forums/user_avatar/developer.squareup.com/bryan-square/32/38_2.png) [@Bryan-Square](https://developer.squareup.com/forums/u/Bryan-Square)\
**Post date:** [March 21, 2024, 3:49pm UTC](https://developer.squareup.com/forums/t/adding-service-charges-in-line-item/13797/2 "2024-03-21T15:49:18Z")

</div>

This is correct. The service charge can be applied to an order but it’s not scoped to line items at this time. 🙂

---

<div class="post-metadata">

**Author:** ![jackpriceburns](https://sea1.discourse-cdn.com/square/forums/user_avatar/developer.squareup.com/jackpriceburns/32/7782_2.png) [@jackpriceburns](https://developer.squareup.com/forums/u/jackpriceburns)\
**Post date:** [October 23, 2024, 1:33pm UTC](https://developer.squareup.com/forums/t/adding-service-charges-in-line-item/13797/3 "2024-10-23T13:33:03Z")

</div>

@Bryan-Square

I’ve noticed that the order line items from the API now have a `total_service_charge_money` property ([OrderLineItem Object - Square API Reference](https://developer.squareup.com/reference/square/objects/OrderLineItem#definition__property-total_service_charge_money))

I’ve checked an order that happened a few days ago, which had service charge, however none of the line items had this `total_service_charge_money` property with anything other than `0`.

Few questions:

1. For this value to be filled, do I need to enroll in some sort of beta? Also do you know when this will graduate from beta?

2. The docs say “The total amount of apportioned service charge money to collect for the line item.” Can I know the calculation for how the service charge will be apportioned?

3. When this does fully roll out, will this value be available for all previous orders or only for orders going forward?

---

<div class="post-metadata">

**Author:** ![Bryan-Square](https://sea1.discourse-cdn.com/square/forums/user_avatar/developer.squareup.com/bryan-square/32/38_2.png) [@Bryan-Square](https://developer.squareup.com/forums/u/Bryan-Square)\
**Post date:** [October 23, 2024, 5:43pm UTC](https://developer.squareup.com/forums/t/adding-service-charges-in-line-item/13797/4 "2024-10-23T17:43:44Z")

</div>

What’s the order\_id you saw this with so we can take a look? 🙂

---

<div class="post-metadata">

**Author:** ![jackpriceburns](https://sea1.discourse-cdn.com/square/forums/user_avatar/developer.squareup.com/jackpriceburns/32/7782_2.png) [@jackpriceburns](https://developer.squareup.com/forums/u/jackpriceburns)\
**Post date:** [October 25, 2024, 11:32am UTC](https://developer.squareup.com/forums/t/adding-service-charges-in-line-item/13797/5 "2024-10-25T11:32:34Z")

</div>

Hey,

For example, this order `y4ErHZBO3g8IvHLrDGfGgOueV` from one of our customers.  
The order has a total service charge of £15.31  
As seen on the API like this

```auto
{
    "amount": 1531,
    "currency": "GBP"
}

```

Each line item has this `total_service_charge_money` property but it’s always `0`, like this:

```auto
{
    "amount": 0,
    "currency": "GBP"
}

```

I have actually already implemented my own logic for assigning service charge at a line item level, but was just curious what this service charge field is on the line item.

---

<div class="post-metadata">

**Author:** ![Bryan-Square](https://sea1.discourse-cdn.com/square/forums/user_avatar/developer.squareup.com/bryan-square/32/38_2.png) [@Bryan-Square](https://developer.squareup.com/forums/u/Bryan-Square)\
**Post date:** [October 25, 2024, 3:58pm UTC](https://developer.squareup.com/forums/t/adding-service-charges-in-line-item/13797/6 "2024-10-25T15:58:57Z")

</div>

The service charge that you see in this order is the one the customer configured in the Dashboard. It’s a per person percentage service charge that doesn’t effect any of line items. In the order you’ll see that there is a `catalog_object_id` `UXNH24ZYDL2XESTZ33TAH7ZP` for the service charge. Unfortunately, the seller configured service charges aren’t available in a list with our APIs but you will see them in the orders. 🙂

---

<div class="post-metadata">

**Author:** ![helle253](https://avatars.discourse-cdn.com/v4/letter/h/ecccb3/32.png) [@helle253](https://developer.squareup.com/forums/u/helle253)\
**Post date:** [August 28, 2025, 4:34pm UTC](https://developer.squareup.com/forums/t/adding-service-charges-in-line-item/13797/7 "2025-08-28T16:34:30Z")

</div>

Are service charges still not applicable at the Line Item level via the API?

---

<div class="post-metadata">

**Author:** ![Bryan-Square](https://sea1.discourse-cdn.com/square/forums/user_avatar/developer.squareup.com/bryan-square/32/38_2.png) [@Bryan-Square](https://developer.squareup.com/forums/u/Bryan-Square)\
**Post date:** [August 28, 2025, 5:31pm UTC](https://developer.squareup.com/forums/t/adding-service-charges-in-line-item/13797/8 "2025-08-28T17:31:03Z")

</div>

At this time there aren’t any additional updates to service charges. We’re constantly working to improve our features based on feedback like this, so I’ll be sure to share your request to the API product team. 🙂
