Preview an Invoice Request
Price an invoice request as a draft and get it back as JSON, a PDF, or the invoice email, without saving it.
Authorizations
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
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.
json, pdf, email Body
auto_charge, manual 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 1 to 50 items.
A line that exists only on this invoice.
- Option 1
- Option 2
The billing address of an invoice request.
10 addresses or fewer.
The customer email is used when this is not set.
20 codes or fewer.
A custom due date. Do not send it with payment_terms.
The reminder override of one invoice. The business settings fill the other dunning values.
Arbitrary key-value metadata. Values can be string, integer, number, or boolean.
Do not send it with due_at.
- Due On Receipt
- Net
true keeps a renewal draft for review before it finalises.
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.