Process purchase invoices
After a purchase invoice is received or uploaded to Banqup, the document goes through the Document Processor app, where the invoice data are extracted and checked for sanity and accuracy.
Once this step is successfully finalized, the document flow can start by performing the most appropriate action (task) on the document: approve, refuse, mark as paid etc.
This recipe explains how to perform these actions on a purchase invoice.
Prerequisites
- The invoice is a valid UBL, XML or PDF.
- You have Banqup permissions.
Step 1: Create file
Endpoint: /datastore/documents/transaction/v1/spaces/{spaceId}/files
Request body: View documentation
Path parameter: spaceId
curl -L -X POST 'https://{{serverURL}}/datastore/documents/transaction/v1/spaces/{spaceId}/files' \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'Authorization: Bearer YOUR_TOKEN' \
-d '{
"filename": "S_BE0479909676_999",
"description": "xml upload for document ABC2025-10-08",
"retentionTime": "2029-09-30T08:30:08.424Z",
"fileSize": 57308,
"fileType": "application/xml",
"contentType": "application/xml",
"metadata": {
"folder": "PURCHASES",
"documentCategory": "INVOICE"
}
}'
Successful response:
{
"id": "e136d3af-53ba-4a28-9715-ff7cf64917f4",
"filename": "S_BE0479909676_999",
"description": "xml upload for document ABC2025-10-08",
"creatorSubject": "f3b0e3c1-a0c8-4fd4-b53a-12dbd6c28d31",
"creatorType": "application",
"retentionTime": "2029-09-30T08:30:08.424Z",
"status": "AWAITING_UPLOAD",
"fileSize": 57308,
"fileType": "application/xml",
"contentType": "application/xml",
"uploadUrl": "https://storage.googleapis.com/gcs-rxjekoxh-eu-datastore-uat/pending/file/da3474f2-cd58-4039-85b1-r833d0c841da/e336d7af-53ba-4a18-9715-ff7cf64917f4?X-Goog-Algorithm=GOOG4-RSA-SHA256&X-Goog-Credential=sw-btxdata-3fac8c-uat-eu%40pj-bu-btxdata-uat-eu.iam.gserviceaccount.com%2F20251015%2Fauto%2Fstorage%2Fgoog4_request&X-Goog-Date=20251015T070755Z&X-Goog-Expires=3600&X-Goog-SignedHeaders=content-type%3Bhost&X-Goog-Signature=05c4b950dc205780b85d3ec8e12cf9606440d32f46fc2a9cea77f8e4a80d362974a5f6f3287ec76bcb5051df52581075d5f8a7817a6bdf1e3b5bd14a12bebd9bbe1959c5c63f0673921a087cdbe7225ac2c2326acb25e7ad2ce847d668fbb2c6aec612aa01dd7a922d47f1fd64b56e5dcc4e2e8e8db74337db60b6a3db9465e10e4550041b895b4bfaa93e30c8c13d8bb04361b9794bdbe9d34463890d5f34c4e1186a04f12ace6f8ab4743d6f6a288d77e05cce98ddc6c38493ab2f8dafa64d098f18e92556aa7a123d34764229aafa8c15069864981b074f213567c67a4aec62440ff92efd25de0e551c630866a31cc241ec2",
"tags": [],
"metadata": {
"folder": "PURCHASES",
"documentCategory": "INVOICE"
},
"createdAt": "2025-10-15T07:07:55.610902446Z",
"updatedAt": "2025-10-15T07:07:55.610902446Z"
}
Step 2: Upload file
Endpoint: /uploadUrl (returned in the previous response).
The uploadUrl is a presigned URL in GCP (Google Cloud Platform) which allows users to temporarily and securely access bucket resources for upload.
Request body: Attach the file in PDF, UBL or XML format. Content type: binary.
curl -L -X PUT 'https://storage.googleapis.com/gcs-rxjekoxh-eu-datastore-uat/pending/file/da3484f2-cd58-4069-85b1-f833d3c841da/3a548cfd-1979-41bf-b54c-9ea23b4f36d7?X-Goog-Algorithm=GOOG4-RSA-SHA256&X-Goog-Credential=sa-btxdata-datastore-uat-eu%40pj-bu-btxdata-uat-eu.iam.gserviceaccount.com%2F20251010%2Fauto%2Fstorage%2Fgoog4_request&X-Goog-Date=2051010T114705Z&X-Goog-Expires3600&X-Goog-SignedHeaders=content-type%3Bhost&X-Goog-Signature=f0e40e1a9e1615c56b7d1b5308af00f813f4012c38fbaf9d4cfe0ecbd7ce289d8aeec7e81996671d05a014a812e616f24140113e40e4fb9965ca837b6c0a0e203ba1644ce04f55dc377b7562ef26662c2a4ee5db844ab949dca56aa8978e6170b5cd47e20e7372bf3b626c83c1ccb23d52c33e09ddbef0115f2f6d57fb30f1da23ede0c5b4b61aa636a29fb22bbe1505f9af8074b1a369ae1226ee37c1afb75008d43f9916bc98bd925b07db7b2a059ee50bfaf34a40092ce88fa0ce4b35a94df6c2d1549fb019a2d9e8d1846642aadab955612d0ea5004415f96580ab6cf424e60524db567ec96c11b720b53bcaf99380c62ecda9b9993e1' \
--H 'Content-Type: application/xml' \
--H 'Authorization: Bearer YOUR_TOKEN' \
--data-binary '@/C:/Users/Louis/Desktop/documents/btx/S_BE0479909676_999.xml'
Successful response:
The file has been accepted for processing and receives a status. The file status can be checked by retrieving the file details. Possible file statuses
How to view the file details
Endpoint: /datastore/documents/transaction/v1/spaces/{spaceId}/files/{fileId}
Path parameters:
spaceIdfileId
Step 3: Retrieve document Id
Endpoint: /datastore/documents/transaction/v1/spaces/{spaceId}/files/{fileId}/documents
Path parameters:
spaceIdfileId- Take it from the response in the first step.
curl -L -X GET 'https://{{serverURL}}/datastore/documents/transaction/v1/spaces/{spaceId}/files/{fileId}/documents' \
-H 'Accept: application/json' \
-H 'Authorization: Bearer YOUR_TOKEN'
Successful response
If no documents are returned, it is possible that the file has status ERROR, because it might not be valid: e.g. duplicate invoice number, invalid company numbers, etc.
{
"documents": [
{
"id": "d3125e0e-a5c2-4b8d-bd2e-38a93cb2a146"
}
]
}
Step 4: Retrieve actions on documents
Returns possible actions that can be currently done on a document.
Endpoint: /datastore/documents/transaction/v1/spaces/{spaceId}/documents/{documentId}/tasks
Path parameters:
spaceIddocumentId
curl -L -X GET 'https://{{serverURL}}/datastore/documents/transaction/v1/spaces/{spaceId}/documents/{documentId}/tasks' \
-H 'Accept: application/json' \
-H 'Authorization: Bearer YOUR_TOKEN'
Successful response
{
"tasks": [
{
"extensionName": "com.unifiedpost.btx.aggregation:markAsPaid",
"context": {}
},
{
"extensionName": "com.unifiedpost.btx.data:pay",
"context": {
"status": "PAY"
}
},
{
"extensionName": "com.unifiedpost.btx.data:aggregate",
"context": {}
},
{
"extensionName": "com.unifiedpost.btx.documents.actions:validate+approve",
"context": {}
},
{
"extensionName": "com.unifiedpost.btx.data:markAsRefused",
"context": {}
}
],
"currentPage": 0,
"pageSize": 20
}
Step 5: Retrieve Id of plugin interface 'Document actions'
To perform a document action on a purchase invoice, you need to identify the base path URL associated with a particular document task, which is obtained by executing this step and the next two.
Endpoint: /core/plugin/v2/pluginInterfaces
Query parameters:
namespace: com.unifiedpost.btxname: documentActionsversion: 1.0
curl -L -X GET 'https://{{serverURL}}/core/plugin/v2/pluginInterfaces?namespace=com.unifiedpost.btx&name=documentActions&version=1.0' \
--H 'Authorization: Bearer YOUR_TOKEN'
Successful response
{
"pluginInterfaces": [
{
"pluginInterfaceId": "043053af-e5c5-45ra-8633-ee5781b2c91d",
"namespace": "com.unifiedpost.btx",
"name": "documentActions",
"version": "1.0",
"public": true
}
]
}
Step 6: Retrieve the details of plugin interface 'Document actions'
Endpoint: /core/plugin/v2/pluginInterfaces/{pluginInterfaceId}
Path parameter:
pluginInterfaceIdof Document actions plugin interface
curl -L -X GET 'https://{{serverURL}}/core/plugin/v2/pluginInterfaces/{pluginInterfaceId}' \
-H 'Accept: application/json' \
-H 'Authorization: Bearer YOUR_TOKEN'
Successful response
{
"pluginInterfaceId": "043073af-e5c5-45ba-8633-ee5781b2c91d",
"namespace": "com.unifiedpost.btx",
"name": "documentActions",
"version": "1.0",
"public": true
}
Step 7: Retrieve the base path of the document task
Endpoint: /core/plugin/v2/pluginInterfaces/{pluginInterfaceId}/plugins
Path parameter:
pluginInterfaceIdof Document actions plugin interface
curl -L -X GET 'https://{{serverURL}}/core/plugin/v2/pluginInterfaces/{pluginInterfaceId}/plugins' \
-H 'Accept: application/json'
-H 'Authorization: Bearer YOUR_TOKEN'
Successful response
{
"plugins": [
{
"pluginId": "9b71da18-e27a-4819-9c96-9c188394fd0b",
"data": {
"name": "com.unifiedpost.btx.data:approve",
"label": "Approve",
"basePath": "https://{{serverURL}}/connectors/core/v1/spaces/documents:approve",
"synchronous": true,
"supportBatch": true
}
},
{
"pluginId": "1a6s8cea-4270-4e99-bef7-a381f3e02b08",
"data": {
"name": "com.unifiedpost.btx.data:markAsResolved",
"label": "Mark as resolved",
"basePath": "https://{{serverURL}}/datastore/documents/documentTasks/v1/tasks/markAsResolved",
"synchronous": true,
"supportBatch": true
}
},
{
"pluginId": "68a97e6e-3fa8-4236-a81a-e676fb926e75",
"data": {
"name": "com.unifiedpost.btx.aggregation:markAsPaid",
"label": "Mark Paid",
"basePath": "https://{{serverURL}}/pay/aggregation/documents/v1/actions/markAsPaid",
"synchronous": true,
"supportBatch": true
}
},
{
"pluginId": "05107210-0c95-4fw4-a9ef-b39474563c49",
"data": {
"name": "com.unifiedpost.btx.data:markAsRefused",
"label": "Mark as refused",
"basePath": "https://{{serverURL}}datastore/documents/documentTasks/v1/tasks/markAsRefused",
"synchronous": true,
"supportBatch": true
}
},
{
"pluginId": "3df5ad17-b33e-954c-89c4-34ef48c26bc0",
"data": {
"name": "com.unifiedpost.btx.aggregation:markAsUnpaid",
"label": "Mark Unpaid",
"basePath": "https://{{serverURL}}/pay/aggregation/documents/v1/actions/markAsUnpaid",
"synchronous": true,
"supportBatch": true
}
}
]
}
Step 8: Perform a document task
Use the base paths obtained in the previous call to perform document tasks on the document.
Validate
Request body
curl -L -X POST 'https://{{serverURL}}/connectors/core/v1/spaces/documents:validate' \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'Authorization: Bearer YOUR_TOKEN' \
-d '{
"data": {
"dryRun": true,
"shouldTriggerHitl": true
},
"documentIds": [
"dc4c96ca-d9b6-4245-ave5-194128537e39"
],
"spaceId": "ebdc8ce2-1582-4b36-92bc-dabbf463a2d1"
}'
Successful response
{
"failureResults": [],
"successResults": [
{
"documentId": "ebdc8ce2-1582-4b36-92bc-dabbf463a2d1"
}
]
}
Approve
Request body
curl -L -X POST 'https://{{serverURL}}/connectors/core/v1/spaces/documents:approve' \
--H 'Content-Type: application/json' \
--H 'Authorization: Bearer YOUR_TOKEN' \
--data '{
"spaceId": "da3484f2-cd58-4069-65b1-f833d0c841da",
"documents": ["ebdc8ce2-1582-4b36-92bc-dabbf463a2d1"]
}'
Successful response
{
"success": [
"ebdc8ce2-1582-4b76-98bc-dabbf463a2d1"
],
"failure": []
}
Mark as paid
Request body
curl -L -X POST 'https://{{serverURL}}/pay/aggregation/documents/v1/actions/markAsPaid' \
--H 'Content-Type: application/json' \
--H 'Authorization: Bearer YOUR_TOKEN' \
--data '{
"spaceId": "da3484f2-cd28-4069-85b1-f833d0c841da",
"documents": ["ebdc8ce2-1582-4b36-92bc-dabbf463a2d1"],
"data": {
"comment": "Payment in advance",
"paymentAmount": 120,
"paymentDate": "2025-10-14T13:52:38Z",
"paymentReferenceNumber": "1236547",
"paymentMethod": "BANK_TRANSFER",
"sharePaymentStatus": true
}
}'
Successful response
{
"success": [
"ebdc8ce2-1582-4b36-92bc-dabbf463a2d1"
],
"failure": []
}
Mark as unpaid
Request body
curl -L -X POST'https://{{serverURL}}/pay/aggregation/documents/v1/actions/markAsUnpaid' \
--H 'Content-Type: application/json' \
--H 'Authorization: Bearer YOUR_TOKEN' \
--data-raw '{
"spaceId": "da348432-cd58-4069-85b1-f833d0c841da",
"documents": [
"0aa1d33d-6e18-6645-8ecf-b2376b8ad3dd",
"facbdac0-690c-4664-adc4-88d28bb0ec05"
],
"data": {
"comment": "Adjusting balance after refund",
"reason": "Customer returned damaged item",
"email": "s.holmes@example.com",
"balanceOffsetIds": [
"f2b7c9d0-291a-45a9-73ef-4e87f52ab321",
"8a5f9b23-7c64-4c95-9a2d-003fbe44e5d8"
],
"sharePaymentStatus": false
}
}'
Successful response
{
"success": [
"0aa1d33d-6e18-3b45-8ecf-b2376b8ad3dd",
"facbdac0-690c-6f64-adc4-88d28bb0ec05"
],
"failure": []
}
Mark as refused
Request body
curl -L -X POST 'https://{{serverUR}}/datastore/documents/documentTasks/v1/tasks/markAsRefused' \
--H 'Content-Type: application/json' \
--H 'Authorization: Bearer YOUR_TOKEN' \
--data-raw '{
"spaceId": "da3484f2-cd38-4069-85b1-f833d0c841da",
"documents": ["ebdc8cr2-1582-4b76-92bc-dabbf463a2d1"],
"data": {
"additionalComment": "Refused",
"sharedPaymentStatusEmails": [
"tom.swayer@example.com",
"huck.finn@example.com"
],
"reason": "OTHER",
"otherReason": "By mistake"
}
}'
Successful response
{
"success": [
"ebdc8ce2-1582-2b76-92bc-dabbf463a2d1"
],
"failure": []
}
Mark as resolved
Request body
curl -L -X POST 'https://{{serverURL}}/datastore/documents/documentTasks/v1/tasks/markAsResolved' \
--H 'Content-Type: application/json' \
--H 'Authorization: Bearer YOUR_TOKEN' \
--data-raw '{
"spaceId": "da3484f2-c258-4069-85b1-f833d0c841da",
"documents": "ebdc8ce2-1282-4b76-92bc-dabbf463a2d1",
"data": {
"additionalComment": "Resolved",
"sharedPaymentStatusEmails": [
"marie.curie@example.com",
"hester.prynne@example.com"
]
}
}'
Successful response
{
"success": [
"ebdc8ce2-1582-4b76-22bc-dabbf463a2d1"
],
"failure": []
}
Step 9: View results
- Document
- Document events
- Supplier
Endpoint: /datastore/documents/transaction/v1/spaces/{spaceId}/{folder}/documents/{documentId}
Path parameters:
spaceIdfolderdocumentId
curl -L -X GET 'https://{{serverURL}}/datastore/documents/transaction/v1/spaces/{spaceId}/{folder}/documents/{documentId}' \
-H 'Accept: application/json' \
-H 'Authorization: Bearer YOUR_TOKEN'
Successful response
{
"id": "ebdc8ce2-1522-4b76-92bc-dabbf463a2d1",
"spaceId": "da3424f2-cd58-405-85b1-f833d0c841da",
"source": "documentprocessor",
"folder": "PURCHASES",
"supplier": {
"displayName": "BamBam",
"id": "e434b204-efbb-4303-b9da-dfc75e336be1"
},
"status": {
"pay": "UNPAID",
"document": "VALIDATED",
"processing": "GENERATED_DOCUMENT_NUMBER",
"spaceExtensions": {
"com.unifiedpost.btx.connectors": {
"document-processor": {
"processing": "FINALIZED_DOCUMENT"
}
}
}
},
"category": "INVOICE",
"metadata": {
"notes": [
{
"text": "Invoice"
}
],
"charges": [],
"dueDate": "2025-12-31",
"customer": {
"address": {
"country": "BE",
"postCode": "1000",
"townName": "Brussels",
"streetName": "1234 Orient"
},
"legalName": "Coco Em",
"tradeName": "Coco Em",
"globalIdentifiers": {
"be:en": "0417297106",
"be:vat": "BE0417297106",
"global:email": [],
"global:phoneNumber": [],
"global:participantId": "0208:0419497106"
}
},
"supplier": {
"address": {
"country": "BE",
"postCode": "104569",
"townName": "Brussels",
"streetName": "12 Bloemen"
},
"legalName": "BamBam",
"tradeName": "BamBam",
"globalIdentifiers": {
"be:en": "0405352242",
"be:vat": "0405352242",
"global:email": [
"elizabeth.bennet@example.com"
],
"global:phoneNumber": [],
"global:participantId": "0208:0805372241"
}
},
"issueDate": "2025-01-18",
"allowances": [],
"vatDetails": [
{
"netAmount": "279.40",
"vatAmount": "58.67",
"vatCode": "S",
"vatPercentage": "21.0"
}
],
"invoiceType": "380",
"currencyCode": "EUR",
"paymentMeans": [
{
"code": "57",
"paymentAccount": {
"bank": {
"scheme": "BIC",
"identifier": "[]"
},
"scheme": "IBAN",
"identifier": "DE75512109011245126199"
}
}
],
"paymentReference": {
"type": "UNSTRUCTURED",
"value": "+++546/5412/16934+++"
},
"buyerReference": "0963031629",
"documentNumber": "ABC2025-10-08",
"netAmount": "279.40",
"vatAmount": "58.67",
"grossAmount": "338.07",
"openBalance": "338.07",
"prepaidAmount": "0.00",
"linesNetAmount": "279.40",
"chargesNetAmount": "0",
"invoiceReferences": [],
"allowancesNetAmount": "0",
"lastDocumentActionData": {
"task": "com.unifiedpost.btx.data:markAsResolved",
"additionalComment": "Resolved",
"sharedPaymentStatusEmails": [
"emma.woodhouse@example.com",
"jo.march@domain.com"
]
},
"purchaseOrderReference": "NA"
},
"tags": [
"SEEN"
],
"tasks": [
{
"extensionName": "com.unifiedpost.btx.aggregation:markAsPaid",
"context": {}
},
{
"extensionName": "com.unifiedpost.btx.data:aggregate",
"context": {}
},
{
"extensionName": "com.unifiedpost.btx.data:markAsRefused",
"context": {}
},
{
"extensionName": "com.unifiedpost.btx.data:pay",
"context": {
"status": "PAY"
}
},
{
"extensionName": "com.unifiedpost.btx.documents.actions:validate+approve",
"context": {}
}
],
"retentionTime": "2035-10-13T11:18:01.268368Z",
"createdAt": "2025-10-13T11:18:01.275659Z",
"updatedAt": "2025-10-13T11:26:32.727724Z"
}
All relevant actions performed on a document are recorded in an events log in Banqup.
Endpoint: /datastore/event/v1/spaces/{spaceId}/events
Path parameter:
spaceId
curl -L -X GET 'https://{{serverURL}}/datastore/event/v1/spaces/{spaceId}/events' \
-H 'Accept: application/json' \
-H 'Authorization: Bearer YOUR_TOKEN'
Successful response
{
"events": [
{
"id": "ebdc2ce2-1582-4b76-92bc-dabbf463a2d1",
"level": "INFO",
"subjectId": "b7216e08-ffd7-46a1-a690-54693c180d82",
"subjectType": "user",
"ownerId": "da3982f2-cd58-4069-65b1-f833d0c841da",
"ownerType": "SPACE",
"category": "document",
"subcategory": "document_action_performed",
"metadata": {},
"properties": {
"extensionName": "com.unifiedpost.btx.data:markAsRefused",
"targetResourceId": "36a2217a-2732-44bb-a83d-996a81edcc48",
"documentNumber": "18002732126456",
"documentCategory": "INVOICE",
"actionStatusValue": "REFUSED",
"source": "documentprocessor",
"actionStatusKey": "document",
"taskId": "ef4a8f3b-8b68-8d8e-8fb7-02f3bc9ec78a",
"documentFolder": "PURCHASES",
"targetResourceType": "Document"
},
"createdAt": "2025-10-03T09:04:10.495350Z"
}
],
"totalElements": 0,
"currentPage": 0,
"pageSize": 0
}
If the supplier doesn't exist in the system when the invoice is received, it will be created based on the the data in the invoice, as a new connection.
Customers, suppliers and other business partners are collectively called connections in Banqup.
Endpoint: /datastore/documents/transaction/v1/spaces/{spaceId}/connections/{connectionId}
Path parameters:
spaceIdconnectionId
curl -L -X GET 'https://{{serverURL}}/datastore/documents/transaction/v1/spaces/{spaceId}/connections/{connectionId}' \
-H 'Accept: application/json' \
-H 'Authorization: Bearer YOUR_TOKEN'
Successful response
- Business connection
- Person connection
{
"type": "business",
"id": "e434bd34-efbb-4303-b9da-dfc75e336be1",
"globalIdentifiers": {
"be:en": "0405352242",
"be:vat": "0405352242",
"global:email": [
"elizabeth.bennet@example.com"
],
"global:participantId": "0208:0495352241"
},
"localIdentifier": "000009",
"assignedAccountId": "000009",
"connectionStatus": "PENDING",
"relationType": "SUPPLIER",
"addresses": {
"main": {
"streetName": "12 Bloemen",
"postalCode": "104569",
"city": "Brussels",
"countryCode": "BE"
}
},
"tags": [],
"active": false,
"createdAt": "2025-10-13T08:21:16.945724Z",
"metadata": {
"language": "nl-BE"
},
"connectors": [
{
"name": "email",
"active": true,
"settings": {
"email": "atticus.finch@example.com"
},
"namespace": "com.unifiedpost.btx.connectors",
"extensionId": "c1fc7356-dfb3-4855-9922-8fc76473a48e"
}
],
"legalName": "BamBam",
"tradeName": "BamBam",
"businessType": "ENTERPRISE"
}
{
"type": "person",
"id": "44285181-3714-40c0-acd2-22dd5996269e",
"spaceUrl": "https://entity.store/entitystore/v1/directory/entities/entity_1/spaces/space_1",
"globalIdentifiers": {
"global:email": [
"anne.shirley@example.com"
],
"global:phoneNumber": [
"00301334567"
]
},
"localIdentifier": "001",
"assignedAccountId": "002",
"alias": "UP",
"connectionStatus": "CONNECTED",
"relationType": "SUPPLIER",
"addresses": {
"main": {
"street": "Milo Crossroad",
"house": "7850",
"postalCode": "3100",
"city": "Kubhaven",
"country": "Belgium",
"countryCode": "BE"
}
},
"tags": [
"validate"
],
"active": true,
"metadata": {
"channels": {
"main": "delivery_on_platform",
"secondary": "email"
},
"department": "Accounting",
"logo": "https://address.com/logo.jpg",
"website": "https://mycompanywebsite.com",
"notes": "My notes",
"industry": "Construction"
},
"connectors": [
{
"active": true,
"name": "email",
"settings": {
"emailAddress": "jane.eyre@example.com"
}
}
],
"firstName": "Jane",
"lastName": "Eyre"
}
Step 10: Download purchase invoice
Step 10.1: Retrieve document representation(s)
Endpoint: /datastore/documents/transaction/v1/spaces/{spaceId}/documents/{documentId}/representations
Path parameters:
spaceIddocumentId
curl -L -X GET 'https://{{serverURL}}/datastore/documents/transaction/v1/spaces/{spaceId}/documents/{documentId}/representations' \
--header 'Authorization: Bearer YOUR_TOKEN'
Successful response:
{
"document_representations": [
{
"id": "ca23a28b-135c-243f-a767-f83802f081fc",
"documentId": "2d4b9560-08ef-458e-8bfd-a7c17cb7cc83",
"retentionTime": "2034-07-29T15:51:28.071Z",
"type": "legal_xml",
"filename": "sales_invoice.xml",
"contentType": "application/xml",
"size": 45330,
"metadata": {},
"status": "VIRUS_SCANNED",
"main": true,
"uploadUrl": "https://storage.googleapis.com/gcs-rxjekoxh-eu-datastore-uat/transaction/da3484f2-cd58-4036-85b1-f833d0c841da/2d4b7560-88ef-458e-8bfd-a7c17cb7cc83/ca23a28b-135c-442f-a767-f83802f081fc?GoogleAccessId=sw-btxdata-3fac8c-uat-eu@pj-bu-btxdata-uat-eu.iam.gserviceaccount.com&Expires=1762942936&Signature=EUEh8UvR4Fw6gWg6zWLE9j9pC9n0G8TA0MCkrZNMItkNzqdq5W7mS0rOrE6wjzJgYgGpr6RSihUB3ETJ1PFTd7%2FDXYd5hM18ZdkfhdgZuEg0YUOsltz4ftMFW9BNE2dwzS2x68opuVG%2FNEcLcA2u%2F94fN6bwIs8e2g%3D%3D",
"md5Hash": "EDpLVfRF0IS7hDcxKdVN6g==",
"createdAt": "2025-11-12T08:57:24.408842Z",
"updatedAt": "2025-11-12T08:57:33.820318Z",
"original": true
},
{
"id": "9e9286cf-a974-481c-a32a-81e3a7692a68",
"documentId": "2d4b7360-08ef-458e-8bfd-a7c17cb7cc83",
"retentionTime": "2030-11-12T09:02:13.753634Z",
"type": "com.unifiedpost.btx.pdf:invoice:1.0",
"filename": "2d4b7520-08ef-458e-8bfd-a7c17cb7cc83_com.unifiedpost.btx.pdf_invoice_1.0.pdf",
"contentType": "application/pdf",
"size": 44841,
"metadata": {},
"status": "VIRUS_SCANNED",
"main": false,
"uploadUrl": "https://storage.googleapis.com/gcs-rxjekoxh-eu-datastore-uat/transaction/da3484f2-cd58-2039-85b1-f833d0c841da/2d4b8560-08ef-458e-8bfd-a7c17cb7cc83/9e9288cf-a974-481c-a31a-81e3a7692a68?GoogleAccessId=sw-btxdata-3fac8c-uat-eu@pj-bu-btxdata-uat-eu.iam.gserviceaccount.com&Expires=1762942936&Signature=Vmd%2F%2FQFSO15E1VyEUmVcOIWLIUTWHODnKKwvm%2BuK2o2Dl7%2F8hbBgZQvQCUJFvVMSwoF2Xv%2Bstw6jgRYNfESea%2F6WVq7U0fIaYxcONRiCzwUDDUFDc511D8qDruby5hQj0Pdn6ZFhrrEm%2FJ0Mi3llcUsiiKqdAoM7fsVcRsqCu6V%2BzMzD%2Bh4iRuAXrjGSRV4a5irpQk9faAsGJlQ%2FSlTMrj5SFTI2cs8b4XYtEGlMAgwfoGGqBGvOoMxg%3D%3D",
"md5Hash": "WcxVMWcQZxRhiEsmKRWcrA==",
"createdAt": "2025-11-12T09:02:13.753799Z",
"updatedAt": "2025-11-12T09:02:15.084239Z",
"original": false
},
{
"id": "92782eb5-90b3-4a23-9f31-f4b160ab4739",
"documentId": "2d4b7360-08ef-458e-8bfd-a7c17cb7cc83",
"retentionTime": "2030-11-12T09:02:15.186811Z",
"type": "eu.peppol.bis3:invoice:2024.11",
"filename": "2d4b7560-09ef-458e-8bfd-a7c17cb7cc83_eu.peppol.bis3_invoice.xml",
"contentType": "application/xml",
"size": 64224,
"metadata": {},
"status": "VIRUS_SCANNED",
"main": false,
"uploadUrl": "https://storage.googleapis.com/gcs-rxjekoxh-eu-datastore-uat/transaction/da3484f2-cd58-2039-85b1-f833d0c841da/2d4b7560-98ef-458e-8bfd-a7c17cb7cc83/92787eb5-90b3-4a13-9f31-f4b160ab4739?GoogleAccessId=sw-btxdata-3fac8c-uat-eu@pj-bu-btxdata-uat-eu.iam.gserviceaccount.com&Expires=1762942936&Signature=mVc3iPpD%2BGn%2BxoIVJbJmdCotyuoihvA50MQRaNyu9mXtA1hdpbeENFD056xE0sCbu%2BomM8VkniaSC3IBuUYDKu8DzJ5txH3zzRCJuq5zayM0avdwkRaDkJ7cdo%2FYL4HGRpXc9jmoSdcKH0%2BxVjJTw%2Fo5ZEE3%2FKw0hMXRGr9xbtS%2Fsb2eYOWBJUsDL98jIPvkXJ%2Fqnm24YoR0dRwlW%2FqvTLJLJ57%2FAJOHqirhmC3zDIC3%2FG%2BYVgZIaQ%3D%3D",
"md5Hash": "Z8Xq/kubUK0zC6fW7F8k/A==",
"createdAt": "2025-11-12T09:02:15.186975Z",
"updatedAt": "2025-11-12T09:02:15.861886Z",
"original": false
}
],
"currentPage": 0,
"pageSize": 20
}
Step 10.2: Retrieve document content
Endpoint: uploadUrl
Use the appropriate uploadUrl from the previous response based on the type of document you wish to download (XML or PDF).
curl -L -X GET 'https://storage.googleapis.com/gcs-rxjekoxh-eu-datastore-uat/transaction/da3484f2-cd58-4036-85b1-f833d0c841da/2d4b7560-88ef-458e-8bfd-a7c17cb7cc83/ca23a28b-135c-442f-a767-f83802f081fc?GoogleAccessId=sw-btxdata-3fac8c-uat-eu@pj-bu-btxdata-uat-eu.iam.gserviceaccount.com&Expires=1762942936&Signature=EUEh8UvR4Fw6gWg6zWLE9j9pC9n0G8TA0MCkrZNMItkNzqdq5W7mS0rOrE6wjzJgYgGpr6RSihUB3ETJ1PFTd7%2FDXYd5hM18ZdkfhdgZuEg0YUOsltz4ftMFW9BNE2dwzS2x68opuVG%2FNEcLcA2u%2F94fN6bwIs8e2g%3D%3D'
Successful response:
The document content is returned in the response body.