Skip to content

Payment Components

Available Components

ComponentDescription
CreatePaymentFormRecord a new payment for a document

CreatePaymentForm

Record a payment against an invoice:

Record Paymenttypescript
import { RecordPaymentForm } from "@/components/space-invoices/payments";

function _PaymentDialog({ invoice, onClose }) {
  const remainingAmount = invoice.total - invoice.paidAmount;

  return (
    
      
        
          Record Payment
        
        id}
          remainingAmount={remainingAmount}
          onSuccess={(payment) => {
            toast.success(`Payment of ${payment.amount} recorded`);
            onClose();
          }}
          onCancel={onClose}
        />
      
    
  );
}

Props

PropTypeDescription
invoiceIdstringInvoice ID
invoiceTotalnumberInvoice total amount
entityIdstringEntity context
onSuccess(payment) => voidSuccess callback
onError(error) => voidError callback

Composing Payment History

The kit does not currently ship a dedicated payment list/detail component. Most teams compose payment history inside their invoice detail page or account UI, using SDK data and their own layout.

Next Steps