openapi: 3.2.0
info:
contact: {}
description: This API allows you to export bank journal entries that were produced in our Treasury product.
title: Treasury Bank Journal Export API
version: v1
servers:
- url: https://api.agicap.com
- url: https://api.agicap.internal
tags:
- name: Export
paths:
/public/treasury-bank-journal/v1/entities/{entityId}/exported-bank-journal-entries/mark-as-imported:
post:
description: 'Indicates Agicap that some exported bank journal entries from Agicap were successfully imported in the client accounting system.
To identify the exported bank journal entry, use the agicapUniqueId provided by Agicap during the export (see the POST Export operation response)
Entries with pending corrections will have their corrections cancelled.
Unknown agicapUniqueId values are silently ignored.
The maximum number of exported bank journal entries you can report is 1000 per request, if you need to report more,
simply call this endpoint as many times as necessary.'
operationId: MarkAsImported
parameters:
- description: Agicap entity identifier
example: 456897
in: path
name: entityId
required: true
schema:
format: int32
type: integer
requestBody:
content:
application/*+json:
schema:
allOf:
- $ref: '#/components/schemas/MarkAsImportedRequest'
description: Request to indicate Agicap that some exported bank journal entries from Agicap were successfully imported in the client accounting system.
application/json:
schema:
allOf:
- $ref: '#/components/schemas/MarkAsImportedRequest'
description: Request to indicate Agicap that some exported bank journal entries from Agicap were successfully imported in the client accounting system.
text/json:
schema:
allOf:
- $ref: '#/components/schemas/MarkAsImportedRequest'
description: Request to indicate Agicap that some exported bank journal entries from Agicap were successfully imported in the client accounting system.
description: Request body with the list of bank journal entries successfully imported
responses:
'200':
description: OK
'401':
description: Unauthorized request.
'403':
description: Forbidden request.
'429':
description: Too many requests. Please try again later.
'500':
content:
application/problem+json:
schema:
$ref: '#/components/schemas/ProblemDetails'
description: An internal server occurred.
security:
- bearer_client_credentials:
- agicap:public-api
- bearerAuth: []
summary: Indicates Agicap that some exported bank journal entries from Agicap were…
tags:
- Export
/public/treasury-bank-journal/v1/entities/{entityId}/exported-bank-journal-entries/mark-as-not-imported:
post:
description: 'Indicates Agicap that some exported bank journal entries from Agicap were not correctly imported in the client accounting system.
You can report several errors per bank journal entry. For each error, use the most precise error type whenever possible, and OTHER otherwise.
To identify the exported bank journal entry, use the agicapUniqueId provided by Agicap during the export (see the POST Export operation response)
This means, you need to keep track of which entry in the client accounting system corresponds to the agicapUniqueId.
The maximum number of exported bank journal entries you can report is 1000 per request, if you need to report more,
simply call this endpoint as many times as necessary.
In the example of an export response below, the id to use is "agicapUniqueId": "f7f7ed5c-943c-4385-aa8d-145fd76b2fa1":
POST /public-api/treasury-bank-journal/v1/entities/{entityId}/exports/{exportId}
{
"exportId": "7397d1b5-d76d-43d2-a153-2bcff5e57455",
"year": 2024,
"bankJournalExportIndexInYear": 1,
"entityName": "Contoso",
"entries": [
{
"indexInYear": 57,
"indexInExport": 1,
"agicapUniqueId": "f7f7ed5c-943c-4385-aa8d-145fd76b2fa1", -- this is the id to use !
"name": "ACME Payment",
... other fields omitted for brevity.
}
]
}'
operationId: MarkAsNotImported
parameters:
- description: Agicap entity identifier
example: 456897
in: path
name: entityId
required: true
schema:
format: int32
type: integer
requestBody:
content:
application/*+json:
example:
entriesNotImported:
- entryAgicapUniqueId: f7f7ed5c-943c-4385-aa8d-145fd76b2fa1
errors:
- errorMessage: 1234 is not a valid accounting account
errorType: UNKNOWN_ACCOUNTING_ACCOUNT
- errorMessage: 5678 is not a valid third party
errorType: UNKNOWN_THIRD_PARTY
- entryAgicapUniqueId: 6dd1efd6-f286-4877-9012-2cf7c3bc6858
errors:
- errorMessage: No journal code set
errorType: UNKNOWN_JOURNAL_CODE
schema:
allOf:
- $ref: '#/components/schemas/MarkAsNotImportedRequest'
description: Request to indicate Agicap that some exported bank journal entries from Agicap were not correctly imported in the client accounting system.
application/json:
example:
entriesNotImported:
- entryAgicapUniqueId: f7f7ed5c-943c-4385-aa8d-145fd76b2fa1
errors:
- errorMessage: 1234 is not a valid accounting account
errorType: UNKNOWN_ACCOUNTING_ACCOUNT
- errorMessage: 5678 is not a valid third party
errorType: UNKNOWN_THIRD_PARTY
- entryAgicapUniqueId: 6dd1efd6-f286-4877-9012-2cf7c3bc6858
errors:
- errorMessage: No journal code set
errorType: UNKNOWN_JOURNAL_CODE
schema:
allOf:
- $ref: '#/components/schemas/MarkAsNotImportedRequest'
description: Request to indicate Agicap that some exported bank journal entries from Agicap were not correctly imported in the client accounting system.
text/json:
example:
entriesNotImported:
- entryAgicapUniqueId: f7f7ed5c-943c-4385-aa8d-145fd76b2fa1
errors:
- errorMessage: 1234 is not a valid accounting account
errorType: UNKNOWN_ACCOUNTING_ACCOUNT
- errorMessage: 5678 is not a valid third party
errorType: UNKNOWN_THIRD_PARTY
- entryAgicapUniqueId: 6dd1efd6-f286-4877-9012-2cf7c3bc6858
errors:
- errorMessage: No journal code set
errorType: UNKNOWN_JOURNAL_CODE
schema:
allOf:
- $ref: '#/components/schemas/MarkAsNotImportedRequest'
description: Request to indicate Agicap that some exported bank journal entries from Agicap were not correctly imported in the client accounting system.
description: Request body describing the errors for each bank journal entry not correctly imported in the client accounting system
responses:
'200':
description: OK
'401':
description: Unauthorized request.
'403':
description: Forbidden request.
'429':
description: Too many requests. Please try again later.
'500':
content:
application/problem+json:
schema:
$ref: '#/components/schemas/ProblemDetails'
description: An internal server occurred.
security:
- bearer_client_credentials:
- agicap:public-api
- bearerAuth: []
summary: Indicates Agicap that some exported bank journal entries from Agicap were not…
tags:
- Export
/public/treasury-bank-journal/v1/entities/{entityId}/exports:
get:
description: 'Returns a list of short summaries of bank journal entries previous exports, without their entries.
You can then use `exportId` of a summary to call the GET Export endpoint to retrieve the export content with its entries.
The query pagination is based on a mandatory timestamp cursor whose value is specified either with the `after` parameter or the
`before` parameter (but not both).
It returns (at most) `size` bank journal exports whose export dates are either:
- strictly after the given `after` parameter if specified, the results ordered chronologically (from oldest to newest)
- strictly before the given `before` parameter if specified, the results in reverse chronological order (from newest to oldest)
Both `after` and `before` parameters are ISO8601 date-time format interpreted in UTC, examples:
- `2024-11-01`
- `2024-11-01T14:30:00`
- `2024-11-01T14:30:00Z`
- `2024-11-01T14:30:00.123Z`
Note that the server can return less than the `size` items requested if it deems the value too big, in this case, query again by using the
returned cursor value as a new starting point.
In the response if the cursor `after` value is null, this means there is no value `after` that, same goes for the
`before` value.
Example:
- Query 1: `/public-api/treasury-bank-journal/v1/entities/42/exports?size=10&after=2024-11-01`
- Response: 10 bank journals returned chronologically, the last one at `2024-11-07T14:30:00Z` which is the value of the returned cursor `after`
field
To get the next bank journal exports, use the returned cursor `after` field value as the `after` parameter,
remember that bank journals at this date are excluded so you won''t get the last bank journal of the previous response again.
- Query 2: `/public-api/treasury-bank-journal/v1/entities/42/exports?size=10&after=2024-11-07T14:30:00Z`
- Response: 7 bank journal exports returned, since there are no more bank journal exports to get, the returned cursor `after` field is null
The `before` parameter works the same way, but instead of going in chronological order, it goes backward, the newest export is first and the oldest
last.'
operationId: GetBankJournalExports
parameters:
- description: Agicap entity identifier
example: 456897
in: path
name: entityId
required: true
schema:
format: int32
type: integer
- description: When specified, returns bank journals whose export date is before the given UTC date time
example: '2024-11-01T11:27:00'
in: query
name: before
schema:
type: string
- description: When specified, returns bank journals whose export date is after the given UTC date time
example: '2024-10-21T14:30:00'
in: query
name: after
schema:
type: string
- description: Number of bank journals to return
example: 100
in: query
name: size
required: true
schema:
format: int32
type: integer
responses:
'200':
content:
application/json:
example:
cursor:
after: '2024-10-30T18:07:00.806Z'
before: null
size: 3
items:
- exportDateUtc: '2024-10-28T14:30:00.123Z'
exportId: f8e601b1-1724-41cf-bd60-f720f91236c2
exportIndexInYear: 1
exportYear: 2024
indexInYearOfFirstEntryInBankJournal: 1
indexInYearOfLastEntryInBankJournal: 20
numberOfEntries: 20
- exportDateUtc: '2024-10-29T09:18:00.504Z'
exportId: 0e9d04c2-c6dd-44ec-9789-eef8a04ec7a0
exportIndexInYear: 2
exportYear: 2024
indexInYearOfFirstEntryInBankJournal: 21
indexInYearOfLastEntryInBankJournal: 30
numberOfEntries: 10
- exportDateUtc: '2024-10-30T18:07:00.806Z'
exportId: 0e9d04c2-c6dd-44ec-9789-eef8a04ec7a0
exportIndexInYear: 3
exportYear: 2024
indexInYearOfFirstEntryInBankJournal: 31
indexInYearOfLastEntryInBankJournal: 50
numberOfEntries: 20
schema:
$ref: '#/components/schemas/GetBankJournalExportsResponse'
text/json:
example:
cursor:
after: '2024-10-30T18:07:00.806Z'
before: null
size: 3
items:
- exportDateUtc: '2024-10-28T14:30:00.123Z'
exportId: f8e601b1-1724-41cf-bd60-f720f91236c2
exportIndexInYear: 1
exportYear: 2024
indexInYearOfFirstEntryInBankJournal: 1
indexInYearOfLastEntryInBankJournal: 20
numberOfEntries: 20
- exportDateUtc: '2024-10-29T09:18:00.504Z'
exportId: 0e9d04c2-c6dd-44ec-9789-eef8a04ec7a0
exportIndexInYear: 2
exportYear: 2024
indexInYearOfFirstEntryInBankJournal: 21
indexInYearOfLastEntryInBankJournal: 30
numberOfEntries: 10
- exportDateUtc: '2024-10-30T18:07:00.806Z'
exportId: 0e9d04c2-c6dd-44ec-9789-eef8a04ec7a0
exportIndexInYear: 3
exportYear: 2024
indexInYearOfFirstEntryInBankJournal: 31
indexInYearOfLastEntryInBankJournal: 50
numberOfEntries: 20
schema:
$ref: '#/components/schemas/GetBankJournalExportsResponse'
text/plain:
example:
cursor:
after: '2024-10-30T18:07:00.806Z'
before: null
size: 3
items:
- exportDateUtc: '2024-10-28T14:30:00.123Z'
exportId: f8e601b1-1724-41cf-bd60-f720f91236c2
exportIndexInYear: 1
exportYear: 2024
indexInYearOfFirstEntryInBankJournal: 1
indexInYearOfLastEntryInBankJournal: 20
numberOfEntries: 20
- exportDateUtc: '2024-10-29T09:18:00.504Z'
exportId: 0e9d04c2-c6dd-44ec-9789-eef8a04ec7a0
exportIndexInYear: 2
exportYear: 2024
indexInYearOfFirstEntryInBankJournal: 21
indexInYearOfLastEntryInBankJournal: 30
numberOfEntries: 10
- exportDateUtc: '2024-10-30T18:07:00.806Z'
exportId: 0e9d04c2-c6dd-44ec-9789-eef8a04ec7a0
exportIndexInYear: 3
exportYear: 2024
indexInYearOfFirstEntryInBankJournal: 31
indexInYearOfLastEntryInBankJournal: 50
numberOfEntries: 20
schema:
$ref: '#/components/schemas/GetBankJournalExportsResponse'
description: OK
'401':
description: Unauthorized request.
'403':
description: Forbidden request.
'429':
description: Too many requests. Please try again later.
'500':
content:
application/problem+json:
schema:
$ref: '#/components/schemas/ProblemDetails'
description: An internal server occurred.
security:
- bearer_client_credentials:
- agicap:public-api
- bearerAuth: []
summary: Returns a list of bank journal entries export summaries
tags:
- Export
/public/treasury-bank-journal/v1/entities/{entityId}/exports/{exportId}:
get:
description: 'Retrieve an existing bank journal export by its identifier, with all its entries.
The bank journal export is returned as a JSON payload.
If the export is not found an error is returned.'
operationId: GetExport
parameters:
- description: Agicap entity identifier
example: 54
in: path
name: entityId
required: true
schema:
format: int32
type: integer
- description: Unique ID of an existing bank journal export.
example: 31dee215-e458-4145-8fe8-c20a0ea06042
in: path
name: exportId
required: true
schema:
format: uuid
type: string
responses:
'200':
content:
application/json:
example:
bankJournalExportIndexInYear: 1
entityName: Contoso
entries:
- accountingAccountExternalId: null
accountingAccountNumber: '201.01000'
accountingCurrency: USD
agicapUniqueId: f7f7ed5c-943c-4385-aa8d-145fd76b2fa1
bankAccountName: Cars bank account
causale: RIBA
counterparts:
- accountingAccountExternalId: null
accountingAccountNumber: '140.0000'
accountingAccountType: SUPPLIER
accountingCurrency: null
analyticalCodes: {}
creditInAccountingCurrency: null
creditInOriginalCurrency: null
customFields: null
debitInAccountingCurrency: null
debitInOriginalCurrency: 700000
document:
documentIssueDate: null
documentReference: INV-2025-0001
documentType: SUPPLIER_INVOICE
externalEntityId: null
externalId: 29a7e40d-3e7a-44bc-b245-0b7da2eaf5bd
originalDueDate: '2025-12-21'
uniqueId: yv73xx45
exchangeRate: null
journalCode: SG1
linkedExportedEntry: null
name: ACME Invoice 1
originalCurrency: EUR
taxKey: null
thirdPartyCode: S23
thirdPartyExternalId: null
thirdPartyName: Supplier 23
- accountingAccountExternalId: null
accountingAccountNumber: '140.0000'
accountingAccountType: SUPPLIER
accountingCurrency: USD
analyticalCodes:
Country: FR
Project: Marketing
creditInAccountingCurrency: null
creditInOriginalCurrency: null
customFields:
- name: ERP id
value: '123'
- name: Company division
value: Cars
debitInAccountingCurrency: 200000
debitInOriginalCurrency: 300000
document:
documentIssueDate: null
documentReference: INV-2025-0002
documentType: SUPPLIER_INVOICE
externalEntityId: null
externalId: 37cfb760-8f09-4fc1-8269-18f92e6e90e4
originalDueDate: '2025-12-21'
uniqueId: 2wrrwpou
exchangeRate: null
journalCode: SG1
linkedExportedEntry: null
name: ACME Invoice 2
originalCurrency: EUR
taxKey: null
thirdPartyCode: S23
thirdPartyExternalId: null
thirdPartyName: Supplier 23
creditInAccountingCurrency: 900000
creditInOriginalCurrency: 1000000
debitInAccountingCurrency: null
debitInOriginalCurrency: null
entryMemo: null
exchangeRate: null
exportEntryReference: 0o00001l
indexInExport: 1
indexInYear: 57
journalCode: SG1
name: ACME Payment
originalCurrency: EUR
paymentDate: '2024-12-24'
type: BANK
exportId: 7397d1b5-d76d-43d2-a153-2bcff5e57455
year: 2024
schema:
$ref: '#/components/schemas/GetExportResponse'
text/json:
example:
bankJournalExportIndexInYear: 1
entityName: Contoso
entries:
- accountingAccountExternalId: null
accountingAccountNumber: '201.01000'
accountingCurrency: USD
agicapUniqueId: f7f7ed5c-943c-4385-aa8d-145fd76b2fa1
bankAccountName: Cars bank account
causale: RIBA
counterparts:
- accountingAccountExternalId: null
accountingAccountNumber: '140.0000'
accountingAccountType: SUPPLIER
accountingCurrency: null
analyticalCodes: {}
creditInAccountingCurrency: null
creditInOriginalCurrency: null
customFields: null
debitInAccountingCurrency: null
debitInOriginalCurrency: 700000
document:
documentIssueDate: null
documentReference: INV-2025-0001
documentType: SUPPLIER_INVOICE
externalEntityId: null
externalId: 29a7e40d-3e7a-44bc-b245-0b7da2eaf5bd
originalDueDate: '2025-12-21'
uniqueId: yv73xx45
exchangeRate: null
journalCode: SG1
linkedExportedEntry: null
name: ACME Invoice 1
originalCurrency: EUR
taxKey: null
thirdPartyCode: S23
thirdPartyExternalId: null
thirdPartyName: Supplier 23
- accountingAccountExternalId: null
accountingAccountNumber: '140.0000'
accountingAccountType: SUPPLIER
accountingCurrency: USD
analyticalCodes:
Country: FR
Project: Marketing
creditInAccountingCurrency: null
creditInOriginalCurrency: null
customFields:
- name: ERP id
value: '123'
- name: Company division
value: Cars
debitInAccountingCurrency: 200000
debitInOriginalCurrency: 300000
document:
documentIssueDate: null
documentReference: INV-2025-0002
documentType: SUPPLIER_INVOICE
externalEntityId: null
externalId: 37cfb760-8f09-4fc1-8269-18f92e6e90e4
originalDueDate: '2025-12-21'
uniqueId: 2wrrwpou
exchangeRate: null
journalCode: SG1
linkedExportedEntry: null
name: ACME Invoice 2
originalCurrency: EUR
taxKey: null
thirdPartyCode: S23
thirdPartyExternalId: null
thirdPartyName: Supplier 23
creditInAccountingCurrency: 900000
creditInOriginalCurrency: 1000000
debitInAccountingCurrency: null
debitInOriginalCurrency: null
entryMemo: null
exchangeRate: null
exportEntryReference: 0o00001l
indexInExport: 1
indexInYear: 57
journalCode: SG1
name: ACME Payment
originalCurrency: EUR
paymentDate: '2024-12-24'
type: BANK
exportId: 7397d1b5-d76d-43d2-a153-2bcff5e57455
year: 2024
schema:
$ref: '#/components/schemas/GetExportResponse'
text/plain:
example:
bankJournalExportIndexInYear: 1
entityName: Contoso
entries:
- accountingAccountExternalId: null
accountingAccountNumber: '201.01000'
accountingCurrency: USD
agicapUniqueId: f7f7ed5c-943c-4385-aa8d-145fd76b2fa1
bankAccountName: Cars bank account
causale: RIBA
counterparts:
- accountingAccountExternalId: null
accountingAccountNumber: '140.0000'
accountingAccountType: SUPPLIER
accountingCurrency: null
analyticalCodes: {}
creditInAccountingCurrency: null
creditInOriginalCurrency: null
customFields: null
debitInAccountingCurrency: null
debitInOriginalCurrency: 700000
document:
documentIssueDate: null
documentReference: INV-2025-0001
documentType: SUPPLIER_INVOICE
externalEntityId: null
externalId: 29a7e40d-3e7a-44bc-b245-0b7da2eaf5bd
originalDueDate: '2025-12-21'
uniqueId: yv73xx45
exchangeRate: null
journalCode: SG1
linkedExportedEntry: null
name: ACME Invoice 1
originalCurrency: EUR
taxKey: null
thirdPartyCode: S23
thirdPartyExternalId: null
thirdPartyName: Supplier 23
- accountingAccountExternalId: null
accountingAccountNumber: '140.0000'
accountingAccountType: SUPPLIER
accountingCurrency: USD
analyticalCodes:
Country: FR
Project: Marketing
creditInAccountingCurrency: null
creditInOriginalCurrency: null
customFields:
- name: ERP id
value: '123'
- name: Company division
value: Cars
debitInAccountingCurrency: 200000
debitInOriginalCurrency: 300000
document:
documentIssueDate: null
documentReference: INV-2025-0002
documentType: SUPPLIER_INVOICE
externalEntityId: null
externalId: 37cfb760-8f09-4fc1-8269-18f92e6e90e4
originalDueDate: '2025-12-21'
uniqueId: 2wrrwpou
exchangeRate: null
journalCode: SG1
linkedExportedEntry: null
name: ACME Invoice 2
originalCurrency: EUR
taxKey: null
thirdPartyCode: S23
thirdPartyExternalId: null
thirdPartyName: Supplier 23
creditInAccountingCurrency: 900000
creditInOriginalCurrency: 1000000
debitInAccountingCurrency: null
debitInOriginalCurrency: null
entryMemo: null
exchangeRate: null
exportEntryReference: 0o00001l
indexInExport: 1
indexInYear: 57
journalCode: SG1
name: ACME Payment
originalCurrency: EUR
paymentDate: '2024-12-24'
type: BANK
exportId: 7397d1b5-d76d-43d2-a153-2bcff5e57455
year: 2024
schema:
$ref: '#/components/schemas/GetExportResponse'
description: OK
'401':
description: Unauthorized request.
'403':
description: Forbidden request.
'404':
content:
application/json:
schema:
$ref: '#/components/schemas/ProblemDetails'
text/json:
schema:
$ref: '#/components/schemas/ProblemDetails'
text/plain:
schema:
$ref: '#/components/schemas/ProblemDetails'
description: Not Found
'429':
description: Too many requests. Please try again later.
'500':
content:
application/problem+json:
schema:
$ref: '#/components/schemas/ProblemDetails'
description: An internal server occurred.
security:
- bearer_client_credentials:
- agicap:public-api
- bearerAuth: []
summary: Get an existing bank journal entries export
tags:
- Export
post:
description: 'Export all the bank journal entries ready to be exported. You need to provide the export id as a Guid
The bank journal entries will become exported instead of ready to be exported and won''t be exportable anymore, they can be retrieved later on with the same
`exportId` with the GET Export endpoint.
The bank journal is returned as a JSON payload.
The maximum number of entries in a bank journal is limited (currently 5000), if you have more entries to export, simply export several journals with
different `exportId`.
Note that the exported counterparts custom fields include the ERP identification fields from business document when imported in Agicap.
This section is only for ERPs requiring the count of bank journals and bank journal entries created during the year
If your ERP does not require these counts, you can simply specify an empty request body ("" or "{}").
For the first export of the year via Agicap, if a user has already created bank journals outside Agicap and its ERP needs to know
these counts, you can specify where to start the counts of bank journal and bank journal entries in the current year, by specifying in the request
body a currentExportCounts object and set the appropriate values in currentBankJournalsCountInYear and
currentBankJournalEntriesCountInYear fields.
Warning: This must be done only once, the request will fail if you try to set these counts multiple times.'
operationId: Export
parameters:
- description: Agicap entity identifier
example: 54
in: path
name: entityId
required: true
schema:
format: int32
type: integer
- description: 'Unique ID of the export, provided by the caller. In case of network problem, use the same
unique ID to retry.'
example: 31dee215-e458-4145-8fe8-c20a0ea06042
in: path
name: exportId
required: true
schema:
format: uuid
type: string
requestBody:
content:
application/*+json:
example:
currentExportCounts:
currentBankJournalEntriesCountInYear: 100
currentBankJournalsCountInYear: 5
schema:
allOf:
- $ref: '#/components/schemas/ExportRequest'
description: Export request
application/json:
example:
currentExportCounts:
currentBankJournalEntriesCountInYear: 100
currentBankJournalsCountInYear: 5
schema:
allOf:
- $ref: '#/components/schemas/ExportRequest'
description: Export request
text/json:
example:
currentExportCounts:
currentBankJournalEntriesCountInYear: 100
currentBankJournalsCountInYear: 5
schema:
allOf:
- $ref: '#/components/schemas/ExportRequest'
description: Export request
description: "
\n This is only needed if your ERP requires these counts, and if that is the case, it is only needed for the FIRST export.\n
\n\n If you don't need it, simply pass an empty body (\"\" or \"{}\").\n
\nOptional one time use export parameters allowing to set:\n - the count of already created bank journal in the current year
- the count of already created bank journal entries in the current year
"
responses:
'200':
content:
application/json:
example:
bankJournalExportIndexInYear: 1
entityName: Contoso
entries:
- accountingAccountExternalId: null
accountingAccountNumber: '201.01000'
accountingCurrency: USD
agicapUniqueId: f7f7ed5c-943c-4385-aa8d-145fd76b2fa1
bankAccountName: Cars bank account
causale: RIBA
counterparts:
- accountingAccountExternalId: null
accountingAccountNumber: '140.0000'
accountingAccountType: SUPPLIER
accountingCurrency: null
analyticalCodes: {}
creditInAccountingCurrency: null
creditInOriginalCurrency: null
customFields: null
debitInAccountingCurrency: null
debitInOriginalCurrency: 700000
document:
documentIssueDate: '2025-12-21T11:11:11+00:00'
documentReference: INV-2025-0001
documentType: SUPPLIER_INVOICE
externalEntityId: null
externalId: 29a7e40d-3e7a-44bc-b245-0b7da2eaf5bd
originalDueDate: '2025-12-21'
uniqueId: yv73xx45
exchangeRate: null
journalCode: SG1
linkedExportedEntry: null
name: ACME Invoice 1
originalCurrency: EUR
taxKey: null
thirdPartyCode: S23
thirdPartyExternalId: null
thirdPartyName: Supplier 23
- accountingAccountExternalId: null
accountingAccountNumber: '140.0000'
accountingAccountType: SUPPLIER
accountingCurrency: USD
analyticalCodes:
Country: FR
Project: Marketing
creditInAccountingCurrency: null
creditInOriginalCurrency: null
customFields:
- name: ERP id
value: '123'
- name: Company division
value: Cars
debitInAccountingCurrency: 200000
debitInOriginalCurrency: 300000
document:
documentIssueDate: null
documentReference: INV-2025-0002
documentType: SUPPLIER_INVOICE
externalEntityId: null
externalId: 37cfb760-8f09-4fc1-8269-18f92e6e90e4
originalDueDate: '2025-12-21'
uniqueId: 2wrrwpou
exchangeRate: null
journalCode: SG1
linkedExportedEntry: null
name: ACME Invoice 2
originalCurrency: EUR
taxKey: null
thirdPartyCode: S23
thirdPartyExternalId: null
thirdPartyName: Supplier 23
creditInAccountingCurrency: 900000
creditInOriginalCurrency: 1000000
debitInAccountingCurrency: null
debitInOriginalCurrency: null
entryMemo: null
exchangeRate: null
exportEntryReference: 0o00001l
indexInExport: 1
indexInYear: 57
journalCode: SG1
name: ACME Payment
originalCurrency: EUR
paymentDate: '2024-12-24'
type: BANK
exportId: 7397d1b5-d76d-43d2-a153-2bcff5e57455
year: 2024
schema:
$ref: '#/components/schemas/ExportResponse'
text/json:
example:
bankJournalExportIndexInYear: 1
entityName: Contoso
entries:
- accountingAccountExternalId: null
accountingAccountNumber: '201.01000'
accountingCurrency: USD
agicapUniqueId: f7f7ed5c-943c-4385-aa8d-145fd76b2fa1
bankAccountName: Cars bank account
causale: RIBA
counterparts:
- accountingAccountExternalId: null
accountingAccountNumber: '140.0000'
accountingAccountType: SUPPLIER
accountingCurrency: null
analyticalCodes: {}
creditInAccountingCurrency: null
creditInOriginalCurrency: null
customFields: null
debitInAccountingCurrency: null
debitInOriginalCurrency: 700000
document:
documentIssueDate: '2025-12-21T11:11:11+00:00'
documentReference: INV-2025-0001
documentType: SUPPLIER_INVOICE
externalEntityId: null
externalId: 29a7e40d-3e7a-44bc-b245-0b7da2eaf5bd
originalDueDate: '2025-12-21'
uniqueId: yv73xx45
exchangeRate: null
journalCode: SG1
linkedExportedEntry: null
name: ACME Invoice 1
originalCurrency: EUR
taxKey: null
thirdPartyCode: S23
thirdPartyExternalId: null
thirdPartyName: Supplier 23
- accountingAccountExternalId: null
accountingAccountNumber: '140.0000'
accountingAccountType: SUPPLIER
accountingCurrency: USD
analyticalCodes:
Country: FR
Project: Marketing
creditInAccountingCurrency: null
creditInOriginalCurrency: null
customFields:
- name: ERP id
value: '123'
- name: Company division
value: Cars
debitInAccountingCurrency: 200000
debitInOriginalCurrency: 300000
document:
documentIssueDate: null
documentReference: INV-2025-0002
documentType: SUPPLIER_INVOICE
externalEntityId: null
externalId: 37cfb760-8f09-4fc1-8269-18f92e6e90e4
originalDueDate: '2025-12-21'
uniqueId: 2wrrwpou
exchangeRate: null
journalCode: SG1
linkedExportedEntry: null
name: ACME Invoice 2
originalCurrency: EUR
taxKey: null
thirdPartyCode: S23
thirdPartyExternalId: null
thirdPartyName: Supplier 23
creditInAccountingCurrency: 900000
creditInOriginalCurrency: 1000000
debitInAccountingCurrency: null
debitInOriginalCurrency: null
entryMemo: null
exchangeRate: null
exportEntryReference: 0o00001l
indexInExport: 1
indexInYear: 57
journalCode: SG1
name: ACME Payment
originalCurrency: EUR
paymentDate: '2024-12-24'
type: BANK
exportId: 7397d1b5-d76d-43d2-a153-2bcff5e57455
year: 2024
schema:
$ref: '#/components/schemas/ExportResponse'
text/plain:
example:
bankJournalExportIndexInYear: 1
entityName: Contoso
entries:
- accountingAccountExternalId: null
accountingAccountNumber: '201.01000'
accountingCurrency: USD
agicapUniqueId: f7f7ed5c-943c-4385-aa8d-145fd76b2fa1
bankAccountName: Cars bank account
causale: RIBA
counterparts:
- accountingAccountExternalId: null
accountingAccountNumber: '140.0000'
accountingAccountType: SUPPLIER
accountingCurrency: null
analyticalCodes: {}
creditInAccountingCurrency: null
creditInOriginalCurrency: null
customFields: null
debitInAccountingCurrency: null
debitInOriginalCurrency: 700000
document:
documentIssueDate: '2025-12-21T11:11:11+00:00'
documentReference: INV-2025-0001
documentType: SUPPLIER_INVOICE
externalEntityId: null
externalId: 29a7e40d-3e7a-44bc-b245-0b7da2eaf5bd
originalDueDate: '2025-12-21'
uniqueId: yv73xx45
exchangeRate: null
journalCode: SG1
linkedExportedEntry: null
name: ACME Invoice 1
originalCurrency: EUR
taxKey: null
thirdPartyCode: S23
thirdPartyExternalId: null
thirdPartyName: Supplier 23
- accountingAccountExternalId: null
accountingAccountNumber: '140.0000'
accountingAccountType: SUPPLIER
accountingCurrency: USD
analyticalCodes:
Country: FR
Project: Marketing
creditInAccountingCurrency: null
creditInOriginalCurrency: null
customFields:
- name: ERP id
value: '123'
- name: Company division
value: Cars
debitInAccountingCurrency: 200000
debitInOriginalCurrency: 300000
document:
documentIssueDate: null
documentReference: INV-2025-0002
documentType: SUPPLIER_INVOICE
externalEntityId: null
externalId: 37cfb760-8f09-4fc1-8269-18f92e6e90e4
originalDueDate: '2025-12-21'
uniqueId: 2wrrwpou
exchangeRate: null
journalCode: SG1
linkedExportedEntry: null
name: ACME Invoice 2
originalCurrency: EUR
taxKey: null
thirdPartyCode: S23
thirdPartyExternalId: null
thirdPartyName: Supplier 23
creditInAccountingCurrency: 900000
creditInOriginalCurrency: 1000000
debitInAccountingCurrency: null
debitInOriginalCurrency: null
entryMemo: null
exchangeRate: null
exportEntryReference: 0o00001l
indexInExport: 1
indexInYear: 57
journalCode: SG1
name: ACME Payment
originalCurrency: EUR
paymentDate: '2024-12-24'
type: BANK
exportId: 7397d1b5-d76d-43d2-a153-2bcff5e57455
year: 2024
schema:
$ref: '#/components/schemas/ExportResponse'
description: OK
'204':
description: No Content
'401':
description: Unauthorized request.
'403':
description: Forbidden request.
'429':
description: Too many requests. Please try again later.
'500':
content:
application/problem+json:
schema:
$ref: '#/components/schemas/ProblemDetails'
description: An internal server occurred.
security:
- bearer_client_credentials:
- agicap:public-api
- bearerAuth: []
summary: Export bank journal entries ready to be exported
tags:
- Export
components:
schemas:
CurrentExportCountsDto:
additionalProperties: false
description: 'Optional export parameters allowing to set where to start:
- the count of already created bank journal in the current year
- the count of already created bank journal entries in the current year
This is needed if there were bank journal already created outside Agicap systems, Agicap needs to know where to pick up the counts.'
properties:
currentBankJournalEntriesCountInYear:
description: The number of bank journal entries previously created (starts at 1)
format: int32
type: integer
currentBankJournalsCountInYear:
description: The number of bank journal previously created (starts at 1)
format: int32
type: integer
required:
- currentBankJournalEntriesCountInYear
- currentBankJournalsCountInYear
type: object
DocumentDto:
additionalProperties: false
description: Document related (invoice, credit note, purchase order, etc) information
properties:
documentIssueDate:
description: The document issue date
format: date-time
type:
- string
- 'null'
documentReference:
description: '>The document reference number (e.g., invoice number, purchase order number)'
type:
- string
- 'null'
documentType:
description: 'The document type (CLIENT_INVOICE, CLIENT_CREDIT_NOTE, SUPPLIER_INVOICE, SUPPLIER_CREDIT_NOTE, CLIENT_QUOTE, SALES_ORDER,
PURCHASE_ORDER, PROFORMA_INVOICE, OTHER)'
type: string
externalEntityId:
description: The external identifier of the owning entity in the source system
type:
- string
- 'null'
externalId:
description: The document identifier from the source system
type:
- string
- 'null'
originalDueDate:
description: The document due date
format: date
type: string
uniqueId:
description: A unique 8-character alphanumeric identifier for the document
type: string
required:
- documentType
- originalDueDate
- uniqueId
type: object
ExportRequest:
additionalProperties: false
description: Export request
properties:
currentExportCounts:
allOf:
- $ref: '#/components/schemas/CurrentExportCountsDto'
description: 'Optional export parameters allowing to set where to start:
- the count of already created bank journal in the current year
- the count of already created bank journal entries in the current year
This is needed if there were bank journal already created outside Agicap systems, Agicap needs to know where to pick up the counts.'
type: object
CustomFieldDto:
additionalProperties: false
description: A custom field
properties:
name:
description: The custom field name
type: string
value:
description: The custom field value
type: string
required:
- name
- value
type: object
GetExportResponse:
additionalProperties: false
description: Get exported bank journal response
properties:
bankJournalExportIndexInYear:
description: The index of the bank journal export in the current year
format: int32
type: integer
entityName:
description: Name of the entity
type: string
entries:
description: Array of all entries in the bank journal export
items:
$ref: '#/components/schemas/ExportedBankJournalEntryDto'
type: array
exportId:
description: The identifier of the export as specified in the request
format: uuid
type: string
year:
description: Current year in UTC when the bank journal has been exported
format: int32
type: integer
required:
- bankJournalExportIndexInYear
- entityName
- entries
- exportId
- year
type: object
ImportedEntryDto:
additionalProperties: false
description: Identifies a bank journal entry that was successfully imported in the client accounting system.
properties:
entryAgicapUniqueId:
description: The agicapUniqueId of the exported bank journal entry
format: uuid
type: string
required:
- entryAgicapUniqueId
type: object
GetBankJournalExportsResponse:
additionalProperties: false
description: 'A list of bank journal exports summaries along with a timestamp cursor pagination.
'
properties:
cursor:
allOf:
- $ref: '#/components/schemas/CursorDto'
description: 'The cursor current state as returned after a query.
Both after and before values are ISO 8601 date/time in UTC in this format: 2024-10-28T14:30:00.123Z.'
items:
items:
$ref: '#/components/schemas/BankJournalExportSummaryDto'
type: array
required:
- cursor
- items
type: object
ExportedBankJournalEntryDto:
additionalProperties: false
description: A bank journal entry
properties:
accountingAccountExternalId:
description: An optional ERP-specific external identifier for the bank accounting account
type:
- string
- 'null'
accountingAccountNumber:
description: The accounting account number
type: string
accountingCurrency:
description: The accounting currency ISO code on three uppercase letters (ISO 4217 standard)
type: string
agicapUniqueId:
description: A unique id generated by Agicap
format: uuid
type: string
bankAccountName:
description: The bank account name
type: string
causale:
description: The banking transaction causale (only populated for entities with causale option enabled)
type:
- string
- 'null'
counterparts:
description: The bank journal entry counterparts
items:
$ref: '#/components/schemas/ExportedCounterpartDto'
type: array
creditInAccountingCurrency:
description: Credit value in accounting currency (rounded to four decimals)
format: double
type:
- number
- 'null'
creditInOriginalCurrency:
description: Credit value in original currency (rounded to four decimals)
format: double
type:
- number
- 'null'
debitInAccountingCurrency:
description: Debit value in accounting currency (rounded to four decimals)
format: double
type:
- number
- 'null'
debitInOriginalCurrency:
description: Debit value in original currency (rounded to four decimals)
format: double
type:
- number
- 'null'
entryMemo:
description: A free-text memo for the bank journal entry
type:
- string
- 'null'
exchangeRate:
description: The exchange rate applied between the original currency amount and the accounting currency amount (rounded to six decimals). Null when the rate is not applicable (e.g., synthetic exchange gain/loss counterpart, or when the original amount is zero).
format: double
type:
- number
- 'null'
exportEntryReference:
description: A unique reference per entity generated by Agicap, max 8 characters, designed to match reference formats expected by ERPs and accounting systems
type: string
indexInExport:
description: Index of the bank journal entry in the bank journal (starts at 1)
format: int32
type: integer
indexInYear:
description: Index of the bank journal entry in the current year (starts at 1)
format: int32
type: integer
journalCode:
description: The journal code
type:
- string
- 'null'
name:
description: The bank journal entry name (title)
type: string
originalCurrency:
description: The original currency ISO code on three uppercase letters (ISO 4217 standard)
type: string
paymentDate:
description: The banking transaction payment date
format: date
type: string
type:
description: 'The journal entry type: ''BANK'' for bank journal entries, ''CASH_IN_TRANSIT'' for cash-in-transit entries.'
type: string
required:
- accountingAccountNumber
- accountingCurrency
- agicapUniqueId
- bankAccountName
- counterparts
- exportEntryReference
- indexInExport
- indexInYear
- name
- originalCurrency
- paymentDate
- type
type: object
LinkedExportedEntryDto:
additionalProperties: false
description: Reference to a previously exported journal entry linked to this counterpart
properties:
agicapUniqueId:
description: The unique identifier of the linked entry (same format as ExportedBankJournalEntryDto.AgicapUniqueId)
format: uuid
type: string
exportEntryReference:
description: The unique export reference of the linked entry (same format as ExportedBankJournalEntryDto.ExportEntryReference)
type: string
required:
- agicapUniqueId
- exportEntryReference
type: object
AccountingAccountTypeDto:
enum:
- OTHER
- SUPPLIER
- CLIENT
- EXPENSE
- PRODUCT
- VAT
- BANK
type: string
ErrorDto:
additionalProperties: false
description: Describes a single error when failing to import a bank journal entry in the client accounting system.
properties:
errorMessage:
description: Optional error message
type:
- string
- 'null'
errorType:
allOf:
- $ref: '#/components/schemas/ErrorTypeDto'
description: Mandatory error type
required:
- errorType
type: object
ErrorTypeDto:
description: Describes the types of errors when failing to import a bank journal entry in the client accounting system.
enum:
- UNKNOWN_JOURNAL_CODE
- UNKNOWN_ACCOUNTING_ACCOUNT
- UNKNOWN_THIRD_PARTY
- UNKNOWN_ANALYTICAL_CODE
- OTHER
type: string
BankJournalExportSummaryDto:
additionalProperties: false
description: A bank journal export description.
properties:
exportDateUtc:
description: The export date-time in UTC format
example: '2024-10-28T14:30:59.999Z'
type: string
exportId:
description: Unique ID of the export.
example: 31dee215-e458-4145-8fe8-c20a0ea06042
format: uuid
type: string
exportIndexInYear:
description: The index of the bank journal export in the `ExportYear` (index starting at 1)
example: 12
format: int32
type: integer
exportYear:
description: The year the export was done
example: 2024
format: int32
type: integer
indexInYearOfFirstEntryInBankJournal:
description: 'The index in `ExportYear` of the first entry in the bank journal export (index
starting at 1)'
example: 105
format: int32
type: integer
indexInYearOfLastEntryInBankJournal:
description: 'The index in `ExportYear` of the last entry in the bank journal export (index
starting at 1)'
example: 120
format: int32
type: integer
numberOfEntries:
description: The number of entries in the bank journal export
example: 16
format: int32
type: integer
required:
- exportDateUtc
- exportId
- exportIndexInYear
- exportYear
- indexInYearOfFirstEntryInBankJournal
- indexInYearOfLastEntryInBankJournal
- numberOfEntries
type: object
CursorDto:
additionalProperties: false
description: 'The cursor current state as returned after a query.
Both after and before values are ISO 8601 date/time in UTC in this format: 2024-10-28T14:30:00.123Z.'
properties:
after:
description: The export date in UTC of the newest returned bank journal export (only if the request specified the after parameter
example: '2024-11-01T09:45:00.000Z'
type:
- string
- 'null'
before:
description: The export date in UTC of the oldest returned bank journal export (only if the request specified the before parameter
example: '2024-10-28T14:30:59.999Z'
type:
- string
- 'null'
size:
description: The number of exported bank journals returned (might be different from the requested size)
example: 100
format: int32
type: integer
required:
- size
type: object
MarkAsNotImportedRequest:
additionalProperties: false
description: Request to indicate Agicap that some exported bank journal entries from Agicap were not correctly imported in the client accounting system.
properties:
entriesNotImported:
description: The list of bank journal entries not imported in the client accounting system with their errors description (max 1000 entries)
items:
$ref: '#/components/schemas/NotImportedEntryDto'
type: array
required:
- entriesNotImported
type: object
ExportedCounterpartDto:
additionalProperties: false
description: A bank journal entry counterpart
properties:
accountingAccountExternalId:
description: An optional ERP-specific external identifier for the accounting account
type:
- string
- 'null'
accountingAccountNumber:
description: The accounting account number
type: string
accountingAccountType:
allOf:
- $ref: '#/components/schemas/AccountingAccountTypeDto'
description: The accounting account type (OTHER, SUPPLIER, CLIENT, EXPENSE, PRODUCT, VAT, BANK)
accountingCurrency:
description: The accounting currency ISO code on three uppercase letters (ISO4217 standard)
type:
- string
- 'null'
analyticalCodes:
additionalProperties:
type: string
description: The list of analytical codes of the counterpart
type: object
creditInAccountingCurrency:
description: Credit value in accounting currency (rounded to four decimals)
format: double
type:
- number
- 'null'
creditInOriginalCurrency:
description: Credit value in original currency (rounded to four decimals)
format: double
type:
- number
- 'null'
customFields:
description: Additional fields coming from the reconciled expected used to initialize the counterpart, they include the ERP identification fields from business document when imported in Agicap
items:
$ref: '#/components/schemas/CustomFieldDto'
type:
- array
- 'null'
debitInAccountingCurrency:
description: Debit value in accounting currency (rounded to four decimals)
format: double
type:
- number
- 'null'
debitInOriginalCurrency:
description: Debit value in original currency (rounded to four decimals)
format: double
type:
- number
- 'null'
document:
allOf:
- $ref: '#/components/schemas/DocumentDto'
description: Document related (invoice, credit note, purchase order, etc) information (reference, original due date, type)
exchangeRate:
description: The exchange rate applied between the original currency amount and the accounting currency amount (rounded to six decimals). Null when the rate is not applicable (e.g., synthetic exchange gain/loss counterpart, or when the original amount is zero).
format: double
type:
- number
- 'null'
journalCode:
description: The journal code
type:
- string
- 'null'
linkedExportedEntry:
allOf:
- $ref: '#/components/schemas/LinkedExportedEntryDto'
description: Reference to a previously exported journal entry linked to this counterpart (used for ERP reconciliation)
name:
description: The counterpart name (title)
type: string
originalCurrency:
description: The original currency ISO code on three uppercase letters (ISO4217 standard)
type: string
taxKey:
description: Tax Key (only relevant for Vat accounting account)
type:
- string
- 'null'
thirdPartyCode:
description: The third party code
type:
- string
- 'null'
thirdPartyExternalId:
description: An optional ERP-specific external identifier for the third party
type:
- string
- 'null'
thirdPartyName:
description: The third party name
type:
- string
- 'null'
required:
- accountingAccountNumber
- accountingAccountType
- analyticalCodes
- name
- originalCurrency
type: object
ExportResponse:
additionalProperties: false
description: Export response
properties:
bankJournalExportIndexInYear:
description: The index of the bank journal export in the current year
format: int32
type: integer
entityName:
description: Name of the entity
type: string
entries:
description: List of all entries in the bank journal export
items:
$ref: '#/components/schemas/ExportedBankJournalEntryDto'
type: array
exportId:
description: The identifier of the export as specified in the request
format: uuid
type: string
year:
description: Current year in UTC when the bank journal has been exported
format: int32
type: integer
required:
- bankJournalExportIndexInYear
- entityName
- entries
- exportId
- year
type: object
MarkAsImportedRequest:
additionalProperties: false
description: Request to indicate Agicap that some exported bank journal entries from Agicap were successfully imported in the client accounting system.
properties:
entriesImported:
description: The list of bank journal entries imported in the client accounting system (max 1000 entries)
items:
$ref: '#/components/schemas/ImportedEntryDto'
type: array
required:
- entriesImported
type: object
NotImportedEntryDto:
additionalProperties: false
description: Describes all the errors that occured when failing to import a bank journal entry in the client accounting system.
properties:
entryAgicapUniqueId:
format: uuid
type: string
errors:
items:
$ref: '#/components/schemas/ErrorDto'
type: array
required:
- entryAgicapUniqueId
- errors
type: object
ProblemDetails:
additionalProperties: false
properties:
detail:
type:
- string
- 'null'
instance:
type:
- string
- 'null'
status:
format: int32
type:
- integer
- 'null'
title:
type:
- string
- 'null'
type:
type:
- string
- 'null'
type: object
securitySchemes:
bearerAuth:
bearerFormat: OPAQUE
scheme: bearer
type: http
bearer_client_credentials:
description: 'Client credentials: bearer'
flows:
clientCredentials:
scopes:
agicap:public-api: ''
tokenUrl: https://myaccount.agicap.com/connect/token
type: oauth2