gohighlevel-php-sdk

Invoices Resource

Invoice

The Invoice class is a central resource for managing invoices. It allows you to create, retrieve, update, and delete invoices, as well as perform other related actions such as voiding, sending, and recording payments. It also provides access to sub-resources for managing invoice templates, schedules, and Text2Pay settings.


generateNumber(string $altId, string $altType): array|string

Generates a new invoice number for a given location or company.


get(string $invoiceId, array $params = []): array|string

Retrieves a single invoice by its ID.


update(string $invoiceId, array $params): array|string

Updates an existing invoice.


delete(string $invoiceId, string $altId, string $altType): array|string

Deletes an invoice.


void(string $invoiceId, string $altId, string $altType): array|string

Voids an invoice.


send(string $invoiceId, array $params): array|string

Sends an invoice.


recordPayment(string $invoiceId, array $params): array|string

Records a payment for an invoice.


create(array $params): array|string

Creates a new invoice.


list(string $altId, string $altType, string $limit, string $offset, array $params = []): array|string

Retrieves a paginated list of invoices for a location or company.


template(): TemplateContract

Returns an instance of the Template sub-resource for managing invoice templates.


schedule(): ScheduleContract

Returns an instance of the Schedule sub-resource for managing scheduled invoices.


text2pay(): Text2payContract

Returns an instance of the Text2pay sub-resource for managing Text2Pay settings.


Schedule

The Schedule class is a sub-resource of Invoice for managing scheduled and recurring invoices.


create(array $params): array|string

Creates a new scheduled invoice.


list(string $altId, string $altType, string $limit, string $offset, array $params = []): array|string

Retrieves a paginated list of scheduled invoices for a location or company.


get(string $scheduleId, string $altId, string $altType): array|string

Retrieves a single scheduled invoice by its ID.


update(string $scheduleId, string $altId, string $altType, array $params = []): array|string

Updates a scheduled invoice.


delete(string $scheduleId, string $altId, string $altType): array|string

Deletes a scheduled invoice.


invoice(string $scheduleId, string $altId, string $altType, array $params): array|string

Manually creates an invoice from a scheduled invoice. This is likely used to generate an invoice for a specific instance of a recurring schedule.


autoPayment(string $scheduleId, string $altId, string $altType, array $params): array|string

Sets or updates auto-payment settings for a scheduled invoice.


cancel(string $scheduleId, string $altId, string $altType): array|string

Cancels a scheduled invoice. This is different from deleting it, as it likely stops future invoices from being generated.


Template

The Template class is a sub-resource of Invoice for managing invoice templates.


create(array $params): array|string

Creates a new invoice template.


list(string $altId, string $altType, string $limit, string $offset, array $params = []): array|string

Retrieves a paginated list of invoice templates for a location or company.


get(string $templateId, array $params = []): array|string

Retrieves a single invoice template by its ID.


update(string $templateId, array $params = []): array|string

Updates an existing invoice template.


delete(string $templateId): array|string

Deletes an invoice template.


Text2pay

The Text2pay class is a sub-resource of Invoice for managing Text2Pay functionality, which allows clients to pay invoices via a link sent over SMS.


create(array $params): array|string

Creates a new Text2Pay link for an invoice.


update(string $id, array $params): array|string

Updates a Text2Pay link. This endpoint may be used to re-send the link or modify its status.