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.
|
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.
|
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/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.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/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.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](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.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](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).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.CreateInvoiceAttachmentResponse createInvoiceAttachment(String invoiceId, CreateInvoiceAttachmentRequest request, FileWrapper imageFile) throws ApiException, IOException
invoiceId - 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.CompletableFuture<CreateInvoiceAttachmentResponse> createInvoiceAttachmentAsync(String invoiceId, CreateInvoiceAttachmentRequest request, FileWrapper imageFile)
invoiceId - 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:DeleteInvoiceAttachmentResponse deleteInvoiceAttachment(String invoiceId, String attachmentId) throws ApiException, IOException
invoiceId - 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.CompletableFuture<DeleteInvoiceAttachmentResponse> deleteInvoiceAttachmentAsync(String invoiceId, String attachmentId)
invoiceId - 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.CancelInvoiceResponse cancelInvoice(String invoiceId, CancelInvoiceRequest body) throws ApiException, IOException
invoiceId - 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.CompletableFuture<CancelInvoiceResponse> cancelInvoiceAsync(String invoiceId, CancelInvoiceRequest body)
invoiceId - 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.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 © 2024. All rights reserved.