Class DocumentsApi
java.lang.Object
markets.alpaca.client.openapi.broker.api.DocumentsApi
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 DocumentgetDocsForAccount: Retrieve a List of Account DocumentsgetV1AccountsAccountIdDocumentsW8benDocumentIdDownload: Download the W8BEN document for the primary owner of an accountuploadDocToAccount: Upload Owner Documents for an Existing Account
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoiddownloadDocFromAccount(UUID accountId, UUID documentId) Download an Account Document This endpoint downloads an account document based on the document ID.okhttp3.CalldownloadDocFromAccountAsync(UUID accountId, UUID documentId, ApiCallback<Void> _callback) Download an Account Document (asynchronously) This endpoint downloads an account document based on the document ID.okhttp3.CalldownloadDocFromAccountCall(UUID accountId, UUID documentId, ApiCallback _callback) Build call for downloadDocFromAccountdownloadDocFromAccountWithHttpInfo(UUID accountId, UUID documentId) Download an Account Document This endpoint downloads an account document based on the document ID.getDocsForAccount(UUID accountId, LocalDate start, LocalDate end, String type) Retrieve a List of Account Documents This endpoint allows you to query all the account document based on an account ID.okhttp3.CallgetDocsForAccountAsync(UUID accountId, LocalDate start, LocalDate end, String type, ApiCallback<List<AccountDocument>> _callback) Retrieve a List of Account Documents (asynchronously) This endpoint allows you to query all the account document based on an account ID.okhttp3.CallgetDocsForAccountCall(UUID accountId, LocalDate start, LocalDate end, String type, ApiCallback _callback) Build call for getDocsForAccountgetDocsForAccountWithHttpInfo(UUID accountId, LocalDate start, LocalDate end, String type) Retrieve a List of Account Documents This endpoint allows you to query all the account document based on an account ID.intvoidgetV1AccountsAccountIdDocumentsW8benDocumentIdDownload(String accountId, String documentId) 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.okhttp3.CallgetV1AccountsAccountIdDocumentsW8benDocumentIdDownloadAsync(String accountId, String documentId, ApiCallback<Void> _callback) 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.okhttp3.CallgetV1AccountsAccountIdDocumentsW8benDocumentIdDownloadCall(String accountId, String documentId, ApiCallback _callback) Build call for getV1AccountsAccountIdDocumentsW8benDocumentIdDownloadgetV1AccountsAccountIdDocumentsW8benDocumentIdDownloadWithHttpInfo(String accountId, String documentId) 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.voidsetApiClient(ApiClient apiClient) voidsetCustomBaseUrl(String customBaseUrl) voidsetHostIndex(int hostIndex) voiduploadDocToAccount(UUID accountId, List<OwnerDocumentUploadRequest> ownerDocumentUploadRequest) Upload Owner Documents for an Existing Account Upload documents for the primary account owner of an account.okhttp3.CalluploadDocToAccountAsync(UUID accountId, List<OwnerDocumentUploadRequest> ownerDocumentUploadRequest, ApiCallback<Void> _callback) Upload Owner Documents for an Existing Account (asynchronously) Upload documents for the primary account owner of an account.okhttp3.CalluploadDocToAccountCall(UUID accountId, List<OwnerDocumentUploadRequest> ownerDocumentUploadRequest, ApiCallback _callback) Build call for uploadDocToAccountuploadDocToAccountWithHttpInfo(UUID accountId, List<OwnerDocumentUploadRequest> ownerDocumentUploadRequest) Upload Owner Documents for an Existing Account Upload documents for the primary account owner of an account.
-
Constructor Details
-
DocumentsApi
public DocumentsApi() -
DocumentsApi
-
-
Method Details
-
getApiClient
-
setApiClient
-
getHostIndex
public int getHostIndex() -
setHostIndex
public void setHostIndex(int hostIndex) -
getCustomBaseUrl
-
setCustomBaseUrl
-
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 -
-