Templates

Use the /templates resource to create, list, show details for, update, and delete invoice templates. Use the /templates resource when you create a third-party invoicing application. For instance, a business can create a template with predefined invoice data. Later, the business can select the template to populate the invoice data.

Note: To upload a logo to display on an invoice, you can use the Template Settings dashboard to create a templatearrow-up-right. When you create an invoice, you can use the URI for that logo.

The template object

Attributes

The template with invoice details to load with all captured fields.

idstring · max: 30Read-onlyOptional

The ID of the template.

namestring · min: 1 · max: 500Optional

The template name.Note: The template name must be unique.

default_templatebooleanOptional

Indicates whether this template is the default template. A invoicer can have one default template.

unit_of_measurestring · enumOptional

The unit of measure for the template. Value is quantity, hours, or amount.

Possible values:
standard_templatebooleanRead-onlyOptional

Indicates whether this template is a invoicer-created custom template. The system generates non-custom templates.

The template object

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.

chevron-right
lockRequired scopes
This endpoint requires the following scopes:
  • : For Reading the invoice details.
Authorizations
OAuth2clientCredentialsRequired

Oauth 2.0 authentication

Token URL:
Query parameters
fieldsstringOptional

The fields to return in the response. Value is all or none. To return only the template name, ID, and default attributes, specify none.

Default: allPattern: (?i)^(all|none)$
pageinteger · min: 1 · max: 1000Optional

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.

Default: 1
page_sizeinteger · min: 1 · max: 100Optional

The maximum number of templates to return in the response.

Default: 20
Responses
chevron-right
200

A successful request returns the HTTP 200 OK status code and a JSON response body that lists invoices.

get
/v2/invoicing/templates

Create template

post
/v2/invoicing/templates

Creates an invoice template. You can use details from this template to create an invoice. You can create up to 50 templates.

Note: Every merchant starts with three PayPal system templates that are optimized for the unit type billed. The template includes Quantity, Hours, and Amount.

chevron-right
lockRequired scopes
This endpoint requires the following scopes:
  • : For managing (Create, Update, Delete) invoice.
Authorizations
OAuth2clientCredentialsRequired

Oauth 2.0 authentication

Token URL:
Body

The template with invoice details to load with all captured fields.

idstring · max: 30Read-onlyOptional

The ID of the template.

namestring · min: 1 · max: 500Optional

The template name.Note: The template name must be unique.

default_templatebooleanOptional

Indicates whether this template is the default template. A invoicer can have one default template.

unit_of_measurestring · enumOptional

The unit of measure for the template. Value is quantity, hours, or amount.

Possible values:
standard_templatebooleanRead-onlyOptional

Indicates whether this template is a invoicer-created custom template. The system generates non-custom templates.

Responses
post
/v2/invoicing/templates

Show template details

get
/v2/invoicing/templates/{template_id}

Shows details for a template, by ID.

chevron-right
lockRequired scopes
This endpoint requires the following scopes:
  • : For Reading the invoice details.
Authorizations
OAuth2clientCredentialsRequired

Oauth 2.0 authentication

Token URL:
Path parameters
template_idstringRequired

The ID of the template to delete.

Responses
chevron-right
200

A successful request returns the HTTP 200 OK status code and a JSON response body that shows template details.

get
/v2/invoicing/templates/{template_id}

Fully update template

put
/v2/invoicing/templates/{template_id}

Fully updates a template, by ID. In the JSON request body, include a complete template object. This call does not support partial updates.

chevron-right
lockRequired scopes
This endpoint requires the following scopes:
  • : For managing (Create, Update, Delete) invoice.
Authorizations
OAuth2clientCredentialsRequired

Oauth 2.0 authentication

Token URL:
Path parameters
template_idstringRequired

The ID of the template to delete.

Body

The template with invoice details to load with all captured fields.

idstring · max: 30Read-onlyOptional

The ID of the template.

namestring · min: 1 · max: 500Optional

The template name.Note: The template name must be unique.

default_templatebooleanOptional

Indicates whether this template is the default template. A invoicer can have one default template.

unit_of_measurestring · enumOptional

The unit of measure for the template. Value is quantity, hours, or amount.

Possible values:
standard_templatebooleanRead-onlyOptional

Indicates whether this template is a invoicer-created custom template. The system generates non-custom templates.

Responses
chevron-right
200

A successful request returns the HTTP 200 OK status code. A JSON response body that shows template details is returned if you set prefer=return=representation.

application/json
put
/v2/invoicing/templates/{template_id}

Delete template

delete
/v2/invoicing/templates/{template_id}

Deletes a template, by ID.

chevron-right
lockRequired scopes
This endpoint requires the following scopes:
  • : For managing (Create, Update, Delete) invoice.
Authorizations
OAuth2clientCredentialsRequired

Oauth 2.0 authentication

Token URL:
Path parameters
template_idstringRequired

The ID of the template to delete.

Responses
delete
/v2/invoicing/templates/{template_id}

No content

Last updated

Was this helpful?