public final class DefaultInvoicesApi extends BaseApi implements InvoicesApi
BaseApi.RequestExecutor, BaseApi.RequestSupplier, BaseApi.ResponseHandler<T>authManagers, config, httpCallback, internalUserAgent| Constructor and Description |
|---|
DefaultInvoicesApi(Configuration config,
HttpClient httpClient,
Map<String,AuthManager> authManagers)
Initializes the controller.
|
DefaultInvoicesApi(Configuration config,
HttpClient httpClient,
Map<String,AuthManager> authManagers,
HttpCallback httpCallback)
Initializes the controller with HTTPCallback.
|
| 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.
|
DeleteInvoiceResponse |
deleteInvoice(String invoiceId,
Integer version)
Deletes the specified invoice.
|
CompletableFuture<DeleteInvoiceResponse> |
deleteInvoiceAsync(String invoiceId,
Integer version)
Deletes the specified invoice.
|
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, getHttpCallback, makeHttpCallAsync, validateResponsepublic DefaultInvoicesApi(Configuration config, HttpClient httpClient, Map<String,AuthManager> authManagers)
config - Configurations added in client.httpClient - Send HTTP requests and read the responses.authManagers - Apply authorization to requests.public DefaultInvoicesApi(Configuration config, HttpClient httpClient, Map<String,AuthManager> authManagers, HttpCallback httpCallback)
config - Configurations added in client.httpClient - Send HTTP requests and read the responses.authManagers - Apply authorization to requests.httpCallback - Callback to be called before and after the HTTP call.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/working-with-apis/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/working-with-apis/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]($m/Invoice) to delete. If
you do not know the version, you can call [GetInvoice]($e/Invoices/GetInvoice) or
[ListInvoices]($e/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]($m/Invoice) to delete. If
you do not know the version, you can call [GetInvoice]($e/Invoices/GetInvoice) or
[ListInvoices]($e/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 CancelInvoiceResponse cancelInvoice(String invoiceId, CancelInvoiceRequest body) throws ApiException, IOException
cancelInvoice in interface InvoicesApiinvoiceId - Required parameter: The ID of the [invoice]($m/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]($m/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 © 2022. All rights reserved.