Ad hoc OrderLineTaxItem not being calculated

I created an order, added an adhoc item, and also added an ad hoc OrderLineTaxItem (see below), but I am not seeing the tax being applied onto the order under net amounts.

Request Body:

{
    "idempotency_key": "ea0c2602-c305-4a4f-bca8-fbaf6c6f47f3",
    "order": {
      "location_id": "944DYRHACBQFT",
      "state": "OPEN",
      "source": {
        "name": "Source Name"
      },
      "taxes": [
        {
          "scope": "ORDER",
          "type": "ADDITIVE",
          "percentage": "6.625",
          "name": "Tax"
        }
      ],
      "service_charges": [
        {
          "amount_money": {
            "currency": "USD",
            "amount": 100
          },
          "calculation_phase": "TOTAL_PHASE",
          "name": "Fee",
          "taxable": false
        }
      ],
      "fulfillments": [
        {
          "type": "PICKUP",
          "state": "PROPOSED",
          "pickup_details": {
            "schedule_type": "ASAP",
            "recipient": {
              "display_name": "Test Name"
            },
            "pickup_at": "2022-11-20T15:28:00.000"
          }
        }
      ],
      "line_items": [
        {
          "item_type": "ITEM",
          "quantity": "1",
          "name": "Test Item1",
          "base_price_money": {
            "amount": 100,
            "currency": "USD"
          }
        }
      ]
    }
  }

Response Body:

{
  "order": {
    "id": "ynOe4jyVfK9UVxNB4SSnV1CfHJKZY",
    "location_id": "944DYRHACBQFT",
    "line_items": [
      {
        "uid": "SdYjSX5pPbt2w6HnPy8E1D",
        "quantity": "1",
        "name": "Test Item1",
        "base_price_money": {
          "amount": 100,
          "currency": "USD"
        },
        "gross_sales_money": {
          "amount": 100,
          "currency": "USD"
        },
        "total_tax_money": {
          "amount": 0,
          "currency": "USD"
        },
        "total_discount_money": {
          "amount": 0,
          "currency": "USD"
        },
        "total_money": {
          "amount": 100,
          "currency": "USD"
        },
        "variation_total_price_money": {
          "amount": 100,
          "currency": "USD"
        },
        "item_type": "ITEM"
      }
    ],
    "taxes": [
        {
            "uid": "7kLhhdmiYjabfnL7qT0m0C",
            "name": "Tax",
            "percentage": "6.625",
            "type": "ADDITIVE",
            "applied_money": {
                "amount": 0,
                "currency": "USD"
            },
            "scope": "LINE_ITEM"
        }
     ],
    "fulfillments": [
      {
        "uid": "KGh51zf37dlS7Ej3UeTgID",
        "type": "PICKUP",
        "state": "PROPOSED",
        "pickup_details": {
          "pickup_at": "2022-11-20T15:28:00.000Z",
          "schedule_type": "ASAP",
          "recipient": {
            "display_name": "Test Name"
          }
        }
      }
    ],
    "created_at": "2022-11-20T15:28:16.821Z",
    "updated_at": "2022-11-20T15:33:45.020Z",
    "state": "OPEN",
    "version": 2,
    "total_tax_money": {
      "amount": 0,
      "currency": "USD"
    },
    "total_discount_money": {
      "amount": 0,
      "currency": "USD"
    },
    "total_tip_money": {
      "amount": 0,
      "currency": "USD"
    },
    "total_money": {
      "amount": 200,
      "currency": "USD"
    },
    "service_charges": [
      {
        "uid": "2lmCWtqR9kklnIPrpAGiYB",
        "name": "Fee",
        "amount_money": {
          "amount": 100,
          "currency": "USD"
        },
        "applied_money": {
          "amount": 100,
          "currency": "USD"
        },
        "calculation_phase": "TOTAL_PHASE",
        "taxable": false,
        "total_money": {
          "amount": 100,
          "currency": "USD"
        },
        "total_tax_money": {
          "amount": 0,
          "currency": "USD"
        },
        "type": "CUSTOM"
      }
    ],
    "total_service_charge_money": {
      "amount": 100,
      "currency": "USD"
    },
    "net_amounts": {
      "total_money": {
        "amount": 200,
        "currency": "USD"
      },
      "tax_money": {
        "amount": 0,
        "currency": "USD"
      },
      "discount_money": {
        "amount": 0,
        "currency": "USD"
      },
      "tip_money": {
        "amount": 0,
        "currency": "USD"
      },
      "service_charge_money": {
        "amount": 100,
        "currency": "USD"
      }
    },
    "ticket_name": "Order",
    "net_amount_due_money": {
      "amount": 200,
      "currency": "USD"
    }
  }
}

I also tried to update the ticket and adding adhoc OrderLineTaxItem object as well but that also does not calculate any tax amount.

When I tried your request it worked as expected and calculated the taxes. What Square API version are you on? :slightly_smiling_face:

I am currently on api version 2022-10-19. If possible, could you share your request and response body alongside of the endpoint you sent the request to as well. I want to see if there’s something that you might have had that I might have missed.

Thanks Bryan

Yeah, this was my request:

{
    "idempotency_key": "{{$guid}}",
    "order": {
      "location_id": "{{location_id}}",
      "state": "OPEN",
      "source": {
        "name": "Source Name"
      },
      "taxes": [
        {
          "scope": "ORDER",
          "type": "ADDITIVE",
          "percentage": "6.625",
          "name": "Tax"
        }
      ],
      "service_charges": [
        {
          "amount_money": {
            "currency": "USD",
            "amount": 100
          },
          "calculation_phase": "TOTAL_PHASE",
          "name": "Fee",
          "taxable": false
        }
      ],
      "fulfillments": [
        {
          "type": "PICKUP",
          "state": "PROPOSED",
          "pickup_details": {
            "schedule_type": "ASAP",
            "recipient": {
              "display_name": "Test Name"
            },
            "pickup_at": "2022-11-20T15:28:00.000"
          }
        }
      ],
      "line_items": [
        {
          "item_type": "ITEM",
          "quantity": "1",
          "name": "Test Item1",
          "base_price_money": {
            "amount": 100,
            "currency": "USD"
          }
        }
      ]
    }
  }

Response:

{
    "order": {
        "id": "I6wUj7K96kvlbgblLwceXtXzRdaZY",
        "location_id": "6VJ7QXVFCPZCM",
        "line_items": [
            {
                "uid": "k1JI6ahXeEXLJFt486eVmC",
                "quantity": "1",
                "name": "Test Item1",
                "base_price_money": {
                    "amount": 100,
                    "currency": "USD"
                },
                "gross_sales_money": {
                    "amount": 100,
                    "currency": "USD"
                },
                "total_tax_money": {
                    "amount": 7,
                    "currency": "USD"
                },
                "total_discount_money": {
                    "amount": 0,
                    "currency": "USD"
                },
                "total_money": {
                    "amount": 107,
                    "currency": "USD"
                },
                "variation_total_price_money": {
                    "amount": 100,
                    "currency": "USD"
                },
                "applied_taxes": [
                    {
                        "uid": "f0kM53AUtilX1ai2LRFakC",
                        "tax_uid": "umeM5chaEIOsuV4ljzxWVD",
                        "applied_money": {
                            "amount": 7,
                            "currency": "USD"
                        }
                    }
                ],
                "item_type": "ITEM"
            }
        ],
        "taxes": [
            {
                "uid": "umeM5chaEIOsuV4ljzxWVD",
                "name": "Tax",
                "percentage": "6.625",
                "type": "ADDITIVE",
                "applied_money": {
                    "amount": 7,
                    "currency": "USD"
                },
                "scope": "ORDER"
            }
        ],
        "fulfillments": [
            {
                "uid": "CzgKNrKADy242Eps25AFfD",
                "type": "PICKUP",
                "state": "PROPOSED",
                "pickup_details": {
                    "pickup_at": "2022-11-20T15:28:00.000Z",
                    "schedule_type": "ASAP",
                    "recipient": {
                        "display_name": "Test Name"
                    }
                }
            }
        ],
        "created_at": "2022-11-21T18:29:10.467Z",
        "updated_at": "2022-11-21T18:29:10.467Z",
        "state": "OPEN",
        "version": 1,
        "total_tax_money": {
            "amount": 7,
            "currency": "USD"
        },
        "total_discount_money": {
            "amount": 0,
            "currency": "USD"
        },
        "total_tip_money": {
            "amount": 0,
            "currency": "USD"
        },
        "total_money": {
            "amount": 207,
            "currency": "USD"
        },
        "service_charges": [
            {
                "uid": "2R6JympMgfWDk8SqhgztZ",
                "name": "Fee",
                "amount_money": {
                    "amount": 100,
                    "currency": "USD"
                },
                "applied_money": {
                    "amount": 100,
                    "currency": "USD"
                },
                "calculation_phase": "TOTAL_PHASE",
                "taxable": false,
                "total_money": {
                    "amount": 100,
                    "currency": "USD"
                },
                "total_tax_money": {
                    "amount": 0,
                    "currency": "USD"
                },
                "type": "CUSTOM"
            }
        ],
        "total_service_charge_money": {
            "amount": 100,
            "currency": "USD"
        },
        "net_amounts": {
            "total_money": {
                "amount": 207,
                "currency": "USD"
            },
            "tax_money": {
                "amount": 7,
                "currency": "USD"
            },
            "discount_money": {
                "amount": 0,
                "currency": "USD"
            },
            "tip_money": {
                "amount": 0,
                "currency": "USD"
            },
            "service_charge_money": {
                "amount": 100,
                "currency": "USD"
            }
        },
        "source": {
            "name": "Source Name"
        },
        "net_amount_due_money": {
            "amount": 207,
            "currency": "USD"
        }
    }
}

:slightly_smiling_face:

Hey Bryan,

My apologies, the request that was causing me issues with tax was when I set the ad hoc tax scope to lint_item. I will leave updated request and response bodies for you to test out on your end.

Request Body:

{
    "idempotency_key": "9be87ef5-c0ff-49ae-b646-8b4a4278be2c",
    "order": {
      "location_id": "944DYRHACBQFT",
      "state": "OPEN",
      "source": {
        "name": "Source Name"
      },
      "taxes": [
        {
          "scope": "LINE_ITEM",
          "type": "ADDITIVE",
          "percentage": "6.625",
          "name": "Tax"
        }
      ],
      "service_charges": [
        {
          "amount_money": {
            "currency": "USD",
            "amount": 100
          },
          "calculation_phase": "TOTAL_PHASE",
          "name": "CustomFee",
          "taxable": false
        }
      ],
      "fulfillments": [
        {
          "type": "PICKUP",
          "state": "PROPOSED",
          "pickup_details": {
            "schedule_type": "ASAP",
            "recipient": {
              "display_name": "Order Name"
            },
            "pickup_at": "2022-11-22T03:30:00.000"
          }
        }
      ],
      "line_items": [
        {
          "item_type": "ITEM",
          "quantity": "1",
          "name": "Test Item 1",
          "base_price_money": {
            "amount": 100,
            "currency": "USD"
          }
        },
        {
          "quantity": "2",
          "base_price_money": {
            "amount": 200,
            "currency": "USD"
          },
          "item_type": "ITEM",
          "name": "Test Item 2"
        }
      ],
      "ticket_name": "Order Ticket Name"
    }
  }

Response Body:

{
  "order": {
    "id": "mtOrqy5dYoyGaWU5zSrOb8snpiYZY",
    "location_id": "944DYRHACBQFT",
    "line_items": [
      {
        "uid": "x9bRDwRikM4dLmEa2QEz4B",
        "quantity": "1",
        "name": "Test Item 1",
        "base_price_money": {
          "amount": 100,
          "currency": "USD"
        },
        "gross_sales_money": {
          "amount": 100,
          "currency": "USD"
        },
        "total_tax_money": {
          "amount": 0,
          "currency": "USD"
        },
        "total_discount_money": {
          "amount": 0,
          "currency": "USD"
        },
        "total_money": {
          "amount": 100,
          "currency": "USD"
        },
        "variation_total_price_money": {
          "amount": 100,
          "currency": "USD"
        },
        "item_type": "ITEM"
      },
      {
        "uid": "FznFifSEgFOCzeym7YmUe",
        "quantity": "2",
        "name": "Test Item 2",
        "base_price_money": {
          "amount": 200,
          "currency": "USD"
        },
        "gross_sales_money": {
          "amount": 400,
          "currency": "USD"
        },
        "total_tax_money": {
          "amount": 0,
          "currency": "USD"
        },
        "total_discount_money": {
          "amount": 0,
          "currency": "USD"
        },
        "total_money": {
          "amount": 400,
          "currency": "USD"
        },
        "variation_total_price_money": {
          "amount": 400,
          "currency": "USD"
        },
        "item_type": "ITEM"
      }
    ],
    "taxes": [
      {
        "uid": "y21l9KL4iC3w10HiyNP7jB",
        "name": "Tax",
        "percentage": "6.625",
        "type": "ADDITIVE",
        "applied_money": {
          "amount": 0,
          "currency": "USD"
        },
        "scope": "LINE_ITEM"
      }
    ],
    "fulfillments": [
      {
        "uid": "FF1YjZdxuNz5xBniCu8nAD",
        "type": "PICKUP",
        "state": "PROPOSED",
        "pickup_details": {
          "pickup_at": "2022-11-22T03:30:00.000Z",
          "schedule_type": "ASAP",
          "recipient": {
            "display_name": "Order Name"
          }
        }
      }
    ],
    "created_at": "2022-11-22T03:24:27.460Z",
    "updated_at": "2022-11-22T03:24:27.460Z",
    "state": "OPEN",
    "version": 1,
    "total_tax_money": {
      "amount": 0,
      "currency": "USD"
    },
    "total_discount_money": {
      "amount": 0,
      "currency": "USD"
    },
    "total_tip_money": {
      "amount": 0,
      "currency": "USD"
    },
    "total_money": {
      "amount": 600,
      "currency": "USD"
    },
    "service_charges": [
      {
        "uid": "1aoowRqeCwf3NZCR0mWvK",
        "name": "CustomFee",
        "amount_money": {
          "amount": 100,
          "currency": "USD"
        },
        "applied_money": {
          "amount": 100,
          "currency": "USD"
        },
        "calculation_phase": "TOTAL_PHASE",
        "taxable": false,
        "total_money": {
          "amount": 100,
          "currency": "USD"
        },
        "total_tax_money": {
          "amount": 0,
          "currency": "USD"
        },
        "type": "CUSTOM"
      }
    ],
    "total_service_charge_money": {
      "amount": 100,
      "currency": "USD"
    },
    "net_amounts": {
      "total_money": {
        "amount": 600,
        "currency": "USD"
      },
      "tax_money": {
        "amount": 0,
        "currency": "USD"
      },
      "discount_money": {
        "amount": 0,
        "currency": "USD"
      },
      "tip_money": {
        "amount": 0,
        "currency": "USD"
      },
      "service_charge_money": {
        "amount": 100,
        "currency": "USD"
      }
    },
    "source": {
      "name": "Source Name"
    },
    "ticket_name": "Order Ticket Name",
    "net_amount_due_money": {
      "amount": 600,
      "currency": "USD"
    }
  }
}

Here you will see that I have configured the adhoc tax to line_item but I am not seeing. Are there any changes I need to perform from the Test business location dashboard?

Thank you

The tax isn’t being applied cause there’s not applied_taxes in the line item and uid in the tax. For example:
Request:

{
    "idempotency_key": "{{$guid}}",
    "order": {
      "location_id": "{{location_id}}",
      "state": "OPEN",
      "source": {
        "name": "Source Name"
      },
      "taxes": [
        {
          "scope": "LINE_ITEM",
          "uid": "slkdhfosifw",
          "type": "ADDITIVE",
          "percentage": "6.625",
          "name": "Tax"
        }
      ],
      "service_charges": [
        {
          "amount_money": {
            "currency": "USD",
            "amount": 100
          },
          "calculation_phase": "TOTAL_PHASE",
          "name": "CustomFee",
          "taxable": false
        }
      ],
      "fulfillments": [
        {
          "type": "PICKUP",
          "state": "PROPOSED",
          "pickup_details": {
            "schedule_type": "ASAP",
            "recipient": {
              "display_name": "Order Name"
            },
            "pickup_at": "2022-11-22T03:30:00.000"
          }
        }
      ],
      "line_items": [
        {
          "item_type": "ITEM",
           "applied_taxes": [
            {
              "tax_uid": "slkdhfosifw"
            }
           ],
          "quantity": "1",
          "name": "Test Item 1",
          "base_price_money": {
            "amount": 100,
            "currency": "USD"
          }
        },
        {
          "quantity": "2",
          "base_price_money": {
            "amount": 200,
            "currency": "USD"
          },
          "item_type": "ITEM",
          "name": "Test Item 2"
        }
      ],
      "ticket_name": "Order Ticket Name"
    }
  }

Response:

{
    "order": {
        "id": "LeHUQUXEBgrty37k5edUmttPYJUZY",
        "location_id": "3Z4V4WHQK64X9",
        "line_items": [
            {
                "uid": "aqc83R8QuivqSQuyTMvvE",
                "quantity": "1",
                "name": "Test Item 1",
                "base_price_money": {
                    "amount": 100,
                    "currency": "USD"
                },
                "gross_sales_money": {
                    "amount": 100,
                    "currency": "USD"
                },
                "total_tax_money": {
                    "amount": 7,
                    "currency": "USD"
                },
                "total_discount_money": {
                    "amount": 0,
                    "currency": "USD"
                },
                "total_money": {
                    "amount": 107,
                    "currency": "USD"
                },
                "variation_total_price_money": {
                    "amount": 100,
                    "currency": "USD"
                },
                "applied_taxes": [
                    {
                        "uid": "ysTnTchbm6A9T7dgAzpRa",
                        "tax_uid": "slkdhfosifw",
                        "applied_money": {
                            "amount": 7,
                            "currency": "USD"
                        }
                    }
                ],
                "item_type": "ITEM"
            },
            {
                "uid": "czexiKFQe0fh1ml3uz88k",
                "quantity": "2",
                "name": "Test Item 2",
                "base_price_money": {
                    "amount": 200,
                    "currency": "USD"
                },
                "gross_sales_money": {
                    "amount": 400,
                    "currency": "USD"
                },
                "total_tax_money": {
                    "amount": 0,
                    "currency": "USD"
                },
                "total_discount_money": {
                    "amount": 0,
                    "currency": "USD"
                },
                "total_money": {
                    "amount": 400,
                    "currency": "USD"
                },
                "variation_total_price_money": {
                    "amount": 400,
                    "currency": "USD"
                },
                "item_type": "ITEM"
            }
        ],
        "taxes": [
            {
                "uid": "slkdhfosifw",
                "name": "Tax",
                "percentage": "6.625",
                "type": "ADDITIVE",
                "applied_money": {
                    "amount": 7,
                    "currency": "USD"
                },
                "scope": "LINE_ITEM"
            }
        ],
        "fulfillments": [
            {
                "uid": "itoBO7uZbwmIXnsvNpMvRC",
                "type": "PICKUP",
                "state": "PROPOSED",
                "pickup_details": {
                    "pickup_at": "2022-11-22T03:30:00.000Z",
                    "schedule_type": "ASAP",
                    "recipient": {
                        "display_name": "Order Name"
                    }
                }
            }
        ],
        "created_at": "2022-11-22T16:47:35.034Z",
        "updated_at": "2022-11-22T16:47:35.034Z",
        "state": "OPEN",
        "version": 1,
        "total_tax_money": {
            "amount": 7,
            "currency": "USD"
        },
        "total_discount_money": {
            "amount": 0,
            "currency": "USD"
        },
        "total_tip_money": {
            "amount": 0,
            "currency": "USD"
        },
        "total_money": {
            "amount": 607,
            "currency": "USD"
        },
        "service_charges": [
            {
                "uid": "7kU2G8AIS7GdWriuME2lUC",
                "name": "CustomFee",
                "amount_money": {
                    "amount": 100,
                    "currency": "USD"
                },
                "applied_money": {
                    "amount": 100,
                    "currency": "USD"
                },
                "calculation_phase": "TOTAL_PHASE",
                "taxable": false,
                "total_money": {
                    "amount": 100,
                    "currency": "USD"
                },
                "total_tax_money": {
                    "amount": 0,
                    "currency": "USD"
                },
                "type": "CUSTOM"
            }
        ],
        "total_service_charge_money": {
            "amount": 100,
            "currency": "USD"
        },
        "net_amounts": {
            "total_money": {
                "amount": 607,
                "currency": "USD"
            },
            "tax_money": {
                "amount": 7,
                "currency": "USD"
            },
            "discount_money": {
                "amount": 0,
                "currency": "USD"
            },
            "tip_money": {
                "amount": 0,
                "currency": "USD"
            },
            "service_charge_money": {
                "amount": 100,
                "currency": "USD"
            }
        },
        "source": {
            "name": "Source Name"
        },
        "ticket_name": "Order Ticket Name",
        "net_amount_due_money": {
            "amount": 607,
            "currency": "USD"
        }
    }
}

:slightly_smiling_face: