fluentcart-developer 1.1.0 → 1.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CLAUDE.md +22 -22
- package/LICENSE +21 -21
- package/README.md +169 -127
- package/SKILL.md +127 -127
- package/bin/index.js +281 -281
- package/package.json +48 -37
- package/skills/fluentcart-developer/SKILL.md +172 -172
- package/skills/fluentcart-developer/examples/README.md +25 -25
- package/skills/fluentcart-developer/examples/fluentcart-starter-child-theme/fluent-cart/checkout.php +32 -32
- package/skills/fluentcart-developer/examples/fluentcart-starter-child-theme/functions.php +40 -40
- package/skills/fluentcart-developer/examples/sample-custom-addon/fluentcart-custom-addon.php +114 -114
- package/skills/fluentcart-developer/examples/sample-custom-payment-gateway/fluentcart-custom-gateway-example.php +149 -149
- package/skills/fluentcart-developer/examples/sample-fee-surcharge-plugin/fluentcart-fee-surcharge.php +38 -38
- package/skills/fluentcart-developer/examples/sample-shipping-carrier/fluentcart-custom-shipping-carrier.php +62 -62
- package/skills/fluentcart-developer/references/action-hooks-admin-templates.md +787 -787
- package/skills/fluentcart-developer/references/action-hooks-cart-checkout.md +1355 -1355
- package/skills/fluentcart-developer/references/action-hooks-customers-users.md +266 -266
- package/skills/fluentcart-developer/references/action-hooks-licenses.md +855 -855
- package/skills/fluentcart-developer/references/action-hooks-orders.md +631 -631
- package/skills/fluentcart-developer/references/action-hooks-payments-integrations.md +963 -963
- package/skills/fluentcart-developer/references/action-hooks-products-coupons.md +585 -585
- package/skills/fluentcart-developer/references/action-hooks-subscriptions.md +661 -661
- package/skills/fluentcart-developer/references/database-models-query-builder.md +194 -194
- package/skills/fluentcart-developer/references/database-models-reference.md +604 -604
- package/skills/fluentcart-developer/references/database-schema-reference.md +940 -940
- package/skills/fluentcart-developer/references/engineering-notes.md +154 -154
- package/skills/fluentcart-developer/references/fee-system-guide.md +449 -449
- package/skills/fluentcart-developer/references/filter-hooks-cart-checkout.md +1202 -1202
- package/skills/fluentcart-developer/references/filter-hooks-customers-subscriptions.md +902 -902
- package/skills/fluentcart-developer/references/filter-hooks-integrations-advanced.md +1598 -1598
- package/skills/fluentcart-developer/references/filter-hooks-orders-payments.md +1319 -1319
- package/skills/fluentcart-developer/references/filter-hooks-products-pricing.md +628 -628
- package/skills/fluentcart-developer/references/filter-hooks-settings-configuration.md +1177 -1177
- package/skills/fluentcart-developer/references/fluentcart-developer-guide.md +154 -154
- package/skills/fluentcart-developer/references/ghost-product-selling.md +458 -458
- package/skills/fluentcart-developer/references/modules-and-extensions-reference.md +224 -224
- package/skills/fluentcart-developer/references/payment-gateway-integration.md +761 -761
- package/skills/fluentcart-developer/references/rest-api-checkout.md +286 -286
- package/skills/fluentcart-developer/references/rest-api-coupons.md +794 -794
- package/skills/fluentcart-developer/references/rest-api-customer-profile.md +190 -190
- package/skills/fluentcart-developer/references/rest-api-customers.md +1121 -1121
- package/skills/fluentcart-developer/references/rest-api-dashboard-utilities.md +219 -219
- package/skills/fluentcart-developer/references/rest-api-email-notifications.md +619 -619
- package/skills/fluentcart-developer/references/rest-api-files.md +290 -290
- package/skills/fluentcart-developer/references/rest-api-integrations.md +324 -324
- package/skills/fluentcart-developer/references/rest-api-labels-attributes.md +321 -321
- package/skills/fluentcart-developer/references/rest-api-licensing.md +171 -171
- package/skills/fluentcart-developer/references/rest-api-order-bumps.md +200 -200
- package/skills/fluentcart-developer/references/rest-api-orders.md +1241 -1241
- package/skills/fluentcart-developer/references/rest-api-overview.md +131 -131
- package/skills/fluentcart-developer/references/rest-api-products.md +2563 -2563
- package/skills/fluentcart-developer/references/rest-api-public-shop.md +172 -172
- package/skills/fluentcart-developer/references/rest-api-reference.md +552 -552
- package/skills/fluentcart-developer/references/rest-api-reports.md +377 -377
- package/skills/fluentcart-developer/references/rest-api-roles-permissions.md +147 -147
- package/skills/fluentcart-developer/references/rest-api-settings.md +528 -528
- package/skills/fluentcart-developer/references/rest-api-shipping.md +799 -799
- package/skills/fluentcart-developer/references/rest-api-subscriptions.md +606 -606
- package/skills/fluentcart-developer/references/rest-api-tax.md +356 -356
- package/skills/fluentcart-developer/references/subscription-customization.md +197 -197
- package/skills/fluentcart-developer/scripts/cli.js +1 -1
- package/.gitattributes +0 -2
- package/CONTRIBUTING.md +0 -73
- package/copy-skills.js +0 -43
- package/skills.sh.json +0 -13
|
@@ -1,356 +1,356 @@
|
|
|
1
|
-
# Tax API
|
|
2
|
-
|
|
3
|
-
Configure tax classes, manage country-specific tax rates, set up tax configuration, and handle EU VAT/OSS compliance and tax filing.
|
|
4
|
-
|
|
5
|
-
**Base URL:** `https://your-site.com/wp-json/fluent-cart/v2`
|
|
6
|
-
|
|
7
|
-
> All monetary values are in cents (e.g., `$10.00` = `1000`).
|
|
8
|
-
|
|
9
|
-
---
|
|
10
|
-
|
|
11
|
-
## Endpoints Overview
|
|
12
|
-
|
|
13
|
-
| Group | Method | Endpoint | Description |
|
|
14
|
-
|-------|--------|----------|-------------|
|
|
15
|
-
| **Tax Filing** | GET | `/taxes` | List Tax Records (Order-level filing) |
|
|
16
|
-
| | POST | `/taxes` | Mark Taxes as Filed |
|
|
17
|
-
| **Tax Classes** | GET | `/tax/classes` | List Tax Classes |
|
|
18
|
-
| | POST | `/tax/classes` | Create Tax Class |
|
|
19
|
-
| | DELETE | `/tax/classes/{id}` | Delete Tax Class |
|
|
20
|
-
| **Tax Rates** | GET | `/tax/rates` | List All Tax Rates (grouped by region) |
|
|
21
|
-
| | GET | `/tax/rates/country/rates/{country_code}` | Get Country Tax Rates |
|
|
22
|
-
| | POST | `/tax/country-status/{country_code}` | Enable/Disable Country Tax Status |
|
|
23
|
-
| | POST | `/tax/country/rate` | Create Tax Rate |
|
|
24
|
-
| | PUT | `/tax/country/rate/{id}` | Update Tax Rate |
|
|
25
|
-
| | DELETE | `/tax/country/rate/{id}` | Delete Tax Rate |
|
|
26
|
-
| | POST | `/tax/rates/country/override` | Save Shipping Tax Override |
|
|
27
|
-
| | DELETE | `/tax/rates/country/override/{id}` | Delete Shipping Tax Override |
|
|
28
|
-
| | GET | `/tax/product-overrides/{country_code}` | Get Product Category Tax Overrides |
|
|
29
|
-
| | POST | `/tax/product-overrides` | Save Product Category Tax Override |
|
|
30
|
-
| | DELETE | `/tax/product-overrides/{id}` | Delete Product Category Tax Override |
|
|
31
|
-
| | GET | `/tax/country-tax-id/{country_code}` | Get Country Tax ID |
|
|
32
|
-
| | POST | `/tax/country-tax-id/{country_code}` | Save Country Tax ID |
|
|
33
|
-
| **Tax Config** | GET | `/tax/configuration/rates` | Get Preconfigured Tax Rates |
|
|
34
|
-
| | POST | `/tax/configuration/countries` | Save Configured Countries |
|
|
35
|
-
| | GET | `/tax/configuration/settings` | Get Tax Settings |
|
|
36
|
-
| | POST | `/tax/configuration/settings` | Save Tax Settings |
|
|
37
|
-
| **EU VAT** | POST | `/tax/configuration/settings/eu-vat` | Save EU VAT Cross-Border Settings |
|
|
38
|
-
| | POST | `/tax/configuration/settings/eu-vat/reset-rates` | Reset EU VAT Rates |
|
|
39
|
-
| | GET | `/tax/configuration/settings/eu-vat/product-overrides` | Get EU VAT Product Overrides |
|
|
40
|
-
| | GET | `/tax/configuration/settings/eu-vat/oss-rates` | Get OSS Country Rates |
|
|
41
|
-
| | POST | `/tax/configuration/settings/eu-vat/oss-rates` | Save OSS Country Rates |
|
|
42
|
-
|
|
43
|
-
---
|
|
44
|
-
|
|
45
|
-
## Tax Filing
|
|
46
|
-
|
|
47
|
-
Manage order-level tax records for filing and reporting purposes.
|
|
48
|
-
|
|
49
|
-
**Prefix:** `/fluent-cart/v2/taxes` | **Policy:** `AdminPolicy`
|
|
50
|
-
|
|
51
|
-
### List Tax Records
|
|
52
|
-
|
|
53
|
-
`GET /fluent-cart/v2/taxes`
|
|
54
|
-
|
|
55
|
-
Retrieve a paginated list of order tax rate records.
|
|
56
|
-
|
|
57
|
-
#### Parameters
|
|
58
|
-
|
|
59
|
-
| Parameter | Type | Location | Required | Description |
|
|
60
|
-
|-----------|------|----------|----------|-------------|
|
|
61
|
-
| `page` | integer | query | No | Page number |
|
|
62
|
-
| `per_page` | integer | query | No | Records per page (default: 10, max: 200) |
|
|
63
|
-
| `search` | string | query | No | Search by ID, order_id, country, state, postcode, or name |
|
|
64
|
-
| `sort_by` | string | query | No | Column to sort by (default: `id`) |
|
|
65
|
-
| `sort_type` | string | query | No | `asc` or `desc` (default: `desc`) |
|
|
66
|
-
| `active_view` | string | query | No | Tab filter: `filed` or `not_filed` |
|
|
67
|
-
| `filter_type` | string | query | No | `simple` or `advanced` |
|
|
68
|
-
| `advanced_filters` | string (JSON) | query | No | JSON filter groups by country, region, name, filed status |
|
|
69
|
-
|
|
70
|
-
#### Response
|
|
71
|
-
|
|
72
|
-
```json
|
|
73
|
-
{
|
|
74
|
-
"taxes": {
|
|
75
|
-
"current_page": 1,
|
|
76
|
-
"data": [
|
|
77
|
-
{
|
|
78
|
-
"id": 1,
|
|
79
|
-
"order_id": 42,
|
|
80
|
-
"tax_rate_id": 5,
|
|
81
|
-
"shipping_tax": 150,
|
|
82
|
-
"order_tax": 1000,
|
|
83
|
-
"total_tax": 1150,
|
|
84
|
-
"meta": {
|
|
85
|
-
"rates": [],
|
|
86
|
-
"tax_country": "US",
|
|
87
|
-
"store_vat_number": ""
|
|
88
|
-
},
|
|
89
|
-
"filed_at": null,
|
|
90
|
-
"created_at": "2025-06-01 12:00:00",
|
|
91
|
-
"updated_at": "2025-06-01 12:00:00"
|
|
92
|
-
}
|
|
93
|
-
],
|
|
94
|
-
"per_page": 10,
|
|
95
|
-
"total": 50,
|
|
96
|
-
"last_page": 5
|
|
97
|
-
}
|
|
98
|
-
}
|
|
99
|
-
```
|
|
100
|
-
|
|
101
|
-
#### Example
|
|
102
|
-
|
|
103
|
-
```bash
|
|
104
|
-
curl -X GET "https://example.com/wp-json/fluent-cart/v2/taxes?page=1&per_page=20&active_view=not_filed" \
|
|
105
|
-
-u "username:app_password"
|
|
106
|
-
```
|
|
107
|
-
|
|
108
|
-
---
|
|
109
|
-
|
|
110
|
-
### Mark Taxes as Filed
|
|
111
|
-
|
|
112
|
-
`POST /fluent-cart/v2/taxes`
|
|
113
|
-
|
|
114
|
-
Mark one or more order tax records as filed by setting their `filed_at` timestamp.
|
|
115
|
-
|
|
116
|
-
#### Parameters
|
|
117
|
-
|
|
118
|
-
| Parameter | Type | Location | Required | Description |
|
|
119
|
-
|-----------|------|----------|----------|-------------|
|
|
120
|
-
| `ids` | array | body | Yes | Array of OrderTaxRate record IDs to mark as filed |
|
|
121
|
-
|
|
122
|
-
#### Response
|
|
123
|
-
|
|
124
|
-
```json
|
|
125
|
-
{
|
|
126
|
-
"message": "Taxes marked as filed successfully"
|
|
127
|
-
}
|
|
128
|
-
```
|
|
129
|
-
|
|
130
|
-
#### Example
|
|
131
|
-
|
|
132
|
-
```bash
|
|
133
|
-
curl -X POST "https://example.com/wp-json/fluent-cart/v2/taxes" \
|
|
134
|
-
-u "username:app_password" \
|
|
135
|
-
-H "Content-Type: application/json" \
|
|
136
|
-
-d '{"ids": [1, 2, 3, 5]}'
|
|
137
|
-
```
|
|
138
|
-
|
|
139
|
-
---
|
|
140
|
-
|
|
141
|
-
## Tax Classes
|
|
142
|
-
|
|
143
|
-
Group tax rates by category (e.g., Standard, Reduced, Zero). Maximum 6 classes allowed. Standard cannot be deleted.
|
|
144
|
-
|
|
145
|
-
**Prefix:** `/fluent-cart/v2/tax/classes` | **Policy:** `StoreSettingsPolicy`
|
|
146
|
-
|
|
147
|
-
### List Tax Classes
|
|
148
|
-
|
|
149
|
-
`GET /fluent-cart/v2/tax/classes`
|
|
150
|
-
|
|
151
|
-
#### Response
|
|
152
|
-
|
|
153
|
-
```json
|
|
154
|
-
{
|
|
155
|
-
"classes": [
|
|
156
|
-
{
|
|
157
|
-
"id": 1,
|
|
158
|
-
"title": "Standard",
|
|
159
|
-
"slug": "standard",
|
|
160
|
-
"created_at": "2025-01-01 00:00:00"
|
|
161
|
-
},
|
|
162
|
-
{
|
|
163
|
-
"id": 2,
|
|
164
|
-
"title": "Reduced",
|
|
165
|
-
"slug": "reduced",
|
|
166
|
-
"created_at": "2025-01-01 00:00:00"
|
|
167
|
-
}
|
|
168
|
-
],
|
|
169
|
-
"max_classes": 6,
|
|
170
|
-
"next_builtin": {
|
|
171
|
-
"slug": "zero",
|
|
172
|
-
"title": "Zero"
|
|
173
|
-
}
|
|
174
|
-
}
|
|
175
|
-
```
|
|
176
|
-
|
|
177
|
-
---
|
|
178
|
-
|
|
179
|
-
### Create Tax Class
|
|
180
|
-
|
|
181
|
-
`POST /fluent-cart/v2/tax/classes`
|
|
182
|
-
|
|
183
|
-
#### Parameters
|
|
184
|
-
|
|
185
|
-
| Parameter | Type | Location | Required | Description |
|
|
186
|
-
|-----------|------|----------|----------|-------------|
|
|
187
|
-
| `title` | string | body | Conditional | Tax class title (max 30 chars). Required unless built-in slug passed |
|
|
188
|
-
| `slug` | string | body | No | Pass `reduced` or `zero` to create built-in class |
|
|
189
|
-
|
|
190
|
-
#### Example
|
|
191
|
-
|
|
192
|
-
```bash
|
|
193
|
-
curl -X POST "https://example.com/wp-json/fluent-cart/v2/tax/classes" \
|
|
194
|
-
-u "username:app_password" \
|
|
195
|
-
-H "Content-Type: application/json" \
|
|
196
|
-
-d '{"title": "Digital Goods"}'
|
|
197
|
-
```
|
|
198
|
-
|
|
199
|
-
---
|
|
200
|
-
|
|
201
|
-
### Delete Tax Class
|
|
202
|
-
|
|
203
|
-
`DELETE /fluent-cart/v2/tax/classes/{id}`
|
|
204
|
-
|
|
205
|
-
Products/rates referencing deleted class fall back to Standard. Standard class cannot be deleted.
|
|
206
|
-
|
|
207
|
-
---
|
|
208
|
-
|
|
209
|
-
## Tax Rates
|
|
210
|
-
|
|
211
|
-
**Prefix:** `/fluent-cart/v2/tax` | **Policy:** `StoreSettingsPolicy`
|
|
212
|
-
|
|
213
|
-
### List All Tax Rates
|
|
214
|
-
|
|
215
|
-
`GET /fluent-cart/v2/tax/rates`
|
|
216
|
-
|
|
217
|
-
Retrieve all rates grouped by region/continent and country.
|
|
218
|
-
|
|
219
|
-
### Get Country Tax Rates
|
|
220
|
-
|
|
221
|
-
`GET /fluent-cart/v2/tax/rates/country/rates/{country_code}`
|
|
222
|
-
|
|
223
|
-
### Update Country Tax Status
|
|
224
|
-
|
|
225
|
-
`POST /fluent-cart/v2/tax/country-status/{country_code}`
|
|
226
|
-
|
|
227
|
-
#### Parameters
|
|
228
|
-
|
|
229
|
-
| Parameter | Type | Location | Required | Description |
|
|
230
|
-
|-----------|------|----------|----------|-------------|
|
|
231
|
-
| `country_code` | string | path | Yes | ISO country code or `EU` |
|
|
232
|
-
| `enabled` | integer | body | Yes | `1` to enable, `0` to disable |
|
|
233
|
-
|
|
234
|
-
---
|
|
235
|
-
|
|
236
|
-
### Create Tax Rate
|
|
237
|
-
|
|
238
|
-
`POST /fluent-cart/v2/tax/country/rate`
|
|
239
|
-
|
|
240
|
-
#### Parameters
|
|
241
|
-
|
|
242
|
-
| Parameter | Type | Location | Required | Description |
|
|
243
|
-
|-----------|------|----------|----------|-------------|
|
|
244
|
-
| `class_id` | integer | body | Yes | Tax class ID |
|
|
245
|
-
| `country` | string | body | No | ISO country code (max 45 chars) |
|
|
246
|
-
| `state` | string | body | No | State/province code |
|
|
247
|
-
| `postcode` | string | body | No | Postal code |
|
|
248
|
-
| `city` | string | body | No | City name |
|
|
249
|
-
| `rate` | string | body | No | Rate percentage (e.g. `"19.0000"`) |
|
|
250
|
-
| `name` | string | body | No | Display name |
|
|
251
|
-
| `group` | string | body | No | Geographic group (e.g. `EU`, `NA`) |
|
|
252
|
-
| `priority` | integer | body | No | Application priority (min 1) |
|
|
253
|
-
| `is_compound` | integer | body | No | Compound tax flag (`0` or `1`) |
|
|
254
|
-
| `for_shipping` | integer | body | No | Shipping override rate (null = none) |
|
|
255
|
-
| `for_order` | integer | body | No | Order-level tax flag (`0` or `1`) |
|
|
256
|
-
|
|
257
|
-
---
|
|
258
|
-
|
|
259
|
-
### Update Tax Rate
|
|
260
|
-
|
|
261
|
-
`PUT /fluent-cart/v2/tax/country/rate/{id}`
|
|
262
|
-
|
|
263
|
-
---
|
|
264
|
-
|
|
265
|
-
### Delete Tax Rate
|
|
266
|
-
|
|
267
|
-
`DELETE /fluent-cart/v2/tax/country/rate/{id}`
|
|
268
|
-
|
|
269
|
-
---
|
|
270
|
-
|
|
271
|
-
### Shipping Tax Overrides
|
|
272
|
-
|
|
273
|
-
- `POST /fluent-cart/v2/tax/rates/country/override` — Save shipping tax override on a rate.
|
|
274
|
-
- `DELETE /fluent-cart/v2/tax/rates/country/override/{id}` — Remove shipping tax override.
|
|
275
|
-
|
|
276
|
-
---
|
|
277
|
-
|
|
278
|
-
### Product Category Tax Overrides
|
|
279
|
-
|
|
280
|
-
- `GET /fluent-cart/v2/tax/product-overrides/{country_code}` — Get product category overrides for country.
|
|
281
|
-
- `POST /fluent-cart/v2/tax/product-overrides` — Create or update product category tax override.
|
|
282
|
-
- `DELETE /fluent-cart/v2/tax/product-overrides/{id}` — Delete product category tax override.
|
|
283
|
-
|
|
284
|
-
---
|
|
285
|
-
|
|
286
|
-
### Store Tax ID (VAT/GST/EIN)
|
|
287
|
-
|
|
288
|
-
- `GET /fluent-cart/v2/tax/country-tax-id/{country_code}` — Get store tax ID for country.
|
|
289
|
-
- `POST /fluent-cart/v2/tax/country-tax-id/{country_code}` — Save store tax ID for country.
|
|
290
|
-
|
|
291
|
-
---
|
|
292
|
-
|
|
293
|
-
## Tax Configuration
|
|
294
|
-
|
|
295
|
-
**Prefix:** `/fluent-cart/v2/tax/configuration` | **Policy:** `StoreSettingsPolicy`
|
|
296
|
-
|
|
297
|
-
### Get Preconfigured Tax Rates
|
|
298
|
-
|
|
299
|
-
`GET /fluent-cart/v2/tax/configuration/rates`
|
|
300
|
-
|
|
301
|
-
Returns default tax rates from built-in rates dataset (`tax.php`) grouped by region/country.
|
|
302
|
-
|
|
303
|
-
### Save Configured Countries
|
|
304
|
-
|
|
305
|
-
`POST /fluent-cart/v2/tax/configuration/countries`
|
|
306
|
-
|
|
307
|
-
Imports default tax rates for selected country codes.
|
|
308
|
-
|
|
309
|
-
```bash
|
|
310
|
-
curl -X POST "https://example.com/wp-json/fluent-cart/v2/tax/configuration/countries" \
|
|
311
|
-
-u "username:app_password" \
|
|
312
|
-
-H "Content-Type: application/json" \
|
|
313
|
-
-d '{"countries": ["DE", "FR", "IT", "ES"]}'
|
|
314
|
-
```
|
|
315
|
-
|
|
316
|
-
### Get / Save Tax Settings
|
|
317
|
-
|
|
318
|
-
- `GET /fluent-cart/v2/tax/configuration/settings`
|
|
319
|
-
- `POST /fluent-cart/v2/tax/configuration/settings`
|
|
320
|
-
|
|
321
|
-
#### Settings Object Fields
|
|
322
|
-
|
|
323
|
-
| Field | Values | Description |
|
|
324
|
-
|-------|--------|-------------|
|
|
325
|
-
| `enable_tax` | `"yes"`, `"no"` | Master tax switch |
|
|
326
|
-
| `tax_inclusion` | `"included"`, `"excluded"` | Whether catalog prices include tax |
|
|
327
|
-
| `tax_calculation_basis` | `"shipping"`, `"billing"`, `"store"` | Address basis for calculation |
|
|
328
|
-
| `tax_rounding` | `"item"`, `"total"`, `"subtotal"` | Rounding application point |
|
|
329
|
-
| `checkout_tax_breakdown_display` | `"itemized"`, `"simplified"` | Display format at checkout |
|
|
330
|
-
| `tax_display_label` | string | Label used at checkout (e.g. `"VAT"`) |
|
|
331
|
-
| `price_suffix_included` | string | Suffix for tax-included prices |
|
|
332
|
-
| `price_suffix_excluded` | string | Suffix for tax-excluded prices |
|
|
333
|
-
| `eu_vat_settings` | object | EU VAT compliance configuration |
|
|
334
|
-
|
|
335
|
-
---
|
|
336
|
-
|
|
337
|
-
## EU VAT & OSS Compliance
|
|
338
|
-
|
|
339
|
-
**Prefix:** `/fluent-cart/v2/tax/configuration/settings/eu-vat` | **Policy:** `StoreSettingsPolicy`
|
|
340
|
-
|
|
341
|
-
### Save EU VAT Cross-Border Settings
|
|
342
|
-
|
|
343
|
-
`POST /fluent-cart/v2/tax/configuration/settings/eu-vat`
|
|
344
|
-
|
|
345
|
-
Multi-action endpoint dispatched via `action`:
|
|
346
|
-
|
|
347
|
-
1. `euCrossBorderSettings`: Save method (`oss`, `home`, `specific`), `oss_country`, `oss_vat`, `home_country`, `home_vat`.
|
|
348
|
-
2. `saveCountryRegistration`: Save per-country VAT registration (`country`, `vat`, `rates`).
|
|
349
|
-
3. `deleteCountryRegistration`: Delete per-country VAT registration (`country`).
|
|
350
|
-
|
|
351
|
-
### Other EU VAT Endpoints
|
|
352
|
-
|
|
353
|
-
- `POST /tax/configuration/settings/eu-vat/reset-rates` — Reset EU standard VAT rates to built-in defaults.
|
|
354
|
-
- `GET /tax/configuration/settings/eu-vat/product-overrides` — Retrieve all EU product category overrides & shipping overrides.
|
|
355
|
-
- `GET /tax/configuration/settings/eu-vat/oss-rates` — Get OSS country rates per tax class.
|
|
356
|
-
- `POST /tax/configuration/settings/eu-vat/oss-rates` — Save OSS country rates.
|
|
1
|
+
# Tax API
|
|
2
|
+
|
|
3
|
+
Configure tax classes, manage country-specific tax rates, set up tax configuration, and handle EU VAT/OSS compliance and tax filing.
|
|
4
|
+
|
|
5
|
+
**Base URL:** `https://your-site.com/wp-json/fluent-cart/v2`
|
|
6
|
+
|
|
7
|
+
> All monetary values are in cents (e.g., `$10.00` = `1000`).
|
|
8
|
+
|
|
9
|
+
---
|
|
10
|
+
|
|
11
|
+
## Endpoints Overview
|
|
12
|
+
|
|
13
|
+
| Group | Method | Endpoint | Description |
|
|
14
|
+
|-------|--------|----------|-------------|
|
|
15
|
+
| **Tax Filing** | GET | `/taxes` | List Tax Records (Order-level filing) |
|
|
16
|
+
| | POST | `/taxes` | Mark Taxes as Filed |
|
|
17
|
+
| **Tax Classes** | GET | `/tax/classes` | List Tax Classes |
|
|
18
|
+
| | POST | `/tax/classes` | Create Tax Class |
|
|
19
|
+
| | DELETE | `/tax/classes/{id}` | Delete Tax Class |
|
|
20
|
+
| **Tax Rates** | GET | `/tax/rates` | List All Tax Rates (grouped by region) |
|
|
21
|
+
| | GET | `/tax/rates/country/rates/{country_code}` | Get Country Tax Rates |
|
|
22
|
+
| | POST | `/tax/country-status/{country_code}` | Enable/Disable Country Tax Status |
|
|
23
|
+
| | POST | `/tax/country/rate` | Create Tax Rate |
|
|
24
|
+
| | PUT | `/tax/country/rate/{id}` | Update Tax Rate |
|
|
25
|
+
| | DELETE | `/tax/country/rate/{id}` | Delete Tax Rate |
|
|
26
|
+
| | POST | `/tax/rates/country/override` | Save Shipping Tax Override |
|
|
27
|
+
| | DELETE | `/tax/rates/country/override/{id}` | Delete Shipping Tax Override |
|
|
28
|
+
| | GET | `/tax/product-overrides/{country_code}` | Get Product Category Tax Overrides |
|
|
29
|
+
| | POST | `/tax/product-overrides` | Save Product Category Tax Override |
|
|
30
|
+
| | DELETE | `/tax/product-overrides/{id}` | Delete Product Category Tax Override |
|
|
31
|
+
| | GET | `/tax/country-tax-id/{country_code}` | Get Country Tax ID |
|
|
32
|
+
| | POST | `/tax/country-tax-id/{country_code}` | Save Country Tax ID |
|
|
33
|
+
| **Tax Config** | GET | `/tax/configuration/rates` | Get Preconfigured Tax Rates |
|
|
34
|
+
| | POST | `/tax/configuration/countries` | Save Configured Countries |
|
|
35
|
+
| | GET | `/tax/configuration/settings` | Get Tax Settings |
|
|
36
|
+
| | POST | `/tax/configuration/settings` | Save Tax Settings |
|
|
37
|
+
| **EU VAT** | POST | `/tax/configuration/settings/eu-vat` | Save EU VAT Cross-Border Settings |
|
|
38
|
+
| | POST | `/tax/configuration/settings/eu-vat/reset-rates` | Reset EU VAT Rates |
|
|
39
|
+
| | GET | `/tax/configuration/settings/eu-vat/product-overrides` | Get EU VAT Product Overrides |
|
|
40
|
+
| | GET | `/tax/configuration/settings/eu-vat/oss-rates` | Get OSS Country Rates |
|
|
41
|
+
| | POST | `/tax/configuration/settings/eu-vat/oss-rates` | Save OSS Country Rates |
|
|
42
|
+
|
|
43
|
+
---
|
|
44
|
+
|
|
45
|
+
## Tax Filing
|
|
46
|
+
|
|
47
|
+
Manage order-level tax records for filing and reporting purposes.
|
|
48
|
+
|
|
49
|
+
**Prefix:** `/fluent-cart/v2/taxes` | **Policy:** `AdminPolicy`
|
|
50
|
+
|
|
51
|
+
### List Tax Records
|
|
52
|
+
|
|
53
|
+
`GET /fluent-cart/v2/taxes`
|
|
54
|
+
|
|
55
|
+
Retrieve a paginated list of order tax rate records.
|
|
56
|
+
|
|
57
|
+
#### Parameters
|
|
58
|
+
|
|
59
|
+
| Parameter | Type | Location | Required | Description |
|
|
60
|
+
|-----------|------|----------|----------|-------------|
|
|
61
|
+
| `page` | integer | query | No | Page number |
|
|
62
|
+
| `per_page` | integer | query | No | Records per page (default: 10, max: 200) |
|
|
63
|
+
| `search` | string | query | No | Search by ID, order_id, country, state, postcode, or name |
|
|
64
|
+
| `sort_by` | string | query | No | Column to sort by (default: `id`) |
|
|
65
|
+
| `sort_type` | string | query | No | `asc` or `desc` (default: `desc`) |
|
|
66
|
+
| `active_view` | string | query | No | Tab filter: `filed` or `not_filed` |
|
|
67
|
+
| `filter_type` | string | query | No | `simple` or `advanced` |
|
|
68
|
+
| `advanced_filters` | string (JSON) | query | No | JSON filter groups by country, region, name, filed status |
|
|
69
|
+
|
|
70
|
+
#### Response
|
|
71
|
+
|
|
72
|
+
```json
|
|
73
|
+
{
|
|
74
|
+
"taxes": {
|
|
75
|
+
"current_page": 1,
|
|
76
|
+
"data": [
|
|
77
|
+
{
|
|
78
|
+
"id": 1,
|
|
79
|
+
"order_id": 42,
|
|
80
|
+
"tax_rate_id": 5,
|
|
81
|
+
"shipping_tax": 150,
|
|
82
|
+
"order_tax": 1000,
|
|
83
|
+
"total_tax": 1150,
|
|
84
|
+
"meta": {
|
|
85
|
+
"rates": [],
|
|
86
|
+
"tax_country": "US",
|
|
87
|
+
"store_vat_number": ""
|
|
88
|
+
},
|
|
89
|
+
"filed_at": null,
|
|
90
|
+
"created_at": "2025-06-01 12:00:00",
|
|
91
|
+
"updated_at": "2025-06-01 12:00:00"
|
|
92
|
+
}
|
|
93
|
+
],
|
|
94
|
+
"per_page": 10,
|
|
95
|
+
"total": 50,
|
|
96
|
+
"last_page": 5
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
#### Example
|
|
102
|
+
|
|
103
|
+
```bash
|
|
104
|
+
curl -X GET "https://example.com/wp-json/fluent-cart/v2/taxes?page=1&per_page=20&active_view=not_filed" \
|
|
105
|
+
-u "username:app_password"
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
---
|
|
109
|
+
|
|
110
|
+
### Mark Taxes as Filed
|
|
111
|
+
|
|
112
|
+
`POST /fluent-cart/v2/taxes`
|
|
113
|
+
|
|
114
|
+
Mark one or more order tax records as filed by setting their `filed_at` timestamp.
|
|
115
|
+
|
|
116
|
+
#### Parameters
|
|
117
|
+
|
|
118
|
+
| Parameter | Type | Location | Required | Description |
|
|
119
|
+
|-----------|------|----------|----------|-------------|
|
|
120
|
+
| `ids` | array | body | Yes | Array of OrderTaxRate record IDs to mark as filed |
|
|
121
|
+
|
|
122
|
+
#### Response
|
|
123
|
+
|
|
124
|
+
```json
|
|
125
|
+
{
|
|
126
|
+
"message": "Taxes marked as filed successfully"
|
|
127
|
+
}
|
|
128
|
+
```
|
|
129
|
+
|
|
130
|
+
#### Example
|
|
131
|
+
|
|
132
|
+
```bash
|
|
133
|
+
curl -X POST "https://example.com/wp-json/fluent-cart/v2/taxes" \
|
|
134
|
+
-u "username:app_password" \
|
|
135
|
+
-H "Content-Type: application/json" \
|
|
136
|
+
-d '{"ids": [1, 2, 3, 5]}'
|
|
137
|
+
```
|
|
138
|
+
|
|
139
|
+
---
|
|
140
|
+
|
|
141
|
+
## Tax Classes
|
|
142
|
+
|
|
143
|
+
Group tax rates by category (e.g., Standard, Reduced, Zero). Maximum 6 classes allowed. Standard cannot be deleted.
|
|
144
|
+
|
|
145
|
+
**Prefix:** `/fluent-cart/v2/tax/classes` | **Policy:** `StoreSettingsPolicy`
|
|
146
|
+
|
|
147
|
+
### List Tax Classes
|
|
148
|
+
|
|
149
|
+
`GET /fluent-cart/v2/tax/classes`
|
|
150
|
+
|
|
151
|
+
#### Response
|
|
152
|
+
|
|
153
|
+
```json
|
|
154
|
+
{
|
|
155
|
+
"classes": [
|
|
156
|
+
{
|
|
157
|
+
"id": 1,
|
|
158
|
+
"title": "Standard",
|
|
159
|
+
"slug": "standard",
|
|
160
|
+
"created_at": "2025-01-01 00:00:00"
|
|
161
|
+
},
|
|
162
|
+
{
|
|
163
|
+
"id": 2,
|
|
164
|
+
"title": "Reduced",
|
|
165
|
+
"slug": "reduced",
|
|
166
|
+
"created_at": "2025-01-01 00:00:00"
|
|
167
|
+
}
|
|
168
|
+
],
|
|
169
|
+
"max_classes": 6,
|
|
170
|
+
"next_builtin": {
|
|
171
|
+
"slug": "zero",
|
|
172
|
+
"title": "Zero"
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
```
|
|
176
|
+
|
|
177
|
+
---
|
|
178
|
+
|
|
179
|
+
### Create Tax Class
|
|
180
|
+
|
|
181
|
+
`POST /fluent-cart/v2/tax/classes`
|
|
182
|
+
|
|
183
|
+
#### Parameters
|
|
184
|
+
|
|
185
|
+
| Parameter | Type | Location | Required | Description |
|
|
186
|
+
|-----------|------|----------|----------|-------------|
|
|
187
|
+
| `title` | string | body | Conditional | Tax class title (max 30 chars). Required unless built-in slug passed |
|
|
188
|
+
| `slug` | string | body | No | Pass `reduced` or `zero` to create built-in class |
|
|
189
|
+
|
|
190
|
+
#### Example
|
|
191
|
+
|
|
192
|
+
```bash
|
|
193
|
+
curl -X POST "https://example.com/wp-json/fluent-cart/v2/tax/classes" \
|
|
194
|
+
-u "username:app_password" \
|
|
195
|
+
-H "Content-Type: application/json" \
|
|
196
|
+
-d '{"title": "Digital Goods"}'
|
|
197
|
+
```
|
|
198
|
+
|
|
199
|
+
---
|
|
200
|
+
|
|
201
|
+
### Delete Tax Class
|
|
202
|
+
|
|
203
|
+
`DELETE /fluent-cart/v2/tax/classes/{id}`
|
|
204
|
+
|
|
205
|
+
Products/rates referencing deleted class fall back to Standard. Standard class cannot be deleted.
|
|
206
|
+
|
|
207
|
+
---
|
|
208
|
+
|
|
209
|
+
## Tax Rates
|
|
210
|
+
|
|
211
|
+
**Prefix:** `/fluent-cart/v2/tax` | **Policy:** `StoreSettingsPolicy`
|
|
212
|
+
|
|
213
|
+
### List All Tax Rates
|
|
214
|
+
|
|
215
|
+
`GET /fluent-cart/v2/tax/rates`
|
|
216
|
+
|
|
217
|
+
Retrieve all rates grouped by region/continent and country.
|
|
218
|
+
|
|
219
|
+
### Get Country Tax Rates
|
|
220
|
+
|
|
221
|
+
`GET /fluent-cart/v2/tax/rates/country/rates/{country_code}`
|
|
222
|
+
|
|
223
|
+
### Update Country Tax Status
|
|
224
|
+
|
|
225
|
+
`POST /fluent-cart/v2/tax/country-status/{country_code}`
|
|
226
|
+
|
|
227
|
+
#### Parameters
|
|
228
|
+
|
|
229
|
+
| Parameter | Type | Location | Required | Description |
|
|
230
|
+
|-----------|------|----------|----------|-------------|
|
|
231
|
+
| `country_code` | string | path | Yes | ISO country code or `EU` |
|
|
232
|
+
| `enabled` | integer | body | Yes | `1` to enable, `0` to disable |
|
|
233
|
+
|
|
234
|
+
---
|
|
235
|
+
|
|
236
|
+
### Create Tax Rate
|
|
237
|
+
|
|
238
|
+
`POST /fluent-cart/v2/tax/country/rate`
|
|
239
|
+
|
|
240
|
+
#### Parameters
|
|
241
|
+
|
|
242
|
+
| Parameter | Type | Location | Required | Description |
|
|
243
|
+
|-----------|------|----------|----------|-------------|
|
|
244
|
+
| `class_id` | integer | body | Yes | Tax class ID |
|
|
245
|
+
| `country` | string | body | No | ISO country code (max 45 chars) |
|
|
246
|
+
| `state` | string | body | No | State/province code |
|
|
247
|
+
| `postcode` | string | body | No | Postal code |
|
|
248
|
+
| `city` | string | body | No | City name |
|
|
249
|
+
| `rate` | string | body | No | Rate percentage (e.g. `"19.0000"`) |
|
|
250
|
+
| `name` | string | body | No | Display name |
|
|
251
|
+
| `group` | string | body | No | Geographic group (e.g. `EU`, `NA`) |
|
|
252
|
+
| `priority` | integer | body | No | Application priority (min 1) |
|
|
253
|
+
| `is_compound` | integer | body | No | Compound tax flag (`0` or `1`) |
|
|
254
|
+
| `for_shipping` | integer | body | No | Shipping override rate (null = none) |
|
|
255
|
+
| `for_order` | integer | body | No | Order-level tax flag (`0` or `1`) |
|
|
256
|
+
|
|
257
|
+
---
|
|
258
|
+
|
|
259
|
+
### Update Tax Rate
|
|
260
|
+
|
|
261
|
+
`PUT /fluent-cart/v2/tax/country/rate/{id}`
|
|
262
|
+
|
|
263
|
+
---
|
|
264
|
+
|
|
265
|
+
### Delete Tax Rate
|
|
266
|
+
|
|
267
|
+
`DELETE /fluent-cart/v2/tax/country/rate/{id}`
|
|
268
|
+
|
|
269
|
+
---
|
|
270
|
+
|
|
271
|
+
### Shipping Tax Overrides
|
|
272
|
+
|
|
273
|
+
- `POST /fluent-cart/v2/tax/rates/country/override` — Save shipping tax override on a rate.
|
|
274
|
+
- `DELETE /fluent-cart/v2/tax/rates/country/override/{id}` — Remove shipping tax override.
|
|
275
|
+
|
|
276
|
+
---
|
|
277
|
+
|
|
278
|
+
### Product Category Tax Overrides
|
|
279
|
+
|
|
280
|
+
- `GET /fluent-cart/v2/tax/product-overrides/{country_code}` — Get product category overrides for country.
|
|
281
|
+
- `POST /fluent-cart/v2/tax/product-overrides` — Create or update product category tax override.
|
|
282
|
+
- `DELETE /fluent-cart/v2/tax/product-overrides/{id}` — Delete product category tax override.
|
|
283
|
+
|
|
284
|
+
---
|
|
285
|
+
|
|
286
|
+
### Store Tax ID (VAT/GST/EIN)
|
|
287
|
+
|
|
288
|
+
- `GET /fluent-cart/v2/tax/country-tax-id/{country_code}` — Get store tax ID for country.
|
|
289
|
+
- `POST /fluent-cart/v2/tax/country-tax-id/{country_code}` — Save store tax ID for country.
|
|
290
|
+
|
|
291
|
+
---
|
|
292
|
+
|
|
293
|
+
## Tax Configuration
|
|
294
|
+
|
|
295
|
+
**Prefix:** `/fluent-cart/v2/tax/configuration` | **Policy:** `StoreSettingsPolicy`
|
|
296
|
+
|
|
297
|
+
### Get Preconfigured Tax Rates
|
|
298
|
+
|
|
299
|
+
`GET /fluent-cart/v2/tax/configuration/rates`
|
|
300
|
+
|
|
301
|
+
Returns default tax rates from built-in rates dataset (`tax.php`) grouped by region/country.
|
|
302
|
+
|
|
303
|
+
### Save Configured Countries
|
|
304
|
+
|
|
305
|
+
`POST /fluent-cart/v2/tax/configuration/countries`
|
|
306
|
+
|
|
307
|
+
Imports default tax rates for selected country codes.
|
|
308
|
+
|
|
309
|
+
```bash
|
|
310
|
+
curl -X POST "https://example.com/wp-json/fluent-cart/v2/tax/configuration/countries" \
|
|
311
|
+
-u "username:app_password" \
|
|
312
|
+
-H "Content-Type: application/json" \
|
|
313
|
+
-d '{"countries": ["DE", "FR", "IT", "ES"]}'
|
|
314
|
+
```
|
|
315
|
+
|
|
316
|
+
### Get / Save Tax Settings
|
|
317
|
+
|
|
318
|
+
- `GET /fluent-cart/v2/tax/configuration/settings`
|
|
319
|
+
- `POST /fluent-cart/v2/tax/configuration/settings`
|
|
320
|
+
|
|
321
|
+
#### Settings Object Fields
|
|
322
|
+
|
|
323
|
+
| Field | Values | Description |
|
|
324
|
+
|-------|--------|-------------|
|
|
325
|
+
| `enable_tax` | `"yes"`, `"no"` | Master tax switch |
|
|
326
|
+
| `tax_inclusion` | `"included"`, `"excluded"` | Whether catalog prices include tax |
|
|
327
|
+
| `tax_calculation_basis` | `"shipping"`, `"billing"`, `"store"` | Address basis for calculation |
|
|
328
|
+
| `tax_rounding` | `"item"`, `"total"`, `"subtotal"` | Rounding application point |
|
|
329
|
+
| `checkout_tax_breakdown_display` | `"itemized"`, `"simplified"` | Display format at checkout |
|
|
330
|
+
| `tax_display_label` | string | Label used at checkout (e.g. `"VAT"`) |
|
|
331
|
+
| `price_suffix_included` | string | Suffix for tax-included prices |
|
|
332
|
+
| `price_suffix_excluded` | string | Suffix for tax-excluded prices |
|
|
333
|
+
| `eu_vat_settings` | object | EU VAT compliance configuration |
|
|
334
|
+
|
|
335
|
+
---
|
|
336
|
+
|
|
337
|
+
## EU VAT & OSS Compliance
|
|
338
|
+
|
|
339
|
+
**Prefix:** `/fluent-cart/v2/tax/configuration/settings/eu-vat` | **Policy:** `StoreSettingsPolicy`
|
|
340
|
+
|
|
341
|
+
### Save EU VAT Cross-Border Settings
|
|
342
|
+
|
|
343
|
+
`POST /fluent-cart/v2/tax/configuration/settings/eu-vat`
|
|
344
|
+
|
|
345
|
+
Multi-action endpoint dispatched via `action`:
|
|
346
|
+
|
|
347
|
+
1. `euCrossBorderSettings`: Save method (`oss`, `home`, `specific`), `oss_country`, `oss_vat`, `home_country`, `home_vat`.
|
|
348
|
+
2. `saveCountryRegistration`: Save per-country VAT registration (`country`, `vat`, `rates`).
|
|
349
|
+
3. `deleteCountryRegistration`: Delete per-country VAT registration (`country`).
|
|
350
|
+
|
|
351
|
+
### Other EU VAT Endpoints
|
|
352
|
+
|
|
353
|
+
- `POST /tax/configuration/settings/eu-vat/reset-rates` — Reset EU standard VAT rates to built-in defaults.
|
|
354
|
+
- `GET /tax/configuration/settings/eu-vat/product-overrides` — Retrieve all EU product category overrides & shipping overrides.
|
|
355
|
+
- `GET /tax/configuration/settings/eu-vat/oss-rates` — Get OSS country rates per tax class.
|
|
356
|
+
- `POST /tax/configuration/settings/eu-vat/oss-rates` — Save OSS country rates.
|