Packages

Complete Stripe SDK for Elixir with parity to the official Ruby SDK. V1+V2 coverage (193 services, 320 resource structs, 525 documented params). Per-event modules, Finch HTTP/2, RustyJSON, automatic retries, OAuth, webhooks, telemetry, per-client config, streaming pagination.

Current section

Files

Jump to
tiger_stripe lib stripe services invoice_rendering_template_service.ex
Raw

lib/stripe/services/invoice_rendering_template_service.ex

# File generated from our OpenAPI spec
defmodule Stripe.Services.InvoiceRenderingTemplateService do
@moduledoc """
InvoiceRenderingTemplate
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.
"""
alias Stripe.Client
@doc """
Archive an invoice rendering template
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.
"""
@spec archive(Client.t(), String.t(), map(), keyword()) ::
{:ok, term()} | {:error, Stripe.Error.t()}
def archive(client, template, params \\ %{}, opts \\ []) do
Client.request(
client,
:post,
"/v1/invoice_rendering_templates/#{template}/archive",
Keyword.merge(opts, params: params)
)
end
@doc """
List all invoice rendering templates
List all templates, ordered by creation date, with the most recently created template appearing first.
"""
@spec list(Client.t(), map(), keyword()) ::
{:ok, term()} | {:error, Stripe.Error.t()}
def list(client, params \\ %{}, opts \\ []) do
Client.request(
client,
:get,
"/v1/invoice_rendering_templates",
Keyword.merge(opts, params: params)
)
end
@doc """
Retrieve an invoice rendering template
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.
"""
@spec retrieve(Client.t(), String.t(), map(), keyword()) ::
{:ok, term()} | {:error, Stripe.Error.t()}
def retrieve(client, template, params \\ %{}, opts \\ []) do
Client.request(
client,
:get,
"/v1/invoice_rendering_templates/#{template}",
Keyword.merge(opts, params: params)
)
end
@doc """
Unarchive an invoice rendering template
Unarchive an invoice rendering template so it can be used on new Stripe objects again.
"""
@spec unarchive(Client.t(), String.t(), map(), keyword()) ::
{:ok, term()} | {:error, Stripe.Error.t()}
def unarchive(client, template, params \\ %{}, opts \\ []) do
Client.request(
client,
:post,
"/v1/invoice_rendering_templates/#{template}/unarchive",
Keyword.merge(opts, params: params)
)
end
end