系统-基础税费-保存
基础税费 - 设置国家税率, 如果该订单在自定义税费方案里面没有匹配,那么将使用基础税费来计算税费,本api进行配置基础税费
接口信息
- 接口地址:
{your-site-url}/api/skill/tax/save-base-tax - 基础 URL:
{your-site-url}需替换为你自己的独立站 URL 地址,如https://your-domain.com/apimanager666 - 请求方式:
POST - Content-Type:
application/json - 说明: 此接口用于设置某个国家的税费(税率),支持设置全国默认税率以及省/州级别的独立税率
认证
请求头中需要携带 skill-access-token:
| Header | 值 |
|---|---|
skill-access-token |
{your-skill-access-token} (请替换为你自己的 token) |
请求参数 (JSON Body)
| 字段 | 类型 | 必填 | 说明 |
|---|---|---|---|
country_code |
string | ✅ 必填 | 国家简码,从 得到国家和省列表 获取 |
country_tax |
string | ✅ 必填 | 该国家的默认税率。如果未对省/州单独设置税率,将使用此默认税率 |
country_taxs |
Array[Object] | 否 | 该国家各州/省的税率列表。可对不同的省/州设置不同的税率 |
country_taxs[].state_code |
string | ✅ | 省/州简码,从 得到国家和省列表 返回的 provinces 中获取 |
country_taxs[].tax |
float | ✅ | 该省/州对应的税率 |
请求示例
cURL
curl --location --request POST '{your-site-url}/api/skill/tax/save-base-tax' \
--header 'skill-access-token: {your-skill-access-token}' \
--header 'Content-Type: application/json' \
--data-raw '{
"country_code": "US",
"country_tax": "8",
"country_taxs": [
{"state_code": "AL", "tax": 6.34},
{"state_code": "AK", "tax": 5.34},
{"state_code": "CA", "tax": 2.34}
]
}'
返回结果
code 为 200 表示调用成功;code 不为 200 表示调用失败。
成功响应
{
"code": 200,
"data": [],
"message": "success"
}
返回字段说明
| 字段 | 类型 | 说明 |
|---|---|---|
code |
Number | 状态码,200 表示成功 |
message |
String | 执行结果的文字描述 |
data |
Array | 返回数据,目前为空数组 |
注意事项
country_code和country_tax为必填- 国家简码和省份简码从 得到国家和省列表 获取
country_tax为全国默认税率:如果某省/州未在country_taxs中单独设置税率,则采用此默认税率country_taxs用于对不同省/州设置独立税率,其优先级高于country_tax