Quote to cash
Create a customer quote, convert it to an invoice, and record the payment without losing the accounting trail.
Quote to cash
A quote-to-cash integration carries the same customer and commercial context from the first quote through the paid invoice.
Workflow
| Step | Endpoint | Result |
|---|---|---|
| 1. Resolve the customer | List contacts or Create contact | Customer contact ID |
| 2. Create the quote | Create quote | Quote ID |
| 3. Convert it | Convert quote to invoice | Invoice ID |
| 4. Record receipt | Create payment | Payment linked to the invoice |
| 5. Confirm balances | Retrieve invoice | Updated balance and status |
Create the quote
A quote can include its line items in the initial request:
curl --request POST "https://api.wafeq.com/v1/quotes/" \
--header "Authorization: Api-Key <API_KEY>" \
--header "Content-Type: application/json" \
--header "X-Wafeq-Idempotency-Key: quote-<ORDER_ID>" \
--data '{
"contact": "<CUSTOMER_CONTACT_ID>",
"currency": "AED",
"quote_date": "2026-08-29",
"quote_number": "Q-1042",
"reference": "ORDER-1042",
"external_id": "order_1042",
"tax_amount_type": "TAX_EXCLUSIVE",
"line_items": [
{
"description": "Annual subscription",
"quantity": 1,
"unit_amount": 1200,
"tax_rate": "<TAX_RATE_ID>"
}
]
}'Use external_id for your stable source identifier. Use the idempotency header for retry protection; they solve different problems.
You can also add or update lines through the Quote line items endpoints.
Convert the accepted quote
After the customer accepts the quote:
curl --request POST "https://api.wafeq.com/v1/quotes/<QUOTE_ID>/invoice/" \
--header "Authorization: Api-Key <API_KEY>" \
--header "Content-Type: application/json"The response is the new invoice. Store both the quote ID and invoice ID so users can move between the source order and its accounting document.
Record the customer payment
Resolve a payment-enabled account first, then create the payment:
curl --request POST "https://api.wafeq.com/v1/payments/" \
--header "Authorization: Api-Key <API_KEY>" \
--header "Content-Type: application/json" \
--header "X-Wafeq-Idempotency-Key: payment-<PAYMENT_ID>" \
--data '{
"amount": 1260,
"currency": "AED",
"date": "2026-09-02",
"paid_through_account": "<BANK_OR_GATEWAY_ACCOUNT_ID>",
"contact": "<CUSTOMER_CONTACT_ID>",
"external_id": "pay_1042",
"invoice_payments": [
{
"invoice": "<INVOICE_ID>",
"amount": 1260,
"amount_to_pcy": 1260
}
]
}'For cross-currency payments, follow the payment schema for amount, amount_to_pcy, and exchange_rate rather than assuming a one-to-one conversion.
Production checks
- Re-read the invoice after payment and store its latest balance.
- Never create a second invoice when a conversion request times out; look up the existing result and retry safely.
- Keep customer, currency, project, branch, and custom-field mappings consistent across every document.
- Create a credit note rather than editing financial history after an invoice has been issued.
For invoices created without a quote, see Manage the invoice lifecycle.
Updated about 1 hour ago