0

Can i use "fee_lines" for below 'booking fee' and 'waiter tip' in rest API of woocommerce ? If yes then send here example please.

I used like below but not working.

    "fee_lines": [
    {
      "name": "7.5% Booking Fee",
"tax_status" : 'taxable',
      "tax_class": 0,
      "total_tax": "77.25",
      "total": "77.25",
      "taxes": [],
      "meta_data":  [] 
    },
  {
      "name": "Waiter Tip (5%)",
"tax_status" : 'taxable',
      "tax_class": 0,
      "total_tax": "115.875",
      "total": "115.875",
      "taxes": [],
      "meta_data":  [] 
    }
  ]

enter image description here

3
  • Tax class = 0 as an integer looks wrong to me - the documentation says it's a string. What do you get back from the list all tax classes endpoint? The example response there has "standard", "reduced-rate" and "zero-rate". You'd hope the API would give you an error if that's the issue though. Any errors in your site's server error log / WordPress debug log / PHP error log if different?
    – Rup
    Feb 12 at 12:44
  • You would do better asking somewhere WooCommerce-specific though, e,g, start at developer.woo.com
    – Rup
    Feb 12 at 12:46
  • @Rup right. Tax class having string.
    – Heena
    Feb 13 at 6:23

1 Answer 1

1

Here is my code that working fine.

"fee_lines": [
        { 
            "name": "7.5% Booking Fee",
            "tax_status": "taxable",
            "tax_class": "",
            "total": "26.02",
            "total_tax": "26.02",
            "taxes": [],
            "meta_data": []
        },
        { 
            "name": "Waiter Tip (5%)",
            "tax_status": "taxable",
            "tax_class": "",
            "total": "8.00",
            "total_tax": "8.00",
            "taxes": [],
            "meta_data": []
        }
    ]

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.