gpt4 book ai didi

rest - PayPal REST API 使用模板创建发票

转载 作者:太空宇宙 更新时间:2023-11-03 15:47:07 25 4
gpt4 key购买 nike

有没有人使用特定的选定模板成功创建过 PayPal 发票?我似乎无法让它工作。

已尝试在调用中指定 template_id,也已尝试将所需模板设置为默认模板。在这两种情况下,API 响应都包含所选模板 ID,但在发送发票时,它不使用所选模板(可以看出,因为没有 Logo )。

这是 API 调用:

curl -v -X POST https://api.paypal.com/v1/invoicing/invoices/ \
-H "Content-Type:application/json" \
-H "Authorization: Bearer <Access-Token>" \
-d '{
"template_id": "TEMP-66B140465N059453G",
"items": [
{
"name": "Part E",
"quantity": 2,
"unit_price": {
"currency": "USD",
"value": "10.15"
}
}
],
"shipping_info": {
"first_name": "John",
"last_name": "Doe",
"business_name": "Not applicable",
"phone": {
"country_code": "001",
"national_number": "5039871234"
},
"address": {
"line1": "1234 Broad St.",
"city": "Portland",
"state": "OR",
"postal_code": "97216",
"country_code": "US"
}
},
"shipping_cost": {
"amount": {
"currency": "USD",
"value": "15.01"
}
},
"allow_tip": false
}'

这是响应:

"id":<Invoice ID>,
"number":"0004",
"template_id":"TEMP-66B140465N059453G",
"status":"DRAFT",
"merchant_info":{},
"shipping_info":{"first_name":"John","last_name":"Doe","business_name":"Not applicable","phone":{"country_code":"001","national_number":"5039871234"},"address":{"line1":"1234 Broad St.","city":"Portland","state":"OR","postal_code":"97216","country_code":"US"}},
"items":[{"name":"Part E","quantity":2.0,"unit_price":{"currency":"USD","value":"10.15"}}],
"invoice_date":"2017-05-30 PDT",
"shipping_cost":{"amount":{"currency":"USD","value":"15.01"}},
"tax_calculated_after_discount":false,
"tax_inclusive":false,
"total_amount":{"currency":"USD","value":"35.31"},
"metadata":{"created_date":"2017-05-30 13:35:39 PDT"},
"allow_tip":false

如果有人有任何想法,我们很乐意听取他们的意见。

谢谢。

最佳答案

我们正在更正有关如何使用模板 ID 的说明。抱歉造成混淆。

当您进行基本集成以创建和发送发票时,您根本不需要使用模板。

如果您正在创建一个完整的发票应用程序,您希望最终用户(开票人)能够创建模板并在创建发票时访问它们,那么模板很有用。有关模板的使用方式,请参阅 PayPal.com 网站。

问候,克里斯汀

关于rest - PayPal REST API 使用模板创建发票,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44272418/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com