- Authorization
- Orders
- Payments
- Invoices
- Invoices
- Templates
- Subscriptions
- Catalog Products
- Plans
- Subscriptions
- Payouts
- Webhooks
- Shipment Tracking
- Transaction Search
- Disputes
- List disputes
- Show dispute details
- Accept claim
- Appeal dispute
- Settle dispute
- Update dispute status
- Make offer to resolve dispute
- Provide evidence
- Acknowledge returned item
- Provide supporting information for dispute
- Escalate dispute to claim
- Accept offer to resolve dispute
- Send message about dispute to other party
- Deny offer to resolve dispute
- Partially update dispute
- Onboarding (Limited Release)
List templates
GET
/v2/invoicing/templates
The user can select which values to show in the business information section of their template.
请求参数
Authorization
在 Header 添加参数
Authorization
,其值为在 Basic 之后拼接空格,以及经过 Base64 编码的 username:password
示例:
Authorization: Basic *****************
Query 参数
fields
string
必需
all
or none
. To return only the template name, ID, and default attributes, specify none
.示例值:
all
page
string
必需
page=1
and page_size=20
returns the first 20 templates. A combination of page=2
and page_size=20
returns the next 20 templates.示例值:
1
page_size
string
必需
示例值:
10
示例代码
Shell
JavaScript
Java
Swift
Go
PHP
Python
HTTP
C
C#
Objective-C
Ruby
OCaml
Dart
R
请求示例请求示例
Shell
JavaScript
Java
Swift
curl --location --request GET 'https://api-m.sandbox.paypal.com/v2/invoicing/templates?fields=all&page=1&page_size=10' \
--header 'Authorization: Basic Og=='
返回响应
🟢200200 - List Templates
application/json
Body
addresses
array [object {5}]
必需
address_line_1
string
必需
address_line_2
string
必需
admin_area_2
string
必需
admin_area_1
string
必需
postal_code
string
必需
emails
string
必需
templates
array [object {8}]
必需
id
string
必需
name
string
必需
default_template
boolean
必需
template_info
object
必需
settings
object
必需
unit_of_measure
string
必需
standard_template
boolean
必需
links
array [object {3}]
必需
links
array [object {3}]
必需
href
string
可选
rel
string
可选
method
string
可选
示例
{
"addresses": [
{
"address_line_1": "1 Main St",
"address_line_2": "",
"admin_area_2": "San Jose",
"admin_area_1": "CA",
"postal_code": "95131"
},
{
"address_line_1": "1 Main St",
"address_line_2": "",
"admin_area_2": "San Jose",
"admin_area_1": "CA",
"postal_code": "95131"
}
],
"emails": "etondoze-facilitator@gmail.com",
"templates": [
{
"id": "TEMP-2GF67762TU7270255",
"name": "Amount",
"default_template": false,
"template_info": {
"detail": {
"currency_code": "USD",
"metadata": {
"create_time": "2021-11-14T23:49:30Z"
}
},
"invoicer": {
"business_name": "test facilitator's Test Store",
"address": {
"address_line_1": "1 Main St",
"address_line_2": "",
"admin_area_2": "San Jose",
"admin_area_1": "CA",
"postal_code": "95131"
},
"email_address": "etondoze-facilitator@gmail.com"
}
},
"settings": {
"template_item_settings": [
{
"field_name": "items.date",
"display_preference": {
"hidden": true
}
},
{
"field_name": "items.discount",
"display_preference": {
"hidden": true
}
},
{
"field_name": "items.tax",
"display_preference": {
"hidden": true
}
},
{
"field_name": "items.description",
"display_preference": {
"hidden": true
}
},
{
"field_name": "items.quantity",
"display_preference": {
"hidden": true
}
}
],
"template_subtotal_settings": [
{
"field_name": "custom",
"display_preference": {
"hidden": true
}
},
{
"field_name": "discount",
"display_preference": {
"hidden": true
}
},
{
"field_name": "shipping",
"display_preference": {
"hidden": true
}
}
]
},
"unit_of_measure": "AMOUNT",
"standard_template": true,
"links": [
{
"href": "https://api.sandbox.paypal.com/v2/invoicing/templates/TEMP-2GF67762TU7270255",
"rel": "self",
"method": "GET"
}
]
},
{
"id": "TEMP-21S46474NR9308124",
"name": "Hours",
"default_template": false,
"template_info": {
"detail": {
"currency_code": "USD",
"metadata": {
"create_time": "2021-11-14T23:49:31Z"
}
},
"invoicer": {
"business_name": "test facilitator's Test Store",
"address": {
"address_line_1": "1 Main St",
"address_line_2": "",
"admin_area_2": "San Jose",
"admin_area_1": "CA",
"postal_code": "95131"
},
"email_address": "etondoze-facilitator@gmail.com"
}
},
"settings": {
"template_item_settings": [
{
"field_name": "items.date",
"display_preference": {
"hidden": true
}
},
{
"field_name": "items.discount",
"display_preference": {
"hidden": true
}
},
{
"field_name": "items.tax",
"display_preference": {
"hidden": true
}
}
],
"template_subtotal_settings": [
{
"field_name": "custom",
"display_preference": {
"hidden": true
}
},
{
"field_name": "shipping",
"display_preference": {
"hidden": true
}
}
]
},
"unit_of_measure": "HOURS",
"standard_template": true,
"links": [
{
"href": "https://api.sandbox.paypal.com/v2/invoicing/templates/TEMP-21S46474NR9308124",
"rel": "self",
"method": "GET"
}
]
},
{
"id": "TEMP-8LK05440PT816351U",
"name": "Quantity",
"default_template": true,
"template_info": {
"detail": {
"currency_code": "USD",
"metadata": {
"create_time": "2021-11-14T23:49:31Z"
}
},
"invoicer": {
"business_name": "test facilitator's Test Store",
"address": {
"address_line_1": "1 Main St",
"address_line_2": "",
"admin_area_2": "San Jose",
"admin_area_1": "CA",
"postal_code": "95131"
},
"email_address": "etondoze-facilitator@gmail.com"
}
},
"settings": {
"template_item_settings": [
{
"field_name": "items.date",
"display_preference": {
"hidden": true
}
},
{
"field_name": "items.discount",
"display_preference": {
"hidden": true
}
},
{
"field_name": "items.tax",
"display_preference": {
"hidden": false
}
},
{
"field_name": "items.description",
"display_preference": {
"hidden": false
}
}
],
"template_subtotal_settings": [
{
"field_name": "custom",
"display_preference": {
"hidden": true
}
},
{
"field_name": "discount",
"display_preference": {
"hidden": false
}
},
{
"field_name": "shipping",
"display_preference": {
"hidden": false
}
}
]
},
"unit_of_measure": "QUANTITY",
"standard_template": true,
"links": [
{
"href": "https://api.sandbox.paypal.com/v2/invoicing/templates/TEMP-8LK05440PT816351U",
"rel": "self",
"method": "GET"
}
]
}
],
"links": [
{
"href": "https://api.sandbox.paypal.com/v2/invoicing/templates?page=1&page_size=10",
"rel": "self",
"method": "GET"
}
]
}
🟠401401 Unauthorized - Invalid Token
修改于 2023-08-16 07:18:59