Requesting a statement

A quick guide to requesting and retrieving account statement

This guide provides you with step-by-step instructions to retrieving a statement for an account/wallet.

  1. Create the request for a statement
  2. Verify the status of the statement request
  3. Download the statement

To begin the process for retrieving a statement, send a request to the endpoint linked:

cURL SAMPLE REQUEST

curl --location 'https://api.sandbox.waza.co/payouts/v1/statements' \
--header 'Content-Type: application/json' \
--header 'x-waza-key: YOUR_WAZA_KEY' \
--data '{
    "from": "2023-07-01",
    "to": "2023-08-07",
    "account_id": "1fbc064f-5fd6-488f-869f-18f879cd4073"
}'

Successful Response

If the request is successful, you will receive a response similar to this:

{
    "data": {
        "id": "80c3fd5e-525b-47cb-82fd-df5a0fa48e97",
        "created_at": "2023-08-29T18:03:08.478Z",
        "updated_at": "2023-08-29T18:03:08.478Z",
        "state": "PENDING",
        "from": "2023-07-01",
        "to": "2023-08-07",
        "accountId": "1fbc064f-5fd6-488f-869f-18f879cd4073"
    }
}

After the Statement has been created, verify the status sending a request to the linked endpoint providing the statement id as a query params .

cURL SAMPLE REQUEST

curl --location 'https://api.sandbox.waza.co/payouts/v1/statements/80c3fd5e-525b-47cb-82fd-df5a0fa48e97' \
--header 'x-waza-key:  YOUR_WAZA_KEY'

Successful Response

If the request is successful, you will receive the following response (Take note of the "state": "COMPLETED" field returned in the response):

{
    "data": {
        "id": "80c3fd5e-525b-47cb-82fd-df5a0fa48e97",
        "created_at": "2023-08-29T18:03:08.478Z",
        "updated_at": "2023-08-29T18:03:09.127Z",
        "state": "COMPLETE",
        "from": "2023-07-01",
        "to": "2023-08-07",
        "accountId": "1fbc064f-5fd6-488f-869f-18f879cd4073"
    }
}

After the status has been verified, download the statement by sending a request to the linked endpoint providing the statement id as a query parameters along with other query parameters. Note that only statements in COMPLETED state can be downloaded else an error is returned.

cURL SAMPLE REQUEST

curl --location --request GET 'https://api.sandbox.waza.co/payouts/v1/statements/80c3fd5e-525b-47cb-82fd-df5a0fa48e97/download' \
--header 'Content-Type: application/json' \
--header 'x-waza-key: YOUR_WAZA_KEY' \
--data '{
    "from": "2023-07-15",
    "to": "2023-08-04",
    "account_id": "f471f115-8e3e-4a99-95e2-142594221122"
}'

Successful Response

If the request is successful, a statement is delivered as an excel sheet with the content type set as an attachment, triggering most HTTP clients or browsers to treat it as a file download. In PostMan, you will receive a content disposition of attachment i.e. a raw buffer of the statement.

Errors & Troubleshooting with Statements:

  • 404 Not Found: This could mean that there's no statement with the provided id or it might have been removed.
  • 403 Forbidden: This usually indicates an authentication problem. Verify if you're providing the correct authentication details and have the necessary permissions.
  • 412 Precondition Failed: If the statement is not in the COMPLETED state, you might receive this response. Only completed statements are available for download.