// checkout/payment.provider_metadata requires amount and currency (checkout)
// or success_url (payment)
await paykit.checkouts.create({
customer: { email: 'user@example.com' },
item_id: 'my-product',
session_type: 'one_time',
quantity: 1,
success_url: 'https://example.com/success',
cancel_url: 'https://example.com/cancel',
provider_metadata: {
amount: '40000', // in the smallest currency unit (e.g. paise), as a string
currency: 'INR',
},
});
// subscription.provider_metadata requires total_count or end_at
await paykit.subscriptions.create({
customer: { email: 'user@example.com' },
item_id: 'plan_00000000000001',
quantity: 1,
billing_interval: 'month',
amount: 49900,
currency: 'INR',
metadata: null,
provider_metadata: {
total_count: 12, // number of billing cycles
},
});