API referenceStatements

Render a period to a file

Queue a statement export — AC2. Always 202, never the file: a year of a busy corridor is hundreds of thousands of lines and rendering it inside the request is a gateway timeout for the caller and a held cursor for us. The `export.ready` webhook arrives when it is done, or poll this job. Asking twice for the same period returns the same job, so a dashboard that polls by re-POSTing costs one render rather than one per poll.

POST
/api/b/v1/statements/export

Queue a statement export — AC2.

Always 202, never the file: a year of a busy corridor is hundreds of thousands of lines and rendering it inside the request is a gateway timeout for the caller and a held cursor for us. The export.ready webhook arrives when it is done, or poll this job.

Asking twice for the same period returns the same job, so a dashboard that polls by re-POSTing costs one render rather than one per poll.

Authorization

OAuth2PasswordBearer
AuthorizationBearer <token>

In: header

admin_access_token?string|null

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

A statement to build. IN-302.

Accepted rather than returned: the file is rendered in the background and the response carries a job to poll. A statement over a long window is not something to hold an HTTP connection open for.

Response Body

application/json

application/json

curl -X POST "https://example.com/api/b/v1/statements/export" \  -H "Content-Type: application/json" \  -d '{    "currency": "RWF"  }'
{  "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",  "kind": "string",  "format": "string",  "status": "string",  "filename": "string",  "row_count": 0,  "byte_size": 0,  "error": "string",  "expires_at": "2019-08-24T14:15:22Z",  "created_at": "2019-08-24T14:15:22Z"}