Prerequisites
- Customer assigned to the order with
creditLimit > 0in Odoo - Order mode is not
return(credit is unavailable for refunds)
Eligibility check
The credit button appears in the payment screen when:- The order has a
partnerId(customer assigned) - The customer’s
creditLimitis greater than zero - The order mode is not
return
API endpoint
POST
/pos-api/v1/customers/credit-checkRequest
Response
Payment flow
1
Select customer
Assign a customer with credit limit to the order via the customer select button.
2
Open payment screen
The credit button appears alongside standard payment methods if the customer is eligible.
3
Tap credit
Calls
/pos-api/v1/customers/credit-check to verify eligibility. If approved, a payment line is added with isCredit: true.4
Complete payment
Credit lines can cover part or all of the balance. Mix with cash/card as needed.
5
Order submission
Credit lines are filtered out from
statement_ids before sending to Odoo. Only non-credit payment lines create journal entries.Implementation details
PaymentLine.isCredit
ThePaymentLine type in types.ts includes an isCredit?: boolean flag. During order submission, lines with isCredit: true are excluded:
Customer model
TheCustomer interface in domain/customers/models.ts includes creditLimit?: number, populated from the bootstrap partners array and customer API responses.