This link accepts query parameters that are processed through our Query Collector System. When parameters are provided, they are stored in session storage with a unique ID (e.g., sess_1a2b3c4d) and made available throughout the checkout flow.
The supported query parameters are:
Core Parameters:
quantity: The quantity of the product to be purchased. Default is 1.
redirect_url: URL to redirect after payment completion.
Note: The redirect URL will include payment details as query parameters:
fullName: Customer’s full name (ignored if firstName or lastName is provided)
firstName: Customer’s first name
lastName: Customer’s last name
email: Customer’s email address
country: Customer’s country
addressLine: Customer’s street address
city: Customer’s city
state: Customer’s state/province
zipCode: Customer’s postal/ZIP code
Form Field Controls:
The following flags can disable form fields, but only take effect when the associated field data is also provided:
disableFullName: Disables fullName field (requires fullName parameter)
disableFirstName: Disables fullName field (requires fullName parameter)
disableLastName: Disables fullName field (requires fullName parameter)
disableEmail: Disables email field (requires email parameter)
disableCountry: Disables country field (requires country parameter)
disableAddressLine: Disables address field (requires addressLine parameter)
disableCity: Disables city field (requires city parameter)
disableState: Disables state field (requires state parameter)
disableZipCode: Disables ZIP code field (requires zipCode parameter)
paymentCurrency: Specifies the payment currency. Default is set as per the billing country.
showCurrencySelector: Shows the currency selector. Default is true.
Custom Data:
Metadata fields can be passed using the metadata_ prefix
Example: metadata_orderId=123 or metadata_customerNote=Special instructions
paymentAmount: Specifies the payment amount in cents (e.g., $10.00 would be entered as 1000). This parameter is exclusively available for one-time payment links that use Pay What You Want (PWYW) pricing model.
When a customer visits the payment link, all query parameters are collected and stored with a session ID. The URL is then simplified to include just the session parameter (e.g., ?session=sess_1a2b3c4d). The stored information persists through page refreshes and is accessible throughout the checkout process.
Make sure you are passing payment_link = true to get payment link
import DodoPayments from 'dodopayments';const client = new DodoPayments({bearerToken: process.env['DODO_PAYMENTS_API_KEY'], // This is the default and can be omitted});async function main() {const payment = await client.payments.create({payment_link: true,billing: { city: 'city', country: 'AF', state: 'state', street: 'street', zipcode: 0 },customer: { email: 'email@email.com', name: 'name' },product_cart: [{ product_id: 'product_id', quantity: 0 }],});console.log(payment.payment_id);}main();
import DodoPayments from 'dodopayments';const client = new DodoPayments({bearerToken: process.env['DODO_PAYMENTS_API_KEY'], // This is the default and can be omitted});async function main() {const payment = await client.payments.create({payment_link: true,billing: { city: 'city', country: 'AF', state: 'state', street: 'street', zipcode: 0 },customer: { email: 'email@email.com', name: 'name' },product_cart: [{ product_id: 'product_id', quantity: 0 }],});console.log(payment.payment_id);}main();
import osfrom dodopayments import DodoPaymentsclient = DodoPayments(bearer_token=os.environ.get("DODO_PAYMENTS_API_KEY"), # This is the default and can be omitted (if using same name `DODO_PAYMENTS_API_KEY`))payment = client.payments.create(payment_link=True,billing={ "city": "city", "country": "AF", "state": "state", "street": "street", "zipcode": 0,},customer={ "email": "email@email.com", "name": "name",},product_cart=[{ "product_id": "product_id", "quantity": 0,}],)print(payment.payment_link)