Class: InvoicesClient

Inherits:
Object
  • Object
show all
Defined in:
lib/lockstep_sdk/clients/invoices_client.rb

Instance Method Summary collapse

Constructor Details

#initialize(lockstepsdk) ⇒ InvoicesClient

Initialize the InvoicesClient class with a lockstepsdk instance.

Parameters:

  • lockstepsdk (LockstepApi)

    The Lockstep API client object for this connection



24
25
26
# File 'lib/lockstep_sdk/clients/invoices_client.rb', line 24

def initialize(lockstepsdk)
    @lockstepsdk = lockstepsdk
end

Instance Method Details

#create_invoices(body:) ⇒ Object

Creates one or more Invoices within this account and returns the records as created.

An Invoice represents a bill sent from one company to another. The creator of the invoice is identified by the CompanyId field, and the recipient of the invoice is identified by the CustomerId field. Most invoices are uniquely identified both by a Lockstep Platform ID number and a customer ERP “key” that was generated by the system that originated the invoice. Invoices have a total amount and a due date, and when some payments have been made on the Invoice the TotalAmount and the OutstandingBalanceAmount may be different.

Parameters:

  • body (InvoiceModel)

    The Invoices to create



69
70
71
72
# File 'lib/lockstep_sdk/clients/invoices_client.rb', line 69

def create_invoices(body:)
    path = "/api/v1/Invoices"
    @lockstepsdk.request(:post, path, body, nil)
end

#delete_invoice(id:) ⇒ Object

Deletes the Invoice referred to by this unique identifier. An Invoice represents a bill sent from one company to another. The creator of the invoice is identified by the CompanyId field, and the recipient of the invoice is identified by the CustomerId field. Most invoices are uniquely identified both by a Lockstep Platform ID number and a customer ERP “key” that was generated by the system that originated the invoice. Invoices have a total amount and a due date, and when some payments have been made on the Invoice the TotalAmount and the OutstandingBalanceAmount may be different.

Parameters:

  • id (uuid)

    The unique Lockstep Platform ID number of the invoice to delete; NOT the customer’s ERP key



58
59
60
61
# File 'lib/lockstep_sdk/clients/invoices_client.rb', line 58

def delete_invoice(id:)
    path = "/api/v1/Invoices/#{id}"
    @lockstepsdk.request(:delete, path, nil, nil)
end

#query_at_risk_invoice_summary_view(filter:, include_param:, order:, page_size:, page_number:) ⇒ Object

Queries At Risk Invoices for this account using the specified filtering, sorting, nested fetch, and pagination rules requested. Display the results using the At Risk Invoice Summary View format.

More information on querying can be found on the [Searchlight Query Language](developer.lockstep.io/docs/querying-with-searchlight) page on the Lockstep Developer website.

The At Risk Invoice Summary View represents a slightly different view of the data and includes some extra fields that might be useful. For more information, see the data format of the At Risk Invoice Summary Model.

Parameters:



120
121
122
123
124
# File 'lib/lockstep_sdk/clients/invoices_client.rb', line 120

def query_at_risk_invoice_summary_view(filter:, include_param:, order:, page_size:, page_number:)
    path = "/api/v1/Invoices/views/at-risk-summary"
    params = {:filter => filter, :include => include_param, :order => order, :pageSize => page_size, :pageNumber => page_number}
    @lockstepsdk.request(:get, path, nil, params)
end

#query_invoice_summary_view(filter:, include_param:, order:, page_size:, page_number:) ⇒ Object

Queries Invoices for this account using the specified filtering, sorting, nested fetch, and pagination rules requested. Display the results using the Invoice Summary View format.

More information on querying can be found on the [Searchlight Query Language](developer.lockstep.io/docs/querying-with-searchlight) page on the Lockstep Developer website.

The Invoice Summary View represents a slightly different view of the data and includes some extra fields that might be useful. For more information, see the data format of the Invoice Summary Model.

Parameters:



102
103
104
105
106
# File 'lib/lockstep_sdk/clients/invoices_client.rb', line 102

def query_invoice_summary_view(filter:, include_param:, order:, page_size:, page_number:)
    path = "/api/v1/Invoices/views/summary"
    params = {:filter => filter, :include => include_param, :order => order, :pageSize => page_size, :pageNumber => page_number}
    @lockstepsdk.request(:get, path, nil, params)
end

#query_invoices(filter:, include_param:, order:, page_size:, page_number:) ⇒ Object

Queries Invoices for this account using the specified filtering, sorting, nested fetch, and pagination rules requested.

More information on querying can be found on the [Searchlight Query Language](developer.lockstep.io/docs/querying-with-searchlight) page on the Lockstep Developer website. An Invoice represents a bill sent from one company to another. The creator of the invoice is identified by the CompanyId field, and the recipient of the invoice is identified by the CustomerId field. Most invoices are uniquely identified both by a Lockstep Platform ID number and a customer ERP “key” that was generated by the system that originated the invoice. Invoices have a total amount and a due date, and when some payments have been made on the Invoice the TotalAmount and the OutstandingBalanceAmount may be different.

Parameters:



84
85
86
87
88
# File 'lib/lockstep_sdk/clients/invoices_client.rb', line 84

def query_invoices(filter:, include_param:, order:, page_size:, page_number:)
    path = "/api/v1/Invoices/query"
    params = {:filter => filter, :include => include_param, :order => order, :pageSize => page_size, :pageNumber => page_number}
    @lockstepsdk.request(:get, path, nil, params)
end

#retrieve_invoice(id:, include_param:) ⇒ Object

Retrieves the Invoice specified by this unique identifier, optionally including nested data sets.

An Invoice represents a bill sent from one company to another. The creator of the invoice is identified by the CompanyId field, and the recipient of the invoice is identified by the CustomerId field. Most invoices are uniquely identified both by a Lockstep Platform ID number and a customer ERP “key” that was generated by the system that originated the invoice. Invoices have a total amount and a due date, and when some payments have been made on the Invoice the TotalAmount and the OutstandingBalanceAmount may be different.

Parameters:

  • id (uuid)

    The unique Lockstep Platform ID number of this invoice; NOT the customer’s ERP key

  • include_param (string)

    To fetch additional data on this object, specify the list of elements to retrieve. Available collections: Addresses, Lines, Payments, Notes, Attachments, Company, Customer, CustomFields, CreditMemos



36
37
38
39
40
# File 'lib/lockstep_sdk/clients/invoices_client.rb', line 36

def retrieve_invoice(id:, include_param:)
    path = "/api/v1/Invoices/#{id}"
    params = {:include => include_param}
    @lockstepsdk.request(:get, path, nil, params)
end

#update_invoice(id:, body:) ⇒ Object

Updates an existing Invoice with the information supplied to this PATCH call.

The PATCH method allows you to change specific values on the object while leaving other values alone. As input you should supply a list of field names and new values. If you do not provide the name of a field, that field will remain unchanged. This allows you to ensure that you are only updating the specific fields desired. An Invoice represents a bill sent from one company to another. The creator of the invoice is identified by the CompanyId field, and the recipient of the invoice is identified by the CustomerId field. Most invoices are uniquely identified both by a Lockstep Platform ID number and a customer ERP “key” that was generated by the system that originated the invoice. Invoices have a total amount and a due date, and when some payments have been made on the Invoice the TotalAmount and the OutstandingBalanceAmount may be different.

Parameters:

  • id (uuid)

    The unique Lockstep Platform ID number of the invoice to update; NOT the customer’s ERP key

  • body (object)

    A list of changes to apply to this Invoice



49
50
51
52
# File 'lib/lockstep_sdk/clients/invoices_client.rb', line 49

def update_invoice(id:, body:)
    path = "/api/v1/Invoices/#{id}"
    @lockstepsdk.request(:patch, path, body.to_camelback_keys.to_json, nil)
end