Documentation
¶
Index ¶
- type EmailReceivablesForCustomerEndpoint
- type EmailReceivablesForCustomerRequest
- type ExportReceivablesByCustomerEndpoint
- type ExportReceivablesByCustomerRequest
- type ListReceivablesByCustomerEndpoint
- type ListReceivablesByCustomerRequest
- type ListReceivablesEndpoint
- type ListReceivablesRequest
- type ReceivableSvc
- type ReceivableSvcConfig
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type EmailReceivablesForCustomerEndpoint ¶
type EmailReceivablesForCustomerEndpoint struct{}
Emails a statement of account for a specific customer to the provided recipients.
The email carries an Excel attachment listing the customer's outstanding receivables and its open credits, which are transactions such as payments and credit memos that still have an unapplied balance. The statement always reflects current balances; there is no cutoff date. Delivery is asynchronous: the endpoint returns `202 Accepted` once the email is queued.
func (*EmailReceivablesForCustomerEndpoint) Materialize ¶
func (e *EmailReceivablesForCustomerEndpoint) Materialize() *apiendpoint.APIEndpoint[*EmailReceivablesForCustomerRequest, *apiresource.EmptyResource]
type EmailReceivablesForCustomerRequest ¶
type EmailReceivablesForCustomerRequest struct {
// ID of the customer account the statement is prepared for.
AccountID string `json:"-" path:"account_id" validate:"required"`
// Email addresses to send the statement of account to.
//
// The statement goes only to these addresses; the customer's own notification contacts are not added.
RecipientEmails []string `json:"recipient_emails" validate:"required,min=1"`
}
Request to email a statement of account for a specific customer.
func (*EmailReceivablesForCustomerRequest) SchemaExample ¶
func (*EmailReceivablesForCustomerRequest) SchemaExample() any
type ExportReceivablesByCustomerEndpoint ¶
type ExportReceivablesByCustomerEndpoint struct{}
Exports a single customer's outstanding receivable entries as a downloadable CSV file.
The response is the file itself rather than a JSON resource, and it covers every open invoice for the customer instead of one page of results. When a cutoff date is supplied, it is included in the generated file name.
func (*ExportReceivablesByCustomerEndpoint) Materialize ¶
func (e *ExportReceivablesByCustomerEndpoint) Materialize() *apiendpoint.APIEndpoint[*ExportReceivablesByCustomerRequest, *httptransport.FileDownload]
type ExportReceivablesByCustomerRequest ¶
type ExportReceivablesByCustomerRequest struct {
// ID of the customer account whose outstanding balances are exported.
AccountID string `json:"-" path:"account_id" validate:"required"`
// Compute receivable balances as of this timestamp.
//
// Only invoices created before the cutoff are included, only payments whose funds had landed by then are subtracted from each remaining balance, and entries already settled by the cutoff drop out. When omitted, current balances are returned for every unpaid invoice.
CutoffDate *time.Time `query:"cutoff_at"`
}
Request to export receivable entries for a specific customer as CSV.
type ListReceivablesByCustomerEndpoint ¶
type ListReceivablesByCustomerEndpoint struct{}
Returns a paginated list of outstanding receivable entries for a single customer account, newest invoice first.
One entry is returned per invoice billed to that customer that is not marked paid in full. Invoices billed to the customer's child accounts are not included.
func (*ListReceivablesByCustomerEndpoint) Materialize ¶
func (e *ListReceivablesByCustomerEndpoint) Materialize() *apiendpoint.APIEndpoint[*ListReceivablesByCustomerRequest, *apiresource.List[apiresource.ReceivableEntry]]
type ListReceivablesByCustomerRequest ¶
type ListReceivablesByCustomerRequest struct {
apiresource.PaginationRequest
// ID of the customer account whose outstanding balances are listed.
AccountID string `json:"-" path:"account_id" validate:"required"`
// Compute receivable balances as of this timestamp.
//
// Only invoices created before the cutoff are included, only payments whose funds had landed by then are subtracted from each remaining balance, and entries already settled by the cutoff drop out. When omitted, current balances are returned for every unpaid invoice.
CutoffDate *time.Time `query:"cutoff_at"`
}
Request to list receivable entries for a specific customer.
type ListReceivablesEndpoint ¶
type ListReceivablesEndpoint struct{}
Returns a paginated list of outstanding receivable entries for the current account, newest invoice first.
One entry is returned per invoice that is not marked paid in full, across every customer. A free-text search term (`q`) is matched against the invoice number and the customer name.
func (*ListReceivablesEndpoint) Materialize ¶
func (e *ListReceivablesEndpoint) Materialize() *apiendpoint.APIEndpoint[*ListReceivablesRequest, *apiresource.List[apiresource.ReceivableEntry]]
type ListReceivablesRequest ¶
type ListReceivablesRequest struct {
apiresource.PaginationRequest
// Compute receivable balances as of this timestamp.
//
// Only invoices created before the cutoff are included, only payments whose funds had landed by then are subtracted from each remaining balance, and entries already settled by the cutoff drop out. When omitted, current balances are returned for every unpaid invoice.
CutoffDate *time.Time `query:"cutoff_at"`
}
Request to list all receivable entries.
type ReceivableSvc ¶
type ReceivableSvc interface {
ListReceivables(ctx context.Context, req *ListReceivablesRequest) (*apiresource.List[apiresource.ReceivableEntry], *apierror.APIError)
ListReceivablesByCustomer(ctx context.Context, req *ListReceivablesByCustomerRequest) (*apiresource.List[apiresource.ReceivableEntry], *apierror.APIError)
ExportReceivablesByCustomer(ctx context.Context, req *ExportReceivablesByCustomerRequest) (*httptransport.FileDownload, *apierror.APIError)
EmailReceivablesForCustomer(ctx context.Context, req *EmailReceivablesForCustomerRequest) (*apiresource.EmptyResource, *apierror.APIError)
}
func NewReceivableSvc ¶
func NewReceivableSvc(config *ReceivableSvcConfig) ReceivableSvc
type ReceivableSvcConfig ¶
type ReceivableSvcConfig struct {
// CoreClient (required) is the core-service gRPC client.
CoreClient pb.CoreServiceClient
}