GET /api/batch_documents
Get batch documents list

Returns the list of succeeded batch documents

Supported Formats

json

Examples

[
  {
    "description":"Expenses paid with personal assets, sent to Netvisor",
    "created_at":"2019-09-23",
    "reference_number":"RF713392536027589",
    "pdf_file_url":"http://bezala.com/pdf/74/ba/22/74ba22c0-50ae-4d55-851c-7dbf29465740.pdf",
    "id":12301,
    "external_id":null,
    "show_resend_sepa_link":true
    "accounting_integration_documents":[],
    "other_integration_documents":[
      {
        "integration_id":42,
        "url":"http://url.of.sepa.xml",
        "label":"SEPA"
      }
    ]
  }
] 

Params

Param name Description
page
optional

Page number

Validations:

  • Must be a Integer

per_page
optional

Number of records per page. Can be set to 1000 for getting more records in one page. Default: 50

Validations:

  • Must be a Integer

date_range
optional

Show all batch documents that have been created within the date range. Date range format: “DD/MM/YYYY - DD/MM/YYYY” (example: 01/12/2021 - 12/12/2023)

Validations:

  • Must be a String

user_id
optional

Show all accesible batch documents that contain expenses for the specified user.

Validations:

  • Must be a Integer

skip_pagination
optional

Pass true to skip pagination and receive all the records in one request, no pagination.

Validations:

  • Must be one of: true, false, 1, 0.


GET /api/batch_documents/export
Export summary into PDF

Export batch summary. Response has Content-Type: application/pdf.

By default, exports all available batch document information into the PDF.

To filter batch info to export by user and/or date range, use GET /api/batch_documents with corresponding filter params first, and then make GET /api/batch_documents/export request passing the cookies received with the /api/batch_documents response.

Example

Step 1. Filter batch documents

curl -H 'Authorization: Bearer TOKEN' -c PATH_TO_COOKIE_FILE https://app.bezala.com/api/batch_documents?date_range=01%2F01%2F2022%20-%2031%2F12%2F2022

Step 2. Export filtered batch documents into PDF

curl -H 'Authorization: Bearer TOKEN' -b PATH_TO_COOKIE_FILE --output PATH_TO_PDF https://app.bezala.com/api/batch_documents/export


PUT /api/batch_documents/:id/set_external_id
Set external ID for batch document

Set batch document’s external ID, e.g. to corresponding voucher number in bookkeeping software.

Supported Formats

json

Params

Param name Description
external_id
required

External ID

Validations:

  • Must be a String