Secure Documents
The Secure Documents API (POST /e9v3/secure_doc_delivery) uploads one or more
documents and returns a hosted, shareable link. Unlike the order and
inventory writes, this endpoint is synchronous: it stores the upload and
responds 201 with the document URL directly — there is no job to poll.
What it’s for
- Turn an invoice, packing slip, or export into a link you can email or embed.
- Attach a shareable copy of a document to an order by passing its
order_id. - Hand a customer or supplier a stable URL without exposing your own storage.
Authentication
- Scope:
orders:write— document upload reuses the orders write scope; a token that can create orders can also upload documents. - Auth Method: OAuth 2.0 M2M (Machine-to-Machine), Bearer token in the
Authorizationheader. - Rate limit: standard (1 request/second per API key, burst 10).
See the Authentication guide for how
to obtain a JWT token with the orders:write scope.
Request
Send the payload as multipart/form-data.
POST /e9v3/secure_doc_delivery
Authorization: Bearer <jwt-token>
Content-Type: multipart/form-data
Form fields
| Field | Type | Required | Description |
|---|---|---|---|
files |
binary (repeatable) | Yes | One or more files to upload. Repeat the part to send several documents in one request. A legacy single part named file is also accepted. |
order_id |
text | No | Order reference. Labels the stored document (Order {order_id}) and is recorded as its task number. |
Constraints
- At least one file is required.
- PDF and CSV only. Any other file type is rejected with
400 invalid_file_type. - Combined size ≤ 32 MiB across all parts (
SDD_MAX_UPLOAD_BYTES).
Example
# Get a token (see the Authentication guide), then upload
curl -X POST https://api.equos.one/e9v3/secure_doc_delivery \
-H "Authorization: Bearer $TOKEN" \
-F "files=@invoice.pdf" \
-F "order_id=SO-1234"
Upload several files in one request by repeating the files part:
curl -X POST https://api.equos.one/e9v3/secure_doc_delivery \
-H "Authorization: Bearer $TOKEN" \
-F "files=@invoice.pdf" \
-F "files=@line-items.csv"
Response (201 Created)
{
"document_url": "https://docs.equos.one/r/a1b2c3"
}
The document_url is absolute ({publicBaseURL}/r/{shortCode}) when a
public base URL is configured, otherwise root-relative (/r/{shortCode}).
Error Handling
All errors return the shape { "error": "...", "code": "..." }.
| Status | code |
Meaning |
|---|---|---|
400 |
parse_error |
Malformed multipart body |
400 |
file_required |
No file part was supplied |
400 |
invalid_file_type |
A file that is not PDF or CSV was included |
401 |
— | Missing or invalid Bearer token |
429 |
— | Rate limit exceeded (1 request/sec per key, burst 10) |
500 |
shortcode_error |
Failed to allocate a short code for the link |
500 |
create_link_error |
Failed to create the hosted link |
500 |
file_open_error |
Failed to read an uploaded file |
500 |
upload_error |
Failed to store an uploaded file |
Next Steps
- Orders to create the order you attach documents to
- Authentication for obtaining an
orders:writetoken - API Tester to try endpoints interactively