i don’t know how to create a sample order with service charge taxable in line item.
below is request:
{
“idempotency_key”: “{{$guid}}”,
“order”: {
“location_id”: “LF1GYFQK5DCP4”,
“line_items”: [
{
“catalog_object_id”: “G254XOXDZYCYNED7CW3J6SQA”,
“quantity”: “2”,
“name”: “Lychee & Peach Tea Slush(LCHJ 1,T200,L1)芝芝粉荔桃”,
“variation_name”: “”,
“base_price_money”: {
“amount”: 200,
“currency”: “USD”
},
“item_type”: “ITEM”,
“applied_taxes”: [
{
“tax_uid”: “e23972c7-6da5-4905-952a-26a06ac2788a”
}
],
“applied_service_charges”: [
{
“uid”: “serviceCharge”,
“service_charge_uid”: “e23972c7-6da5-4905-952a-26a06ac27666”
}
]
}
],
“taxes”: [
{
“uid”: “e23972c7-6da5-4905-952a-26a06ac2788a”,
“name”: “tax”,
“percentage”:“2”,
“type”: “ADDITIVE”,
“scope”: “LINE_ITEM”
}
],
“service_charges”: [
{
“uid”: “e23972c7-6da5-4905-952a-26a06ac27666”,
“amount_money”: {
“amount”: 20,
“currency”: “USD”
},
“name”: “Fee”,
“calculation_phase”: “SUBTOTAL_PHASE”,
“scope”: “LINE_ITEM”,
“taxable”: false,
“applied_taxes”: [
{
“tax_uid”: “e23972c7-6da5-4905-952a-26a06ac2788a”
}
]
}
],
“pricing_options”: {
“auto_apply_discounts”: false,
“auto_apply_taxes”: false
}
}
}
and response is:
{
“errors”: [
{
“code”: “BAD_REQUEST”,
“detail”: “Unexpected calculation phase SURCHARGE_PHASE for applied service charge custom-surcharge:e23972c7-6da5-4905-952a-26a06ac27666.”,
“category”: “INVALID_REQUEST_ERROR”
}
]
}
could you tell me the reason why it fails,
or give me a correct sample?