Create a tax rule
How to create a tax rule via API
To create a new tax rule, send a POST
request to the /api/tax_rules
endpoint, passing the resource arguments in the request body.
Request
POST https://yourdomain.commercelayer.io/api/tax_rules
Arguments
Body Parameter | Type | Required |
---|---|---|
type |
| Required |
attributes.adjustment_taxable |
| Optional, default is 'false' |
attributes.country_code_regex |
| Optional |
attributes.freight_taxable |
| Optional, default is 'false' |
attributes.gift_card_taxable |
| Optional, default is 'false' |
attributes.metadata |
| Optional |
attributes.name |
| Required |
attributes.not_country_code_regex |
| Optional |
attributes.not_state_code_regex |
| Optional |
attributes.not_zip_code_regex |
| Optional |
attributes.payment_method_taxable |
| Optional, default is 'false' |
attributes.reference |
| Optional |
attributes.reference_origin |
| Optional |
attributes.state_code_regex |
| Optional |
attributes.tax_rate |
| Optional, default is 0.0 |
attributes.zip_code_regex |
| Optional |
relationships.manual_tax_calculator |
| Required |
Example
The following request creates a new tax rule:
Last updated