Paypal API
  1. Templates
Paypal API
  • Authorization
    • Generate access_token
      POST
    • Terminate access_token
      POST
    • User Info
      GET
    • Generate client_token
      POST
  • Orders
    • Create order
      POST
    • Show order details
      GET
    • Update order
      PATCH
    • Authorize payment for order
      POST
    • Capture payment for order
      POST
  • Payments
    • Show details for authorized payment
      GET
    • Reauthorize authorized payment
      POST
    • Void authorized payment
      POST
    • Capture authorized payment
      POST
    • Show captured payment details
      GET
    • Refund captured payment
      POST
    • Show refund details
      GET
  • Invoices
    • Invoices
      • Generate invoice number
      • Create draft invoice
      • Show invoice details
      • List invoices
      • Generate QR code
      • Fully update invoice
      • Send invoice
      • Send invoice reminder
      • Cancel sent invoice
      • Delete invoice
      • Search for invoices
      • Record payment for invoice
      • Delete external payment
      • Record refund for invoice
      • Delete external refund
    • Templates
      • List templates
        GET
      • Create template
        POST
      • Show template details
        GET
      • Fully update template
        PUT
      • Delete template
        DELETE
  • Subscriptions
    • Catalog Products
      • Create product
      • List products
      • Show product details
      • Update product
    • Plans
      • Create plan
      • List plans
      • Show plan details
      • Update plan
      • Deactivate plan
      • Activate plan
      • Update pricing
    • Subscriptions
      • Create subscription
      • Show subscription details
      • Update subscription
      • Revise plan or quantity of subscription
      • Suspend subscription
      • Activate subscription
      • Cancel subscription
      • Capture authorized payment on subscription
      • List transactions for subscription
  • Payouts
    • Create batch payout
    • Show payout batch details
    • Show payout item details
    • Cancel unclaimed payout item
  • Webhooks
    • List available events
    • Create webhook
    • List webhooks
    • Show webhook details
    • List event notifications
    • List event subscriptions for webhook
    • Show event notification details
    • Trigger a sample event
    • Verify webhook signature
    • Resend event notification
    • Simulate webhook event
    • Update webhook
    • Delete webhook
  • Shipment Tracking
    • Add tracking information for multiple PayPal transactions
    • Show tracking information
    • Update or cancel tracking information for PayPal transaction
  • Transaction Search
    • List transactions
    • List all balances
  • 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)
    • Manage Accounts
      • Create managed account
      • Search managed account through external id
      • Search managed account by Seller Id
      • Partially updates information for a managed account
      • Shows collection of registered wallet domains
  1. Templates

List templates

GET
/v2/invoicing/templates
Lists merchant-created templates with associated details. The associated details include the emails, addresses, and phone numbers from the user's PayPal profile.
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 
必需
The fields to return in the response. Value is all or none. To return only the template name, ID, and default attributes, specify none.
示例值:
all
page
string 
必需
The page number to be retrieved, for the list of templates. So, a combination of 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 
必需
The maximum number of templates to return in the response.
示例值:
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
上一页
Delete external refund
下一页
Create template
Built with