Quotations

Send a quotation the customer accepts online (with a deposit if you ask for one), then turn it into an invoice.

A quotation is a draft until you issue it. Once issued the customer gets a link to accept or decline it; a revision replaces an issued quotation and the earlier one can no longer be accepted.

Keys and scopes

A secret key, or a restricted key with the invoices scope (quotations share it).

Create and issue

Ask for a deposit with deposit_required and deposit_amount: the customer pays it when accepting.

typescript
const quote = await watenga.quotations.create({
  title: 'Website redesign',
  customer_name: 'Ada Buyer',
  customer_email: 'ada@example.com',
  currency: 'USD',
  line_items: [{ description: 'Design and build', quantity: 1, unit_price: '1800.00' }],
  expiry_date: '2026-11-30',
});
await watenga.quotations.issue(quote.id);

Turn an accepted quotation into an invoice

When quotation.accepted arrives, convert it; a paid deposit is credited on the invoice.

typescript
const invoice = await watenga.quotations.convertToInvoice(quote.id);

Webhook events

EventWhen
quotation.acceptedThe customer accepted
quotation.deposit-paidThe deposit was paid
quotation.declinedThe customer declined
quotation.expiredThe expiry date passed
quotation.convertedIt became an invoice

Each event carries the object in data.object; verify the signature first (Webhooks).

Test it

Use a test secret key (sk_test_…): it never moves money. Pay with the test cards and wallet numbers, and receive the webhooks on your machine with watenga listen --forward-to http://localhost:3000/webhooks (CLI).

Related: Invoices