Skip to main content
POST
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.

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

Body

application/json
collection_method
enum<string>
required
Available options:
auto_charge,
manual
currency
enum<string>
required
Available options:
AED,
ALL,
AMD,
ANG,
AOA,
ARS,
AUD,
AWG,
AZN,
BAM,
BBD,
BDT,
BGN,
BHD,
BIF,
BMD,
BND,
BOB,
BRL,
BSD,
BWP,
BYN,
BZD,
CAD,
CHF,
CLP,
CNY,
COP,
CRC,
CUP,
CVE,
CZK,
DJF,
DKK,
DOP,
DZD,
EGP,
ETB,
EUR,
FJD,
FKP,
GBP,
GEL,
GHS,
GIP,
GMD,
GNF,
GTQ,
GYD,
HKD,
HNL,
HRK,
HTG,
HUF,
IDR,
ILS,
INR,
IQD,
JMD,
JOD,
JPY,
KES,
KGS,
KHR,
KMF,
KRW,
KWD,
KYD,
KZT,
LAK,
LBP,
LKR,
LRD,
LSL,
LYD,
MAD,
MDL,
MGA,
MKD,
MMK,
MNT,
MOP,
MRU,
MUR,
MVR,
MWK,
MXN,
MYR,
MZN,
NAD,
NGN,
NIO,
NOK,
NPR,
NZD,
OMR,
PAB,
PEN,
PGK,
PHP,
PKR,
PLN,
PYG,
QAR,
RON,
RSD,
RUB,
RWF,
SAR,
SBD,
SCR,
SEK,
SGD,
SHP,
SLE,
SLL,
SOS,
SRD,
SSP,
STN,
SVC,
SZL,
THB,
TND,
TOP,
TRY,
TTD,
TWD,
TZS,
UAH,
UGX,
USD,
UYU,
UZS,
VES,
VND,
VUV,
WST,
XAF,
XCD,
XOF,
XPF,
YER,
ZAR,
ZMW
customer_id
string
required
items
object[]
required

1 to 50 items.

A line that exists only on this invoice.

billing_address
null | object

The billing address of an invoice request.

cc_emails
string[] | null

10 addresses or fewer.

customer_email
string | null

The customer email is used when this is not set.

discount_ids
string[] | null

20 codes or fewer.

due_at
string<date-time> | null

A custom due date. Do not send it with payment_terms.

dunning
null | object

The reminder override of one invoice. The business settings fill the other dunning values.

memo
string | null
metadata
Metadata · object

Arbitrary key-value metadata. Values can be string, integer, number, or boolean.

payment_terms
Due On Receipt · object

Do not send it with due_at.

review_required
boolean

true keeps a renewal draft for review before it finalises.

tax_id
string | null

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