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 /upload, with these fields in the JSON body:

The request format documented here covers Italy and Poland. 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 or PL.
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 you attach to the upload. Up to 255 printable ASCII characters, with no leading or trailing space. It is stored exactly as you send 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. It leads you to every 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/upload \
-H "Authorization: Bearer <your-token>" \
-H 'Content-Type: application/json' \
-d '{
"country": "IT",
"file_name": "invoice_2026_01.csv",
"content": "'"$(base64 < invoice_2026_01.csv | tr -d '\n')"'",
"e2e_id": "erp-2026-01-run-14"
}'

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>", "e2e_id": "erp-2026-01-run-14", "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 or End-to-end ID.

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 upload with GET /uploads?e2e_id=erp-2026-01-run-14. See Tracking via API.

Errors​

StatusMeaningWhat to do
400A field is not valid, including content that is not standard base64. The body is {"errors": {"<field>": "<message>"}}. The keys are country, fileName, content and e2eId.Correct the field.
400The body is not valid JSON. The body is {"errors": "Invalid JSON upload request"}, where errors is a string.Send a JSON object with the fields above.
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. The body is {"code": "transfer_not_configured"}.Contact A-Cube.
413The body is over 5 MiB.Send the file through SFTP, or split it.
503Transfer could not confirm that it stored the file. The body is the receipt with an errors message.Read the upload with its id. 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.