On this page
No Headings
Note: Every merchant starts with three PayPal system templates that are optimized for the unit type billed. The template includes `Quantity`, `Hours`, and `Amount`.
Oauth 2.0 authentication
Client CredentialsToken URL/api/oauth-proxyInheaderScopes
https://uri.paypal.com/services/invoicing/invoices/readwriteapplication/json
TypeScript Definitions
Use the request body type in TypeScript.
application/json
curl -X POST "https://api-m.sandbox.paypal.com/v2/invoicing/templates" \ -H "Content-Type: application/json" \ -d '{}'{
"id": "string",
"name": "string",
"default_template": true,
"template_info": {
"detail": {
"reference": "string",
"currency_code": "str",
"note": "string",
"terms_and_conditions": "string",
"memo": "string",
"attachments": [],
"payment_term": {
"term_type": "DUE_ON_RECEIPT"
},
"metadata": {
"create_time": "stringstringstringst",
"created_by": "string",
"last_update_time": "stringstringstringst",
"last_updated_by": "string"
}
},
"invoicer": {
"business_name": "string",
"name": {
"prefix": "string",
"given_name": "string",
"surname": "string",
"middle_name": "string",
"suffix": "string",
"alternate_full_name": "string",
"full_name": "string"
},
"address": {
"address_line_1": "string",
"address_line_2": "string",
"address_line_3": "string",
"admin_area_4": "string",
"admin_area_3": "string",
"admin_area_2": "string",
"admin_area_1": "string",
"postal_code": "string",
"country_code": "st",
"address_details": {
"street_number": "string",
"street_name": "string",
"street_type": "string",
"delivery_service": "string",
"building_name": "string",
"sub_building": "string"
}
},
"email_address": "string",
"phones": [
{
"country_code": "str",
"national_number": "string",
"extension_number": "string",
"phone_type": "FAX"
}
],
"website": "http://example.com",
"tax_id": "string",
"additional_notes": "string",
"logo_url": "http://example.com"
},
"primary_recipients": [],
"additional_recipients": [],
"items": [],
"configuration": {
"tax_calculated_after_discount": true,
"tax_inclusive": false,
"allow_tip": false,
"partial_payment": {
"allow_partial_payment": false,
"minimum_amount_due": {
"currency_code": "str",
"value": "string"
}
},
"has_conditional_rule": false
},
"amount": {
"currency_code": "str",
"value": "string",
"breakdown": {
"item_total": {
"currency_code": "str",
"value": "string"
},
"discount": {
"invoice_discount": {
"percent": "string",
"amount": {
"currency_code": "str",
"value": "string"
}
},
"item_discount": {
"currency_code": "str",
"value": "string"
}
},
"tax_total": {
"currency_code": "str",
"value": "string"
},
"shipping": {
"amount": {
"currency_code": "str",
"value": "string"
},
"tax": {
"name": "string",
"percent": "string",
"amount": {
"currency_code": "str",
"value": "string"
},
"tax_note": "string"
}
},
"custom": {
"label": "string",
"amount": {
"currency_code": "str",
"value": "string"
}
}
}
},
"due_amount": {
"currency_code": "str",
"value": "string"
}
},
"settings": {
"template_item_settings": [],
"template_subtotal_settings": []
},
"unit_of_measure": "QUANTITY",
"standard_template": true,
"links": []
}{
"name": "INVALID_REQUEST",
"message": "Request is not well-formed, syntactically incorrect, or violates schema.",
"debug_id": "string",
"links": [],
"details": [
{
"issue": "TEMPLATE_NAME_ALREADY_EXISTS",
"description": "Template name already exists."
}
]
}{
"name": "NOT_AUTHORIZED",
"message": "Authorization failed due to insufficient permissions.",
"details": [
{
"field": "string",
"value": "string",
"location": "body",
"issue": "string",
"description": "string"
}
],
"debug_id": "string",
"links": []
}{
"name": "UNPROCESSABLE_ENTITY",
"message": "The requested action could not be performed, semantically incorrect, or failed business validation.",
"debug_id": "string",
"links": [],
"details": [
{
"issue": "CANNOT_CANCEL_DRAFT_INVOICE",
"description": "Cannot cancel a draft invoice."
}
]
}{
"name": "INTERNAL_SERVER_ERROR",
"message": "An internal server error occurred.",
"debug_id": "90957fca61718",
"links": [
{
"href": "https://developer.paypal.com/api/orders/v2/#error-INTERNAL_SERVER_ERROR",
"rel": "information_link"
}
]
}{
"name": "INVALID_REQUEST",
"message": "Request is not well-formed, syntactically incorrect, or violates schema.",
"details": [
{
"field": "string",
"value": "string",
"location": "body",
"issue": "string",
"description": "string"
}
],
"debug_id": "string",
"links": []
}The template name.Note: The template name must be unique.
^[\S\s]*$1 <= length <= 500Indicates whether this template is the default template. A invoicer can have one default template.
The template details. Includes invoicer business information, invoice recipients, items, and configuration.
The template settings. Describes which fields to show or hide when you create an invoice.
The unit of measure for the invoiced item. For AMOUNT the unit_amount and quantity are not shown on the invoice.Note: If your specify different unit_of_measure values for the same invoice, the invoice uses the first value.
^[\S\s]*$0 <= length <= 2147483647"QUANTITY" | "HOURS" | "AMOUNT"