Skip to main content

create_facility_invoice

PostgREST stored procedure — POST /rest/v1/rpc/create_facility_invoice.

Call it through the Supabase client (RLS and the service role are enforced by the function):

const { data, error } = await supabase.rpc('create_facility_invoice', { p_company_id, p_created_by, p_due_date, p_facility_id, p_lines, p_period_end, p_period_start, p_total_cents, p_variance_flagged });

Arguments

ArgumentTypeRequired
p_company_iduuidyes
p_created_byuuidyes
p_due_datedateyes
p_facility_iduuidyes
p_linesjsonbyes
p_period_enddateyes
p_period_startdateyes
p_total_centsbigintyes
p_variance_flaggedbooleanyes

Generated from specs/supabase.json. The function's behaviour is defined by its SQL migration; this page documents its call signature only.