Generating Statements on a User's Behalf
To generate a statement on a user's behalf, you must first follow our Sharing Guide to establish an active connection to their claims.
Generating a Statement
To generate a statement, call the folllowing request:
POST /v1/verify/statements/generate
The required parameters for this call are:
account_holder_id
– The unique identifier of the user.claim_ids
– An array of claim IDs to include in the statement.opening_time
andclosing_time
– Timestamps in Unix format, including the appropriatetimezone
context.
Request:
curl https://api.hoseki.app/api/v1/verify/statements/generate \
--request POST \
--header 'Accept: /' \
--header 'Authorization: Bearer YOUR_SECRET_TOKEN' \
--header 'Content-Type: application/json' \
--data '{
"account_holder_id": "ah_ezwIXuhcaxO749oDQdZef",
"claim_ids": [
"vy_clac_VDuR6hmjILpF03nabeFaV"
],
"period": {
"open": 1615766400,
"close": 1615766400
},
"timezone": "UTC"
}'
Response:
{
"id": "vy_stmt_Kj9mN2pQ5vX8wR3tY7hL4",
"status": "pending",
"created_at": 1615766400,
"updated_at": 1615766400,
"timezone": "UTC",
"period": {
"open": 1615766400,
"close": 1615766400
},
"account_holder_id": "ah_ezwIXuhcaxO749oDQdZef"
}
Once the statement has been generated, you’ll receive a webhook notification confirming its completion. For more information on available webhook events, refer to our webhook documentation.
PDF Download
Once a statement has been generated, you can download it as a PDF. There is a one-time cost to initiate the PDF generation, but after that, it can be downloaded as many times as needed at no additional charge.
To download the PDF version of a generated statement, use the following endpoint:
GET /api/v1/verify/statements/{id}/document/pdf
Request:
curl https://api.hoseki.app/api/v1/verify/statements/{statement_id}/document/pdf \
--header 'Accept: /' \
--header 'Authorization: Bearer YOUR_SECRET_TOKEN'
You can include optional query parameters to customize the format of the downloaded PDF:
-
format=monthly
– Displays the summary table and transaction data broken down by month within the selected date range. This format is designed to mirror traditional financial statements. -
format=custom
– Displays a single summary table and complete transaction data for the entire period between the specified opening and closing dates.