Operator keys write quotes and invoices; reader keys read them. Amounts are integers in the currency's smallest unit (cents for USD). Yasad calculates totals and tax, numbers documents without gaps when they're sent or issued, and freezes them from then on.
TypeScriptconst quote = await yasad.sales.createQuote({ requestId, customerId, calculation: {currency: 'USD', taxMode: 'exclusive', taxRates: [], discounts: [],lines: [{ id: 'labour', description: 'Labour (1.5 h)', quantity: '1.5', unitAmount: 9500, taxRateIds: [] }] } });const { customerLink } = await yasad.sales.sendQuote(quote.id, { requestId: sendId, expectedRevision: quote.revision, expiresInDays: 30 });
customerLinkis shown once (a retry returnsnull; make another withnewCustomerLink). It opens Yasad's customer page, where the customer views, downloads and accepts or declines. There is no API for accepting on the customer's behalf: in automated tests, open the link in a headless browser and press Accept quote.- Pass
customerIdto link a Yasad customer. An inlinecustomer(name, email, phone, address) is printed on the document but doesn't create a Yasad customer. - After acceptance:
convertQuote(once) gives an invoice draft;issueInvoicenumbers it (dueInDays) and returns its customer link;recordPaymentadds money received (never more than is due; the same amount again within 15 minutes needsconfirmDuplicate: true);voidInvoicecancels one with no payments. - Lists return the newest 100;
sales.page({ kind, before })continues.