public final class DefaultInvoicesApi extends BaseApi implements InvoicesApi
AUTHENTICATION_KEY, GLOBAL_ERROR_CASES| Constructor and Description |
|---|
DefaultInvoicesApi(io.apimatic.core.GlobalConfiguration globalConfig)
Initializes the controller.
|
| Modifier and Type | Method and Description |
|---|---|
CancelInvoiceResponse |
cancelInvoice(String invoiceId,
CancelInvoiceRequest body)
Cancels an invoice.
|
CompletableFuture<CancelInvoiceResponse> |
cancelInvoiceAsync(String invoiceId,
CancelInvoiceRequest body)
Cancels an invoice.
|
CreateInvoiceResponse |
createInvoice(CreateInvoiceRequest body)
Creates a draft [invoice]($m/Invoice) for an order created using the Orders API.
|
CompletableFuture<CreateInvoiceResponse> |
createInvoiceAsync(CreateInvoiceRequest body)
Creates a draft [invoice]($m/Invoice) for an order created using the Orders API.
|
CreateInvoiceAttachmentResponse |
createInvoiceAttachment(String invoiceId,
CreateInvoiceAttachmentRequest request,
FileWrapper imageFile)
Uploads a file and attaches it to an invoice.
|
CompletableFuture<CreateInvoiceAttachmentResponse> |
createInvoiceAttachmentAsync(String invoiceId,
CreateInvoiceAttachmentRequest request,
FileWrapper imageFile)
Uploads a file and attaches it to an invoice.
|
DeleteInvoiceResponse |
deleteInvoice(String invoiceId,
Integer version)
Deletes the specified invoice.
|
CompletableFuture<DeleteInvoiceResponse> |
deleteInvoiceAsync(String invoiceId,
Integer version)
Deletes the specified invoice.
|
DeleteInvoiceAttachmentResponse |
deleteInvoiceAttachment(String invoiceId,
String attachmentId)
Removes an attachment from an invoice and permanently deletes the file.
|
CompletableFuture<DeleteInvoiceAttachmentResponse> |
deleteInvoiceAttachmentAsync(String invoiceId,
String attachmentId)
Removes an attachment from an invoice and permanently deletes the file.
|
GetInvoiceResponse |
getInvoice(String invoiceId)
Retrieves an invoice by invoice ID.
|
CompletableFuture<GetInvoiceResponse> |
getInvoiceAsync(String invoiceId)
Retrieves an invoice by invoice ID.
|
ListInvoicesResponse |
listInvoices(String locationId,
String cursor,
Integer limit)
Returns a list of invoices for a given location.
|
CompletableFuture<ListInvoicesResponse> |
listInvoicesAsync(String locationId,
String cursor,
Integer limit)
Returns a list of invoices for a given location.
|
PublishInvoiceResponse |
publishInvoice(String invoiceId,
PublishInvoiceRequest body)
Publishes the specified draft invoice.
|
CompletableFuture<PublishInvoiceResponse> |
publishInvoiceAsync(String invoiceId,
PublishInvoiceRequest body)
Publishes the specified draft invoice.
|
SearchInvoicesResponse |
searchInvoices(SearchInvoicesRequest body)
Searches for invoices from a location specified in the filter.
|
CompletableFuture<SearchInvoicesResponse> |
searchInvoicesAsync(SearchInvoicesRequest body)
Searches for invoices from a location specified in the filter.
|
UpdateInvoiceResponse |
updateInvoice(String invoiceId,
UpdateInvoiceRequest body)
Updates an invoice by modifying fields, clearing fields, or both.
|
CompletableFuture<UpdateInvoiceResponse> |
updateInvoiceAsync(String invoiceId,
UpdateInvoiceRequest body)
Updates an invoice by modifying fields, clearing fields, or both.
|
getClientInstance, getGlobalConfiguration, getHttpCallbackpublic DefaultInvoicesApi(io.apimatic.core.GlobalConfiguration globalConfig)
globalConfig - Configurations added in client.public ListInvoicesResponse listInvoices(String locationId, String cursor, Integer limit) throws ApiException, IOException
listInvoices in interface InvoicesApilocationId - Required parameter: The ID of the location for which to list invoices.cursor - Optional parameter: A pagination cursor returned by a previous call to this
endpoint. Provide this cursor to retrieve the next set of results for your original
query. For more information, see
[Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination).limit - Optional parameter: The maximum number of invoices to return (200 is the
maximum `limit`). If not provided, the server uses a default limit of 100 invoices.ApiException - Represents error response from the server.IOException - Signals that an I/O exception of some sort has occurred.public CompletableFuture<ListInvoicesResponse> listInvoicesAsync(String locationId, String cursor, Integer limit)
listInvoicesAsync in interface InvoicesApilocationId - Required parameter: The ID of the location for which to list invoices.cursor - Optional parameter: A pagination cursor returned by a previous call to this
endpoint. Provide this cursor to retrieve the next set of results for your original
query. For more information, see
[Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination).limit - Optional parameter: The maximum number of invoices to return (200 is the
maximum `limit`). If not provided, the server uses a default limit of 100 invoices.public CreateInvoiceResponse createInvoice(CreateInvoiceRequest body) throws ApiException, IOException
createInvoice in interface InvoicesApibody - Required parameter: An object containing the fields to POST for the request.
See the corresponding object definition for field details.ApiException - Represents error response from the server.IOException - Signals that an I/O exception of some sort has occurred.public CompletableFuture<CreateInvoiceResponse> createInvoiceAsync(CreateInvoiceRequest body)
createInvoiceAsync in interface InvoicesApibody - Required parameter: An object containing the fields to POST for the request.
See the corresponding object definition for field details.public SearchInvoicesResponse searchInvoices(SearchInvoicesRequest body) throws ApiException, IOException
searchInvoices in interface InvoicesApibody - Required parameter: An object containing the fields to POST for the request.
See the corresponding object definition for field details.ApiException - Represents error response from the server.IOException - Signals that an I/O exception of some sort has occurred.public CompletableFuture<SearchInvoicesResponse> searchInvoicesAsync(SearchInvoicesRequest body)
searchInvoicesAsync in interface InvoicesApibody - Required parameter: An object containing the fields to POST for the request.
See the corresponding object definition for field details.public DeleteInvoiceResponse deleteInvoice(String invoiceId, Integer version) throws ApiException, IOException
deleteInvoice in interface InvoicesApiinvoiceId - Required parameter: The ID of the invoice to delete.version - Optional parameter: The version of the [invoice](entity:Invoice) to delete.
If you do not know the version, you can call
[GetInvoice](api-endpoint:Invoices-GetInvoice) or
[ListInvoices](api-endpoint:Invoices-ListInvoices).ApiException - Represents error response from the server.IOException - Signals that an I/O exception of some sort has occurred.public CompletableFuture<DeleteInvoiceResponse> deleteInvoiceAsync(String invoiceId, Integer version)
deleteInvoiceAsync in interface InvoicesApiinvoiceId - Required parameter: The ID of the invoice to delete.version - Optional parameter: The version of the [invoice](entity:Invoice) to delete.
If you do not know the version, you can call
[GetInvoice](api-endpoint:Invoices-GetInvoice) or
[ListInvoices](api-endpoint:Invoices-ListInvoices).public GetInvoiceResponse getInvoice(String invoiceId) throws ApiException, IOException
getInvoice in interface InvoicesApiinvoiceId - Required parameter: The ID of the invoice to retrieve.ApiException - Represents error response from the server.IOException - Signals that an I/O exception of some sort has occurred.public CompletableFuture<GetInvoiceResponse> getInvoiceAsync(String invoiceId)
getInvoiceAsync in interface InvoicesApiinvoiceId - Required parameter: The ID of the invoice to retrieve.public UpdateInvoiceResponse updateInvoice(String invoiceId, UpdateInvoiceRequest body) throws ApiException, IOException
updateInvoice in interface InvoicesApiinvoiceId - Required parameter: The ID of the invoice to update.body - Required parameter: An object containing the fields to POST for the request.
See the corresponding object definition for field details.ApiException - Represents error response from the server.IOException - Signals that an I/O exception of some sort has occurred.public CompletableFuture<UpdateInvoiceResponse> updateInvoiceAsync(String invoiceId, UpdateInvoiceRequest body)
updateInvoiceAsync in interface InvoicesApiinvoiceId - Required parameter: The ID of the invoice to update.body - Required parameter: An object containing the fields to POST for the request.
See the corresponding object definition for field details.public CreateInvoiceAttachmentResponse createInvoiceAttachment(String invoiceId, CreateInvoiceAttachmentRequest request, FileWrapper imageFile) throws ApiException, IOException
createInvoiceAttachment in interface InvoicesApiinvoiceId - Required parameter: The ID of the [invoice](entity:Invoice) to attach the
file to.request - Optional parameter: Represents a
[CreateInvoiceAttachment]($e/Invoices/CreateInvoiceAttachment) request.imageFile - Optional parameter: Example:ApiException - Represents error response from the server.IOException - Signals that an I/O exception of some sort has occurred.public CompletableFuture<CreateInvoiceAttachmentResponse> createInvoiceAttachmentAsync(String invoiceId, CreateInvoiceAttachmentRequest request, FileWrapper imageFile)
createInvoiceAttachmentAsync in interface InvoicesApiinvoiceId - Required parameter: The ID of the [invoice](entity:Invoice) to attach the
file to.request - Optional parameter: Represents a
[CreateInvoiceAttachment]($e/Invoices/CreateInvoiceAttachment) request.imageFile - Optional parameter: Example:public DeleteInvoiceAttachmentResponse deleteInvoiceAttachment(String invoiceId, String attachmentId) throws ApiException, IOException
deleteInvoiceAttachment in interface InvoicesApiinvoiceId - Required parameter: The ID of the [invoice](entity:Invoice) to delete the
attachment from.attachmentId - Required parameter: The ID of the
[attachment](entity:InvoiceAttachment) to delete.ApiException - Represents error response from the server.IOException - Signals that an I/O exception of some sort has occurred.public CompletableFuture<DeleteInvoiceAttachmentResponse> deleteInvoiceAttachmentAsync(String invoiceId, String attachmentId)
deleteInvoiceAttachmentAsync in interface InvoicesApiinvoiceId - Required parameter: The ID of the [invoice](entity:Invoice) to delete the
attachment from.attachmentId - Required parameter: The ID of the
[attachment](entity:InvoiceAttachment) to delete.public CancelInvoiceResponse cancelInvoice(String invoiceId, CancelInvoiceRequest body) throws ApiException, IOException
cancelInvoice in interface InvoicesApiinvoiceId - Required parameter: The ID of the [invoice](entity:Invoice) to cancel.body - Required parameter: An object containing the fields to POST for the request.
See the corresponding object definition for field details.ApiException - Represents error response from the server.IOException - Signals that an I/O exception of some sort has occurred.public CompletableFuture<CancelInvoiceResponse> cancelInvoiceAsync(String invoiceId, CancelInvoiceRequest body)
cancelInvoiceAsync in interface InvoicesApiinvoiceId - Required parameter: The ID of the [invoice](entity:Invoice) to cancel.body - Required parameter: An object containing the fields to POST for the request.
See the corresponding object definition for field details.public PublishInvoiceResponse publishInvoice(String invoiceId, PublishInvoiceRequest body) throws ApiException, IOException
publishInvoice in interface InvoicesApiinvoiceId - Required parameter: The ID of the invoice to publish.body - Required parameter: An object containing the fields to POST for the request.
See the corresponding object definition for field details.ApiException - Represents error response from the server.IOException - Signals that an I/O exception of some sort has occurred.public CompletableFuture<PublishInvoiceResponse> publishInvoiceAsync(String invoiceId, PublishInvoiceRequest body)
publishInvoiceAsync in interface InvoicesApiinvoiceId - Required parameter: The ID of the invoice to publish.body - Required parameter: An object containing the fields to POST for the request.
See the corresponding object definition for field details.Copyright © 2024. All rights reserved.