public interface InvoicesApi
| 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.
|
ListInvoicesResponse listInvoices(String locationId, String cursor, Integer limit) throws ApiException, IOException
locationId - 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.CompletableFuture<ListInvoicesResponse> listInvoicesAsync(String locationId, String cursor, Integer limit)
locationId - 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.CreateInvoiceResponse createInvoice(CreateInvoiceRequest body) throws ApiException, IOException
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.CompletableFuture<CreateInvoiceResponse> createInvoiceAsync(CreateInvoiceRequest body)
body - Required parameter: An object containing the fields to POST for the request.
See the corresponding object definition for field details.SearchInvoicesResponse searchInvoices(SearchInvoicesRequest body) throws ApiException, IOException
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.CompletableFuture<SearchInvoicesResponse> searchInvoicesAsync(SearchInvoicesRequest body)
body - Required parameter: An object containing the fields to POST for the request.
See the corresponding object definition for field details.DeleteInvoiceResponse deleteInvoice(String invoiceId, Integer version) throws ApiException, IOException
invoiceId - 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.CompletableFuture<DeleteInvoiceResponse> deleteInvoiceAsync(String invoiceId, Integer version)
invoiceId - 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).GetInvoiceResponse getInvoice(String invoiceId) throws ApiException, IOException
invoiceId - 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.CompletableFuture<GetInvoiceResponse> getInvoiceAsync(String invoiceId)
invoiceId - Required parameter: The ID of the invoice to retrieve.UpdateInvoiceResponse updateInvoice(String invoiceId, UpdateInvoiceRequest body) throws ApiException, IOException
invoiceId - 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.CompletableFuture<UpdateInvoiceResponse> updateInvoiceAsync(String invoiceId, UpdateInvoiceRequest body)
invoiceId - 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.CancelInvoiceResponse cancelInvoice(String invoiceId, CancelInvoiceRequest body) throws ApiException, IOException
invoiceId - 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.CompletableFuture<CancelInvoiceResponse> cancelInvoiceAsync(String invoiceId, CancelInvoiceRequest body)
invoiceId - 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.PublishInvoiceResponse publishInvoice(String invoiceId, PublishInvoiceRequest body) throws ApiException, IOException
invoiceId - 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.CompletableFuture<PublishInvoiceResponse> publishInvoiceAsync(String invoiceId, PublishInvoiceRequest body)
invoiceId - 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.