发票模块
- 2021-07-29 14:21:36
- 刘若谷
- 3337
- 最后编辑:刘若谷 于 2021-08-09 17:31:43
- 分享链接
一、获取发票列表
请求地址:GET /api.php/v1/crm/invoices
请求头HEADER:
Content-Type: application/json Token: my-token Accept-Language:zh-CN,zh
参数列表:
|
字段 |
必填 | 默认值 | 描述 |
| kind | 否 |
sale |
sale:销项发票 purchase:进项发票 |
|
company |
否 |
空字符 |
开票公司id |
|
month |
否 |
空字符 | 搜索月份(yyyy-MM格式,如2021-01) |
|
status |
否 |
空字符 |
normal:已开票 canceled:已作废 |
| sort |
否 |
id_desc |
按照 "_" 字符前面的字段进行排序 desc为降序 asc 为升序 |
| page |
否 |
1 |
页码 |
| limit |
否 |
20 |
每页展示行数 |
|
timeFormat |
否 | null |
系统默认返回的日期格式: YYYY-MM-DD HH:ii:ss 传入参数utc后返回的日期格式:
YYYY-MM-DDTHH:ii:ssZ
|
请求示例:
curl --location --request GET 'https://biz.demo.zdoo.com/api.php/v1/crm/invoices' \ --header 'Token: my-token' \ --header 'Accept-Language: zh-CN,zh' \ --header 'Content-Type: application/json'
返回结果(200):
{
"data": {
"status": "success",
"data": {Objects}
}
}
|
字段 |
类型 | 描述 |
|
title |
string | 页面标题 |
| invoiceList | object | 发票列表 |
| customers | object | 客户信息 |
| users |
object
|
用户信息 |
| currentYear | string | 当前搜索年份 |
| currentMonth |
string
|
当前搜索月份 |
| pager | object | 分页信息 |
| mode | string |
筛选条件
all:全部订单 |
| orderBy | string |
按照 "_" 字符前面的字段进行排序 desc为降序 asc 为升序 |
二、获取发票详情
请求地址:GET /api.php/v1/crm/invoices/:id
请求头HEADER:
Content-Type: application/json Token: my-token Accept-Language:zh-CN,zh
参数列表:
|
字段 |
必填 | 默认值 | 描述 |
|
timeFormat |
否 | null |
系统默认返回的日期格式: YYYY-MM-DD HH:ii:ss 传入参数utc后返回的日期格式:
YYYY-MM-DDTHH:ii:ssZ
|
请求示例:
curl --location --request GET 'https://biz.demo.zdoo.com/api.php/v1/crm/invoices/1' \ --header 'Token: my-token' \ --header 'Accept-Language: zh-CN,zh' \ --header 'Content-Type: application/json'
返回结果(200):
{
"data": {
"status": "success",
"data": {Objects} }
}
|
字段 |
类型 | 描述 |
|
title |
string | 页面标题 |
| companies | object | 公司信息 |
| customer | object | 客户信息 |
| contract | object | 关联合同 |
| contact | object | 关联联系人 |
| address | object | 邮寄地址 |
| users | address | 用户列表 |
| invoice | address | 发票信息 |
|
appOperate |
array | 移动端所属动作 |
三、创建发票信息
请求地址:POST /api.php/v1/crm/invoices
请求头HEADER:
Content-Type: application/json Token: my-token Accept-Language:zh-CN,zh
请求BODY:
| 字段 | 必填 | 类型 | 描述 |
| company | 是 | int | 开票公司id |
| customer | 是 | int | 客户id |
|
contract |
否 | int | 合同id |
|
type
|
是 | string |
类型 companyOrdinary:企业增值税普通发 票 companyDigitalOrdinary:企业增值税电子普通发票 companySpecial:企业增值税专用发票
personalOrdinary:个人增值税普通发票 OrganizedOrdinary:组织增值税普通发票 |
|
taxRate
|
否 |
string |
税率 |
|
saleType
|
是 |
string |
销售类型 product:产品类 service:服务类 |
|
invoiceTitle
|
否 |
string | 发票抬头 |
|
taxNumber
|
否 | string | 税号 |
|
registedAddress
|
否 |
string | 注册地址 |
|
phone
|
否 | string | 电话 |
|
bankName
|
否 |
string | 开户行 |
|
bankAccount
|
否 |
string | 银行账号 |
|
money |
否 | string | 金额 |
|
drawnMoney
|
否 | bool | 已开金额 |
|
desc
|
否 |
string |
备注 |
|
itemList[$n]
|
是 |
int | 第$n项发票明细的【产品/服务】id |
| modelList[$n] |
否 |
string |
第$n项发票明细的【规格型号】 |
|
unitList[$n] |
否 |
string |
第$n项发票明细的【单位
】
|
|
amountList[$n]
|
是 |
string |
第$n项发票明细的【数量
】
|
|
priceList[$n]
|
是 |
string |
第$n项发票明细的【
单价
】
|
|
moneyList[$n] |
否 |
string |
第$n项发票明细的【金额
】
|
参数列表:
|
字段 |
必填 | 默认值 | 描述 |
|
timeFormat |
否 | null |
系统默认返回的日期格式: YYYY-MM-DD HH:ii:ss 传入参数utc后返回的日期格式:
YYYY-MM-DDTHH:ii:ssZ
|
请求示例:
curl --location --request POST 'https://biz.demo.zdoo.com/api.php/v1/crm/invoices' \
--header 'Token: my-token' \
--header 'Accept-Language: zh-CN,zh' \
--header 'Content-Type: application/json' \
--data-raw '{"company": "1", "customer": "1", "type": "companyOrdinary", "contract": 54, "saleType": "product", "invoiceTitle": "抬头", "taxNumber": "251515145", "money": 50}'
返回结果(200):
{
"data": {
"result": "success",
"message": "保存成功",
"locate": "/crm/api.php?m=invoices&f=browse&t="
}
}
返回结果(400):
{
"error": errorMessage
}
四、修改发票信息
请求地址:PUT /api.php/v1/crm/invoices/:id
请求头HEADER:
Content-Type: application/json Token: my-token Accept-Language:zh-CN,zh
请求BODY:
| 字段 | 必填 | 类型 | 描述 |
| company | 是 | int | 开票公司id |
|
contract |
否 | int | 合同id |
| type | 是 | string |
类型 companyOrdinary:企业增值税普通发 票 companyDigitalOrdinary:企业增值税电子普通发票 companySpecial:企业增值税专用发票
personalOrdinary:个人增值税普通发票 OrganizedOrdinary:组织增值税普通发票 |
|
taxRate
|
否 |
string |
税率 |
| saleType |
是 |
string |
销售类型 product:产品类 service:服务类 |
| invoiceTitle |
否 |
string | 发票抬头 |
| taxNumber | 否 | string | 税号 |
| registedAddress |
否 |
string | 注册地址 |
| phone | 否 | string | 电话 |
| bankName |
否 |
string | 开户行 |
| bankAccount |
否 |
string | 银行账号 |
|
money |
否 | string | 金额 |
| drawnMoney | 否 | bool | 已开金额 |
|
desc
|
否 |
string |
备注 |
|
itemList[$n]
|
是 |
int | 第$n项发票明细的【产品/服务】id |
| modelList[$n] |
否 |
string |
第$n项发票明细的【规格型号】 |
|
unitList[$n] |
否 |
string |
第$n项发票明细的【单位
】
|
|
amountList[$n]
|
是 |
string |
第$n项发票明细的【数量
】
|
|
priceList[$n]
|
是 |
string |
第$n项发票明细的【
单价
】
|
|
moneyList[$n] |
否 |
string |
第$n项发票明细的【金额
】
|
参数列表:
|
字段 |
必填 | 默认值 | 描述 |
|
timeFormat |
否 | null |
系统默认返回的日期格式: YYYY-MM-DD HH:ii:ss 传入参数utc后返回的日期格式:
YYYY-MM-DDTHH:ii:ssZ
|
请求示例:
curl --location --request PUT 'https://biz.demo.zdoo.com/api.php/v1/crm/invoices' \
--header 'Token: my-token' \
--header 'Accept-Language: zh-CN,zh' \
--header 'Content-Type: application/json' \
--data-raw '{"company": "1", "customer": "1", "type": "companyOrdinary", "contract": 54, "saleType": "product", "invoiceTitle": "抬头", "taxNumber": "251515145", "money": 50}'
返回结果(200):
{
"data": {
"result": "success",
"message": "保存成功",
"locate": "/crm/api.php?m=invoices&f=browse&t="
}
}
返回结果(400):
{
"error": errorMessage
}
五、获取某客户关联发票
请求地址:GET /api.php/v1/customers/:customerID/invoices
请求头HEADER:
Content-Type: application/json Token: my-token Accept-Language:zh-CN,zh
参数列表:
|
字段 |
必填 | 默认值 | 描述 |
|
timeFormat |
否 | null |
系统默认返回的日期格式: YYYY-MM-DD HH:ii:ss 传入参数utc后返回的日期格式:
YYYY-MM-DDTHH:ii:ssZ
|
请求示例:
curl --location --request GET 'https://biz.demo.zdoo.com/api.php/v1/crm/customers/1/invoices' \ --header 'Token: my-token' \ --header 'Accept-Language: zh-CN,zh' \ --header 'Content-Type: application/json'
返回结果(200):
{
"data": {
"status": "success",
"data": {Objects} }
}
