获取商务中心发票
您可以使用本接口获取商务中心下的发票及其详细信息。
代理商商务中心和直客商务中心都能执行发票相关操作。
注意
只有拥有财务经理或财务分析师权限的用户才能在商务中心执行资金管理和发票的相关操作。您可以使用/bc/member/invite/ 和 /bc/member/update/设置或更改成员权限。
v1.2与v1.3版本对比
以下表格概括了 v1.2与v1.3接口的变化。
``xtable
|变化内容{30%}|v1.2{35%}|v1.3{35%}|
|---|---|---|
|接口路径|/v1.2/bc/invoice/get/| /v1.3/bc/invoice/get/|
|请求参数类型|bc_id: number<br>invoice_id: number |bc_id: string<br>invoice_id: string |
|返回参数类型|invoice_id: number |invoice_id: string|
|返回参数名称 |bg_id<br>area_code|billing_group_id<br>country_code`|
## 请求
**地址**
https://business-api.tiktok.com/open_api/v1.3/bc/invoice/get/
**方法** GET
**Header**
``` xtable
|字段{30%}|类型{35%}|描述{35%}|
|---|---|---|
|Access-Token{必填}|string|授权访问令牌。可以通过[获取访问令牌](https://ads.tiktok.com/marketing_api/docs?id=1738373164380162)接口获取。|
参数
|字段|类型|描述|
|---|---|---|
|bc_id {必填}|string| 商务中心ID|
|invoice_id |string|发票ID|
|invoice_title|string|发票抬头|
|invoice_types{必填}|string[]|发票类型。<br><br> 枚举值:<ul><li>`RECON`:对账单发票。</li><li>`CREDIT`:红冲发票。</li><li>`AUTO_PAY`: 自动付款发票。</li></ul><br><p><span style="color:darkred"><b>注意</b></span>:`AUTO_PAY` 不允许和其他发票类型一起传入。 若想筛选自动付款发票,需将 `invoice_types` 设置为 `["AUTO_PAY"]`。|
|pay_statuses|string[]| 发票还款状态。枚举值: `UNPAID`(未支付), `PAID`(已付), `PARTIAL_PAID`(部分支付), `NO_NEED`(已还清)|
|start_time|string|发票开具起始时间。格式:`YYYY-MM-DD HH:MM:SS`。<br><br>示例:`2024-01-01 00:00:00`。<br><br> `start_time` 和 `end_time` 必须同时传或不传。|
|end_time|string|发票开具截止时间。格式:`YYYY-MM-DD HH:MM:SS`。<br><br>示例:`2024-02-01 00:00:00`。<br><br> `start_time` 和 `end_time` 必须同时传或不传。|
|page |number|当前页数,默认值: `1`,取值范围: ≥ 1|
|page_size |number|分页大小,默认值: `10`,取值范围: 1-50|
示例
(code curl http)
curl --location --request GET https://business-api.tiktok.com/open_api/v1.3/bc/invoice/get/?bc_id={{bc_id}}&invoice_types=["CREDIT"]&page_size=50
--header 'Access-Token: {{Access-Token}}' \
--header 'Content-Type: application/json'
(/code)
返回
|字段|类型|描述|
|---|---|---|
|code |number|返回码,详见[附录-返回码](https://ads.tiktok.com/marketing_api/docs?id=1737172488964097) |
|message |string|返回信息,详见[附录-返回码](https://ads.tiktok.com/marketing_api/docs?id=1737172488964097) |
|data |object|返回数据 |
#|list|object[]|发票列表|
##|invoice_id|string|发票ID|
##|serial_number|string|发票编号|
##|subject_id|string|合同主体ID|
##|send_date|string|发票开具日期。格式: YYYY-MM-DD. |
##|currency_code |string|币种|
##|status|string|发票审批状态。<br>枚举值:`CREATED`(已创建), `SUBMITTED`(已提交), `APPROVED`(已审批), `DELETED`(已删除)|
##|due_date |string|发票过期日|
##|invoice_type |string| 发票类型。<br><br> 枚举值:<ul><li>`RECON`:对账单发票。</li><li>`CREDIT`:红冲发票。</li><li>`AUTO_PAY`: 自动付款发票。</li></ul>|
##|entity_serials |string[]|发票所关联的实体编号|
##|negative_invoice_ids |object[]|仅当前发票为正票且被红冲才会被赋值,返回已审批通过的负数发票id和编号|
###|invoice_id|string|负数发票的ID|
###|serial_number|string|负数发票的编号|
##|positive_invoice_ids |object[]|仅当前发票为负票才会被赋值,返回关联的正数发票id和编号|
###|invoice_id|string|正数发票的ID|
###|serial_number|string| 正数发票的编号|
##|billing_group_id |string|发票对应的账单组ID|
##|account_name |string|签约的客户名称|
##|invoice_title |string|发票抬头|
##|country_code|string|地区代码|
##|address |string|开票客户地址|
##|emails |string[]|发票接收地址|
##|tax_id1 |string|发票税号1|
##|tax_id2 |string|发票税号2|
##|amount |number|含税总金额|
##|amount_excluding_tax |number|不含税总金额|
##|total_tax_amount|number|总税费,币种同发票币种|
##|tax_type1|string|税类型1|
##|tax_rate1|number|税率1|
##|tax_amount1|number|税额1|
##|tax_type2|string|税类型2|
##|tax_rate2|number|税率2|
##|tax_amount2|number|税额2|
##| pay_status|string|支付状态|
##|overdue_status|string|逾期状态。 枚举值: `INITIALIZED`(默认), `YES`(逾期), `NO`(未逾期)|
##|unpaid_amount|number|未支付金额|
#|page_info |object| 分页信息 |
##|page|number| 当前页数 |
##|page_size|number| 分页大小 |
##|total_number|number| 总数 |
##|total_page|number| 总页数 |
|request_id |string|请求的日志id,唯一标识一个请求 |
示例
(code Success-Response http)
HTTPS/1.1 200 OK
{
"code": 0,
"message": "OK",
"request_id": "{{request_id}}",
"data": {
"list": [
{
"account_name": "{{account_name}}",
"address": "{{address}}",
"amount_excluding_tax": 293.5,
"status": "APPROVED",
"amount": 293.5,
"positive_invoice_ids": [
{
"invoice_id": "{{invoice_id}}",
"serial_number": "{{serial_number}}"
}
],
"country_code": "VG",
"invoice_type": "CREDIT",
"invoice_id": "{{invoice_id}}",
"serial_number": "{{serial_number}}-CN",
"invoice_title": "{{account_name}}",
"currency_code": "USD",
"unpaid_amount": 293.5,
"emails": [
"{{email}}",
"{{email}}"
],
"billing_group_id": "{{billing_group_id}}",
"entity_serials": [
"{{entity_serial}}"
]
},
{
"account_name": "{{account_name}}",
"address": "{{address}}",
"amount_excluding_tax": 179,
"status": "APPROVED",
"amount": 179,
"positive_invoice_ids": [
{
"invoice_id": "{{invoice_id}}",
"serial_number": "{{serial_number}}"
}
],
"country_code": "VG",
"invoice_type": "CREDIT",
"invoice_id": "{{invoice_id}}",
"serial_number": "{{serial_number}}-CN",
"invoice_title": "{{account_name}}",
"currency_code": "USD",
"unpaid_amount": 179,
"emails": [
"{{email}}",
"{{email}}"
],
"billing_group_id": "{{billing_group_id}}",
"entity_serials": [
"{{entity_serial}}"
]
}
],
"page_info": {
"page": 1,
"page_size": 50,
"total_page": 1,
"total_number": 8
}
}
}
(/code)