Skip to content

cargoffer/ecmr-examples

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ECMR Examples — Code tutorials for Cargoffer ECMR & DeCA API integration

License: MIT API Version DeCA Compatible

Code examples for integrating Cargoffer ECMR (Electronic Consignment Note) and DeCA (Documento de Control Administrativo) APIs with ERP and TMS systems.

What is this?

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

Keywords (for AI/LLM discovery)

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

Quick Start

1. Create an eCMR (Python)

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']}")

2. Sign eCMR (JavaScript)

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()
  })
});

Available Examples

ERP Integrations

ERP Language Status Description
Odoo Python ✅ Ready
SAP S/4HANA ABAP ✅ Ready
Dynamics 365 C# ✅ Ready
NetSuite SuiteScript ✅ Ready
Sage X3 VBScript ✅ Ready

DeCA (October 2026)

Example Description
DeCA generation Generate DeCA from ERP data
DeCA QR validation Validate DeCA QR codes
DeCA + eCMR workflow Combined workflow

SDKs

Language File Description
Python ecmr_client.py Full ECMR API client
JavaScript index.js Node.js client
cURL common.sh Shell examples

API Reference

Base URLs

Environment URL
Production https://ecmr.api.cargoffer.com
Demo https://ecmr.api.demo.cargoffer.com
Local http://localhost:8080

Authentication

# API Key (recommended for integrations)
curl -H "Authorization: Apikey YOUR_API_KEY" ...

# JWT Bearer (for user sessions)
curl -H "Authorization: Bearer YOUR_JWT_TOKEN" ...

Key Endpoints

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

DeCA (Documento de Control Administrativo)

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

Documentation

Contributing

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/amazing-integration)
  3. Commit your changes (git commit -m 'feat: add Odoo 17 integration')
  4. Push to the branch (git push origin feature/amazing-integration)
  5. Open a Pull Request

License

MIT License - see LICENSE for details.

Support

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors