cargopanel logocargopanel for developers

Upload File

POSThttps://api.cargopanel.co/v1/files/upload
POSThttps://sandbox-api.cargopanel.co/v1/files/upload

Uploads files (Invoice, MSDS, FDA forms, etc.) associated with shipments. This endpoint requires requests formatted as multipart/form-data.

Request Fields

filerequiredFile

The binary file content to upload.

documentTyperequiredstring

The classification of the document (e.g., invoice, packing_list, label, identity).

userIdrequiredstring

The owner user identifier of the document.

shipmentIdrequiredstring

The shipment identifier associated with the document.

Example Response

200
{
  "status": "success",
  "message": "Dosya başarıyla yüklendi ve kaydedildi.",
  "file": {
    "originalName": "invoice.pdf",
    "fileName": "e-arşiv_fatura_usr_xyz789_539103",
    "url": "https://api.cargopanel.co/v1/files/e-arşiv_fatura_usr_xyz789_539103",
    "path": "/files/e-arşiv_fatura_usr_xyz789_539103",
    "id": "539103",
    "userId": "usr_xyz789",
    "shipmentId": "12345678",
    "documentType": "E-Arşiv Fatura"
  },
  "fileUrl": "https://api.cargopanel.co/v1/files/e-arşiv_fatura_usr_xyz789_539103",
  "fileId": "539103"
}

Response Fields

statusstring

Status label indicating success or failure.

messagestring

User friendly status message.

fileobject

The uploaded file's metadata record.

idstring

Unique 6-digit identifier of the file.

fileNamestring

The normalized, unique filename saved in storage.

urlstring

Public gateway proxy API URL to view or download the file.

Responses

200File uploaded and saved successfully
400Bad request (e.g. missing file or parameters)
401Unauthorized (invalid or missing API key)