Skip to main content
GET
JavaScript

Authorizations

Authorization
string
header
required

Send your API key as a bearer token: Authorization: Bearer <api_key>. A test mode key starts with dodo_test_, for example dodo_test_AbCd1234EfGh5678.<secret>. A live mode key starts with dodo_live_. Use a test mode key on test.dodopayments.com and a live mode key on live.dodopayments.com. Keys from before these tags have no tag and operate as before.

Path Parameters

invoice_id
string
required

Invoice ID

Query Parameters

format
enum<string>

The preview body. json returns the invoice JSON. pdf returns the PDF with a draft mark. email returns the HTML of the invoice email. A preview saves no row.

Available options:
json,
pdf,
email

Response

The preview in the format asked for: the PDF with a draft mark for pdf, the invoice JSON (an InvoiceResponse) for json, or the HTML of the invoice email for email. The SDKs return the raw response, so read it as bytes, JSON or text to match format.

The response is of type file.

Last modified on November 10, 2026