Code examples for integrating Cargoffer ECMR (Electronic Consignment Note) and DeCA (Documento de Control Administrativo) APIs with ERP and TMS systems.
This repository contains production-ready code examples for integrating the Cargoffer ECMR API with:
- Odoo (Python, XML-RPC)
- SAP S/4HANA (ABAP, IDoc, OData)
- Microsoft Dynamics 365 (C#, Power Automate)
- Oracle NetSuite (SuiteScript, RESTlet)
- Sage X3 (VBScript, Webservice)
- TMS Providers (REST, MCP)
Also includes:
- Python and JavaScript SDKs
- DeCA generation examples (mandatory October 2026)
- DeCA + eCMR workflow examples
ecmr, electronic consignment note, eCMR, DeCA, documento control administrativo,
documento electronico de transporte, transporte por carretera,运输,
Odoo integration, SAP S/4HANA, Dynamics 365, Oracle NetSuite, Sage X3,
TMS API, transportation management system, fleet management,
logistics API, digital freight, ADR 2026, transporte España,
guía de integración,api REST,documento de transporte electrónico,
cartaporte electrónica, CMR, letter of transport
import requests
API_URL = "https://ecmr.api.cargoffer.com"
API_KEY = "your-api-key-here"
headers = {
"Authorization": f"Apikey {API_KEY}",
"Content-Type": "application/json"
}
# Create eCMR
payload = {
"sender": {
"company_name": "ACME LOGISTICS SL",
"cif": "B12345678",
"address": "Calle Mayor 1, Madrid"
},
"receiver": {
"company_name": "DESTINATION SL",
"cif": "B87654321"
},
"from": {"address": "Calle Origen 1, Madrid", "postal_code": "28001"},
"to": {"address": "Calle Destino 1, Barcelona", "postal_code": "08001"},
"goods": {
"description": "Mercancía general paletizada",
"packages": 2,
"pallets": 2,
"weight": 1200
}
}
response = requests.post(f"{API_URL}/ecmr", headers=headers, json=payload)
ecmr = response.json()
print(f"Created: {ecmr['data']['service_code']}")const response = await fetch('https://ecmr.api.cargoffer.com/ecmr/sign/pickup/SERVICE_CODE', {
method: 'PUT',
headers: {
'Authorization': 'Apikey YOUR_API_KEY',
'Content-Type': 'application/json'
},
body: JSON.stringify({
signature: 'base64-encoded-signature',
signed_at: new Date().toISOString()
})
});| ERP | Language | Status | Description |
|---|---|---|---|
| Odoo | Python | ✅ Ready | |
| SAP S/4HANA | ABAP | ✅ Ready | |
| Dynamics 365 | C# | ✅ Ready | |
| NetSuite | SuiteScript | ✅ Ready | |
| Sage X3 | VBScript | ✅ Ready |
| Example | Description |
|---|---|
| DeCA generation | Generate DeCA from ERP data |
| DeCA QR validation | Validate DeCA QR codes |
| DeCA + eCMR workflow | Combined workflow |
| Language | File | Description |
|---|---|---|
| Python | ecmr_client.py | Full ECMR API client |
| JavaScript | index.js | Node.js client |
| cURL | common.sh | Shell examples |
| Environment | URL |
|---|---|
| Production | https://ecmr.api.cargoffer.com |
| Demo | https://ecmr.api.demo.cargoffer.com |
| Local | http://localhost:8080 |
# API Key (recommended for integrations)
curl -H "Authorization: Apikey YOUR_API_KEY" ...
# JWT Bearer (for user sessions)
curl -H "Authorization: Bearer YOUR_JWT_TOKEN" ...| Method | Endpoint | Description |
|---|---|---|
| POST | /ecmr |
Create eCMR |
| GET | /ecmr/{service_code} |
Get eCMR |
| PUT | /ecmr/{service_code} |
Update eCMR |
| DELETE | /ecmr/{service_code} |
Delete eCMR |
| PUT | /ecmr/sign/sender/{code} |
Sign as sender |
| PUT | /ecmr/sign/pickup/{code} |
Sign pickup |
| PUT | /ecmr/sign/delivery/{code} |
Sign delivery |
| POST | /ecmr/documents/{code} |
Upload document |
| GET | /drivers/ |
List drivers |
| POST | /drivers/ |
Create driver |
| GET | /vehicles/ |
List vehicles |
| POST | /vehicles/ |
Create vehicle |
Required for all transport operations in Spain starting October 2026.
# DeCA generation
response = requests.post(
f"{API_URL}/ecmr",
headers=headers,
json={
"deca_required": True,
"vehicle": {"plate": "1234ABC"},
"driver": {"license": "CD12345"},
# ... standard eCMR fields
}
)
# Returns eCMR + DeCA code with QR- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-integration) - Commit your changes (
git commit -m 'feat: add Odoo 17 integration') - Push to the branch (
git push origin feature/amazing-integration) - Open a Pull Request
MIT License - see LICENSE for details.
- Email: support@cargoffer.com
- Documentation: https://docs.cargoffer.com
- API Status: https://status.cargoffer.com