Difference between revisions of "Statement-Download-v2"

From Barion Documentation
Jump to navigation Jump to search
(Input properties)
Line 5: Line 5:
 
{{api_callmethod
 
{{api_callmethod
 
|method=GET
 
|method=GET
|uri=/v2/Statement/Download
+
|uri=/v1/Statement/Download
 
}}
 
}}
  
Line 15: Line 15:
  
  
<span class="api-ver">v2</span> This API endpoint is available in '''API v2''' only.
+
<span class="api-ver">v1</span> This API endpoint is available in '''API v1''' only.
  
 
== Input properties ==
 
== Input properties ==
Line 81: Line 81:
 
Downloading the daily statement of an '''EUR''' account for '''October 6th 2019''':
 
Downloading the daily statement of an '''EUR''' account for '''October 6th 2019''':
  
<code>https://<nowiki />api.barion.com/v2/statement/[email protected]&password=my5Tr0ngP4ssW0rd&year=2019&month=10&day=6&currency=EUR</code>
+
<code>https://<nowiki />api.barion.com/v1/statement/[email protected]&password=my5Tr0ngP4ssW0rd&year=2019&month=10&day=6&currency=EUR</code>
  
  
 
Downloading the monthly statement of an '''HUF''' account for '''April 2019''':
 
Downloading the monthly statement of an '''HUF''' account for '''April 2019''':
  
<code>https://<nowiki />api.barion.com/v2/statement/[email protected]&password=my5Tr0ngP4ssW0rd&year=2019&month=4&currency=HUF</code>
+
<code>https://<nowiki />api.barion.com/v1/statement/[email protected]&password=my5Tr0ngP4ssW0rd&year=2019&month=4&currency=HUF</code>

Revision as of 09:58, 7 November 2019

Barion API: Download statement file

GET /v1/Statement/Download

The /statement/download API endpoint is used to download monthly or daily statement files generated by the Barion system.


Prerequisites before use:


v1 This API endpoint is available in API v1 only.

Input properties

Property name Property type Limitations and constraints Description
UserName string
  • Required
The login name of the Barion user. This is currently the user's e-mail address.
Password string
  • Required
The password of the Barion user.
Year int
  • Required
The statement year.
Month int
  • Required
The statement month.
Day int
  • Optional
The statement day. If specified, the system will serve a daily statement file.
Currency string
  • Required
  • Required length: 3 characters

Accepted values:

  • "CZK" (Czech crown)
  • "EUR" (Euro)
  • "HUF" (Hungarian forint)
  • "USD" (U.S. dollar)
The currency of the statement's account. Accounts with separate currencies have separate statement files.

Output

Depending on the given input parameters the endpoint will produce the following outputs:

  • If the caller fails to authenticate with a valid username and password, the API will produce an empty output with an HTTP 403 Forbidden status code.
  • If only year and month were specified for the statement, the endpoint will try to serve the monthly statement for the corresponding year and month as a signed PDF (Printable Document Format) document.
  • If year, month, and day were specified for the statement, the endpoint will try to serve the daily statement for the corresponding date as a signed XLSX (Microsoft Excel) document.
  • If the requested statement file is not available, the output will be an error message with an HTTP 404 Not found status code. This can happen for the following reasons:
    • The requested statement file has not been generated yet (or generation of the given type is disabled for the user)
    • The user does not have an account in the specified currency, so a statement file is not applicable

Things to know

  • Daily statement files will not show up on the secure.barion.com site for download. They can only be downloaded via this API endpoint.
  • Once the statement files have been generated, they are available to download for an indefinite time.
  • If a statement is re-generated for a given date, it will be assigned a new filename and a new digital signature. The Barion API will always serve the latest statement file for a given day or month. It is the user's responsibility to distinguish between old and new statement files.

Examples

Downloading the daily statement of an EUR account for October 6th 2019:

https://api.barion.com/v1/statement/[email protected]&password=my5Tr0ngP4ssW0rd&year=2019&month=10&day=6&currency=EUR


Downloading the monthly statement of an HUF account for April 2019:

https://api.barion.com/v1/statement/[email protected]&password=my5Tr0ngP4ssW0rd&year=2019&month=4&currency=HUF