Class DocumentsApi

java.lang.Object
markets.alpaca.client.openapi.broker.api.DocumentsApi

public class DocumentsApi extends Object
Generated client for DocumentsApi operations.

This class is generated from the configured OpenAPI spec. Operation method Javadocs include OAS summaries, descriptions, parameters, return types, response details, and external documentation links when present in the spec.

Operations

  • downloadDocFromAccount: Download an Account Document
  • getDocsForAccount: Retrieve a List of Account Documents
  • getV1AccountsAccountIdDocumentsW8benDocumentIdDownload: Download the W8BEN document for the primary owner of an account
  • uploadDocToAccount: Upload Owner Documents for an Existing Account
  • Constructor Details

    • DocumentsApi

      public DocumentsApi()
    • DocumentsApi

      public DocumentsApi(ApiClient apiClient)
  • Method Details

    • getApiClient

      public ApiClient getApiClient()
    • setApiClient

      public void setApiClient(ApiClient apiClient)
    • getHostIndex

      public int getHostIndex()
    • setHostIndex

      public void setHostIndex(int hostIndex)
    • getCustomBaseUrl

      public String getCustomBaseUrl()
    • setCustomBaseUrl

      public void setCustomBaseUrl(String customBaseUrl)
    • downloadDocFromAccountCall

      public okhttp3.Call downloadDocFromAccountCall(@Nonnull UUID accountId, @Nonnull UUID documentId, ApiCallback _callback) throws ApiException
      Build call for downloadDocFromAccount
      Parameters:
      accountId - Account identifier. (required)
      documentId - Document identifier. (required)
      _callback - Callback for upload/download progress
      Returns:
      Call to execute
      Throws:
      ApiException - If fail to serialize the request body object
      HTTP Response Details:
      Response Details
      Status Code Description Response Headers
      301 Redirect to the pre-signed download link for the account document PDF file. -
      404 The document is not found. -
    • downloadDocFromAccount

      public void downloadDocFromAccount(@Nonnull UUID accountId, @Nonnull UUID documentId) throws ApiException
      Download an Account Document This endpoint downloads an account document based on the document ID. The document will be in PDF format. The operation returns a pre-signed downloadable link as a redirect with HTTP status code 301 if one is found. You can retrieve a JSON version of a monthly statement by passing in the header accept: application/json header. These account documents are tax statements, trade confirmations, etc, generated by the Alpaca system. They are distinct from the owner documents you upload and later access via the account object's documents property.
      Parameters:
      accountId - Account identifier. (required)
      documentId - Document identifier. (required)
      Throws:
      ApiException - If fail to call the API, e.g. server error or cannot deserialize the response body
      HTTP Response Details:
      Response Details
      Status Code Description Response Headers
      301 Redirect to the pre-signed download link for the account document PDF file. -
      404 The document is not found. -
    • downloadDocFromAccountWithHttpInfo

      public ApiResponse<Void> downloadDocFromAccountWithHttpInfo(@Nonnull UUID accountId, @Nonnull UUID documentId) throws ApiException
      Download an Account Document This endpoint downloads an account document based on the document ID. The document will be in PDF format. The operation returns a pre-signed downloadable link as a redirect with HTTP status code 301 if one is found. You can retrieve a JSON version of a monthly statement by passing in the header accept: application/json header. These account documents are tax statements, trade confirmations, etc, generated by the Alpaca system. They are distinct from the owner documents you upload and later access via the account object's documents property.
      Parameters:
      accountId - Account identifier. (required)
      documentId - Document identifier. (required)
      Returns:
      ApiResponse<Void>
      Throws:
      ApiException - If fail to call the API, e.g. server error or cannot deserialize the response body
      HTTP Response Details:
      Response Details
      Status Code Description Response Headers
      301 Redirect to the pre-signed download link for the account document PDF file. -
      404 The document is not found. -
    • downloadDocFromAccountAsync

      public okhttp3.Call downloadDocFromAccountAsync(@Nonnull UUID accountId, @Nonnull UUID documentId, ApiCallback<Void> _callback) throws ApiException
      Download an Account Document (asynchronously) This endpoint downloads an account document based on the document ID. The document will be in PDF format. The operation returns a pre-signed downloadable link as a redirect with HTTP status code 301 if one is found. You can retrieve a JSON version of a monthly statement by passing in the header accept: application/json header. These account documents are tax statements, trade confirmations, etc, generated by the Alpaca system. They are distinct from the owner documents you upload and later access via the account object's documents property.
      Parameters:
      accountId - Account identifier. (required)
      documentId - Document identifier. (required)
      _callback - The callback to be executed when the API call finishes
      Returns:
      The request call
      Throws:
      ApiException - If fail to process the API call, e.g. serializing the request body object
      HTTP Response Details:
      Response Details
      Status Code Description Response Headers
      301 Redirect to the pre-signed download link for the account document PDF file. -
      404 The document is not found. -
    • getDocsForAccountCall

      public okhttp3.Call getDocsForAccountCall(@Nonnull UUID accountId, @Nullable LocalDate start, @Nullable LocalDate end, @Nullable String type, ApiCallback _callback) throws ApiException
      Build call for getDocsForAccount
      Parameters:
      accountId - Account identifier. (required)
      start - optional date value to filter the list (inclusive). (optional)
      end - optional date value to filter the list (inclusive). (optional)
      type - The type of the account document (optional)
      _callback - Callback for upload/download progress
      Returns:
      Call to execute
      Throws:
      ApiException - If fail to serialize the request body object
      HTTP Response Details:
      Response Details
      Status Code Description Response Headers
      200 OK -
      404 Not found -
    • getDocsForAccount

      public List<AccountDocument> getDocsForAccount(@Nonnull UUID accountId, @Nullable LocalDate start, @Nullable LocalDate end, @Nullable String type) throws ApiException
      Retrieve a List of Account Documents This endpoint allows you to query all the account document based on an account ID. You can filter by date, or type of document. These account documents are tax statements, trade confirmations, etc, generated by the Alpaca system. They are distinct from the owner documents you upload and later access via the account object's documents property.
      Parameters:
      accountId - Account identifier. (required)
      start - optional date value to filter the list (inclusive). (optional)
      end - optional date value to filter the list (inclusive). (optional)
      type - The type of the account document (optional)
      Returns:
      List<AccountDocument>
      Throws:
      ApiException - If fail to call the API, e.g. server error or cannot deserialize the response body
      HTTP Response Details:
      Response Details
      Status Code Description Response Headers
      200 OK -
      404 Not found -
    • getDocsForAccountWithHttpInfo

      public ApiResponse<List<AccountDocument>> getDocsForAccountWithHttpInfo(@Nonnull UUID accountId, @Nullable LocalDate start, @Nullable LocalDate end, @Nullable String type) throws ApiException
      Retrieve a List of Account Documents This endpoint allows you to query all the account document based on an account ID. You can filter by date, or type of document. These account documents are tax statements, trade confirmations, etc, generated by the Alpaca system. They are distinct from the owner documents you upload and later access via the account object's documents property.
      Parameters:
      accountId - Account identifier. (required)
      start - optional date value to filter the list (inclusive). (optional)
      end - optional date value to filter the list (inclusive). (optional)
      type - The type of the account document (optional)
      Returns:
      ApiResponse<List<AccountDocument>>
      Throws:
      ApiException - If fail to call the API, e.g. server error or cannot deserialize the response body
      HTTP Response Details:
      Response Details
      Status Code Description Response Headers
      200 OK -
      404 Not found -
    • getDocsForAccountAsync

      public okhttp3.Call getDocsForAccountAsync(@Nonnull UUID accountId, @Nullable LocalDate start, @Nullable LocalDate end, @Nullable String type, ApiCallback<List<AccountDocument>> _callback) throws ApiException
      Retrieve a List of Account Documents (asynchronously) This endpoint allows you to query all the account document based on an account ID. You can filter by date, or type of document. These account documents are tax statements, trade confirmations, etc, generated by the Alpaca system. They are distinct from the owner documents you upload and later access via the account object's documents property.
      Parameters:
      accountId - Account identifier. (required)
      start - optional date value to filter the list (inclusive). (optional)
      end - optional date value to filter the list (inclusive). (optional)
      type - The type of the account document (optional)
      _callback - The callback to be executed when the API call finishes
      Returns:
      The request call
      Throws:
      ApiException - If fail to process the API call, e.g. serializing the request body object
      HTTP Response Details:
      Response Details
      Status Code Description Response Headers
      200 OK -
      404 Not found -
    • getV1AccountsAccountIdDocumentsW8benDocumentIdDownloadCall

      public okhttp3.Call getV1AccountsAccountIdDocumentsW8benDocumentIdDownloadCall(@Nonnull String accountId, @Nonnull String documentId, ApiCallback _callback) throws ApiException
      Build call for getV1AccountsAccountIdDocumentsW8benDocumentIdDownload
      Parameters:
      accountId - The id of the related account (required)
      documentId - The id of the W8BEN to download (required)
      _callback - Callback for upload/download progress
      Returns:
      Call to execute
      Throws:
      ApiException - If fail to serialize the request body object
      HTTP Response Details:
      Response Details
      Status Code Description Response Headers
      301 Redirects to a presigned download link for the document PDF. -
      404 Document Not Found -
    • getV1AccountsAccountIdDocumentsW8benDocumentIdDownload

      public void getV1AccountsAccountIdDocumentsW8benDocumentIdDownload(@Nonnull String accountId, @Nonnull String documentId) throws ApiException
      Download the W8BEN document for the primary owner of an account This endpoint allows you to download a W-8 BEN document for the primary owner of an account based on the document_id passed as a path parameter. The returned document is in PDF format. For certain individuals, a W-8 BEN form should be submitted at onboarding. If the individual is not a registered U.S. taxpayer (not subject to a W-9), the W-8 BEN form may need to be submitted. The IRS explains which individuals this applies to and provides instructions on completing the form. Every three years, in addition to the calendar year it was signed, a new W-8 BEN form must be submitted. The form can be submitted in JSON, JSONC, PNG, JPEG or PDF. If submitting it in JSON, please see the W-8 BEN completed with the corresponding field names for the API here. Note: The dates collected on the form are in a slightly different format than how they need to be submitted via Accounts API. It is requested by the user on the form in MM-DD-YYYY, but should be submitted as YYYY-MM-DD.
      Parameters:
      accountId - The id of the related account (required)
      documentId - The id of the W8BEN to download (required)
      Throws:
      ApiException - If fail to call the API, e.g. server error or cannot deserialize the response body
      HTTP Response Details:
      Response Details
      Status Code Description Response Headers
      301 Redirects to a presigned download link for the document PDF. -
      404 Document Not Found -
    • getV1AccountsAccountIdDocumentsW8benDocumentIdDownloadWithHttpInfo

      public ApiResponse<Void> getV1AccountsAccountIdDocumentsW8benDocumentIdDownloadWithHttpInfo(@Nonnull String accountId, @Nonnull String documentId) throws ApiException
      Download the W8BEN document for the primary owner of an account This endpoint allows you to download a W-8 BEN document for the primary owner of an account based on the document_id passed as a path parameter. The returned document is in PDF format. For certain individuals, a W-8 BEN form should be submitted at onboarding. If the individual is not a registered U.S. taxpayer (not subject to a W-9), the W-8 BEN form may need to be submitted. The IRS explains which individuals this applies to and provides instructions on completing the form. Every three years, in addition to the calendar year it was signed, a new W-8 BEN form must be submitted. The form can be submitted in JSON, JSONC, PNG, JPEG or PDF. If submitting it in JSON, please see the W-8 BEN completed with the corresponding field names for the API here. Note: The dates collected on the form are in a slightly different format than how they need to be submitted via Accounts API. It is requested by the user on the form in MM-DD-YYYY, but should be submitted as YYYY-MM-DD.
      Parameters:
      accountId - The id of the related account (required)
      documentId - The id of the W8BEN to download (required)
      Returns:
      ApiResponse<Void>
      Throws:
      ApiException - If fail to call the API, e.g. server error or cannot deserialize the response body
      HTTP Response Details:
      Response Details
      Status Code Description Response Headers
      301 Redirects to a presigned download link for the document PDF. -
      404 Document Not Found -
    • getV1AccountsAccountIdDocumentsW8benDocumentIdDownloadAsync

      public okhttp3.Call getV1AccountsAccountIdDocumentsW8benDocumentIdDownloadAsync(@Nonnull String accountId, @Nonnull String documentId, ApiCallback<Void> _callback) throws ApiException
      Download the W8BEN document for the primary owner of an account (asynchronously) This endpoint allows you to download a W-8 BEN document for the primary owner of an account based on the document_id passed as a path parameter. The returned document is in PDF format. For certain individuals, a W-8 BEN form should be submitted at onboarding. If the individual is not a registered U.S. taxpayer (not subject to a W-9), the W-8 BEN form may need to be submitted. The IRS explains which individuals this applies to and provides instructions on completing the form. Every three years, in addition to the calendar year it was signed, a new W-8 BEN form must be submitted. The form can be submitted in JSON, JSONC, PNG, JPEG or PDF. If submitting it in JSON, please see the W-8 BEN completed with the corresponding field names for the API here. Note: The dates collected on the form are in a slightly different format than how they need to be submitted via Accounts API. It is requested by the user on the form in MM-DD-YYYY, but should be submitted as YYYY-MM-DD.
      Parameters:
      accountId - The id of the related account (required)
      documentId - The id of the W8BEN to download (required)
      _callback - The callback to be executed when the API call finishes
      Returns:
      The request call
      Throws:
      ApiException - If fail to process the API call, e.g. serializing the request body object
      HTTP Response Details:
      Response Details
      Status Code Description Response Headers
      301 Redirects to a presigned download link for the document PDF. -
      404 Document Not Found -
    • uploadDocToAccountCall

      public okhttp3.Call uploadDocToAccountCall(@Nonnull UUID accountId, @Nonnull List<OwnerDocumentUploadRequest> ownerDocumentUploadRequest, ApiCallback _callback) throws ApiException
      Build call for uploadDocToAccount
      Parameters:
      accountId - Account identifier. (required)
      ownerDocumentUploadRequest - (required)
      _callback - Callback for upload/download progress
      Returns:
      Call to execute
      Throws:
      ApiException - If fail to serialize the request body object
      HTTP Response Details:
      Response Details
      Status Code Description Response Headers
      204 Success (No Content) -
      400 Bad Request. The body in the request is not valid. -
      404 Not Found. No account was found for this account_id -
    • uploadDocToAccount

      public void uploadDocToAccount(@Nonnull UUID accountId, @Nonnull List<OwnerDocumentUploadRequest> ownerDocumentUploadRequest) throws ApiException
      Upload Owner Documents for an Existing Account Upload documents for the primary account owner of an account. Documents are binary objects whose contents are encoded in base64. Each encoded content size is limited to 10MB if you use Alpaca for KYCaaS. If you perform your own KYC there are no document size limitations. As a convenience, documents of type w8ben may be uploaded as a JSON object using the content_data request property. The Alpaca system will then generate a formatted W-8 BEN document for subsequent downloads. Note that these owner documents are distinct from the account documents generated by Alpaca, such as tax statements and trade confirmations.
      Parameters:
      accountId - Account identifier. (required)
      ownerDocumentUploadRequest - (required)
      Throws:
      ApiException - If fail to call the API, e.g. server error or cannot deserialize the response body
      HTTP Response Details:
      Response Details
      Status Code Description Response Headers
      204 Success (No Content) -
      400 Bad Request. The body in the request is not valid. -
      404 Not Found. No account was found for this account_id -
    • uploadDocToAccountWithHttpInfo

      public ApiResponse<Void> uploadDocToAccountWithHttpInfo(@Nonnull UUID accountId, @Nonnull List<OwnerDocumentUploadRequest> ownerDocumentUploadRequest) throws ApiException
      Upload Owner Documents for an Existing Account Upload documents for the primary account owner of an account. Documents are binary objects whose contents are encoded in base64. Each encoded content size is limited to 10MB if you use Alpaca for KYCaaS. If you perform your own KYC there are no document size limitations. As a convenience, documents of type w8ben may be uploaded as a JSON object using the content_data request property. The Alpaca system will then generate a formatted W-8 BEN document for subsequent downloads. Note that these owner documents are distinct from the account documents generated by Alpaca, such as tax statements and trade confirmations.
      Parameters:
      accountId - Account identifier. (required)
      ownerDocumentUploadRequest - (required)
      Returns:
      ApiResponse<Void>
      Throws:
      ApiException - If fail to call the API, e.g. server error or cannot deserialize the response body
      HTTP Response Details:
      Response Details
      Status Code Description Response Headers
      204 Success (No Content) -
      400 Bad Request. The body in the request is not valid. -
      404 Not Found. No account was found for this account_id -
    • uploadDocToAccountAsync

      public okhttp3.Call uploadDocToAccountAsync(@Nonnull UUID accountId, @Nonnull List<OwnerDocumentUploadRequest> ownerDocumentUploadRequest, ApiCallback<Void> _callback) throws ApiException
      Upload Owner Documents for an Existing Account (asynchronously) Upload documents for the primary account owner of an account. Documents are binary objects whose contents are encoded in base64. Each encoded content size is limited to 10MB if you use Alpaca for KYCaaS. If you perform your own KYC there are no document size limitations. As a convenience, documents of type w8ben may be uploaded as a JSON object using the content_data request property. The Alpaca system will then generate a formatted W-8 BEN document for subsequent downloads. Note that these owner documents are distinct from the account documents generated by Alpaca, such as tax statements and trade confirmations.
      Parameters:
      accountId - Account identifier. (required)
      ownerDocumentUploadRequest - (required)
      _callback - The callback to be executed when the API call finishes
      Returns:
      The request call
      Throws:
      ApiException - If fail to process the API call, e.g. serializing the request body object
      HTTP Response Details:
      Response Details
      Status Code Description Response Headers
      204 Success (No Content) -
      400 Bad Request. The body in the request is not valid. -
      404 Not Found. No account was found for this account_id -