发票抬头 upsert(整档替换,幂等;company 必填 taxId 18 位、personal 禁填)
PUT
/v1/invoice-profile
const url = 'https://api.tansr.com/v1/invoice-profile';const options = { method: 'PUT', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"type":"personal","title":"example","taxId":"example","email":"hello@example.com"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request PUT \ --url https://api.tansr.com/v1/invoice-profile \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "type": "personal", "title": "example", "taxId": "example", "email": "hello@example.com" }'Authorizations
Section titled “Authorizations”Request Bodyrequired
Section titled “Request Bodyrequired”Responses
Section titled “Responses”已写
Validation_failed(company/personal 与 taxId 跨字段规则)/ bad_request(taxId 18 位 pattern 等形状)
Media typeapplication/json
object
error
required
object
code
required
错误码注册表单源派生(src/http/errors.ts ERROR_CODES;码稳定,消费方按码翻译)
string
message
required
string
requestId
required
string
detail
object
Example
{ "error": { "code": "adjudicator_not_authorized" }}Forbidden(PAT 不可管理发票,须登录态)
Media typeapplication/json
object
error
required
object
code
required
错误码注册表单源派生(src/http/errors.ts ERROR_CODES;码稳定,消费方按码翻译)
string
message
required
string
requestId
required
string
detail
object
Example
{ "error": { "code": "adjudicator_not_authorized" }}本文是否有帮助?
感谢反馈,我们会持续改进这篇文章。