Anyone searching for «mrw api» usually has either a fresh set of credentials from their franchise or an Odoo from which they want to stop retyping addresses into the MRW portal. Here is what the API is, which calls matter and where it breaks, read from the code of our MRW connector for Odoo.
What the MRW API is: Sagec, SOAP and credentials from your franchise
The web service MRW uses to register shipments is called Sagec and it speaks SOAP: XML envelopes with an authentication header, not JSON with a token. It has a test address (sagec-test.mrw.es) and a production one (sagec.mrw.es). The credentials do not come from a developer portal: your franchise gives them to you. They are the franchise code, account number, department if you use one, username and password.
The calls that matter are few: TransmEnvio registers the shipment (TransmEnvioInternacional outside Spain), GetEtiquetaEnvio returns the label and CancelarEnvio cancels it.
The label comes out when the delivery order is validated
In Odoo, MRW installs as one more shipping method. When the delivery order is validated, the connector registers the shipment, stores the number on the delivery order and attaches the label as a PDF; if MRW does not return the file, it uses the label URL from the response. A wizard does the same for several delivery orders at once.
Before the first shipment you have to decide what happens when MRW fails: block validation, so the delivery order does not close without a label, or validate and leave the shipment pending with a warning. What comes already solved: if the delivery order has a shipment number, no second one is registered, so a retry does not leave two labels.
Tracking: what you get and what you do not
The shipment number goes into Odoo's standard tracking field: it reaches the customer in the delivery confirmation email if you have it switched on, and a button on the delivery order opens MRW's tracking page. For most shops, that is enough.
What the connector does not do today is bring every status change into Odoo: out for delivery, delivered, exception. If you need that, say to open a task when a delivery goes wrong, it is custom development, and it starts with confirming what your MRW contract gives you.
Pickups: the date travels with every shipment
The physical pickup is organised by your franchise under your contract. With each shipment Odoo sends the pickup date and the origin details, which are your company's. The connector works out the date from the delivery order's scheduled date: never in the past, moved to the next day from 17:00, and skipping weekends. If your franchise works to a different cut-off, check with them.
And if your company's postcode or phone number is wrong in Odoo, it is not one shipment that fails: they all do.
The address errors that stop the most shipments in Spain
Of the data rejections, address errors are the ones that depend on you rather than the contract. Five worth watching:
- Four-digit postcodes. Spanish postcodes for Álava, Albacete, Alicante, Almería, Ávila, Badajoz, the Balearics, Barcelona and Burgos start with a zero, and that zero vanishes the moment the customer base goes through a spreadsheet: 08001 becomes 8001.
- Street with no number. MRW splits street, number and the rest; Odoo keeps the street on one line. The connector splits it and, if it finds no digit, sends «S/N». Streets with a number in their name, such as «Calle 8 de Marzo», are something no automatic split always gets right: check those first.
- Missing or incomplete recipient phone. MRW requires it; the pre-check flags any number with fewer than nine digits.
- Empty town or province. It happens with contacts created from the website or half-imported; in Odoo, a correct postcode does not fill in the province.
- Zero weight. If products have no weight, neither does the delivery order. There is a configurable default weight, but with heavy parcels it runs into the service's per-parcel limit.
So you do not find out with the van at the door, the shipping method has a pre-check button: it reviews credentials, service, your company details, default weight and up to twenty open delivery orders, looking for exactly these gaps. And when MRW rejects a shipment, the connector turns the response into a readable reason.
Fix the address on the delivery contact and relaunch the shipment from the delivery order: since it was never registered, nothing gets duplicated.
When you do not need our connector
If you register a handful of shipments a week, the MRW portal is enough and no integration pays for itself. If you run Odoo 19 and only need a label and tracking, look first at the OCA delivery_mrw module: it is free and, unlike ours, it already sends cash on delivery. What it lacks is a pre-check, retries and a calculated pickup date. For the wider carrier decision, see MRW vs SEUR in Odoo.
What our connector does
The MRW connector for Odoo does what is described here: shipment and label on validation, tracking, cancellation through CancelarEnvio, pickup date, pre-check and retries. It runs on Odoo 17, 18 and 19, and Odoo 20 the day it ships. If you have your own website rather than Odoo, see integrating a carrier API into your own website.
Frequently asked questions
Do I need an MRW contract to use the API?
Yes. Your MRW franchise gives you the Sagec credentials. The connector keeps the test and production addresses separate and has a button to check the connection before the first real shipment.
Can I ship cash on delivery?
With our connector, not today: shipments are registered without cash on delivery. The OCA MRW module does send it. If you sell cash on delivery with MRW and also need the rest, it is an extension scoped separately.
What happens if the MRW API does not respond?
If the failure is on MRW's side (timeout, 5xx errors or «error interno»), the connector schedules retries at 5, 15, 30, 60, 180 and 360 minutes, six at most by default. If it is a data problem, it does not retry: it shows you the reason.
Useful links inside FlexigoTech
What we do about this
MRW rejecting shipments, or still retyping addresses?
Tell us which Odoo version you run, how many shipments you send a day and which error MRW returns. We will tell you whether it is the data, the contract or the integration, and whether the OCA module is enough for you. Write to comercial@flexigobe.com or book a call.

