Payments
Create One Time Payment
API Documentation & SDKs
- Introduction
- Code Integration Tutorial
- SDKs - Node, Python, PHP, Go, Ruby, Java & Kotlin
- Payments Integration Guide
- Subscription Integration Guide
- Mobile Integration Guide
- On Demand Subscriptions
- Webhooks Details
- Managing Products Via API
- Metadata Guide
- Configuring Allowed Payment Methods
- MCP Server
- Technical - FAQs
Subscriptions
Discounts
Licenses
Customers
Products
Payouts
Miscellaneous
Payments
Create One Time Payment
Create a one-time payment for a customer.
POST
/
payments
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({
billing: { city: 'city', country: 'AF', state: 'state', street: 'street', zipcode: 'zipcode' },
customer: { customer_id: 'customer_id' },
product_cart: [{ product_id: 'product_id', quantity: 0 }],
});
console.log(payment.payment_id);
}
main();
{
"client_secret": "<string>",
"customer": {
"customer_id": "<string>",
"email": "<string>",
"name": "<string>"
},
"discount_id": "<string>",
"metadata": {},
"payment_id": "<string>",
"payment_link": "<string>",
"product_cart": [
{
"amount": 123,
"product_id": "<string>",
"quantity": 1
}
],
"total_amount": 1
}
Authorizations
Bearer authentication header of the form Bearer <token>
, where <token>
is your auth token.
Body
application/json
Response
200 - application/json
One Time payment successfully initiated
The response is of type object
.
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({
billing: { city: 'city', country: 'AF', state: 'state', street: 'street', zipcode: 'zipcode' },
customer: { customer_id: 'customer_id' },
product_cart: [{ product_id: 'product_id', quantity: 0 }],
});
console.log(payment.payment_id);
}
main();
{
"client_secret": "<string>",
"customer": {
"customer_id": "<string>",
"email": "<string>",
"name": "<string>"
},
"discount_id": "<string>",
"metadata": {},
"payment_id": "<string>",
"payment_link": "<string>",
"product_cart": [
{
"amount": 123,
"product_id": "<string>",
"quantity": 1
}
],
"total_amount": 1
}