Skip to main content

weekly_billing_run

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

These are SECURITY DEFINER functions granted only to the service role (execute is revoked from anon/authenticated). They bypass table RLS and enforce their own company_id and status checks internally, so call them server-side with the service-role key:

const { data, error } = await supabase.rpc('weekly_billing_run', { p_company_id, p_period_end, p_period_start });

Arguments

ArgumentTypeRequired
p_company_iduuidyes
p_period_enddateyes
p_period_startdateyes

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