Order potentially has been double-charged with a service charge

Hi,

We’ve been syncing Square Orders information into accounting packages for a quite long time and we noticed an odd scenario in one of our customers. They seem to have an order that potentially contains a service charge for which the payer has been charged twice.

Notice the following order (a copy-paste from the API):

{
  "order": {
    "id": "gSRjC4VEQSSZWe69OGuVb3eeV",
    "location_id": "L15TTNR61SSQV",
    "line_items": [
      {
        "uid": "7B2479D0-592B-4833-8358-05772C91D624",
        "catalog_object_id": "CTPJWRMBR7TBCE6UQCPD4IR3",
        "catalog_version": 1686904163814,
        "quantity": "1",
        "name": "Cap / Hat",
        "variation_name": "RED RACING CAP",
        "base_price_money": {
          "amount": 1500,
          "currency": "AUD"
        },
        "gross_sales_money": {
          "amount": 1524,
          "currency": "AUD"
        },
        "total_tax_money": {
          "amount": 139,
          "currency": "AUD"
        },
        "total_discount_money": {
          "amount": 0,
          "currency": "AUD"
        },
        "total_money": {
          "amount": 1524,
          "currency": "AUD"
        },
        "variation_total_price_money": {
          "amount": 1500,
          "currency": "AUD"
        },
        "applied_taxes": [
          {
            "uid": "F6EF25E1-11AE-4012-9220-2239B224955E",
            "tax_uid": "0DC54C7E-D62B-48A8-A64C-4B44D11A26AD",
            "applied_money": {
              "amount": 139,
              "currency": "AUD"
            }
          }
        ],
        "item_type": "ITEM",
        "applied_service_charges": [
          {
            "uid": "8A190514-C645-472E-9493-5736AB35C317",
            "service_charge_uid": "8A190514-C645-472E-9493-5736AB35C317",
            "applied_money": {
              "amount": 24,
              "currency": "AUD"
            }
          }
        ],
        "total_service_charge_money": {
          "amount": 24,
          "currency": "AUD"
        }
      }
    ],
    "taxes": [
      {
        "uid": "0DC54C7E-D62B-48A8-A64C-4B44D11A26AD",
        "catalog_object_id": "AUSSALESTAXMLK4V4VCQXGXD",
        "catalog_version": 1677536996760,
        "name": "GST",
        "percentage": "10",
        "type": "INCLUSIVE",
        "applied_money": {
          "amount": 139,
          "currency": "AUD"
        },
        "scope": "LINE_ITEM"
      }
    ],
    "created_at": "2023-06-23T02:20:31Z",
    "updated_at": "2023-06-23T02:20:33.000Z",
    "state": "COMPLETED",
    "total_tax_money": {
      "amount": 139,
      "currency": "AUD"
    },
    "total_discount_money": {
      "amount": 0,
      "currency": "AUD"
    },
    "total_tip_money": {
      "amount": 0,
      "currency": "AUD"
    },
    "total_money": {
      "amount": 1548,
      "currency": "AUD"
    },
    "closed_at": "2023-06-23T02:20:33.000Z",
    "tenders": [
      {
        "id": "BQ0qOGi2jVPOZuu2EPZkcE4yvaB",
        "location_id": "L15TTNR61SSQV",
        "transaction_id": "gSRjC4VEQSSZWe69OGuVb3eeV",
        "created_at": "2023-06-23T02:20:30Z",
        "amount_money": {
          "amount": 0,
          "currency": "AUD"
        },
        "processing_fee_money": {
          "amount": 0,
          "currency": "AUD"
        },
        "type": "CASH",
        "cash_details": {
          "buyer_tendered_money": {
            "amount": 0,
            "currency": "AUD"
          },
          "change_back_money": {
            "amount": 0,
            "currency": "AUD"
          }
        }
      }
    ],
    "service_charges": [
      {
        "uid": "8A190514-C645-472E-9493-5736AB35C317",
        "name": "Card Surcharge",
        "percentage": "1.6",
        "applied_money": {
          "amount": 24,
          "currency": "AUD"
        },
        "calculation_phase": "APPORTIONED_PERCENTAGE_PHASE",
        "taxable": true,
        "total_money": {
          "amount": 24,
          "currency": "AUD"
        },
        "total_tax_money": {
          "amount": 0,
          "currency": "AUD"
        },
        "catalog_object_id": "4FCEMTSZP2MUDRNDN3HNNQHJ",
        "catalog_version": 1679648384193,
        "type": "CUSTOM",
        "treatment_type": "APPORTIONED_TREATMENT",
        "scope": "ORDER"
      }
    ],
    "total_service_charge_money": {
      "amount": 24,
      "currency": "AUD"
    },
    "returns": [],
    "return_amounts": {
      "total_money": {
        "amount": 1548,
        "currency": "AUD"
      },
      "tax_money": {
        "amount": 139,
        "currency": "AUD"
      },
      "discount_money": {
        "amount": 0,
        "currency": "AUD"
      },
      "tip_money": {
        "amount": 0,
        "currency": "AUD"
      },
      "service_charge_money": {
        "amount": 24,
        "currency": "AUD"
      }
    },
    "net_amounts": {
      "total_money": {
        "amount": 0,
        "currency": "AUD"
      },
      "tax_money": {
        "amount": 0,
        "currency": "AUD"
      },
      "discount_money": {
        "amount": 0,
        "currency": "AUD"
      },
      "tip_money": {
        "amount": 0,
        "currency": "AUD"
      },
      "service_charge_money": {
        "amount": 0,
        "currency": "AUD"
      }
    },
    "source": {},
    "net_amount_due_money": {
      "amount": 0,
      "currency": "AUD"
    }
  }
}

You can see that it contains a line item with an apportioned service charge of 24 cents which, after contributing to the base_price_money, gives us 1524 cents as the line item’s total_money. The tax is known to be tax inclusive so we don’t need to include it for this calculation.
We would expect that the total_money of the order would be 1524 as well, but for some reason, it’s 1548 which suggests that the 24 cents have been paid twice in this order.

What’s also odd is the tenderamount_money which is 0 even though the order has been marked as COMPLETED. Could you please take a look and let us know if it is something that we should be worried about, or if it’s some kind of a broken order?

Thank you.

The team is looking into this. I’ll be sure to reach out with any updates. :slightly_smiling_face:

1 Like