Statements - Real-Time Statement PDF

How to integration the ERP DIY Integration for statements

João Estima avatar
Written by João Estima
Updated over a week ago

The Live Statement feature provides access to a statement list and statements PDFs for logged-in users on your EvolutionX webstore. Customers can conveniently find and access their Statements PDFs within the Statement module. This feature serves as an additional functionality to the live invoice list.

New ERP Integrations for Live Statement List and Download

We work either directly with the API for your ERP or through a partner integrator (who provides API support) to setup Live Endpoint for the ERP. This typically is a fast-tracked development to ensure you are up and running quickly. Contact our team today to discuss your options and questions.

The following requests and responses are examples for Live Statement Generate:

Request Header

Notes:

  • Bearer Token is preferred but oAuth2 and other authorization types can be supported too.

  • The Method for the endpoint should be POST.

Example Request Header:

Content-Type: application/json
Accept: application/json
Authorization: Bearer Token or username & password

Request Body

Notes:

  • The Customer Code attribute will use the references of the ERP for the account number. It is not required for the ERP to store EvolutionX IDs for these entities. If needed, the EvolutionX Customer Account can store a GUID or Record ID in the Seller Reference as well (ask DevOps if you need this value in this integration).

  • The most important fields to support are:

    • customer_code — the ERP customer code as stored in the EvolutionX Customer Account Number attribute.

    • document_type — static value "statement".

  • Optional

    • Filters — This field can be optional when using Statement List.

      • When provided you can expect start_date and end_date.

Example Request Body

{
"customer_code": "ACME001",
"document_type": "statement",
"filters": {
"start_date": "2022-09-01T10:00:19Z",
"end_date": "2023-03-31T11:56:19Z"
}
}

Example Request Body from the Statement List (read statement list bellow)

{
"customer_code": "ACME001",
"document_type": "statement",
"metadata": {
"document_id": "2404-390469",
"file_name": "ACME001_statement_2404-390469"
}
}

Response Body

Notes:

  • There are 2 possible responses.

  • If the provided customer does not include a document ID, please throw an error.

  • HTTP Response Status

    • Return HTTP response status 2xx for success.

    • Return HTTP response status 4xx for malformed requests.

    • Return HTTP response status 5xx for internal errors.

Base64_encoded:

{
"data": {
"customer_code": "ACME001",
"file_base64": "base64string"
}
}


Document URL:

Contact customer support before implementing this option.

{
"data": {
"customer_code": "ACME001",
"file_url": "https://assets.s3.amazonaws.com/document.pdf"
}
}

The following requests and responses are examples for Live Statement List:

Request Header

Notes:

  • Bearer Token is preferred but oAuth2 and other authorization types can be supported too.

  • The Method for the endpoint should be POST.

Example Request Header:

Content-Type: application/json
Accept: application/json
Authorization: Bearer Token or username & password

Request Body

Notes:

  • The Customer Code attribute will use the references of the ERP for the account number. It is not required for the ERP to store EvolutionX IDs for these entities. If needed, the EvolutionX Customer Account can store a GUID or Record ID in the Seller Reference as well (ask DevOps if you need this value in this integration).

  • The most important fields to support are:

    • customer_code — the ERP customer code as stored in the EvolutionX Customer Account Number attribute.

    • current_page & per_page — used for pagination.

  • Optional

    • Filters — When there's no filter aply the object is provided and the value of the keys might be null.

Example Request Body

{
"customer_code": "ACME001",
"filters": {
"document_id": "2404-390469",
"file_name": "ACME001_statement_2404-390469",
"start_date": "2022-09-01T10:00:19Z",
"end_date": "2023-03-31T11:56:19Z"
},
"current_page": "1",
"per_page": "15"
}

Response Body

Notes:

  • If the provided customer does not include statements, you can return the statements with a empty array.

  • The most important fields to support are:

    • customer_code — the ERP customer code as stored in the EvolutionX Customer Account Number attribute.

    • statements — the key statements is expected.

      • document_id — This is a optional field, when provided we use it for the internal file name and to active the filter.

      • file_name — This field is only used to display in the statement list.

      • date — This field serves as the internal file name when the document_id is not provided, and it must be unique in this scenario.

        • This field allows free text, so you can enter ranges like "2022-09-01 to 2022-09-25", for example.

      • file_url & file_base64 — This is a optional field, used to download the statement pdf.

      • metadata — if file_url & file_base64 are not provided, we will fetch the PDF using the generate statement feature.

        • We send back the metadata object.

        • You can send any data in here and it'll not be used in the list.

  • The Internal File Name must be unique for each statement. It can follow one of these logics:

    • customer_code + "_statement_" + document_id + ".pdf"

    • customer_code + "_statement_" + date + ".pdf"

      • For the date, use underscores (_) instead of special characters, including white spaces.

Example Response Body

{
"data": {
"customer_code": "ACME001",
"statements": [
{
"document_id": "2404-390469",
"file_name": "ACME001_statement_2404-390469",
"date": "2022-09-01",
"file_url": "",
"file_base64": "",
"metadata": {
"document_id": "2404-390469",
"file_name": "ACME001_statement_2404-390469"
}
}
],
"total": "1"
}
}

ERP DIY Integration

To use this feature you need the ERP DIY Integration App see the full article.


Contact the customer success team to discuss an integration project.

Did this answer your question?