Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.cedarai.com/llms.txt

Use this file to discover all available pages before exploring further.

Mexican law (SAT Carta Porte) requires customs and tariff data on top of a standard bill of lading whenever a shipment crosses the US–Mexico border. Cedar enforces these rules during 824 application advice validation against every waybill created through /ims/waybills/bill-of-lading (and every equivalent inbound EDI message). Missing or malformed data surfaces as an 816* or 825* error code on the resulting waybill.

When the requirements apply

The Carta Porte data block is required when both of the following are true:
  • shipmentQualifier is one of 6 (split first bill), 7 (split subordinate), B (single BOL), C (consolidated), F (stop-off), M (master BOL), S (submaster BOL), W (revenue empty).
  • Exactly one of originStation and destinationStation resolves to Mexico (origin xor destination — pure intra-Mexico moves are currently not validated by this rule). Cedar resolves the country from countryCode if present, otherwise from stateOrProvince.
Empty, intermodal, switch, blind-memo, and company-business qualifiers (1, 8, E, G, H, I, N, X) are exempt regardless of route.

Where the data goes

Carta Porte data is attached to the equipment, not to the top-level lineItems[] array:
ArraySchemaPurpose
waybill.lineItems[]LineItemDescribes the lading commodity for the rail waybill itself. Required on every waybill, MX or not.
waybill.equipmentDetails[].shipmentInfo[]EquipmentShipmentInformationPer-equipment Carta Porte block transmitted to Mexican customs. Required only for cross-border waybills.
The two arrays are not interchangeable. waybill.lineItems[].quantity is a nested LineItemQuantity object (billedAsQuantity, weightQualifier, etc.); shipmentInfo[].lineItems[].quantity is a flat numeric field corresponding to the X12 417 N1001 element. A cross-border waybill needs both populated.

Required content of each shipmentInfo[] entry

For each commodity on each piece of equipment:
FieldRequired value
referenceIdQualifierUNC — flags the entry as a UNSPSC-classified commodity.
referenceIdThe UNSPSC code. Must exist in Cedar’s Carta Porte reference data, otherwise validation returns 816801010CE.
extendedReferenceInfo[] with referenceIdQualifier = MTCAt least one entry. referenceId must be a 10-digit Mexico Tariff Rate Code with no punctuation, and must exist in the reference data.
lineItems[]At least one entry. Each entry must populate quantity (N1001), weight (N1008), weightUnitCode (N1007), and smallestExteriorPackageType (N1010).

Hazardous shipments

If the waybill has any hazardousInfo[] entries, every shipmentInfo[] block with referenceIdQualifier = UNC must additionally include at least one extendedReferenceInfo[] entry with referenceIdQualifier = MHC (Mexico SAT Hazardous Code). The MHC value must be prefixed with UN and must exist in the Carta Porte reference data.

Required shipper contact

Cross-border waybills must include a parties[] entry with partyType = SH (shipper) that has at least one administrativeContacts[] entry containing all of:
  • contactFunctionCode = SP
  • a non-empty name
  • communicationNumbers[] with the first entry qualifier = TE (telephone) and a non-empty number, and the second entry qualifier = EM (email) and a non-empty number
The same validation runs whether a waybill is created via /ims/waybills/bill-of-lading or arrives over EDI. The error codes returned in 824 application advice are identical, so the troubleshooting flow is the same regardless of source.