admin管理员组文章数量:1125004
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": []
}
]
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": []
}
]
Share
Improve this question
edited Feb 12, 2024 at 11:59
fuxia♦
107k38 gold badges255 silver badges459 bronze badges
asked Feb 12, 2024 at 6:41
HeenaHeena
1112 bronze badges
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 Commented Feb 12, 2024 at 12:44
- You would do better asking somewhere WooCommerce-specific though, e,g, start at developer.woo.com – Rup Commented Feb 12, 2024 at 12:46
- @Rup right. Tax class having string. – Heena Commented Feb 13, 2024 at 6:23
1 Answer
Reset to default 1Here 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": []
}
]
本文标签: How to add feelines using woocommerce rest API v3
版权声明:本文标题:How to add fee_lines using woocommerce rest API v3? 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1736653363a1946194.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论