Skip to main content

Upload via REST API

Use the REST API to send files from your application and get an upload ID back at once. Each destination page says whether the destination supports REST upload.

Requests use JSON and require a bearer token. Select the base URL for your environment and set the destination country in the request.

Base URLs​

EnvironmentBase URL
Productionhttps://transfer.api.acubeapi.com
Sandboxhttps://transfer-sandbox.api.acubeapi.com

The tracking API uses the same base URLs.

For complete examples, follow UBL JSON to KSeF or CSV to SdI: authenticate, upload, check processing, handle errors and follow the tax authority outcome.

Token​

Get a token with your A-Cube account credentials. Tokens are valid for 24 hours.

curl -s https://common.api.acubeapi.com/login \
-H 'Content-Type: application/json' \
-d '{"email": "<your-email>", "password": "<your-password>", "environment": "sandbox"}'
{"token": "<your-token>"}

Set environment to sandbox or production; the default is production. Include the token in every request:

Authorization: Bearer <your-token>

REST API access is granted separately from SFTP access, per destination. If an upload returns 403, ask A-Cube to enable it for that destination.

Upload a file​

POST /uploads, with these fields in the JSON body:

The request format documented here covers Italy, Poland and Germany. To use file uploads for another destination, ask A-Cube to confirm its API connection details and request format during onboarding. You can also upload through SFTP with the credentials A-Cube provides.

FieldRequiredRules
countryYesThe destination country: IT, PL or DE.
file_nameYesThe file name, up to 255 printable ASCII characters, without / or \. Its extension tells Transfer how to process the file: see File types. A name without a known extension is rejected.
contentYesThe whole file, encoded in standard base64.
e2e_idNoThe End-to-end ID of the invoice in the file. Only for a file with one invoice: not accepted for CSV and ZIP files, signed or not. Up to 255 printable ASCII characters, with no leading or trailing space. It is stored exactly as you send it and cannot be reused once one of your documents has it.

The request body limit is 5 MiB. Base64 encoding increases file size by about one third, leaving room for a file of roughly 3.75 MiB. Use SFTP for larger files.

Use your own ID

Attach an End-to-end ID to a REST API upload of one invoice. It leads you to the document Transfer created and to its identifier in A-Cube's e-invoicing API for that country, where you can follow it further.

curl -s -i -X POST https://transfer-sandbox.api.acubeapi.com/uploads \
-H "Authorization: Bearer <your-token>" \
-H 'Content-Type: application/json' \
-d '{
"country": "IT",
"file_name": "invoice_2026_0014.xml",
"content": "'"$(base64 < invoice_2026_0014.xml | tr -d '\n')"'",
"e2e_id": "erp-invoice-2026-0014"
}'

A 202 response returns the upload receipt, with a Location header that points to the upload:

HTTP/1.1 202 Accepted
Location: /uploads/<upload-id>
{"id": "<upload-id>", "status": "pending"}

The upload exists as soon as you get the receipt. Its status is pending until Transfer starts processing the file, then it follows the usual upload statuses. Every request creates a new upload, even with the same file name. A request with an End-to-end ID that one of your documents already has returns 409.

Follow the upload​

Read the upload with the ID from the receipt:

curl -s "https://transfer-sandbox.api.acubeapi.com/uploads/<upload-id>" \
-H "Authorization: Bearer <your-token>" \
-H 'Accept: application/json'

Then list its documents with GET /uploads/<upload-id>/transfer-documents. If you store only your own identifier, find the document with GET /target-documents?e2e_id=erp-invoice-2026-0014. See Tracking via API.

Errors​

Errors are application/problem+json, as in the other A-Cube APIs: type identifies the error, title and detail describe it, and status repeats the HTTP status.

StatusMeaningWhat to do
400The body is not valid JSON.Send a JSON object with the fields above.
422A field is not valid, including content that is not standard base64, or an e2e_id with a CSV or ZIP file. violations has one entry per field, with propertyPath (country, file_name, content or e2e_id) and message.Correct the field.
401The token is missing, expired or not valid.Get a new token.
403Your account has no access to that country for REST upload.Contact A-Cube.
409Transfer is not set up yet for that country on your account. type is /errors/transfer_not_configured.Contact A-Cube.
409One of your documents already has this e2e_id. type is /errors/e2e_id_already_used, and the file is not stored.Find that document with GET /target-documents?e2e_id=. For a new invoice, use a new End-to-end ID.
413The body is over 5 MiB.Send the file through SFTP, or split it.
503Transfer created the upload but could not confirm that it stored the file. type is /errors/upload_outcome_unavailable. The Location header, also in instance, is the upload.Read the upload at Location. If it is failed, resend the file. If it stays pending, contact A-Cube before retrying: the first request may still finish. Once it is ingested or later, Transfer has the file: do not send it again.

Download files​

Download the file of any document of your uploads, the file you sent or the document Transfer sent to the destination, with GET /transfer-documents/{id}/download. See Download a document file.

PDF attachments for Italy are matched to a CSV in the same directory, so send them through SFTP. See PDF attachments.