Invoice Rendering Templates are used to configure how invoices are rendered on surfaces like the PDF. Invoice Rendering Templates can be created from within the Dashboard, and they can be used over the API when creating invoices.

Attributes

  • idstring

    Unique identifier for the object.

  • objectstring

    String representing the object’s type. Objects of the same type share the same value.

  • createdtimestamp

    Time at which the object was created. Measured in seconds since the Unix epoch.

  • livemodeboolean

    Has the value true if the object exists in live mode or the value false if the object exists in test mode.

  • metadatanullable object

    Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format.

  • nicknamenullable string

    A brief description of the template, hidden from customers

  • statusenum

    The status of the template, one of active or archived.

    Possible enum values
    active
    archived
  • versioninteger

    Version of this template; version increases by one when an update on the template changes any field that controls invoice rendering

The Invoice Rendering Template object
{
"id": "inrtem_abc",
"object": "invoice_rendering_template",
"nickname": "My Invoice Template",
"status": "active",
"version": 1,
"created": 1678942624,
"livemode": false
}

Retrieves an invoice rendering template with the given ID. It by default returns the latest version of the template. Optionally, specify a version to see previous versions.

Parameters

No parameters.

Returns

Returns an invoice_payment object if a valid invoice payment ID and matching invoice ID were provided. Otherwise, this call raises an error.

GET /v1/invoice_rendering_templates/:id
curl https://api.stripe.com/v1/invoice_rendering_templates/inrtem_abc \
-u "sk_test_4eC39Hq...arjtT1zdp7dcsk_test_4eC39HqLyjWDarjtT1zdp7dc:"
Response
{
"id": "inrtem_abc",
"object": "invoice_rendering_template",
"nickname": "My Invoice Template",
"status": "active",
"version": 1,
"created": 1678942624,
"livemode": false
}

List all templates, ordered by creation date, with the most recently created template appearing first.

Parameters

No parameters.

More parameters

  • ending_beforestring

  • limitinteger

  • starting_afterstring

Returns

A dictionary with a data property that contains an array of up to limit templates, starting after template starting_after. Each entry in the array is a separate template object. If no more templates are available, the resulting array will be empty.

GET /v1/invoice_rendering_templates
curl -G https://api.stripe.com/v1/invoice_rendering_templates \
-u "sk_test_4eC39Hq...arjtT1zdp7dcsk_test_4eC39HqLyjWDarjtT1zdp7dc:" \
-d limit=3
Response
{
"object": "list",
"url": "/v1/invoice_rendering_templates",
"has_more": false,
"data": [
{
"id": "inrtem_abc",
"object": "invoice_rendering_template",
"nickname": "My Invoice Template",
"status": "active",
"version": 1,
"created": 1678942624,
"livemode": false
}
{...}
{...}
],
}

Updates the status of an invoice rendering template to ‘archived’ so no new Stripe objects (customers, invoices, etc.) can reference it. The template can also no longer be updated. However, if the template is already set on a Stripe object, it will continue to be applied on invoices generated by it.

Parameters

No parameters.

Returns

The updated template object is returned if successful. Otherwise, this call raises an error.

POST /v1/invoice_rendering_templates/:id/archive
curl -X POST https://api.stripe.com/v1/invoice_rendering_templates/inrtem_abc/archive \
-u "sk_test_4eC39Hq...arjtT1zdp7dcsk_test_4eC39HqLyjWDarjtT1zdp7dc:"
Response
{
"id": "inrtem_abc",
"object": "invoice_rendering_template",
"nickname": "My Invoice Template",
"status": "active",
"version": 1,
"created": 1678942624,
"livemode": false
}