Request your API KEY

    API ROOT

        https://api.smartports.app/
                

You can request your API KEY from the your profile page. Log into your account and click on the top right corner on your profile to retrieve your secret API KEY.

To use this API, you need an API key. Please contact us at [email protected] if you run into any trouble with your KEY.

Demurrage Insurance


# Here is a curl example
curl \
-X POST https://api.smartports.app/insurance/sea-demurrages \
-H "Content-Type: application/json" \
-d '{
        "apiKey": "your_api_key",
        "items": [
            {
                "houseBL": "string",
                "masterBL": "string",    
                "certificateId": 1,
                "insurerCode": "123456",
                "insurerName": "SEA CARGO LOGISTICS SA",
                "rfcId": "RFC SCL090414QE0",
                "arrivalEta": "2025-02-10T19:36:49Z",
                "departureEtd": "2024-12-29T19:36:49Z",
                "consigneeCode": "123456",
                "consigneeName": "SEA CARGO LOGISTICS SA",
                "freeDays": 21,
                "remarks": "IMGDL18587,IMGDL18588",
                "vesselVoyage": "ERAMUS CHIEF / ZRM C0452N",
                "createdAt": "2025-02-28T17:27:36Z",
                "status": "REC",
                "originPort": "VIETNAM",
                "destinationPort": "MEXICO"
            },
            {
                "houseBL": "string",
                "masterBL": "string", 
                "certificateId": 3,
                "insurerCode": "123456",
                "insurerName": "SEA CARGO LOGISTICS SA",
                "rfcId": "RFC SCL090414QE0",
                "arrivalEta": "2025-02-10T19:36:49Z",
                "departureEtd": "2024-12-29T19:36:49Z",
                "consigneeCode": "123456",
                "consigneeName": "SEA CARGO LOGISTICS SA",
                "freeDays": 21,
                "remarks": "IMGDL18587,IMGDL18588",
                "vesselVoyage": "ERAMUS CHIEF / ZRM C0452N",
                "createdAt": "2025-03-18T18:28:44Z",
                "status": "REC",
                "originPort": "VIETNAM",
                "destinationPort": "MEXICO"
            }
        ]
    }'
            

Request your demurrage insurance for each of your BL's by making a POST call to the following URL and sending the parameters in the BODY as raw JSON (Content-Type: application/json):
https://api.smartports.app/insurance/sea-demurrages



Response :

{
    "policy": [
    {
        "policyId": 1,
        "rfcId": "RFC SCL090414QE0",
        "houseBL": "string",
        "masterBL": "string",    
    },
    {
        "policyId": 2,
        "rfcId": "RFC SCL090414QE0",
        "houseBL": "string",
        "masterBL": "string",    
    }
    ]
}
            

Create Invoice


# Here is a curl example
curl \
-X POST https://api.smartports.app/invoices \
-H "Content-Type: application/json" \
-d '{
    "api_key": "your_api_key",
    "invoice": [
        {
            "customer": {
                "legal_name": "Acme Inc.",
                "email": "[email protected]",
                "tax_id": "ABC101010111",
                "tax_system": "601",
                "address": {
                    "zip": "85900"
                }
            },
            "items": [{
                "quantity": 2,
                "product": {
                    "description": "Freight",
                    "product_key": "60131324",
                    "price": 2200.00
                }
            }],
            "payment_form": "06",
            "folio_number": 914,
            "series": "F"
            
        }
    ]
}'
    

Submit your manifest data by making a POST call to the following URL and sending the parameters in the BODY as raw JSON (Content-Type: application/json):
https://api.smartports.app/invoices



Response:[
    {
        "statusCode": 200,
        "reason": "string",
        "invoice": {
            "id": "590ce6c56d04f840aa8438af",
            "created_at": "2025-01-24T20:55:33.468Z",
            "livemode": false,
            "status": "pending",
            "date": "now",
            "address": {
              "street": "Blvd. Atardecer",
              "exterior": 142,
              "interior": 4,
              "neighborhood": "Centro",
              "city": "Huatabampo",
              "municipality": "Huatabampo",
              "zip": 86500,
              "state": "Sonora"
            },
            "type": "I",
            "customer": {
              "id": "58e93bd876be18b0197456",
              "legal_name": "Acme Inc.",
              "tax_id": "ABC101010111",
              "address": {
                "country": "MEX"
              }
            },
            "total": 2200.00,
            "uuid": "39c85a3f-275b-4341-b259-d9e5c6f8b9f3",
            "folio_number": 914,
            "series": "F",
            "external_id": "string",
            "idempotency_key": "string",
            "payment_form": 6,
            "is_ready_to_stamp": true,
            "items": [
              {
                "quantity": 1,
                "discount": 0,
                "product": {
                  "id": "58e93bd8e86eb318b0197454",
                  "description": "Freight",
                  "product_key": 60131324,
                  "price": 2200.0,
                  "tax_included": true,
                  "taxability": "01",
                  "taxes": [
                    {
                      "type": "IVA",
                      "rate": 0.16
                    }
                  ],
                  "local_taxes": [],
                  "unit_key": "H87",
                  "unit_name": "Elemento",
                  "sku": "string"
                },
                "parts": {
                  "description": "string",
                  "product_key": "string",
                  "quantity": 1,
                  "sku": "string",
                  "unit_price": 0,
                  "unit_name": "string",
                  "customs_keys": [
                    "string"
                  ]
                }
              }
            ],
            
            "currency": "MXN",
            
            
            "stamp": {
              "signature": "string",
              "date": "2025-01-24T14:15:22Z",
              "sat_cert_number": "string",
              "sat_signature": "string"
            }
        }
    }
]
                

QUERY PARAMETERS

Field Type Description
typestringRequired. Value: "E"
customerobject or stringRequired. The recipient of the invoice. Either a customer object or customer_id string.
payment_formstring (2 characters)Required. Code representing the payment method, according to the SAT catalog.
itemsArray of objects (LineItem), max 5000Required. Line items to include in the credit note. Max 5000. Split into multiple documents if needed.
usestringOptional. Default: "G01". Usage code according to the SAT CFDI catalog.
currencystringOptional. Default: "MXN". Currency code as per ISO 4217 standard.
exchangenumberOptional. Default: 1. Exchange rate, i.e., MXN per one unit of the specified currency.
statusstringOptional. Default: "pending". Initial invoice status. Use "draft" to save without sending to SAT.
datestring (ISO8601 date-time)Optional. Default: "now". Invoice issue date. Must be within the past 72 hours or up to the current time.
addressobjectOptional. Issuing address of the invoice. Defaults to organization’s address if not provided.
external_idstringOptional. Custom identifier for your records. Not validated for uniqueness.
idempotency_keystringOptional. Unique key to prevent duplicate requests. If blank, it’s ignored.
folio_numberintegerOptional. Default: autoincremental. Internal control number. Auto-assigned if not provided.
seriesstring (max 25 characters)Optional. Series identifier for internal control. Not fiscally valid.

Transmissions - Sea (Data)


# Here is a curl example
curl \
-X POST https://api.smartports.app/transmissions/sea \
-H "Content-Type: application/json" \
-d '{
    "api_key": "your_api_key",
    "transmission": [
        {
            "customSection": "string",
            "carrierKey": "string",
            "vesselName": "string",
            "tripNumber": "string",
            "operationType": 0,
            "blCount": "string",
            "loadingPort": {
                "name": "string",
                "country": "string",
                "portType": 0,
                "portKey": "string",
                "portCountry": "string"
            },
            "bl": {
                "type": "H",
                "referenceNumber": "string"
            },
            "figures": [
                {
                    "type": 0,
                    "name": "string",
                    "fiscalId": "string",
                    "residence": "string"
                },
                {
                    "type": 0,
                    "name": "string",
                    "fiscalId": "string",
                    "residence": "string"
                },
                {
                    "type": 0,
                    "name": "string",
                    "fiscalId": "string",
                    "residence": "string"
                }
            ],
            "reference": "string",
            "goods": [
                {
                    "sequence": 0,
                    "pieceCount": 0,
                    "grossWeightVolume": 0,
                    "unit": "41",
                    "description": "string",
                    "goodsType": 0,
                    "packingType": 0,
                    "dangerousGoods": {
                        "classDivision": "string",
                        "unNumber": "string",
                        "contact": "string",
                        "name": "string"
                    },
                    "containers": [
                        {
                            "number": "string",
                            "type": "1",
                            "serviceType": "FCL",
                            "grossWeight": "string",
                            "pieceCount": 0
                        }
                    ]
                }
            ]
        }
    ]
}'
    

Submit your manifest data by making a POST call to the following URL and sending the parameters in the BODY as raw JSON (Content-Type: application/json):
https://api.smartports.app/transmissions/sea



Response:[
    {
        "statusCode": 200,
        "reason": "string",
        "manifest": {
            "manifestType": "string",
            "fileType": "string",
            "electronicReceipt": "string",
            "tripNumber": "string",
            "houseBL": "string",
            "masterBL": "string",              
            "manifestId": "string",            
            "fileName": "string",              
            "date": "string",                  
            "receipt": "string"                
        }
    }
]
                

QUERY PARAMETERS

Field Type Description
customSectionstringCustom section information
carrierKeystringSCAC for the carrier
vesselNamestringName of the vessel
tripNumberstringTrip identifier or number
operationTypeintegerType of operation (numeric code)
blCountstringNumber of Bills of Lading
loadingPort.namestringName of the loading port
loadingPort.countrystringCountry of the loading port
loadingPort.portTypeintegerPort type (numeric code)
loadingPort.portKeystringUnique key for the port
loadingPort.portCountrystringCountry code for the port
bl.typestringType of Bill of Lading (e.g., H for House BL)
bl.referenceNumberstringReference number of the BL
figures[].typeintegerType of figure (numeric code)
figures[].namestringName of the figure
figures[].fiscalIdstringFiscal ID of the figure
figures[].residencestringResidence country of the figure
referencestringGeneral reference string
goods[].sequenceintegerSequence number for goods
goods[].pieceCountintegerTotal number of pieces
goods[].grossWeightVolumefloatGross weight or volume
goods[].unitstringMeasurement unit (e.g., 41 for kg)
goods[].descriptionstringDescription of the goods
goods[].goodsTypeintegerType of goods (numeric code)
goods[].packingTypeintegerPacking type (numeric code)
goods[].dangerousGoods.classDivisionstringClass or division of dangerous goods
goods[].dangerousGoods.unNumberstringUN number for dangerous goods
goods[].dangerousGoods.contactstringEmergency contact for dangerous goods
goods[].dangerousGoods.namestringName of dangerous goods
goods[].containers[].numberstringContainer number
goods[].containers[].typestringContainer type (e.g., 1)
goods[].containers[].serviceTypestringService type (e.g., FCL)
goods[].containers[].grossWeightstringGross weight of the container
goods[].containers[].pieceCountintegerPiece count within the container

Transmissions - Sea (File)


# Here is a curl example
curl \
-X POST https://api.smartports.app/transmissions/sea-file \
-F 'api_key=your_api_key' \
-F 'file=@path_to_file.pdf;type=application/pdf'
            

Submit your transmission sea data by making a POST call to the following URL and sending the parameters in the BODY as raw JSON (Content-Type: application/json):
https://api.smartports.app/transmissions/sea-file



Response:[
    {
        "statusCode": 200,
        "reason": "string",
        "manifest": {
            "manifestType": "string",
            "fileType": "string",
            "electronicReceipt": "string",
            "tripNumber": "string",
            "houseBL": "string",
            "masterBL": "string",              
            "manifestId": "string",            
            "fileName": "string",              
            "date": "string",                  
            "receipt": "string"                
        }
    }
]
            

Transmissions - Air (Data)


# Here is a curl example
curl \
-X POST https://api.smartports.app/transmissions/air \
-H "Content-Type: application/json" \
-d '{
    "api_key": "your_api_key",
    "transmission_air": {
    "masterGuide": "string",
    "houseGuide": "string",
    "caat": "string",
    "carrier": "string",
    "grossWeight": 0,
    "pieces": 0,
    "productDescription": "string",
    "hazardous": "ED",
    "supplementaryDescription": "string",
    "originAirport": "NHI",
    "destinationAirport": "BBG",
    "originCurrency": "BRI",
    "subjectCode": "IMP",
    "shipper": {
        "name": "string",
        "street": "string",
        "city": "string",
        "country": "string"
    },
    "consignee": {
        "name": "string",
        "street": "string",
        "city": "string",
        "country": "string"
    }
    }
}'
            

Submit your transmission air data by making a POST call to the following URL and sending the parameters in the BODY as raw JSON (Content-Type: application/json):
https://api.smartports.app/transmissions/air



Response:[
    {
        "statusCode": 200,
        "reason": "string",
        "manifest": {
            "manifestType": "string",
            "fileType": "string",
            "electronicReceipt": "string",
            "tripNumber": "string",
            "houseBL": "string",
            "masterBL": "string",              
            "manifestId": "string",            
            "fileName": "string",              
            "date": "string",                  
            "receipt": "string"                
        }
    }
]
            

QUERY PARAMETERS

Field Type Description
masterGuidestringMaster guide number
houseGuidestringHouse guide number
caatstringCarrier authorization or CAAT code
carrierstringCarrier name or identifier
grossWeightintegerGross weight of the shipment
piecesintegerNumber of pieces in the shipment
productDescriptionstringDescription of the product
hazardousstringHazardous material code (e.g., ED)
supplementaryDescriptionstringAdditional description for the shipment
originAirportstringOrigin airport code
destinationAirportstringDestination airport code
originCurrencystringCurrency code of the origin
subjectCodestringSubject code (e.g., IMP)
shipper.namestringShipper's name
shipper.streetstringShipper's street address
shipper.citystringShipper's city
shipper.countrystringShipper's country
consignee.namestringConsignee's name
consignee.streetstringConsignee's street address
consignee.citystringConsignee's city
consignee.countrystringConsignee's country

Transmissions - Air (File)


# Here is a curl example
curl \
-X POST https://api.smartports.app/transmissions/air-file \
-F 'api_key=your_api_key' \
-F 'file=@path_to_file.pdf;type=application/pdf'
            

Submit your transmission air data by making a POST call to the following URL and sending the parameters in the BODY as raw JSON (Content-Type: application/json):
https://api.smartports.app/transmissions/air-file



Response:[
    {
        "statusCode": 200,
        "reason": "string",
        "manifest": {
            "manifestType": "string",
            "fileType": "string",
            "electronicReceipt": "string",
            "tripNumber": "string",
            "houseBL": "string",
            "masterBL": "string",              
            "manifestId": "string",            
            "fileName": "string",              
            "date": "string",                  
            "receipt": "string"                
        }
    }
]
            

Errors

The Smartports API uses the following error codes:

Error Code Meaning
X000 Some parameters are missing. This error appears when you don't pass every mandatory parameters.
X001 Unknown or unvalid api_key. This error appears if you use an unknow API key or if your API key expired.
X002 Unvalid api_key for this domain. This error appears if you use an API key non specified for your domain. Developper or Universal API keys doesn't have domain checker.